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

Minor changes for a test PR #5139

Merged
merged 1 commit into from Sep 15, 2023
Merged

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

This is a PR to test if the pipeline runs for forks.

@vercel
Copy link

vercel bot commented Sep 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
rollup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2023 0:25am

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Merging #5139 (1b2c796) into rollup-swc (ec2f8ec) will not change coverage.
The diff coverage is n/a.

❗ Current head 1b2c796 differs from pull request most recent head eb2b51c. Consider uploading reports for the commit eb2b51c to get more accurate results

@@             Coverage Diff             @@
##           rollup-swc    #5139   +/-   ##
===========================================
  Coverage       97.68%   97.68%           
===========================================
  Files             229      229           
  Lines            8956     8956           
  Branches         2337     2337           
===========================================
  Hits             8749     8749           
  Misses            146      146           
  Partials           61       61           

@lukastaegert lukastaegert merged commit 5d90097 into rollup:rollup-swc Sep 15, 2023
22 checks passed
@github-actions
Copy link

This PR has been released as part of rollup@4.0.0-19. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@4.0.0-19 or npm install rollup@beta. It will likely become part of a regular release later.

lukastaegert added a commit that referenced this pull request Sep 17, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 18, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 18, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 18, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 18, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 21, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 21, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 24, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 24, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Sep 29, 2023
* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>
lukastaegert added a commit that referenced this pull request Sep 29, 2023
* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>
lukastaegert added a commit that referenced this pull request Oct 5, 2023
* [v4.0] Set minimum Node version to 18

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* [v4.0] Set the default of skipSelf to true (#5142)

* Set minimum Node version to 18

* Set the default of skipSelf to true

* [v4.0] Switch parser to SWC and introduce native/WASM code (#5073)

* Add native compilation for local NodeJS

* Link instead of copying for faster dev cycles for now

* Parse AST

* Convert first trivial AST to a buffer

* Use SWC for parsing

* Extend AST conversion

* Make AST more similar

* Fix line number issue by creating a new sourcemap (and thus compiler) for each run

* Collect timings

* Add code_length to struct

* Refine parsing

* Extend parsing

* Extend AST: ImportDefaultSpecifier, LiteralBoolean, LiteralNull, ExportDefaultExpression

* Extend AST: ImportNamespaceSpecifier, ExportAll

* Extend AST: BinaryExpression, ArrayPattern, ObjectPattern, AssignmentPatternProperty, ArrayLiteral, ImportExpression

* Extend AST: ConditionalExpression

* Extend AST: FunctionDeclaration, ClassDeclaration, ClassBody, ReturnStatement

* Extend AST: ObjectLiteral, KeyValueProperty

* Extend AST: ShorthandProperty

* Extend AST: GetterProperty, AssignmentExpression, NewExpression, FunctionExpression

* Extend AST: ThrowStatement

* Extend AST: ExportDefaultDeclaration

* Extend AST: AssignmentPattern, AwaitExpression, BreakStatement
Start sorting AST nodes

* Extend AST: TryStatement, CatchClause, ChainExpression

* Extend AST: ClassExpression, ContinueStatement, DebuggerStatement, DoWhileStatement, EmptyStatement

* Extend AST: ExportNamedDeclaration, ForInStatement, ForOfStatement, ForStatement

* Extend AST: IfStatement

* Extend AST: Import attributes

* Extend AST: Literal<RegExp>, Literal<BigInt>

* Extend AST: LogicalExpression

* Extend AST: MetaProperty

* Extend AST: Various Property types

* Extend AST: Progress on classes

* Extend AST: MethodDefinition, PropertyDefinition, PrivateName, ThisExpression

* Extend AST: StaticBlock, Super

* Extend AST: RestElement, SequenceExpression, SwitchCase, SwitchStatement

* Extend AST: TaggedTemplateExpression, TemplateElement, TemplateLiteral, UnaryExpression, UpdateExpression, YieldExpression

* Extend AST: Properties in object patterns

* Finishing Fixes

* More fixes

* Run cargo fmt

* Handle directives

* Minor fixes

* Unicode support

* Fix optional chain expressions

* Adapt tests

* Do not run acorn anymore

* Update lockfile

* Minor fixes

* Move to rust folder

* Separate Rust Node bindings to allow adding WASM bindings in another workspace

* Make Napi build closer to how rs.napi works

* Fix path issues

* Disable browser build for now

* Add native package directories

* Refine runWithEcho

* Try initial steps with Github flow

* Trigger change

* Temporarily add yarn lockfile until we figured out if we get it to work with npm

* Use nightly toolchain

* Use default locations for Napi files to make things easier

* Adapt workflow

* Skip regular tests for now

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Attempt to fix broken workflows

* Test MacOS/WIndows

* Fix bootstrap build

* Skip tests

* Rename workflow

* Add additional tests

* Use zig differently

* Try to fix musl build

* Skip musl again for now

* Add publish to workflow

* 4.0.0-0

* Remove yarn lock again

* Fix coverage job

* Fix artefact handling

* Revert "4.0.0-0"

This reverts commit 734806f.

* 4.0.0-0

* Do not include default triples twice

* Fix native npm packages

* 4.0.0-1

* Add missing additional tests except browser tests

* Try to fix publish and tests

* 4.0.0-2

* Switch to faster utf-16 conversion

* 4.0.0-3

* Fix positioning algorithm when manually searching the code

* 4.0.0-4

* feat: Add WASM browser build (#5077)

* feat: add wasm browser build

* move wasm binding into a separate cargo workspace

* use imports replacing

* set the targetEnv option of wasm to browser in browser build

* add the wasm build to build command

* fix lint error and ci error

* add more comments to silence the linter

* big change

* trigger change

* run browser tests

* trigger change

* tweak wasm build on CI

* Increase build timeout

* Use shared string constants

* Extract fixed strings into constants

* Remove comment

* Get rid of dbg! calls

* Add lockfile hash to cargo cache

* Use if let over match in some cases

* Return the buffer of the syntax error in parse_ast

* Initial annotation support

* Put annotation types into string table

* Remove invalid annotations

* Support nested calls and new expressions

* Improve tree-shaking for annotations

* Adapt test

* Properly handle line-breaks, commas etc.

* Mark nested pure annotations as pure

* Remove sourcemap comments

* Handle function side effect annotatinos

* Remove old comment-handling code

* Increase timeout for browser tests

* Only skip the tests that still fail

* Run coverage again on CI

* Get the buffer of pos and message from the Syntax error

* Handle the lint errors from SWC

* Reenable tests about parse errors and adjust some relevant code

* Emit native.js to native.cjs

* Add cjs extension for native importee when bundling for ESM

* Change native importee with replace plugin and emit native.cjs in napi build

* Silence the linter for importing native

* Use node:path to resolve native binding files

* Add Node WASM files to Native packages for StackBlitz and similar use cases

* Unignore *.d.ts in the wasm dir

* 4.0.0-5

* Fix copy-wasm-node.js

* 4.0.0-6

* Remove .gitignore in wasm-node directory

* 4.0.0-7

* Include .cjs files when publishing rollup to npm

* 4.0.0-8

* Get readString function at runtime

* eslint: ignore wasm-node and set node extensions of import/resolver

* 4.0.0-9

* Change the required node to >=14.18.0 as before

* 4.0.0-10

* Prepare to fix ESM build

Still requires bug-fix on Rollup side for relative external dependencies
outside the ouput directory

* Update Rollup

* Enable ESM tests

* Re-enable another test

* Remove CJS eslint configuration

* Fix extension

* Fix test

* Fix entension for native import

* Support for publishing a completely separate package @rollup/wasm-node

* 4.0.0-11

* Fix publish for wasm node package

* Add AST verification to function tests

* Only use plugin arrays in form and function tests

* Fix spans in function tests

* Verify AST in form tests as well

* Try to publish @rollup/browser and fix publish-wasm-node-package.js

* 4.0.0-12

* Tweak publish scripts

* Fix importing wasm file in browser

* Parse code as unknown module type for greater compatibility

* Remove acorn options

* Tweak getReadStringFunction

* Fix browser tests

* 4.0.0-13

* Remove polyfills that are no longer needed in browser tests

* Convert to new import attributes AST format

* Rename assertions to attributes

* Deprecate externalImportAssertions in favor of externalImportAttributes

* Update SWC version

* Remove max-call-stack test

SWC is not capable of handling it and we cannot fix it

* Improve coverage

* re-enable repl-artefacts workflow

* Fix test

* Preload wasm file in docs

* docs: add functions to get full path of url

* Delete the build plugin handleImportMetaUrl

* Make 'npm install github/branch' work

* Verify there is a valid changelog entry before releasing

* Create release notes and comments from CI

Minor change to maybe trigger a CI run

* Fix RegExp

* 4.0.0-14

* Minor changes for a test PR (#5139)

* Fix RegExp use

* 4.0.0-15

* Do not rely on current branch to find the PR

* 4.0.0-16

* Fix how to determine git commit range

* 4.0.0-17

* Make sure we fetch all history on publish

* 4.0.0-18

* Add proper permissions

* 4.0.0-19

* Use Double quotation marks instead of Single quotation marks if concurrently scripts with flags

* Remove "engines" from native packages

* Update CONTRIBUTING.md

---------

Co-authored-by: XiaoPi <530257315@qq.com>

* Update tests

* Retrieve the code that was omitted during the merge

* Restore test coverage

* Update docs/plugin-development/index.md

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

---------

Co-authored-by: Lukas Taegert-Atkinson <lukas.taegert-atkinson@tngtech.com>
Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

* [v4.0] Imporve the performance of generating ast and rollup ast nodes (#5144)

* Set TsConfig useDefineForClassFields to false for reducing time consumption

* Adapt annotations props for reducing memory consumption

* [v4.0] Remove deprecated features (#5143)

* Remove hasModuleSideEffects from module info

* Remove this.moduleIds from plugin context

* Remove output.preferConst

* Remove output.dynamicImportFunction

* Remove output.experimentalDeepDynamicChunkOptimization

* Remove output.namespaceToStringTag

* Remove inlineDynamicImports input option

* Remove manualChunks and preserveModules input options as well as maxParallelFileReads

* [v4.0] feat: Do not watch files anymore if their content is returned by the load hook (#5150)

* feat: Do not watch files anymore if their content is returned by the load hook

* tweak test

* [v4.0] Remove onwarn from normalized input options (#5147)

Remove onwarn from normalized input options

Also remove the RollupWarning type

* [v4.0] Add parse option to allow return outside function (#5154)

Allow return outside functions

* [v4.0] Handle empty exports (#5157)

Handle empty exports

* [v4.0] feat: implement hashing content in Rust (#5155)

* [v4.0] fix: also strip BOM from code strings in JS (#5164)

fix: also strip BOM from code strings in JS

* [v4.0] feat: preserve shebang in entry module for CJS and ESM outputs (#5163)

* feat: preserve shebang in entry module for CJS and ESM outputs

* Remove the shebang insertion during cli build

* Parse shebang in JS code

* Render shebang in chunk.render()

---------

Co-authored-by: Lukas Taegert-Atkinson <lukastaegert@users.noreply.github.com>

* [v4.0] warn for invalid annotations (#5165)

* Remove annotations for partially removed declarations

* Warn for invalid annotations

* 4.0.0-24

* [v.4.0] Ensure we support new import attribute "with" syntax (#5168)

* Update dependencies

* Use new import attribute syntax in test files

* [v4.0] Expose parser (#5169)

* Expose parser as separate API

* Ensure key and value of a shorthand property have different references

* 4.0.0-25

---------

Co-authored-by: XiaoPi <530257315@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant