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

remove acorn-bigint and acorn-dynamic-import devDenpendencies #3058

Merged
merged 9 commits into from Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 33 additions & 30 deletions package-lock.json

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

14 changes: 6 additions & 8 deletions package.json
Expand Up @@ -58,15 +58,13 @@
"homepage": "https://github.com/rollup/rollup",
"dependencies": {
"@types/estree": "0.0.39",
"@types/node": "^12.6.9",
"acorn": "^6.2.1"
"@types/node": "^12.7.1",
"acorn": "^6.3.0"
},
"devDependencies": {
"@types/chokidar": "^2.1.3",
"@types/micromatch": "^3.1.0",
"@types/minimist": "^1.2.0",
"acorn-bigint": "^0.4.0",
"acorn-dynamic-import": "^4.0.0",
"acorn-import-meta": "^1.0.0",
"acorn-jsx": "^5.0.1",
"acorn-walk": "^6.2.0",
Expand All @@ -83,7 +81,7 @@
"execa": "^2.0.3",
"fixturify": "^1.2.0",
"hash.js": "^1.1.7",
"husky": "^3.0.2",
"husky": "^3.0.3",
"immutable": "^4.0.0-rc.12",
"is-reference": "^1.1.3",
"lint-staged": "^9.2.1",
Expand All @@ -99,10 +97,10 @@
"pretty-ms": "^5.0.0",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
"rollup": "^1.18.0",
"rollup": "^1.19.4",
"rollup-plugin-alias": "^1.5.2",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.0.1",
"rollup-plugin-commonjs": "^10.0.2",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
Expand All @@ -117,7 +115,7 @@
"source-map-support": "^0.5.13",
"sourcemap-codec": "^1.4.6",
"systemjs": "^5.0.0",
"terser": "^4.1.2",
"terser": "^4.1.4",
"tslib": "^1.10.0",
"tslint": "^5.18.0",
"turbocolor": "^2.6.1",
Expand Down
5 changes: 2 additions & 3 deletions rollup.config.js
Expand Up @@ -54,9 +54,9 @@ function addSheBang() {
};
}

const expectedAcornImport = "import acorn__default, { tokTypes, Parser } from 'acorn';";
const expectedAcornImport = "import acorn__default, { Parser } from 'acorn';";
const newAcornImport =
"import * as acorn__default from 'acorn';\nimport { tokTypes, Parser } from 'acorn';";
"import * as acorn__default from 'acorn';\nimport { Parser } from 'acorn';";

// by default, rollup-plugin-commonjs will translate require statements as default imports
// which can cause issues for secondary tools that use the ESM version of acorn
Expand All @@ -81,7 +81,6 @@ function fixAcornEsmImport() {

const moduleAliases = {
resolve: ['.js', '.json', '.md'],
'acorn-dynamic-import': path.resolve('node_modules/acorn-dynamic-import/src/index.js'),
'help.md': path.resolve('cli/help.md'),
'package.json': path.resolve('package.json')
};
Expand Down
4 changes: 0 additions & 4 deletions src/Graph.ts
@@ -1,6 +1,4 @@
import * as acorn from 'acorn';
import injectBigInt from 'acorn-bigint';
import injectDynamicImportPlugin from 'acorn-dynamic-import';
import injectImportMeta from 'acorn-import-meta';
import * as ESTree from 'estree';
import GlobalScope from './ast/scopes/GlobalScope';
Expand Down Expand Up @@ -171,9 +169,7 @@ export default class Graph {
this.acornOptions = options.acorn || {};
const acornPluginsToInject = [];

acornPluginsToInject.push(injectDynamicImportPlugin);
acornPluginsToInject.push(injectImportMeta);
acornPluginsToInject.push(injectBigInt);

if (options.experimentalTopLevelAwait) {
(this.acornOptions as any).allowAwaitOutsideFunction = true;
Expand Down
2 changes: 1 addition & 1 deletion src/Module.ts
Expand Up @@ -116,7 +116,7 @@ export interface AstContext {
}

export const defaultAcornOptions: acorn.Options = {
ecmaVersion: 2019,
ecmaVersion: 2020 as any,
preserveParens: false,
sourceType: 'module'
};
Expand Down
2 changes: 0 additions & 2 deletions typings/declarations.d.ts
Expand Up @@ -13,6 +13,4 @@ declare module 'date-time';
declare module 'locate-character';
declare module 'is-reference';
declare module 'require-relative';
declare module 'acorn-dynamic-import';
declare module 'acorn-import-meta';
declare module 'acorn-bigint';