Skip to content

Commit bd7e412

Browse files
committed
Merge branch 'master' into parcel2
2 parents bf29513 + 6f38a51 commit bd7e412

8 files changed

Lines changed: 1321 additions & 787 deletions

File tree

.github/workflows/CI.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,33 @@ jobs:
3131
run: |
3232
apm install
3333
34+
# Lint:
35+
# if: "!contains(github.event.head_commit.message, '[skip ci]')"
36+
# runs-on: ubuntu-latest
37+
# env:
38+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
# steps:
40+
# - uses: actions/checkout@v2
41+
# with:
42+
# fetch-depth: 0
43+
# - name: Commit lint ✨
44+
# uses: wagoid/commitlint-github-action@v2
45+
#
46+
# - uses: UziTech/action-setup-atom@v1
47+
# - name: Setup PNPM
48+
# uses: pnpm/action-setup@v1.2.1
49+
# with:
50+
# version: latest
51+
#
52+
# - name: Install dependencies
53+
# run: pnpm install
54+
#
55+
# - name: Format ✨
56+
# run: pnpm test.format
57+
#
58+
# - name: Lint ✨
59+
# run: pnpm test.lint
60+
3461
Release:
3562
needs: [Test]
3663
if: github.ref == 'refs/heads/master' &&

.github/workflows/bump_deps.yml

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,69 @@ name: Bump_Dependencies
22

33
on:
44
schedule:
5-
- cron: "0 0 * * *"
5+
- cron: "5 8 * * Sun" # 8:05 every Sunday
66

77
jobs:
88
Bump_Dependencies:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2-beta
12+
- uses: actions/setup-node@v2
1313
with:
14-
node-version: "14"
14+
node-version: "12"
1515
- name: Setup PNPM
16-
uses: pnpm/action-setup@v1.2.0
16+
uses: pnpm/action-setup@master
1717
with:
18-
version: 4.11.1
18+
version: latest
19+
20+
- name: setup npm-check-updates
21+
run: pnpm install -g npm-check-updates
22+
1923
- run: |
24+
ncu -u --dep prod
2025
pnpm install
21-
pnpm run bump
26+
27+
- uses: tibdex/github-app-token@v1
28+
id: generate-token
29+
with:
30+
app_id: ${{ secrets.APP_ID }}
31+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
32+
- uses: peter-evans/create-pull-request@v3
33+
with:
34+
token: ${{ steps.generate-token.outputs.token }}
35+
commit-message: "fix: update Dependencies"
36+
title: "fix: update Dependencies"
37+
labels: Dependencies
38+
branch: "Bump_Dependencies"
39+
40+
Bump_devDependencies:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v2
44+
- uses: actions/setup-node@v2
45+
with:
46+
node-version: "12"
47+
- name: Setup PNPM
48+
uses: pnpm/action-setup@master
49+
with:
50+
version: latest
51+
52+
- name: setup npm-check-updates
53+
run: pnpm install -g npm-check-updates
54+
55+
- run: |
56+
ncu -u --dep dev
2257
pnpm install
23-
- uses: peter-evans/create-pull-request@v2
58+
59+
- uses: tibdex/github-app-token@v1
60+
id: generate-token
61+
with:
62+
app_id: ${{ secrets.APP_ID }}
63+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
64+
- uses: peter-evans/create-pull-request@v3
2465
with:
25-
token: ${{ secrets.GITHUB_TOKEN }}
26-
commit-message: Update dependencies
27-
title: "[AUTO] Update dependencies"
66+
token: ${{ steps.generate-token.outputs.token }}
67+
commit-message: "chore: update devDependencies"
68+
title: "chore: update devDependencies"
2869
labels: Dependencies
29-
branch: "Bump"
70+
branch: "Bump_devDependencies"

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
public-hoist-pattern[]=*
2+
package-lock=false
3+
lockfile=true
4+
prefer-frozen-lockfile=false

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
pnpm-lock.yaml
3+
package-lock.json
4+
CHANGELOG.md
5+
dist

README.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,43 +3,47 @@
33
This includes the babel configuration used for JavaScript packages in atom-ide-community.
44

55
## Installation
6+
67
```
78
npm install --save-dev babel-preset-atomic
89
```
910

1011
You should also install the peer dependencies:
12+
1113
```
1214
npm install -save-dev "@babel/core"
1315
npm install -save-dev "@babel/cli"
1416
```
1517

1618
## Usage
19+
1720
Create a `babel.config.js` file at the root of the project with the following content:
21+
1822
```js
19-
let presets = [
20-
"babel-preset-atomic",
21-
];
23+
let presets = ["babel-preset-atomic"]
2224

23-
let plugins = [];
25+
let plugins = []
2426

2527
module.exports = {
2628
presets: presets,
2729
plugins: plugins,
2830
exclude: "node_modules/**",
2931
sourceMap: "inline",
30-
};
32+
}
3133
```
3234

