Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update cjs-module-lexer to 2.1.0 #57180

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions deps/cjs-module-lexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,25 @@ If you need to build lib/lexer.wat (optional) you must first install
[wabt](https://github.com/WebAssembly/wabt) as a sibling folder to this
project. The wat file is then build by running `make lib/lexer.wat`

### Creating a Release
These are the steps to create and publish a release. You will need docker
installed as well as having installed [wabt](https://github.com/WebAssembly/wabt)
as outlined above:

- [ ] Figure out if the release should be semver patch, minor or major based on the changes since
the last release and determine the new version.
- [ ] Update the package.json version, and run a full build and test
- npm install
- npm run build
- npm run test
- [ ] Commit and tag the changes, pushing up to main and the tag
- For example
- `git tag -a 1.4.2 -m "1.4.2"`
- `git push origin tag 1.4.2`
- [ ] Create the GitHub release
- [ ] Run npm publish from an account with access (asking somebody with access
the nodejs-foundation account is an option if you don't have access.

### License

MIT
Expand Down
2 changes: 1 addition & 1 deletion deps/cjs-module-lexer/dist/lexer.mjs

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions deps/cjs-module-lexer/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,25 @@ If you need to build lib/lexer.wat (optional) you must first install
[wabt](https://github.com/WebAssembly/wabt) as a sibling folder to this
project. The wat file is then build by running `make lib/lexer.wat`

### Creating a Release
These are the steps to create and publish a release. You will need docker
installed as well as having installed [wabt](https://github.com/WebAssembly/wabt)
as outlined above:

- [ ] Figure out if the release should be semver patch, minor or major based on the changes since
the last release and determine the new version.
- [ ] Update the package.json version, and run a full build and test
- npm install
- npm run build
- npm run test
- [ ] Commit and tag the changes, pushing up to main and the tag
- For example
- `git tag -a 1.4.2 -m "1.4.2"`
- `git push origin tag 1.4.2`
- [ ] Create the GitHub release
- [ ] Run npm publish from an account with access (asking somebody with access
the nodejs-foundation account is an option if you don't have access.

### License

MIT
Expand Down
21 changes: 16 additions & 5 deletions deps/cjs-module-lexer/src/build/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# These flags depend on the system and may be overridden
WASM_CC := clang
WASM_CFLAGS := --sysroot=/usr/share/wasi-sysroot
WASM_LDFLAGS := -nostartfiles

# These are project-specific and are expected to be kept intact
WASM_TARGET := -target wasm32-unknown-wasi
WASM_EXTRA_CFLAGS := -I include-wasm/ -Wno-logical-op-parentheses -Wno-parentheses -Oz
WASM_EXTRA_LDFLAGS := -Wl,-z,stack-size=13312,--no-entry,--compress-relocations,--strip-all
WASM_EXTRA_LDFLAGS += -Wl,--export=__heap_base,--export=parseCJS,--export=sa
WASM_EXTRA_LDFLAGS += -Wl,--export=e,--export=re,--export=es,--export=ee
WASM_EXTRA_LDFLAGS += -Wl,--export=rre,--export=ree,--export=res,--export=ru,--export=us,--export=ue

lib/lexer.wasm: include-wasm/cjs-module-lexer.h src/lexer.c
@mkdir -p lib
clang --sysroot=/usr/share/wasi-sysroot -target wasm32-unknown-wasi src/lexer.c -I include-wasm -o lib/lexer.wasm -nostartfiles \
-Wl,-z,stack-size=13312,--no-entry,--compress-relocations,--strip-all,--export=__heap_base,\
--export=parseCJS,--export=sa,--export=e,--export=re,--export=es,--export=ee,--export=rre,--export=ree,--export=res,--export=ru,--export=us,--export=ue \
-Wno-logical-op-parentheses -Wno-parentheses \
-Oz
$(WASM_CC) $(WASM_CFLAGS) $(WASM_TARGET) $(WASM_EXTRA_CFLAGS) \
src/lexer.c -o lib/lexer.wasm \
$(WASM_LDFLAGS) $(WASM_EXTRA_LDFLAGS)

optimize: lib/lexer.wasm
${WASM_OPT} -Oz lib/lexer.wasm -o lib/lexer.wasm
Expand Down
4 changes: 2 additions & 2 deletions deps/cjs-module-lexer/src/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deps/cjs-module-lexer/src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cjs-module-lexer",
"version": "2.0.0",
"version": "2.1.0",
"description": "Lexes CommonJS modules, returning their named exports metadata",
"main": "lexer.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/cjs_module_lexer_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
// Refer to tools/dep_updaters/update-cjs-module-lexer.sh
#ifndef SRC_CJS_MODULE_LEXER_VERSION_H_
#define SRC_CJS_MODULE_LEXER_VERSION_H_
#define CJS_MODULE_LEXER_VERSION "2.0.0"
#define CJS_MODULE_LEXER_VERSION "2.1.0"
#endif // SRC_CJS_MODULE_LEXER_VERSION_H_
Loading