Skip to content

Commit

Permalink
fix: export version directly from package.json
Browse files Browse the repository at this point in the history
closes #107
  • Loading branch information
3cp committed Oct 13, 2020
1 parent 914a336 commit 46a7d69
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"postversion": "git push && git push --tags && npm publish"
},
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@types/mocha": "^8.0.3",
"@types/node": "^14.11.8",
"@typescript-eslint/eslint-plugin": "^4.4.0",
Expand Down
6 changes: 5 additions & 1 deletion scripts/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const { join } = require('path');
const rollup = require('rollup');
const typescript2 = require('rollup-plugin-typescript2');
const { terser } = require('rollup-plugin-terser');
const json = require('@rollup/plugin-json');
const ts = require('typescript');
const project = require('./project');

Expand All @@ -26,7 +27,8 @@ async function bunldeCJS() {
typescript2({
tsconfig: project['tsconfig.json'].path,
typescript: ts
})
}),
json()
]
});

Expand Down Expand Up @@ -54,6 +56,7 @@ async function bundleES6() {
tsconfig: project['tsconfig.json'].path,
typescript: ts
}),
json(),
...(type === 'minified' ? [terser()] : [])
]
});
Expand Down Expand Up @@ -102,6 +105,7 @@ async function bundleES5() {
tsconfigOverride: { compilerOptions: { target: 'es5' } },
typescript: ts
}),
json(),
...(type === 'minified' ? [terser()] : [])
]
});
Expand Down
2 changes: 1 addition & 1 deletion src/meriyah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ export function parse(source: string, options?: Options): ESTree.Program {
export { Options, ESTree };

// Current version
export const version = '2.1.0';
export { version } from '../package.json';
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"strict": true,
"stripInternal": true,
"target": "ES2020",
"resolveJsonModule": true,
"typeRoots": ["./node_modules/@types"],
"types": ["node", "mocha"]
},
Expand Down

0 comments on commit 46a7d69

Please sign in to comment.