3335
## Options
3436

35-
1) `keepModules`
37+
1. `keepModules`
3638

3739
If you want to keep the ES modules as they are (not transforming `import` to `require`), set `BABEL_KEEP_MODULES` environment variable to `true`. This is useful with bundlers which need you to keep ES6 modules intact. By default the ES6 modules are transformed to ES5 (the value is `false`)
40+
3841
```
3942
cross-env BABEL_KEEP_MODULES=true
4043
```
4144

4245
To permanently set this option, you can add it to your babel config (which disables environment variable effectiveness):
46+
4347
```js
4448
let presets = [
4549
[
@@ -48,26 +52,27 @@ let presets = [
4852
keepModules: true,
4953
},
5054
],
51-
];
55+
]
5256
```
5357

54-
2) `targets`
58+
2. `targets`
5559

5660
To change the target of `preset-env` plugin. By default this is configured for Electron.
61+
5762
```js
5863
let presets = [
5964
[
6065
"babel-preset-atomic",
6166
{
6267
targets: {
6368
electron: 6,
64-
}
69+
},
6570
},
6671
],
67-
];
72+
]
6873
```
6974

70-
3) `addModuleExports`:
75+
3. `addModuleExports`:
7176

7277
Allows to `require` a ES6 module that has exported a single thing as `default`, in a ES5 fashion without `require().default`. This is `true` by default for backward compatibility with Atom packages.
7378

@@ -76,64 +81,74 @@ let presets = [
7681
[
7782
"babel-preset-atomic",
7883
{
79-
addModuleExports: false
84+
addModuleExports: false,
8085
},
8186
],
82-
];
87+
]
8388
```
8489

85-
4) `addModuleExportsDefaultProperty`:
90+
4. `addModuleExportsDefaultProperty`:
8691

8792
```js
8893
let presets = [
8994
[
9095
"babel-preset-atomic",
9196
{
9297
addModuleExports: true,
93-
addModuleExportsDefaultProperty: true
98+
addModuleExportsDefaultProperty: true,
9499
},
95100
],
96-
];
101+
]
97102
```
98103

99104
Adds `default` property to `module.exports` so the ES6 module can be required in the ES6 fashion as well (by `require().default`). This is `false` by default.
100105

101-
6) `react`
106+
6. `react`
102107

103108
Enable `"@babel/preset-react"`. `true` by default.
104109

105-
7) `flow`
110+
7. `flow`
106111

107112
Enable `"@babel/preset-flow"`. `true` by default.
108113

109-
8) `removeAllUseStrict`
114+
7. `typescript`
115+
116+
Enable `"@babel/preset-typescript"`. `true` by default.
117+
118+
9. `removeAllUseStrict`
110119

111120
Remove all `'use strict'` from all files. Passed to [`babel-plugin-transform-not-strict`](https://github.com/atom-ide-community/babel-plugin-transform-not-strict#usage-remove-all). This is `false` by default.
112121

113-
9) `notStrictDirectiveTriggers` and `notStrictCommentTriggers`
122+
10. `notStrictDirectiveTriggers` and `notStrictCommentTriggers`
114123

115124
These specify `"not strict"` triggers. Passed to [`babel-plugin-transform-not-strict`](https://github.com/atom-ide-community/babel-plugin-transform-not-strict#usage-extra-directive-or-comment-triggers).
116125

117126
## Behind the scenes
118127

119128
It includes the following presets:
129+
120130
- `"@babel/preset-env"` (configured for `electron`)
121131
- `"@babel/preset-react"`
122132
- `"@babel/preset-flow"`
133+
- `"@babel/preset-typescript"`
123134

124135
It also includes all the proposal plugins such as:
136+
125137
- `"@babel/plugin-proposal-optional-chaining"`
126138
- `"@babel/plugin-proposal-nullish-coalescing-operator"`
127139
- `"@babel/plugin-proposal-export-default-from"`
128140
- `"@babel/plugin-proposal-export-namespace-from"`
129141
- ...
130142

131143
It includes the plugins for compile time code generation:
144+
132145
- `"babel-plugin-codegen"`
133146
- `"babel-plugin-preval"`
134147

135148
It has the preset that automatically adds default export for older Node versions (so no `require().default` is needed).
149+
136150
- `"babel-plugin-add-module-exports"`
137151

138152
It has the plugin for removing `'use strict'`:
153+
139154
- `"babel-plugin-transform-not-strict"`

0 commit comments

Comments
 (0)