-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(NODE-6731): fix and test webpack bundling (#71)
- Loading branch information
Showing
9 changed files
with
8,927 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Webpack | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 'lts/*' | ||
|
||
- name: "Install dependencies" | ||
shell: bash | ||
run: | | ||
npm install | ||
- name: "Install dependencies in the Webpack bundle test package" | ||
shell: bash | ||
working-directory: ./test/bundling/webpack | ||
run: | | ||
npm install | ||
- name: "Install local zstd into Webpack bundle test package" | ||
shell: bash | ||
working-directory: ./test/bundling/webpack | ||
run: | | ||
npm run install:zstd | ||
- name: "Run webpack build" | ||
shell: bash | ||
working-directory: ./test/bundling/webpack | ||
run: | | ||
npm run build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist/ | ||
*.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
'use strict'; | ||
|
||
const { execSync } = require('node:child_process'); | ||
const { readFileSync } = require('node:fs'); | ||
const { resolve } = require('node:path'); | ||
|
||
const xtrace = (...args) => { | ||
console.log(`running: ${args[0]}`); | ||
return execSync(...args); | ||
}; | ||
|
||
const zstdRoot = resolve(__dirname, '../../..'); | ||
console.log(`zstd package root: ${zstdRoot}`); | ||
|
||
const zstdVersion = JSON.parse( | ||
readFileSync(resolve(zstdRoot, 'package.json'), { encoding: 'utf8' }) | ||
).version; | ||
console.log(`zstd Version: ${zstdVersion}`); | ||
|
||
xtrace('npm pack --pack-destination test/bundling/webpack', { cwd: zstdRoot }); | ||
|
||
xtrace(`npm install --no-save mongodb-js-zstd-${zstdVersion}.tgz`); | ||
|
||
console.log('zstd installed!'); |
Oops, something went wrong.