Skip to content

Commit

Permalink
Update dependencies, fix fsevents issue (#3956)
Browse files Browse the repository at this point in the history
* Update dependencies, fix fsevents issue

* Update dependencies, fix fsevents issue

* Add missing types

* Go to npm 6
  • Loading branch information
lukastaegert committed Feb 12, 2021
1 parent 574050b commit 45d8e5e
Show file tree
Hide file tree
Showing 81 changed files with 4,969 additions and 3,457 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
@@ -0,0 +1 @@
_
2 changes: 1 addition & 1 deletion LICENSE.md
Expand Up @@ -35,7 +35,7 @@ Repository: https://github.com/acornjs/acorn.git

> MIT License
>
> Copyright (C) 2012-2018 by various contributors (see AUTHORS)
> Copyright (C) 2012-2020 by various contributors (see AUTHORS)
>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal
Expand Down
1,049 changes: 438 additions & 611 deletions package-lock.json

Large diffs are not rendered by default.

37 changes: 20 additions & 17 deletions package.json
Expand Up @@ -24,8 +24,10 @@
"perf": "npm run build:cjs && node --expose-gc scripts/perf.js",
"perf:debug": "node --inspect-brk scripts/perf-debug.js",
"perf:init": "node scripts/perf-init.js",
"postinstall": "husky install",
"postpublish": "pinst --enable",
"prepare": "npm run build",
"prepublishOnly": "npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
"prepublishOnly": "pinst --disable && npm ci && npm run lint:nofix && npm run security && npm run build:bootstrap && npm run test:all",
"security": "npm audit",
"test": "npm run build && npm run test:all",
"test:cjs": "npm run build:cjs && npm run test:only",
Expand Down Expand Up @@ -58,51 +60,52 @@
"fsevents": "~2.3.1"
},
"devDependencies": {
"@rollup/plugin-alias": "^3.1.1",
"@rollup/plugin-alias": "^3.1.2",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^17.0.0",
"@rollup/plugin-commonjs": "^18.0.0-1",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"@rollup/plugin-node-resolve": "^11.1.1",
"@rollup/plugin-replace": "^2.3.4",
"@types/micromatch": "^4.0.1",
"@types/node": "^10.17.51",
"@types/require-relative": "^0.8.0",
"@types/signal-exit": "^3.0.0",
"@types/yargs-parser": "^20.2.0",
"acorn": "^8.0.4",
"acorn-class-fields": "^0.3.7",
"acorn": "^8.0.5",
"acorn-class-fields": "^1.0.0",
"acorn-jsx": "^5.3.1",
"acorn-static-class-features": "^0.2.4",
"acorn-walk": "^8.0.1",
"acorn-static-class-features": "^1.0.0",
"acorn-walk": "^8.0.2",
"buble": "^0.20.0",
"chokidar": "^3.5.1",
"codecov": "^3.8.1",
"colorette": "^1.2.1",
"core-js": "^3.8.2",
"core-js": "^3.8.3",
"date-time": "^3.1.0",
"es5-shim": "^4.5.15",
"es6-shim": "^0.35.6",
"eslint": "^7.18.0",
"eslint": "^7.19.0",
"eslint-plugin-import": "^2.22.1",
"execa": "^5.0.0",
"fixturify": "^2.1.0",
"hash.js": "^1.1.7",
"husky": "^4.3.8",
"is-reference": "^1.2.1",
"lint-staged": "^10.5.3",
"husky": "^5.0.9",
"is-reference": "lukastaegert/is-reference#update-class-features",
"lint-staged": "^10.5.4",
"locate-character": "^2.0.5",
"magic-string": "^0.25.7",
"markdownlint-cli": "^0.26.0",
"micromatch": "^4.0.2",
"mocha": "^8.2.1",
"mocha": "^8.3.0",
"node-fetch": "^2.6.1",
"nyc": "^15.1.0",
"pinst": "^2.1.4",
"prettier": "^2.2.1",
"pretty-bytes": "^5.5.0",
"pretty-ms": "^7.0.1",
"require-relative": "^0.8.7",
"requirejs": "^2.3.6",
"rollup": "^2.36.2",
"rollup": "^2.38.5",
"rollup-plugin-license": "^2.2.0",
"rollup-plugin-string": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
Expand All @@ -116,10 +119,10 @@
"source-map-support": "^0.5.19",
"sourcemap-codec": "^1.4.8",
"systemjs": "^6.8.3",
"terser": "^5.5.1",
"terser": "^5.6.0-beta",
"tslib": "^2.1.0",
"tslint": "^6.1.3",
"typescript": "^4.1.3",
"typescript": "^4.1.5",
"url-parse": "^1.4.7",
"weak-napi": "^2.0.2",
"yargs-parser": "^20.2.4"
Expand Down
4 changes: 2 additions & 2 deletions src/ast/nodes/ClassBody.ts
Expand Up @@ -3,13 +3,13 @@ import { HasEffectsContext } from '../ExecutionContext';
import ClassBodyScope from '../scopes/ClassBodyScope';
import Scope from '../scopes/Scope';
import { EMPTY_PATH, ObjectPath } from '../utils/PathTracker';
import FieldDefinition from './FieldDefinition';
import MethodDefinition from './MethodDefinition';
import * as NodeType from './NodeType';
import PropertyDefinition from './PropertyDefinition';
import { NodeBase } from './shared/Node';

export default class ClassBody extends NodeBase {
body!: (MethodDefinition | FieldDefinition)[];
body!: (MethodDefinition | PropertyDefinition)[];
type!: NodeType.tClassBody;

private classConstructor!: MethodDefinition | null;
Expand Down
3 changes: 2 additions & 1 deletion src/ast/nodes/MemberExpression.ts
Expand Up @@ -22,6 +22,7 @@ import Variable from '../variables/Variable';
import Identifier from './Identifier';
import Literal from './Literal';
import * as NodeType from './NodeType';
import PrivateIdentifier from './PrivateIdentifier';
import { ExpressionNode, IncludeChildren, NodeBase } from './shared/Node';
import SpreadElement from './SpreadElement';
import Super from './Super';
Expand Down Expand Up @@ -73,7 +74,7 @@ export default class MemberExpression extends NodeBase implements DeoptimizableE
computed!: boolean;
object!: ExpressionNode | Super;
optional!: boolean;
property!: ExpressionNode;
property!: ExpressionNode | PrivateIdentifier;
propertyKey!: ObjectPathKey | null;
type!: NodeType.tMemberExpression;
variable: Variable | null = null;
Expand Down
3 changes: 2 additions & 1 deletion src/ast/nodes/MethodDefinition.ts
Expand Up @@ -3,11 +3,12 @@ import { HasEffectsContext } from '../ExecutionContext';
import { EMPTY_PATH, ObjectPath } from '../utils/PathTracker';
import FunctionExpression from './FunctionExpression';
import * as NodeType from './NodeType';
import PrivateIdentifier from './PrivateIdentifier';
import { ExpressionNode, NodeBase } from './shared/Node';

export default class MethodDefinition extends NodeBase {
computed!: boolean;
key!: ExpressionNode;
key!: ExpressionNode | PrivateIdentifier;
kind!: 'constructor' | 'method' | 'get' | 'set';
static!: boolean;
type!: NodeType.tMethodDefinition;
Expand Down
7 changes: 4 additions & 3 deletions src/ast/nodes/NodeType.ts
Expand Up @@ -22,7 +22,6 @@ export type tExportDefaultDeclaration = 'ExportDefaultDeclaration';
export type tExportNamedDeclaration = 'ExportNamedDeclaration';
export type tExportSpecifier = 'ExportSpecifier';
export type tExpressionStatement = 'ExpressionStatement';
export type tFieldDefinition = 'FieldDefinition';
export type tForStatement = 'ForStatement';
export type tForInStatement = 'ForInStatement';
export type tForOfStatement = 'ForOfStatement';
Expand All @@ -45,9 +44,10 @@ export type tMethodDefinition = 'MethodDefinition';
export type tNewExpression = 'NewExpression';
export type tObjectExpression = 'ObjectExpression';
export type tObjectPattern = 'ObjectPattern';
export type tPrivateName = 'PrivateName';
export type tPrivateIdentifier = 'PrivateIdentifier';
export type tProgram = 'Program';
export type tProperty = 'Property';
export type tPropertyDefinition = 'PropertyDefinition';
export type tRestElement = 'RestElement';
export type tReturnStatement = 'ReturnStatement';
export type tSequenceExpression = 'SequenceExpression';
Expand Down Expand Up @@ -92,7 +92,6 @@ export const ExportDefaultDeclaration: tExportDefaultDeclaration = 'ExportDefaul
export const ExportNamedDeclaration: tExportNamedDeclaration = 'ExportNamedDeclaration';
export const ExportSpecifier: tExportSpecifier = 'ExportSpecifier';
export const ExpressionStatement: tExpressionStatement = 'ExpressionStatement';
export const FieldDefinition: tFieldDefinition = 'FieldDefinition';
export const ForStatement: tForStatement = 'ForStatement';
export const ForInStatement: tForInStatement = 'ForInStatement';
export const ForOfStatement: tForOfStatement = 'ForOfStatement';
Expand All @@ -115,8 +114,10 @@ export const MethodDefinition: tMethodDefinition = 'MethodDefinition';
export const NewExpression: tNewExpression = 'NewExpression';
export const ObjectExpression: tObjectExpression = 'ObjectExpression';
export const ObjectPattern: tObjectPattern = 'ObjectPattern';
export const PrivateIdentifier: tPrivateIdentifier = 'PrivateIdentifier';
export const Program: tProgram = 'Program';
export const Property: tProperty = 'Property';
export const PropertyDefinition: tPropertyDefinition = 'PropertyDefinition';
export const RestElement: tRestElement = 'RestElement';
export const ReturnStatement: tReturnStatement = 'ReturnStatement';
export const SequenceExpression: tSequenceExpression = 'SequenceExpression';
Expand Down
@@ -1,7 +1,7 @@
import * as NodeType from './NodeType';
import { NodeBase } from './shared/Node';

export default class PrivateName extends NodeBase {
export default class PrivateIdentifier extends NodeBase {
name!: string;
type!: NodeType.tFieldDefinition;
type!: NodeType.tPrivateIdentifier;
}
@@ -1,13 +1,13 @@
import { HasEffectsContext } from '../ExecutionContext';
import * as NodeType from './NodeType';
import PrivateName from './PrivateName';
import PrivateIdentifier from './PrivateIdentifier';
import { ExpressionNode, NodeBase } from './shared/Node';

export default class FieldDefinition extends NodeBase {
export default class PropertyDefinition extends NodeBase {
computed!: boolean;
key!: ExpressionNode | PrivateName;
key!: ExpressionNode | PrivateIdentifier;
static!: boolean;
type!: NodeType.tFieldDefinition;
type!: NodeType.tPropertyDefinition;
value!: ExpressionNode | null;

hasEffects(context: HasEffectsContext): boolean {
Expand Down
8 changes: 4 additions & 4 deletions src/ast/nodes/index.ts
Expand Up @@ -22,7 +22,6 @@ import ExportDefaultDeclaration from './ExportDefaultDeclaration';
import ExportNamedDeclaration from './ExportNamedDeclaration';
import ExportSpecifier from './ExportSpecifier';
import ExpressionStatement from './ExpressionStatement';
import FieldDefinition from './FieldDefinition';
import ForInStatement from './ForInStatement';
import ForOfStatement from './ForOfStatement';
import ForStatement from './ForStatement';
Expand All @@ -44,9 +43,10 @@ import MethodDefinition from './MethodDefinition';
import NewExpression from './NewExpression';
import ObjectExpression from './ObjectExpression';
import ObjectPattern from './ObjectPattern';
import PrivateName from './PrivateName';
import PrivateIdentifier from './PrivateIdentifier';
import Program from './Program';
import Property from './Property';
import PropertyDefinition from './PropertyDefinition';
import RestElement from './RestElement';
import ReturnStatement from './ReturnStatement';
import SequenceExpression from './SequenceExpression';
Expand Down Expand Up @@ -96,7 +96,6 @@ export const nodeConstructors: {
ExportNamedDeclaration,
ExportSpecifier,
ExpressionStatement,
FieldDefinition,
ForInStatement,
ForOfStatement,
ForStatement,
Expand All @@ -118,9 +117,10 @@ export const nodeConstructors: {
NewExpression,
ObjectExpression,
ObjectPattern,
PrivateName,
PrivateIdentifier,
Program,
Property,
PropertyDefinition,
RestElement,
ReturnStatement,
SequenceExpression,
Expand Down
13 changes: 8 additions & 5 deletions src/utils/pureComments.ts
@@ -1,10 +1,9 @@
import * as acorn from 'acorn';
// @ts-ignore
import { base as basicWalker } from 'acorn-walk';
import { base as basicWalker, BaseWalker } from 'acorn-walk';
import { CommentDescription } from '../Module';

// patch up acorn-walk until class-fields are officially supported
basicWalker.FieldDefinition = function (node: any, st: any, c: any) {
basicWalker.PropertyDefinition = function (node: any, st: any, c: any) {
if (node.computed) {
c(node.key, st, 'Expression');
}
Expand All @@ -13,9 +12,13 @@ basicWalker.FieldDefinition = function (node: any, st: any, c: any) {
}
};

interface CommentState {
commentIndex: number; commentNodes: CommentDescription[]
}

function handlePureAnnotationsOfNode(
node: acorn.Node,
state: { commentIndex: number; commentNodes: CommentDescription[] },
state: CommentState,
type: string = node.type
) {
let commentNode = state.commentNodes[state.commentIndex];
Expand All @@ -24,7 +27,7 @@ function handlePureAnnotationsOfNode(
commentNode = state.commentNodes[++state.commentIndex];
}
if (commentNode && commentNode.end <= node.end) {
basicWalker[type](node, state, handlePureAnnotationsOfNode);
(basicWalker as BaseWalker<CommentState>)[type](node, state, handlePureAnnotationsOfNode);
}
}

Expand Down
@@ -0,0 +1,9 @@
define(['exports'], function (exports) { 'use strict';

var other = {};

exports.__exports = other;

Object.defineProperty(exports, '__esModule', { value: true });

});

This file was deleted.

@@ -1,12 +1,13 @@
define(['external', './other'], function (external, other) { 'use strict';
define(['external', './other', './_virtual/other.js_commonjs-exports'], function (require$$0, other$1, other) { 'use strict';

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var external__default = /*#__PURE__*/_interopDefaultLegacy(external);
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);

const { value } = other['default'];
const external = require$$0__default['default'];
const { value } = other.__exports;

console.log(external__default['default'], value);
console.log(external, value);

var commonjs = 42;

Expand Down
@@ -1,9 +1,9 @@
define(['./commonjs', 'external'], function (commonjs, external) { 'use strict';
define(['./commonjs', 'external'], function (commonjs, require$$0) { 'use strict';

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var external__default = /*#__PURE__*/_interopDefaultLegacy(external);
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);

console.log(commonjs, external__default['default']);
console.log(commonjs, require$$0__default['default']);

});
@@ -1,14 +1,7 @@
define(['exports'], function (exports) { 'use strict';
define(['./_virtual/other.js_commonjs-exports'], function (other) { 'use strict';

var value = 43;
other.__exports.value = 43;

var other = {
value: value
};

exports.default = other;
exports.value = value;

Object.defineProperty(exports, '__esModule', { value: true });
return other.__exports;

});
@@ -0,0 +1,7 @@
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var other = {};

exports.__exports = other;

This file was deleted.

0 comments on commit 45d8e5e

Please sign in to comment.