Skip to content

Commit 9c86592

Browse files
authored
feat: add esbuild 0.24 to allowed range, extend integration test (#65)
1 parent 83f3011 commit 9c86592

File tree

4 files changed

+129
-125
lines changed

4 files changed

+129
-125
lines changed

.github/workflows/node.js.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches: [main]
1111

1212
jobs:
13-
build:
13+
test:
1414
runs-on: ubuntu-latest
1515

1616
strategy:
@@ -24,18 +24,7 @@ jobs:
2424
uses: actions/setup-node@v4
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
28-
- name: Get yarn cache directory path
29-
id: yarn-cache-dir-path
30-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
31-
32-
- uses: actions/cache@v4
33-
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
34-
with:
35-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
36-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
37-
restore-keys: |
38-
${{ runner.os }}-yarn-
27+
cache: 'yarn'
3928

4029
- name: Install dependencies
4130
run: yarn install --immutable
@@ -46,5 +35,10 @@ jobs:
4635
- name: Test unit
4736
run: yarn workspace esbuild-node-externals test
4837

49-
- name: Test examples (integration)
38+
- name: Test integration esbuild@default
5039
run: yarn workspace example-basic build
40+
41+
- name: Test integration esbuild@0.12 (minimal)
42+
run: |
43+
yarn workspace example-basic add esbuild@0.12
44+
yarn workspace example-basic build

esbuild-node-externals/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@
3131
"tslib": "^2.4.1"
3232
},
3333
"peerDependencies": {
34-
"esbuild": "0.12 - 0.23"
34+
"esbuild": "0.12 - 0.24"
3535
},
3636
"devDependencies": {
3737
"@types/node": "^18.15.10",
38-
"esbuild": "^0.23.0",
38+
"esbuild": "^0.24.0",
3939
"rimraf": "^4.4.1",
4040
"typescript": "^4.9.4"
4141
}

examples/basic/bundle.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
const esbuild = require('esbuild');
22
const { nodeExternalsPlugin } = require('esbuild-node-externals');
33

4-
esbuild.build({
5-
entryPoints: ['src/index.js'],
6-
bundle: true,
7-
platform: 'node',
8-
outfile: 'dist/index.js',
9-
plugins: [nodeExternalsPlugin()],
10-
});
4+
(async () => {
5+
try {
6+
await esbuild.build({
7+
entryPoints: ['src/index.js'],
8+
bundle: true,
9+
platform: 'node',
10+
outfile: 'dist/index.js',
11+
plugins: [nodeExternalsPlugin()],
12+
});
13+
console.log(`Built with ${esbuild.version}`)
14+
process.exit(0);
15+
}
16+
catch (e) {
17+
console.error(e);
18+
process.exit(1);
19+
}
20+
})()

0 commit comments

Comments
 (0)