Skip to content

Commit 93c1587

Browse files
committed
- Breaking change: Remove bower-registry-client build (bower deprecated)
- Update: Use new SourceMapConsumer API in test - Build: Provide browserified builds with npm package - Travis: Drop 4, 6, 8; Add 10, 12, 14 - Docs: Use fenced code blocks in README (for syntax highlighting) - npm: Add `bugs`, `keywords`, change from `maintainers` to `authors`/`contributors` - npm: Bump deps. (estraverse, optionator, optional source-map potentially breaking) and devDeps. - npm: Drop bluebird in favor of ES Promises - npm: Use more recently maintained browserify + uglifyify - npm: Replace linting and testing scripts in Gulpfile with npm scripts
1 parent a3b6718 commit 93c1587

File tree

11 files changed

+3300
-220
lines changed

11 files changed

+3300
-220
lines changed

.eslintignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
lib
3+
4+
!.eslintrc.js
5+
coverage
6+
7+
test/*/*.js
8+
9+
escodegen.browser.min.js
10+
escodegen.browser.js

.eslintrc.js

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: 'eslint:recommended',
5+
globals: {
6+
Atomics: 'readonly',
7+
SharedArrayBuffer: 'readonly'
8+
},
9+
env: {
10+
node: true,
11+
es6: true
12+
},
13+
parserOptions: {
14+
sourceType: 'module',
15+
ecmaVersion: 2018
16+
},
17+
overrides: [{
18+
files: '.eslintrc.js',
19+
parserOptions: {
20+
sourceType: 'script'
21+
},
22+
rules: {
23+
strict: 'error'
24+
}
25+
}, {
26+
files: 'test/**',
27+
globals: {
28+
expect: true
29+
},
30+
env: {
31+
mocha: true
32+
}
33+
}],
34+
rules: {
35+
// 'push-with-multiple-arguments': 2,
36+
'no-unused-vars': [
37+
2,
38+
{
39+
vars: 'all',
40+
args: 'none'
41+
}
42+
],
43+
'new-cap': [
44+
2,
45+
{
46+
capIsNew: false
47+
}
48+
],
49+
semi: ['error'],
50+
indent: ['error', 4, { SwitchCase: 1 }],
51+
'prefer-const': ['error'],
52+
'no-var': ['error'],
53+
'prefer-destructuring': ['error'],
54+
'object-shorthand': ['error'],
55+
'object-curly-spacing': ['error', 'always'],
56+
quotes: ['error', 'single'],
57+
'quote-props': ['error', 'as-needed'],
58+
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
59+
'prefer-template': ['error']
60+
}
61+
};

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ node_modules/
1010
cover_html/
1111

1212
npm-debug.log
13+
14+
escodegen.browser.min.js
15+
escodegen.browser.js

.npmignore

Lines changed: 0 additions & 15 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- "4"
5-
- "6"
6-
- "8"
4+
- 10
5+
- 12
6+
- 14

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,34 @@ code generator from [Mozilla's Parser API](https://developer.mozilla.org/en/Spid
1111
AST. See the [online generator](https://estools.github.io/escodegen/demo/index.html)
1212
for a demo.
1313

14-
1514
### Install
1615

1716
Escodegen can be used in a web browser:
1817

19-
<script src="escodegen.browser.js"></script>
18+
```html
19+
<script src="escodegen.browser.js"></script>
20+
```
2021

2122
escodegen.browser.js can be found in tagged revisions on GitHub.
2223

2324
Or in a Node.js application via npm:
2425

25-
npm install escodegen
26+
```sh
27+
npm install escodegen
28+
```
2629

2730
### Usage
2831

2932
A simple example: the program
3033

31-
escodegen.generate({
32-
type: 'BinaryExpression',
33-
operator: '+',
34-
left: { type: 'Literal', value: 40 },
35-
right: { type: 'Literal', value: 2 }
36-
});
34+
```js
35+
escodegen.generate({
36+
type: 'BinaryExpression',
37+
operator: '+',
38+
left: { type: 'Literal', value: 40 },
39+
right: { type: 'Literal', value: 2 }
40+
});
41+
```
3742

3843
produces the string `'40 + 2'`.
3944

@@ -45,13 +50,17 @@ options. To run the tests, execute `npm test` in the root directory.
4550
At first, execute `npm install` to install the all dev dependencies.
4651
After that,
4752

48-
npm run-script build
53+
```sh
54+
npm run-script build
55+
```
4956

5057
will generate `escodegen.browser.js`, which can be used in browser environments.
5158

5259
And,
5360

54-
npm run-script build-min
61+
```sh
62+
npm run-script build-min
63+
```
5564

5665
will generate the minified file `escodegen.browser.min.js`.
5766

gulpfile.js

Lines changed: 0 additions & 83 deletions
This file was deleted.

0 commit comments

Comments
 (0)