feat: complete MDX migration, stabilize routing and lead capture
Former-commit-id: ab5cc38c97e5f73d6e821465b90d199fb6e6edc9
This commit is contained in:
49
node_modules/.pnpm/astring@1.9.0/node_modules/astring/.eslintrc.json
generated
vendored
Normal file
49
node_modules/.pnpm/astring@1.9.0/node_modules/astring/.eslintrc.json
generated
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"plugins": ["import"],
|
||||
"extends": ["eslint:recommended", "plugin:import/errors", "prettier"],
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 13,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"globals": {
|
||||
"console": true,
|
||||
"global": true,
|
||||
"module": true,
|
||||
"process": true,
|
||||
"require": true,
|
||||
"window": true,
|
||||
"__dirname": true
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["src/tests/fixtures/**/*.js"],
|
||||
"rules": {
|
||||
"constructor-super": 0,
|
||||
"getter-return": 0,
|
||||
"no-cond-assign": 0,
|
||||
"no-constant-condition": 0,
|
||||
"no-control-regex": 0,
|
||||
"no-debugger": 0,
|
||||
"no-dupe-class-members": 0,
|
||||
"no-dupe-keys": 0,
|
||||
"no-duplicate-case": 0,
|
||||
"no-empty": 0,
|
||||
"no-inner-declarations": 0,
|
||||
"no-irregular-whitespace": 0,
|
||||
"no-redeclare": 0,
|
||||
"no-sparse-arrays": 0,
|
||||
"no-undef": 0,
|
||||
"no-unreachable": 0,
|
||||
"no-unsafe-negation": 0,
|
||||
"no-unused-labels": 0,
|
||||
"no-unused-vars": 0,
|
||||
"no-useless-escape": 0,
|
||||
"no-var": 0,
|
||||
"no-loss-of-precision": 0
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
224
node_modules/.pnpm/astring@1.9.0/node_modules/astring/CHANGELOG.md
generated
vendored
Normal file
224
node_modules/.pnpm/astring@1.9.0/node_modules/astring/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,224 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
## [1.9.0](https://github.com/davidbonnet/astring/compare/v1.8.6...v1.9.0) (2024-08-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add import-attributes support ([#712](https://github.com/davidbonnet/astring/issues/712)) ([d22c19e](https://github.com/davidbonnet/astring/commit/d22c19ee636e671a8214e062c1165cf56511b40f))
|
||||
|
||||
### [1.8.6](https://github.com/davidbonnet/astring/compare/v1.8.5...v1.8.6) (2023-05-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **nullish:** missing parenthesis ([be1aefb](https://github.com/davidbonnet/astring/commit/be1aefb7396c62b8504d15fc21891e4e9317f492)), closes [#695](https://github.com/davidbonnet/astring/issues/695)
|
||||
|
||||
### [1.8.5](https://github.com/davidbonnet/astring/compare/v1.8.4...v1.8.5) (2023-05-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** add type conditional export ([36c0029](https://github.com/davidbonnet/astring/commit/36c00290ab8573a56dec118600721a0b87363a8b))
|
||||
* incorrect nullish coalescing operator precedence ([#694](https://github.com/davidbonnet/astring/issues/694)) ([ad9ce87](https://github.com/davidbonnet/astring/commit/ad9ce8724453bdd497290b464787dde0a86d42ec))
|
||||
|
||||
### [1.8.4](https://github.com/davidbonnet/astring/compare/v1.8.3...v1.8.4) (2022-12-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* static computed property ([#672](https://github.com/davidbonnet/astring/issues/672)) ([1630853](https://github.com/davidbonnet/astring/commit/16308537294bf0af26f318dc2f4a535814c3cae4))
|
||||
|
||||
### [1.8.3](https://github.com/davidbonnet/astring/compare/v1.8.2...v1.8.3) (2022-04-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add missing definitions ([9bb7bcf](https://github.com/davidbonnet/astring/commit/9bb7bcf7ab946bae3aab48b4d4b5edc72b52c208)), closes [#604](https://github.com/davidbonnet/astring/issues/604)
|
||||
|
||||
### [1.8.2](https://github.com/davidbonnet/astring/compare/v1.8.1...v1.8.2) (2022-04-28)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Does not handle undefined private properties ([e6b8ee6](https://github.com/davidbonnet/astring/commit/e6b8ee645d0e9fa3cc6ff4bb30d2a15e2289a88b)), closes [#609](https://github.com/davidbonnet/astring/issues/609)
|
||||
|
||||
### [1.8.1](https://github.com/davidbonnet/astring/compare/v1.8.0...v1.8.1) (2021-11-21)
|
||||
|
||||
## [1.8.0](https://github.com/davidbonnet/astring/compare/v1.7.6...v1.8.0) (2021-11-21)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support ES2022 ([#593](https://github.com/davidbonnet/astring/issues/593)) ([5a327d1](https://github.com/davidbonnet/astring/commit/5a327d1425cdd620377fb52b987880f8af461b62))
|
||||
|
||||
### [1.7.6](https://github.com/davidbonnet/astring/compare/v1.7.5...v1.7.6) (2021-11-21)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* wrong precedence of nullish operator ([#590](https://github.com/davidbonnet/astring/issues/590)) ([10fac23](https://github.com/davidbonnet/astring/commit/10fac23a010feedb26d3baaf0e74e2311504e846))
|
||||
|
||||
### [1.7.5](https://github.com/davidbonnet/astring/compare/v1.7.4...v1.7.5) (2021-06-02)
|
||||
|
||||
### [1.7.4](https://github.com/davidbonnet/astring/compare/v1.7.3...v1.7.4) (2021-04-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** correctly declare module variant ([45203ca](https://github.com/davidbonnet/astring/commit/45203ca5bdd0307cfa3ed9a838d59718de84c6b5)), closes [#505](https://github.com/davidbonnet/astring/issues/505)
|
||||
|
||||
### [1.7.3](https://github.com/davidbonnet/astring/compare/v1.7.2...v1.7.3) (2021-04-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **package:** add "exports" field ([e82e873](https://github.com/davidbonnet/astring/commit/e82e87312f51c2cfa1a3c1104091a30352023bc5))
|
||||
|
||||
### [1.7.2](https://github.com/davidbonnet/astring/compare/v1.7.1...v1.7.2) (2021-04-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* class, ternary, and arrow function miss parentheses ([#504](https://github.com/davidbonnet/astring/issues/504)) ([5037b94](https://github.com/davidbonnet/astring/commit/5037b94b3a447be7d42ae9edeb1e50ef2b2b776c))
|
||||
|
||||
### [1.7.1](https://github.com/davidbonnet/astring/compare/v1.7.0...v1.7.1) (2021-04-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **sourcemaps:** missing sourcemaps on debugger statement ([#503](https://github.com/davidbonnet/astring/issues/503)) ([9822a2a](https://github.com/davidbonnet/astring/commit/9822a2a4432ff957ef18c5959f3c71d10f0e361d))
|
||||
|
||||
## [1.7.0](https://github.com/davidbonnet/astring/compare/v1.6.2...v1.7.0) (2021-02-06)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add typescript definitions ([#346](https://github.com/davidbonnet/astring/issues/346)) ([d2e197a](https://github.com/davidbonnet/astring/commit/d2e197a6b82efeeffc2d7a6fa2f16295c54c8dea))
|
||||
|
||||
### [1.6.2](https://github.com/davidbonnet/astring/compare/v1.6.1...v1.6.2) (2021-02-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* lower yield operator precedence ([d3af2fc](https://github.com/davidbonnet/astring/commit/d3af2fcd8096401b5618a7e479bfb5b25e129eed))
|
||||
|
||||
### [1.6.1](https://github.com/davidbonnet/astring/compare/v1.6.0...v1.6.1) (2021-02-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adjust await and yield operator precendences ([d6166a2](https://github.com/davidbonnet/astring/commit/d6166a256f8e6f1071440b7469b786c18ddf252f)), closes [#435](https://github.com/davidbonnet/astring/issues/435)
|
||||
|
||||
## [1.6.0](https://github.com/davidbonnet/astring/compare/v1.5.1...v1.6.0) (2021-01-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support custom expression precedence ([#427](https://github.com/davidbonnet/astring/issues/427)) ([76ce709](https://github.com/davidbonnet/astring/commit/76ce7099c4ba391ef130ea6010bcce6ae7392cf4))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* unary and update expression precedence ([0b273a6](https://github.com/davidbonnet/astring/commit/0b273a6cfe7c7672de4cf1bd00f423358d0729f4)), closes [#426](https://github.com/davidbonnet/astring/issues/426)
|
||||
|
||||
### [1.5.1](https://github.com/davidbonnet/astring/compare/v1.5.0...v1.5.1) (2021-01-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **source-maps:** map nameless nodes ([102e569](https://github.com/davidbonnet/astring/commit/102e5696482d42f5dcccdb2ce088f7361c7dee94))
|
||||
|
||||
## [1.5.0](https://github.com/davidbonnet/astring/compare/v1.4.3...v1.5.0) (2021-01-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add bigint support ([d061997](https://github.com/davidbonnet/astring/commit/d061997b03095bbd864889dd04b6442fae6363ce))
|
||||
* add identifier support to export all ([a646dfa](https://github.com/davidbonnet/astring/commit/a646dfa9a6d093111f934b306d37ad61cf32fd9b))
|
||||
* add optional chaining support ([8c3ef44](https://github.com/davidbonnet/astring/commit/8c3ef44ae6d273562f6e03cb890726d2cc02f9b2)), closes [#424](https://github.com/davidbonnet/astring/issues/424)
|
||||
* support import expression ([#345](https://github.com/davidbonnet/astring/issues/345)) ([56a1574](https://github.com/davidbonnet/astring/commit/56a1574774533764644107a61bf0acc0d1c7d209))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **demo:** disable spellcheck on input ([b95ef6a](https://github.com/davidbonnet/astring/commit/b95ef6a4a179b031beba27387dd1bba935b2ce72))
|
||||
* incorrect awaited arrow function render ([11ec06c](https://github.com/davidbonnet/astring/commit/11ec06cd092cabc1a82ccd8b74c8219fcf98dcb7))
|
||||
* missing space for repeating unary operator ([#315](https://github.com/davidbonnet/astring/issues/315)) ([48e8a2e](https://github.com/davidbonnet/astring/commit/48e8a2e157858df4e1765cc2db9148b5b708216d))
|
||||
* sourcemaps for multiline strings are incorrect ([f246aff](https://github.com/davidbonnet/astring/commit/f246affc88b57455bc9eaa7f306fc9d2b6fd645f)), closes [#247](https://github.com/davidbonnet/astring/issues/247)
|
||||
|
||||
### [1.4.3](https://github.com/davidbonnet/astring/compare/v1.4.2...v1.4.3) (2019-10-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* render TemplateElement nodes ([8e5f77b](https://github.com/davidbonnet/astring/commit/8e5f77b)), closes [#129](https://github.com/davidbonnet/astring/issues/129)
|
||||
|
||||
### [1.4.2](https://github.com/davidbonnet/astring/compare/v1.4.1...v1.4.2) (2019-09-15)
|
||||
|
||||
|
||||
### Build System
|
||||
|
||||
* **deps-dev:** bump @babel/cli from 7.5.5 to 7.6.0 ([#103](https://github.com/davidbonnet/astring/issues/103)) ([e4681cc](https://github.com/davidbonnet/astring/commit/e4681cc))
|
||||
* **deps-dev:** bump @babel/core from 7.5.5 to 7.6.0 ([#105](https://github.com/davidbonnet/astring/issues/105)) ([08af974](https://github.com/davidbonnet/astring/commit/08af974))
|
||||
* **deps-dev:** bump @babel/generator from 7.5.5 to 7.6.0 ([#104](https://github.com/davidbonnet/astring/issues/104)) ([d4e29bd](https://github.com/davidbonnet/astring/commit/d4e29bd))
|
||||
* **deps-dev:** bump @babel/parser from 7.5.5 to 7.6.0 ([#110](https://github.com/davidbonnet/astring/issues/110)) ([df0414b](https://github.com/davidbonnet/astring/commit/df0414b))
|
||||
* **deps-dev:** bump @babel/preset-env from 7.5.5 to 7.6.0 ([#106](https://github.com/davidbonnet/astring/issues/106)) ([7616978](https://github.com/davidbonnet/astring/commit/7616978))
|
||||
* **deps-dev:** bump acorn from 6.2.1 to 6.3.0 ([#86](https://github.com/davidbonnet/astring/issues/86)) ([585e4c6](https://github.com/davidbonnet/astring/commit/585e4c6))
|
||||
* **deps-dev:** bump ava from 2.2.0 to 2.3.0 ([#89](https://github.com/davidbonnet/astring/issues/89)) ([21c90fa](https://github.com/davidbonnet/astring/commit/21c90fa))
|
||||
* **deps-dev:** bump babel-preset-minify from 0.5.0 to 0.5.1 ([#88](https://github.com/davidbonnet/astring/issues/88)) ([a9c02a2](https://github.com/davidbonnet/astring/commit/a9c02a2))
|
||||
* **deps-dev:** bump cross-env from 5.2.0 to 5.2.1 ([#99](https://github.com/davidbonnet/astring/issues/99)) ([d24faef](https://github.com/davidbonnet/astring/commit/d24faef))
|
||||
* **deps-dev:** bump escodegen from 1.11.1 to 1.12.0 ([#84](https://github.com/davidbonnet/astring/issues/84)) ([09d0a59](https://github.com/davidbonnet/astring/commit/09d0a59))
|
||||
* **deps-dev:** bump eslint from 6.1.0 to 6.2.0 ([#91](https://github.com/davidbonnet/astring/issues/91)) ([63f193d](https://github.com/davidbonnet/astring/commit/63f193d))
|
||||
* **deps-dev:** bump eslint from 6.2.0 to 6.2.1 ([#93](https://github.com/davidbonnet/astring/issues/93)) ([f36bd83](https://github.com/davidbonnet/astring/commit/f36bd83))
|
||||
* **deps-dev:** bump eslint from 6.2.1 to 6.2.2 ([#95](https://github.com/davidbonnet/astring/issues/95)) ([7a0c860](https://github.com/davidbonnet/astring/commit/7a0c860))
|
||||
* **deps-dev:** bump eslint from 6.2.2 to 6.3.0 ([#97](https://github.com/davidbonnet/astring/issues/97)) ([8ba7db9](https://github.com/davidbonnet/astring/commit/8ba7db9))
|
||||
* **deps-dev:** bump eslint from 6.3.0 to 6.4.0 ([#111](https://github.com/davidbonnet/astring/issues/111)) ([eefe681](https://github.com/davidbonnet/astring/commit/eefe681))
|
||||
* **deps-dev:** bump eslint-config-prettier from 6.0.0 to 6.1.0 ([#92](https://github.com/davidbonnet/astring/issues/92)) ([82d33dc](https://github.com/davidbonnet/astring/commit/82d33dc))
|
||||
* **deps-dev:** bump eslint-config-prettier from 6.1.0 to 6.2.0 ([#101](https://github.com/davidbonnet/astring/issues/101)) ([b4198a4](https://github.com/davidbonnet/astring/commit/b4198a4))
|
||||
* **deps-dev:** bump eslint-config-prettier from 6.2.0 to 6.3.0 ([#108](https://github.com/davidbonnet/astring/issues/108)) ([f63fd0c](https://github.com/davidbonnet/astring/commit/f63fd0c))
|
||||
* **deps-dev:** bump husky from 3.0.1 to 3.0.2 ([#77](https://github.com/davidbonnet/astring/issues/77)) ([dbb65dc](https://github.com/davidbonnet/astring/commit/dbb65dc))
|
||||
* **deps-dev:** bump husky from 3.0.2 to 3.0.3 ([#82](https://github.com/davidbonnet/astring/issues/82)) ([f11579c](https://github.com/davidbonnet/astring/commit/f11579c))
|
||||
* **deps-dev:** bump husky from 3.0.3 to 3.0.4 ([a686998](https://github.com/davidbonnet/astring/commit/a686998))
|
||||
* **deps-dev:** bump husky from 3.0.4 to 3.0.5 ([#100](https://github.com/davidbonnet/astring/issues/100)) ([2bff815](https://github.com/davidbonnet/astring/commit/2bff815))
|
||||
* **deps-dev:** bump meriyah from 1.3.5 to 1.6.0 ([#79](https://github.com/davidbonnet/astring/issues/79)) ([2cad1d4](https://github.com/davidbonnet/astring/commit/2cad1d4))
|
||||
* **deps-dev:** bump meriyah from 1.6.0 to 1.6.2 ([#81](https://github.com/davidbonnet/astring/issues/81)) ([7ce3afd](https://github.com/davidbonnet/astring/commit/7ce3afd))
|
||||
* **deps-dev:** bump meriyah from 1.6.10 to 1.6.13 ([#94](https://github.com/davidbonnet/astring/issues/94)) ([49f2899](https://github.com/davidbonnet/astring/commit/49f2899))
|
||||
* **deps-dev:** bump meriyah from 1.6.13 to 1.6.15 ([#96](https://github.com/davidbonnet/astring/issues/96)) ([9a0ce8f](https://github.com/davidbonnet/astring/commit/9a0ce8f))
|
||||
* **deps-dev:** bump meriyah from 1.6.15 to 1.6.16 ([#98](https://github.com/davidbonnet/astring/issues/98)) ([4085bf9](https://github.com/davidbonnet/astring/commit/4085bf9))
|
||||
* **deps-dev:** bump meriyah from 1.6.16 to 1.6.17 ([#102](https://github.com/davidbonnet/astring/issues/102)) ([e56c7c6](https://github.com/davidbonnet/astring/commit/e56c7c6))
|
||||
* **deps-dev:** bump meriyah from 1.6.17 to 1.6.18 ([#107](https://github.com/davidbonnet/astring/issues/107)) ([2c4fc18](https://github.com/davidbonnet/astring/commit/2c4fc18))
|
||||
* **deps-dev:** bump meriyah from 1.6.18 to 1.7.0 ([#109](https://github.com/davidbonnet/astring/issues/109)) ([ba3c487](https://github.com/davidbonnet/astring/commit/ba3c487))
|
||||
* **deps-dev:** bump meriyah from 1.6.2 to 1.6.8 ([#85](https://github.com/davidbonnet/astring/issues/85)) ([0c91697](https://github.com/davidbonnet/astring/commit/0c91697))
|
||||
* **deps-dev:** bump meriyah from 1.6.8 to 1.6.10 ([#87](https://github.com/davidbonnet/astring/issues/87)) ([036c19d](https://github.com/davidbonnet/astring/commit/036c19d))
|
||||
|
||||
|
||||
|
||||
### [1.4.1](https://github.com/davidbonnet/astring/compare/v1.4.0...v1.4.1) (2019-07-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **#74:** correct exponentiation precedence ([b267927](https://github.com/davidbonnet/astring/commit/b267927)), closes [#74](https://github.com/davidbonnet/astring/issues/74) [#74](https://github.com/davidbonnet/astring/issues/74)
|
||||
|
||||
|
||||
|
||||
<a name="1.4.0"></a>
|
||||
# [1.4.0](https://github.com/davidbonnet/astring/compare/v1.3.1...v1.4.0) (2019-03-30)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove Node 6 support ([800c07f](https://github.com/davidbonnet/astring/commit/800c07f))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* support async loops and rest properties ([294021c](https://github.com/davidbonnet/astring/commit/294021c)), closes [#64](https://github.com/davidbonnet/astring/issues/64)
|
||||
|
||||
|
||||
|
||||
<a name="1.3.1"></a>
|
||||
## [1.3.1](https://github.com/davidbonnet/astring/compare/v1.3.0...v1.3.1) (2018-06-23)
|
||||
19
node_modules/.pnpm/astring@1.9.0/node_modules/astring/LICENSE
generated
vendored
Normal file
19
node_modules/.pnpm/astring@1.9.0/node_modules/astring/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2015, David Bonnet <david@bonnet.cc>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
298
node_modules/.pnpm/astring@1.9.0/node_modules/astring/README.md
generated
vendored
Normal file
298
node_modules/.pnpm/astring@1.9.0/node_modules/astring/README.md
generated
vendored
Normal file
@@ -0,0 +1,298 @@
|
||||
# Astring
|
||||
|
||||
[](https://www.npmjs.org/package/astring)
|
||||
[](https://codecov.io/gh/davidbonnet/astring)
|
||||
|
||||
🌳 Tiny and fast JavaScript code generator from an [ESTree](https://github.com/estree/estree)-compliant AST.
|
||||
|
||||
### Key features
|
||||
|
||||
- Generates JavaScript code up to [version 15 (2024)](https://tc39.github.io/ecma262/) and [stage 3 proposals](https://github.com/tc39/proposals#stage-3).
|
||||
- Works on [ESTree](https://github.com/estree/estree)-compliant ASTs such as the ones produced by [Meriyah](https://github.com/meriyah/meriyah) or [Acorn](https://github.com/acornjs/acorn).
|
||||
- Extendable with custom AST node handlers.
|
||||
- Considerably faster than [Bublé](https://gitlab.com/Rich-Harris/buble) (up to 5×), [Escodegen](https://github.com/estools/escodegen) (up to 10×), [Babel](https://github.com/babel/babel) (up to 50×), [UglifyJS](https://github.com/mishoo/UglifyJS2) (up to 125×), and [Prettier](https://github.com/prettier/prettier) (up to 380×).
|
||||
- Supports source map generation with [Source Map](https://github.com/mozilla/source-map#sourcemapgenerator).
|
||||
- Supports comment generation with [Astravel](https://github.com/davidbonnet/astravel).
|
||||
- No dependencies and small footprint (≈ 16 KB minified, ≈ 4 KB gziped).
|
||||
- Runs on [🦕 Deno](https://deno.land/x/astring).
|
||||
|
||||
## Installation
|
||||
|
||||
> :warning: Astring relies on `String.prototype.repeat(amount)` and `String.prototype.endsWith(string)`. If the environment running Astring does not define these methods, use [`string.prototype.repeat`](https://www.npmjs.com/package/string.prototype.repeat), [`string.prototype.endsWith`](https://www.npmjs.com/package/string.prototype.endswith) or [`babel-polyfill`](https://www.npmjs.com/package/babel-polyfill).
|
||||
|
||||
Install with the [Node Package Manager](https://www.npmjs.com/package/astring):
|
||||
|
||||
```bash
|
||||
npm install astring
|
||||
```
|
||||
|
||||
Or install with [JSR](https://jsr.io/@davidbonnet/astring):
|
||||
|
||||
```bash
|
||||
deno add @davidbonnet/astring
|
||||
```
|
||||
|
||||
Alternatively, checkout this repository and install the development dependencies to build the module file:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/davidbonnet/astring.git
|
||||
cd astring
|
||||
npm install
|
||||
```
|
||||
|
||||
## Import
|
||||
|
||||
Import it from [Deno's third party module repository](https://deno.land/x/astring/src/astring.js):
|
||||
|
||||
```js
|
||||
const { generate } = await import('https://deno.land/x/astring/src/astring.js')
|
||||
```
|
||||
|
||||
With JavaScript 6 modules:
|
||||
|
||||
```js
|
||||
import { generate } from 'astring'
|
||||
```
|
||||
|
||||
With CommonJS:
|
||||
|
||||
```js
|
||||
const { generate } = require('astring')
|
||||
```
|
||||
|
||||
A browser-ready minified bundle containing Astring is available at `dist/astring.min.js`. The module exposes a global variable `astring`:
|
||||
|
||||
```html
|
||||
<script src="astring.min.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var generate = astring.generate
|
||||
</script>
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
The `astring` module exposes the following properties:
|
||||
|
||||
### `generate(node: object, options: object): string | object`
|
||||
|
||||
Returns a string representing the rendered code of the provided AST `node`. However, if an `output` stream is provided in the `options`, it writes to that stream and returns it.
|
||||
|
||||
The `options` are:
|
||||
|
||||
- `indent`: string to use for indentation (defaults to `"␣␣"`)
|
||||
- `lineEnd`: string to use for line endings (defaults to `"\n"`)
|
||||
- `startingIndentLevel`: indent level to start from (defaults to `0`)
|
||||
- `comments`: generate comments if `true` (defaults to `false`)
|
||||
- `output`: output stream to write the rendered code to (defaults to `null`)
|
||||
- `generator`: custom code generator (defaults to `GENERATOR`)
|
||||
- `sourceMap`: [source map generator](https://github.com/mozilla/source-map#sourcemapgenerator) (defaults to `null`)
|
||||
- `expressionsPrecedence`: custom map of node types and their precedence level (defaults to `EXPRESSIONS_PRECEDENCE`)
|
||||
|
||||
### `GENERATOR: object`
|
||||
|
||||
Base generator that can be used to [extend Astring](#extending).
|
||||
|
||||
### `EXPRESSIONS_PRECEDENCE: object`
|
||||
|
||||
Mapping of node types and their precedence level to let the generator know when to use parentheses.
|
||||
|
||||
### `NEEDS_PARENTHESES: number`
|
||||
|
||||
Default precedence level that always triggers the use of parentheses.
|
||||
|
||||
### `baseGenerator: object`
|
||||
|
||||
> :warning: Deprecated, use `GENERATOR` instead.
|
||||
|
||||
## Benchmark
|
||||
|
||||
### Generating code
|
||||
|
||||
Operations per second for generating each sample code from a pre-parsed AST:
|
||||
|
||||
| code sample (length) | escodegen | astring | uglify | babel | prettier |
|
||||
| :------------------- | --------: | --------: | ------: | ------: | -------: |
|
||||
| tiny code (11) | 1,257,527 | 7,185,642 | 129,467 | 156,184 | 333 |
|
||||
| everything (8532) | 1,366 | 8,008 | 0 | 346 | 64 |
|
||||
|
||||
### Parsing and generating code
|
||||
|
||||
Operations per second for parsing and generating each sample code:
|
||||
|
||||
| code sample (length) | acorn + astring | meriyah + astring | buble | sucrase |
|
||||
| :------------------- | --------------: | ----------------: | -----: | ------: |
|
||||
| tiny code (11) | 92,578 | 864,665 | 25,911 | 575,370 |
|
||||
| everything (8532) | 706 | 1,425 | 132 | 1,403 |
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples are written in JavaScript 5 with Astring imported _à la CommonJS_.
|
||||
|
||||
### Generating code
|
||||
|
||||
This example uses [Acorn](https://github.com/acornjs/acorn), a blazingly fast JavaScript AST producer and therefore the perfect companion of Astring.
|
||||
|
||||
```javascript
|
||||
// Make sure acorn and astring modules are imported
|
||||
|
||||
// Set example code
|
||||
var code = 'let answer = 4 + 7 * 5 + 3;\n'
|
||||
// Parse it into an AST
|
||||
var ast = acorn.parse(code, { ecmaVersion: 6 })
|
||||
// Format it into a code string
|
||||
var formattedCode = astring.generate(ast)
|
||||
// Check it
|
||||
console.log(code === formattedCode ? 'It works!' : 'Something went wrong…')
|
||||
```
|
||||
|
||||
### Generating source maps
|
||||
|
||||
This example uses the source map generator from the [Source Map](https://github.com/mozilla/source-map#sourcemapgenerator) module.
|
||||
|
||||
```javascript
|
||||
// Make sure acorn, sourceMap and astring modules are imported
|
||||
|
||||
var code = 'function add(a, b) { return a + b; }\n'
|
||||
var ast = acorn.parse(code, {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
// Locations are needed in order for the source map generator to work
|
||||
locations: true,
|
||||
})
|
||||
// Create empty source map generator
|
||||
var map = new sourceMap.SourceMapGenerator({
|
||||
// Source file name must be set and will be used for mappings
|
||||
file: 'script.js',
|
||||
})
|
||||
var formattedCode = generate(ast, {
|
||||
// Enable source maps
|
||||
sourceMap: map,
|
||||
})
|
||||
// Display generated source map
|
||||
console.log(map.toString())
|
||||
```
|
||||
|
||||
### Using writable streams
|
||||
|
||||
This example for [Node](http://nodejs.org) shows how to use writable streams to get the rendered code.
|
||||
|
||||
```javascript
|
||||
// Make sure acorn and astring modules are imported
|
||||
|
||||
// Set example code
|
||||
var code = 'let answer = 4 + 7 * 5 + 3;\n'
|
||||
// Parse it into an AST
|
||||
var ast = acorn.parse(code, { ecmaVersion: 6 })
|
||||
// Format it and write the result to stdout
|
||||
var stream = astring.generate(ast, {
|
||||
output: process.stdout,
|
||||
})
|
||||
// The returned value is the output stream
|
||||
console.log('Does stream equal process.stdout?', stream === process.stdout)
|
||||
```
|
||||
|
||||
### Generating comments
|
||||
|
||||
Astring supports comment generation, provided they are stored on the AST nodes. To do so, this example uses [Astravel](https://github.com/davidbonnet/astravel), a fast AST traveller and modifier.
|
||||
|
||||
```javascript
|
||||
// Make sure acorn, astravel and astring modules are imported
|
||||
|
||||
// Set example code
|
||||
var code =
|
||||
[
|
||||
'// Compute the answer to everything',
|
||||
'let answer = 4 + 7 * 5 + 3;',
|
||||
'// Display it',
|
||||
'console.log(answer);',
|
||||
].join('\n') + '\n'
|
||||
// Parse it into an AST and retrieve the list of comments
|
||||
var comments = []
|
||||
var ast = acorn.parse(code, {
|
||||
ecmaVersion: 6,
|
||||
locations: true,
|
||||
onComment: comments,
|
||||
})
|
||||
// Attach comments to AST nodes
|
||||
astravel.attachComments(ast, comments)
|
||||
// Format it into a code string
|
||||
var formattedCode = astring.generate(ast, {
|
||||
comments: true,
|
||||
})
|
||||
// Check it
|
||||
console.log(code === formattedCode ? 'It works!' : 'Something went wrong…')
|
||||
```
|
||||
|
||||
### Extending
|
||||
|
||||
Astring can easily be extended by updating or passing a custom code `generator`. A code `generator` consists of a mapping of node names and functions that take two arguments: `node` and `state`. The `node` points to the node from which to generate the code and the `state` exposes the `write` method that takes generated code strings.
|
||||
|
||||
This example shows how to support the `await` keyword which is part of the [asynchronous functions proposal](https://github.com/tc39/ecmascript-asyncawait). The corresponding `AwaitExpression` node is based on [this suggested definition](https://github.com/estree/estree/blob/master/es2017.md).
|
||||
|
||||
```javascript
|
||||
// Make sure the astring module is imported and that `Object.assign` is defined
|
||||
|
||||
// Create a custom generator that inherits from Astring's base generator
|
||||
var customGenerator = Object.assign({}, astring.GENERATOR, {
|
||||
AwaitExpression: function (node, state) {
|
||||
state.write('await ')
|
||||
var argument = node.argument
|
||||
if (argument != null) {
|
||||
this[argument.type](argument, state)
|
||||
}
|
||||
},
|
||||
})
|
||||
// Obtain a custom AST somehow (note that this AST is not obtained from a valid code)
|
||||
var ast = {
|
||||
type: 'AwaitExpression',
|
||||
argument: {
|
||||
type: 'CallExpression',
|
||||
callee: {
|
||||
type: 'Identifier',
|
||||
name: 'callable',
|
||||
},
|
||||
arguments: [],
|
||||
},
|
||||
}
|
||||
// Format it
|
||||
var code = astring.generate(ast, {
|
||||
generator: customGenerator,
|
||||
})
|
||||
// Check it
|
||||
console.log(
|
||||
code === 'await callable();\n' ? 'It works!' : 'Something went wrong…',
|
||||
)
|
||||
```
|
||||
|
||||
## Command line interface
|
||||
|
||||
The `bin/astring` utility can be used to convert a JSON-formatted ESTree compliant AST of a JavaScript code. It accepts the following arguments:
|
||||
|
||||
- `-i`, `--indent`: string to use as indentation (defaults to `"␣␣"`)
|
||||
- `-l`, `--line-end`: string to use for line endings (defaults to `"\n"`)
|
||||
- `-s`, `--starting-indent-level`: indent level to start from (defaults to `0`)
|
||||
- `-h`, `--help`: print a usage message and exit
|
||||
- `-v`, `--version`: print package version and exit
|
||||
|
||||
The utility reads the AST from a provided list of files or from `stdin` if none is supplied and prints the generated code.
|
||||
|
||||
### Example
|
||||
|
||||
As in the previous example, these examples use [Acorn](https://github.com/acornjs/acorn) to get the JSON-formatted AST. This command pipes the AST output by Acorn from a `script.js` file to Astring and writes the formatted JavaScript code into a `result.js` file:
|
||||
|
||||
```bash
|
||||
acorn --ecma6 script.js | astring > result.js
|
||||
```
|
||||
|
||||
This command does the same, but reads the AST from an intermediary file:
|
||||
|
||||
```bash
|
||||
acorn --ecma6 script.js > ast.json
|
||||
astring ast.json > result.js
|
||||
```
|
||||
|
||||
This command reads JavaScript 6 code from `stdin` and outputs a prettified version:
|
||||
|
||||
```bash
|
||||
cat | acorn --ecma6 | astring
|
||||
```
|
||||
89
node_modules/.pnpm/astring@1.9.0/node_modules/astring/astring.d.ts
generated
vendored
Normal file
89
node_modules/.pnpm/astring@1.9.0/node_modules/astring/astring.d.ts
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
import type { Node as EstreeNode } from 'estree'
|
||||
import type { Mapping, SourceMapGenerator } from 'source-map'
|
||||
import type { Writable } from 'stream'
|
||||
|
||||
/**
|
||||
* State object passed to generator functions.
|
||||
*/
|
||||
export interface State {
|
||||
output: string
|
||||
write(code: string, node?: EstreeNode): void
|
||||
writeComments: boolean
|
||||
indent: string
|
||||
lineEnd: string
|
||||
indentLevel: number
|
||||
line?: number
|
||||
column?: number
|
||||
lineEndSize?: number
|
||||
mapping?: Mapping
|
||||
}
|
||||
|
||||
/**
|
||||
* Code generator for each node type.
|
||||
*/
|
||||
export type Generator = {
|
||||
[T in EstreeNode['type']]: (
|
||||
node: EstreeNode & { type: T },
|
||||
state: State,
|
||||
) => void
|
||||
}
|
||||
|
||||
/**
|
||||
* Code generator options.
|
||||
*/
|
||||
export interface Options<Output = null> {
|
||||
/**
|
||||
* If present, source mappings will be written to the generator.
|
||||
*/
|
||||
sourceMap?: SourceMapGenerator
|
||||
/**
|
||||
* String to use for indentation, defaults to `"␣␣"`.
|
||||
*/
|
||||
indent?: string
|
||||
/**
|
||||
* String to use for line endings, defaults to `"\n"`.
|
||||
*/
|
||||
lineEnd?: string
|
||||
/**
|
||||
* Indent level to start from, defaults to `0`.
|
||||
*/
|
||||
startingIndentLevel?: number
|
||||
/**
|
||||
* Generate comments if `true`, defaults to `false`.
|
||||
*/
|
||||
comments?: boolean
|
||||
/**
|
||||
* Output stream to write the render code to, defaults to `null`.
|
||||
*/
|
||||
output?: Output
|
||||
/**
|
||||
* Custom code generator logic.
|
||||
*/
|
||||
generator?: Generator
|
||||
}
|
||||
|
||||
/**
|
||||
* Core Estree Node type to accommodate derived node types from parsers.
|
||||
*/
|
||||
interface Node {
|
||||
type: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representing the rendered code of the provided AST `node`.
|
||||
* However, if an `output` stream is provided in the `options`, it writes to that stream and returns it.
|
||||
*/
|
||||
export function generate(node: Node, options?: Options<null>): string
|
||||
export function generate(node: Node, options?: Options<Writable>): Writable
|
||||
|
||||
/**
|
||||
* Base code generator.
|
||||
*/
|
||||
export const GENERATOR: Generator
|
||||
|
||||
/**
|
||||
* Base code generator.
|
||||
*
|
||||
* @deprecated Use {@link GENERATOR} instead.
|
||||
*/
|
||||
export const baseGenerator: Generator
|
||||
103
node_modules/.pnpm/astring@1.9.0/node_modules/astring/bin/astring
generated
vendored
Executable file
103
node_modules/.pnpm/astring@1.9.0/node_modules/astring/bin/astring
generated
vendored
Executable file
@@ -0,0 +1,103 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const generate = require('../dist/astring').generate
|
||||
const version = require('../package').version
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const argv = process.argv.slice(2)
|
||||
const options = {
|
||||
indent: ' ',
|
||||
lindeEnd: '\n',
|
||||
startingIndentLevel: 0,
|
||||
}
|
||||
const files = []
|
||||
|
||||
function printHelp(status) {
|
||||
// eslint-disable-next-line no-console
|
||||
const print = status === 0 ? console.log : console.error
|
||||
const binName = path.basename(process.argv[1])
|
||||
print('Usage: ' + binName + ' [-h, --help] [-v, --version]')
|
||||
print(
|
||||
' ' +
|
||||
binName +
|
||||
' [-i, --indent INDENT] [-l, --line-end LINE_END] [-s, --starting-indent-level LEVEL] files...',
|
||||
)
|
||||
process.exit(status)
|
||||
}
|
||||
|
||||
function printVersion() {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(version)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
for (let i = 0, length = argv.length; i < length; i++) {
|
||||
let arg = argv[i]
|
||||
if (arg[0] === '-') {
|
||||
switch (arg) {
|
||||
case '-i':
|
||||
case '--indent':
|
||||
options.indent = argv[++i]
|
||||
break
|
||||
case '-l':
|
||||
case '--line-end':
|
||||
options.lineEnd = argv[++i]
|
||||
break
|
||||
case '-s':
|
||||
case '--starting-indent-level':
|
||||
options.startingIndentLevel = parseInt(argv[++i])
|
||||
break
|
||||
case '-h':
|
||||
case '--help':
|
||||
printHelp(0)
|
||||
break
|
||||
case '-v':
|
||||
case '--version':
|
||||
printVersion()
|
||||
break
|
||||
default:
|
||||
console.error('Option "' + arg + '" not supported.')
|
||||
printHelp(1)
|
||||
break
|
||||
}
|
||||
} else {
|
||||
files.push(arg)
|
||||
}
|
||||
}
|
||||
|
||||
options.output = process.stdout
|
||||
|
||||
if (files.length === 0) {
|
||||
let data = ''
|
||||
process.stdin.setEncoding('utf8')
|
||||
process.stdin.resume()
|
||||
process.stdin
|
||||
.on('data', function (chunk) {
|
||||
data += chunk
|
||||
})
|
||||
.on('end', function () {
|
||||
try {
|
||||
generate(JSON.parse(data), options)
|
||||
} catch (error) {
|
||||
console.error('Error: ' + error.message)
|
||||
process.exit(1)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
let hasError = false
|
||||
for (let i = 0, length = files.length; i < length; i++) {
|
||||
try {
|
||||
let file = files[i]
|
||||
generate(JSON.parse(fs.readFileSync(file, 'utf8')), options)
|
||||
} catch (error) {
|
||||
console.error('Error: ' + error.message)
|
||||
if (hasError !== true) {
|
||||
hasError = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasError) {
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
14
node_modules/.pnpm/astring@1.9.0/node_modules/astring/deno.json
generated
vendored
Normal file
14
node_modules/.pnpm/astring@1.9.0/node_modules/astring/deno.json
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "@davidbonnet/astring",
|
||||
"version": "1.8.6",
|
||||
"exports": "./src/astring.js",
|
||||
"publish": {
|
||||
"include": [
|
||||
"LICENSE",
|
||||
"README.md",
|
||||
"src/astring.js",
|
||||
"astring.d.ts",
|
||||
"deno.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
1254
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.js
generated
vendored
Normal file
1254
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.js.map
generated
vendored
Normal file
1
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.min.js
generated
vendored
Normal file
3
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.min.js.map
generated
vendored
Normal file
1
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.min.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1225
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.mjs
generated
vendored
Normal file
1225
node_modules/.pnpm/astring@1.9.0/node_modules/astring/dist/astring.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
node_modules/.pnpm/astring@1.9.0/node_modules/astring/node_modules/.bin/astring
generated
vendored
Executable file
21
node_modules/.pnpm/astring@1.9.0/node_modules/astring/node_modules/.bin/astring
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
||||
|
||||
case `uname` in
|
||||
*CYGWIN*|*MINGW*|*MSYS*)
|
||||
if command -v cygpath > /dev/null 2>&1; then
|
||||
basedir=`cygpath -w "$basedir"`
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$NODE_PATH" ]; then
|
||||
export NODE_PATH="/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules/astring/bin/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules/astring/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/node_modules"
|
||||
else
|
||||
export NODE_PATH="/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules/astring/bin/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules/astring/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/astring@1.9.0/node_modules:/Volumes/Alpha SSD/Coding/e-tib.com/node_modules/.pnpm/node_modules:$NODE_PATH"
|
||||
fi
|
||||
if [ -x "$basedir/node" ]; then
|
||||
exec "$basedir/node" "$basedir/../../bin/astring" "$@"
|
||||
else
|
||||
exec node "$basedir/../../bin/astring" "$@"
|
||||
fi
|
||||
98
node_modules/.pnpm/astring@1.9.0/node_modules/astring/package.json
generated
vendored
Normal file
98
node_modules/.pnpm/astring@1.9.0/node_modules/astring/package.json
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"name": "astring",
|
||||
"version": "1.9.0",
|
||||
"description": "JavaScript code generator from an ESTree-compliant AST.",
|
||||
"main": "./dist/astring.js",
|
||||
"module": "./dist/astring.mjs",
|
||||
"types": "./astring.d.ts",
|
||||
"exports": {
|
||||
"types": "./astring.d.ts",
|
||||
"import": "./dist/astring.mjs",
|
||||
"require": "./dist/astring.js",
|
||||
"browser": "./dist/astring.min.js"
|
||||
},
|
||||
"bin": {
|
||||
"astring": "bin/astring"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "babel src/astring.js --out-file dist/astring.js --source-maps --no-comments && cp src/astring.js dist/astring.mjs",
|
||||
"build:watch": "babel src/astring.js --out-file dist/astring.js --source-maps --no-comments --watch",
|
||||
"build:minified": "cross-env BABEL_MODE=minified babel src/astring.js --out-file dist/astring.min.js --source-maps --no-comments",
|
||||
"build:demo": "npm run build:minified && cp dist/astring.min.* docs/demo/",
|
||||
"prepare": "npm run build && npm run build:minified",
|
||||
"test": "npm run eslint && npm run prettier:check && npm run build:minified && npm run test:coverage",
|
||||
"dev": "ava --watch src/tests/astring.js",
|
||||
"test:coverage": "c8 --reporter=html --reporter=text --reporter=lcov --include='src/*.js' --exclude='src/tests/**/*.js' ava src/tests/astring.js",
|
||||
"test:scripts": "npm run test:scripts:build && ava src/tests/_scripts.js",
|
||||
"test:performance": "ava src/tests/performance.js",
|
||||
"benchmark": "node --require esm ./src/tests/benchmark.js",
|
||||
"eslint": "eslint src",
|
||||
"prettier": "prettier --write \"{src,scripts}/**/*.js\" \"bin/astring\"",
|
||||
"prettier:check": "prettier --list-different \"{src,scripts}/**/*.js\" \"bin/astring\"",
|
||||
"prepush": "npm test",
|
||||
"release": "standard-version",
|
||||
"deploy": "git push --follow-tags origin main && npm publish"
|
||||
},
|
||||
"keywords": [
|
||||
"ast",
|
||||
"codegen",
|
||||
"code generator",
|
||||
"estree",
|
||||
"astravel"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/davidbonnet/astring.git"
|
||||
},
|
||||
"author": "David Bonnet <david@bonnet.cc>",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.14.3",
|
||||
"@babel/core": "^7.14.3",
|
||||
"@babel/generator": "^7.14.3",
|
||||
"@babel/parser": "^7.16.4",
|
||||
"@babel/preset-env": "^7.14.4",
|
||||
"acorn": "^8.6.0",
|
||||
"acorn-import-attributes": "^1.9.5",
|
||||
"astravel": "^0.5.0",
|
||||
"ava": "^3.15.0",
|
||||
"babel-preset-minify": "^0.5.1",
|
||||
"benchmark": "^2.1.4",
|
||||
"buble": "^0.20.0",
|
||||
"c8": "^7.10.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"escodegen": "^2.0.0",
|
||||
"eslint": "^8.3.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-import": "^2.25.3",
|
||||
"esm": "^3.2.25",
|
||||
"glob": "^7.1.7",
|
||||
"husky": "^6.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"meriyah": "^4.1.5",
|
||||
"normalize-newline": "^3.0.0",
|
||||
"prettier": "^2.4.1",
|
||||
"standard-version": "^9.3.0",
|
||||
"sucrase": "^3.18.1",
|
||||
"uglify-js": "^3.13.8"
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"semi": false,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all",
|
||||
"bracketSpacing": true
|
||||
},
|
||||
"ava": {
|
||||
"files": [
|
||||
"src/**/tests/astring.js",
|
||||
"src/**/tests/performance.js"
|
||||
],
|
||||
"require": [
|
||||
"esm"
|
||||
]
|
||||
},
|
||||
"esm": "auto"
|
||||
}
|
||||
Reference in New Issue
Block a user