@putout/engine-parser 5.0.0 β 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/parsers/babel/plugins.js +1 -0
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[NPMIMGURL]: https://img.shields.io/npm/v/@putout/engine-parser.svg?style=flat&longCache=true
|
|
4
4
|
[NPMURL]: https://npmjs.org/package/@putout/engine-parser"npm"
|
|
5
5
|
|
|
6
|
-
π[
|
|
6
|
+
π[**Putout**](https://github.com/coderaiser/putout) engine that parses input.
|
|
7
7
|
|
|
8
8
|
## Install
|
|
9
9
|
|
|
@@ -19,7 +19,7 @@ npm i @putout/engine-parser
|
|
|
19
19
|
- [esprima](https://esprima.org/)
|
|
20
20
|
- [tenko](https://github.com/pvdz/tenko)
|
|
21
21
|
|
|
22
|
-
Any parser should be installed before use, but you can be
|
|
22
|
+
Any parser should be installed before use, but you can be sure that `@babel/parse` always installed.
|
|
23
23
|
|
|
24
24
|
## API
|
|
25
25
|
|
|
@@ -50,7 +50,7 @@ You have two ways to benefit from source map generation:
|
|
|
50
50
|
- using `Recast` print;
|
|
51
51
|
- using `Babel` generator;
|
|
52
52
|
|
|
53
|
-
#### Generate sourcemaps
|
|
53
|
+
#### Generate sourcemaps using Recast
|
|
54
54
|
|
|
55
55
|
```js
|
|
56
56
|
const source = `const hello = 'world';`;
|
|
@@ -63,9 +63,9 @@ print(ast, {sourceMapName: 'hello.map'});
|
|
|
63
63
|
{"version":3,"sources":["hello.js"],"names":[],"mappings":"AAAA...","file":"hello.map","sourcesContent":["const hello = 'world';"]}`;
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
#### Generate sourcemaps
|
|
66
|
+
#### Generate sourcemaps using Babel
|
|
67
67
|
|
|
68
|
-
To generate sourcemap
|
|
68
|
+
To generate sourcemap using babel generator, you should use babel parser before.
|
|
69
69
|
This is low level transformation, because `Babel` doesn't preserve any formatting.
|
|
70
70
|
|
|
71
71
|
```js
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@putout/engine-parser",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "πPutout parser",
|
|
7
7
|
"homepage": "https://github.com/coderaiser/putout/tree/master/packages/engine-parser#readme",
|
|
8
8
|
"main": "./lib/parser.js",
|
|
9
9
|
"release": false,
|
|
@@ -48,17 +48,16 @@
|
|
|
48
48
|
"putout-engine"
|
|
49
49
|
],
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@cloudcmd/stub": "^3.0.0",
|
|
52
51
|
"acorn": "^8.1.1",
|
|
53
52
|
"acorn-jsx": "^5.0.2",
|
|
54
53
|
"acorn-stage3": "^4.0.0",
|
|
55
54
|
"c8": "^7.5.0",
|
|
56
55
|
"eslint": "^8.0.1",
|
|
57
56
|
"eslint-plugin-node": "^11.0.0",
|
|
58
|
-
"eslint-plugin-putout": "^
|
|
57
|
+
"eslint-plugin-putout": "^15.0.0",
|
|
59
58
|
"espree": "^9.0.0",
|
|
60
59
|
"esprima": "^4.0.1",
|
|
61
|
-
"hermes-parser": "^0.
|
|
60
|
+
"hermes-parser": "^0.6.0",
|
|
62
61
|
"just-camel-case": "^4.0.2",
|
|
63
62
|
"lerna": "^4.0.0",
|
|
64
63
|
"madrun": "^9.0.0",
|