Skip to content

Commit

Permalink
Update deps.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Sep 16, 2018
1 parent 50fff5f commit 487d64a
Show file tree
Hide file tree
Showing 14 changed files with 654 additions and 438 deletions.
File renamed without changes.
963 changes: 599 additions & 364 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"test:prod": "node script/test.js --prod"
},
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/core": "^7.0.1",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-optional-catch-binding": "^7.0.0",
"@babel/plugin-transform-arrow-functions": "^7.0.0",
Expand All @@ -42,7 +42,7 @@
"@babel/runtime": "^7.0.0",
"@std/esm": "^0.25.5",
"@types/node": "^10.9.4",
"acorn": "^5.7.3",
"acorn": "^6.0.1",
"ava": "1.0.0-beta.7",
"babel-eslint": "^9.0.0",
"babel-loader": "^8.0.2",
Expand All @@ -52,7 +52,7 @@
"bluebird": "^3.5.2",
"chai": "^4.1.2",
"download": "^7.1.0",
"eslint": "^5.5.0",
"eslint": "^5.6.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^7.0.1",
"execa": "^1.0.0",
Expand Down Expand Up @@ -82,15 +82,15 @@
"sleep": "^5.2.3",
"sqreen": "^1.23.0",
"strip-ansi": "^4.0.0",
"terser": "^3.8.2",
"terser-webpack-plugin": "^1.1.0",
"test262-parser": "^2.0.7",
"trash": "^4.3.0",
"ts-node": "^7.0.1",
"typescript": "^3.0.3",
"uglify-es": "^3.3.10",
"uglifyjs-webpack-plugin": "^1.3.0",
"unused-webpack-plugin": "^2.0.0",
"webpack": "^4.18.0",
"webpack-bundle-analyzer": "^3.0.1",
"webpack": "^4.19.0",
"webpack-bundle-analyzer": "^3.0.2",
"webpack-cli": "^3.1.0",
"yargs": "^12.0.2"
},
Expand Down
6 changes: 3 additions & 3 deletions script/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ const rootPath = path.resolve(__dirname, "..")
const buildPath = path.resolve(rootPath, "build")
const loaderPath = path.resolve(rootPath, "esm/loader.js")

const uglifyPluginPath = path.resolve(rootPath, "node_modules/uglifyjs-webpack-plugin")
const uglifyPath = path.resolve(uglifyPluginPath, "node_modules/uglify-es")
const terserPluginPath = path.resolve(rootPath, "node_modules/terser-webpack-plugin")
const terserPath = path.resolve(terserPluginPath, "node_modules/terser")

const trashPaths = [
buildPath,
loaderPath,
uglifyPath
terserPath
]

const webpackArgs = [
Expand Down
7 changes: 3 additions & 4 deletions script/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ const fleece = require("golden-fleece")
const fs = require("fs-extra")
const htmlmin = require("html-minifier").minify
const path = require("path")
const uglify = require("uglify-es").minify
const terser = require("terser").minify

const rootPath = path.resolve(__dirname, "..")
const esmPath = path.resolve(rootPath, "esm.js")
const indexPath = path.resolve(rootPath, "index.js")
const pkgPath = path.resolve(rootPath, "package.json")
const readmePath = path.resolve(rootPath, "README.md")

const uglifyOptions = fs.readJSONSync(path.resolve(rootPath, ".uglifyrc"))

const tableRegExp = /^<table>[^]*?\n<\/table>/gm
const terserOptions = fs.readJSONSync(path.resolve(rootPath, ".terserrc"))

const defaultScripts = {
test: 'echo "Error: no test specified" && exit 1'
Expand Down Expand Up @@ -86,7 +85,7 @@ function minifyHTML(content) {
}

function minifyJS(content) {
return uglify(content, uglifyOptions).code
return terser(content, terserOptions).code
}

function publishPackage() {
Expand Down
2 changes: 1 addition & 1 deletion script/setup-acorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const acornPath = path.resolve(vendorPath, "acorn")
const acornPkg = require("acorn/package.json")
const acornURL = "https://github.com/ternjs/acorn/archive/" + acornPkg.version + ".zip"

const extractFilterRegExp = /^(?:pack|src).*?\.(?:js|json)$/
const extractFilterRegExp = /^acorn[\\/].*?\.(?:js|json)$/

function setupAcorn() {
if (fs.existsSync(acornPath)) {
Expand Down
6 changes: 3 additions & 3 deletions script/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const ignorePaths = require("./ignore-paths.js")
const path = require("path")
const setupTest262 = require("./setup-test262.js")
const trash = require("./trash.js")
const uglify = require("uglify-es").minify
const terser = require("terser").minify

const argv = require("yargs")
.boolean("prod")
Expand Down Expand Up @@ -58,7 +58,7 @@ nodeArgs.push(
)

const trashPaths = ignorePaths.filter(isKept)
const uglifyOptions = fs.readJSONSync(path.resolve(rootPath, ".uglifyrc"))
const terserOptions = fs.readJSONSync(path.resolve(rootPath, ".terserrc"))

function cleanJS() {
jsPaths.forEach((filename) => {
Expand All @@ -79,7 +79,7 @@ function isKept(thePath) {
}

function minifyJS(content) {
return uglify(content, uglifyOptions).code
return terser(content, terserOptions).code
}

function runTests(cached) {
Expand Down
24 changes: 12 additions & 12 deletions src/acorn.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import "./vendor/acorn/src/expression.js"
import "./vendor/acorn/src/location.js"
import "./vendor/acorn/src/lval.js"
import "./vendor/acorn/src/node.js"
import "./vendor/acorn/src/scope.js"
import "./vendor/acorn/src/statement.js"
import "./vendor/acorn/src/tokencontext.js"
import "./vendor/acorn/src/tokenize.js"
import "./vendor/acorn/acorn/src/expression.js"
import "./vendor/acorn/acorn/src/location.js"
import "./vendor/acorn/acorn/src/lval.js"
import "./vendor/acorn/acorn/src/node.js"
import "./vendor/acorn/acorn/src/scope.js"
import "./vendor/acorn/acorn/src/statement.js"
import "./vendor/acorn/acorn/src/tokencontext.js"
import "./vendor/acorn/acorn/src/tokenize.js"

import {
lineBreak as lineBreakRegExp,
skipWhiteSpace as skipWhiteSpaceRegExp
} from "./vendor/acorn/src/whitespace.js"
} from "./vendor/acorn/acorn/src/whitespace.js"

import { Parser } from "./vendor/acorn/src/state.js"
import { getLineInfo } from "./vendor/acorn/src/locutil.js"
import { types as tokTypes } from "./vendor/acorn/src/tokentype.js"
import { Parser } from "./vendor/acorn/acorn/src/state.js"
import { getLineInfo } from "./vendor/acorn/acorn/src/locutil.js"
import { types as tokTypes } from "./vendor/acorn/acorn/src/tokentype.js"

const literalRegExp = /^(?:'((?:\\.|[^'])*?)'|"((?:\\.|[^"])*?)"|;)/

Expand Down
6 changes: 2 additions & 4 deletions src/acorn/parser/class-fields.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function init() {
const Plugin = {
enable(parser) {
parser.getTokenFromCode = wrap(parser.getTokenFromCode, getTokenFromCode)
parser.parseClassMember = wrap(parser.parseClassMember, parseClassMember)
parser.parseClassElement = wrap(parser.parseClassElement, parseClassElement)
return parser
}
}
Expand All @@ -32,7 +32,7 @@ function init() {
return this.finishToken(tt.name, this.readWord1())
}

function parseClassMember(func, args) {
function parseClassElement(func, args) {
if (this.type !== tt.name) {
return Reflect.apply(func, this, args)
}
Expand All @@ -51,15 +51,13 @@ function init() {
return Reflect.apply(func, this, args)
}

const [classBody] = args
const node = this.startNode()

node.computed = false
node.key = this.parseIdent(true)
node.value = this.eat(tt.eq) ? this.parseExpression() : null

this.finishNode(node, "FieldDefinition")
classBody.body.push(node)
this.semicolon()
return node
}
Expand Down
26 changes: 0 additions & 26 deletions src/acorn/parser/for-await-outside-function.js

This file was deleted.

28 changes: 20 additions & 8 deletions src/acorn/parser/tolerance.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import noop from "../../util/noop.js"
import shared from "../../shared.js"

function init() {
const scopes = { __proto__: null }

const Plugin = {
enable(parser) {
parser.isDirectiveCandidate =
parser.strictDirective = alwaysFalse

parser.canDeclareLexicalName =
parser.canDeclareVarName =
parser.isSimpleParamList = alwaysTrue

parser.adaptDirectivePrologue =
Expand All @@ -20,17 +20,13 @@ function init() {
parser.checkPropClash =
parser.checkVariableExport =
parser.checkYieldAwaitInDefaultParams =
parser.declareLexicalName =
parser.declareVarName =
parser.enterFunctionScope =
parser.enterLexicalScope =
parser.exitFunctionScope =
parser.exitLexicalScope =
parser.declareName =
parser.invalidStringToken =
parser.validateRegExpFlags =
parser.validateRegExpPattern = noop

parser.checkExpressionErrors = checkExpressionErrors
parser.enterScope = enterScope
return parser
}
}
Expand All @@ -43,6 +39,22 @@ function init() {
return false
}

function enterScope(flags) {
this.scopeStack.push(getScope(flags))
}

function getScope(flags) {
if (Reflect.has(scopes, flags)) {
return scopes[flags]
}

return scopes[flags] = {
flags,
lexical: [],
var: []
}
}

return Plugin
}

Expand Down
2 changes: 1 addition & 1 deletion src/acorn/parser/top-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function init() {
let inited = false

while (this.type !== tt.eof) {
const stmt = this.parseStatement(true, true, exported)
const stmt = this.parseStatement(null, true, exported)

let { expression, type } = stmt

Expand Down
2 changes: 0 additions & 2 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { Parser as AcornParser } from "./acorn.js"
import acornParserBigInt from "./acorn/parser/big-int.js"
import acornParserClassFields from "./acorn/parser/class-fields.js"
import acornParserErrorMessages from "./acorn/parser/error-messages.js"
import acornParserForAwaitOutsideFunction from "./acorn/parser/for-await-outside-function.js"
import acornParserFunctionParamsStart from "./acorn/parser/function-params-start.js"
import acornParserHTMLComment from "./acorn/parser/html-comment.js"
import acornParserImport from "./acorn/parser/import.js"
Expand Down Expand Up @@ -48,7 +47,6 @@ function init() {
acornParserBigInt.enable(parser)
acornParserClassFields.enable(parser)
acornParserErrorMessages.enable(parser)
acornParserForAwaitOutsideFunction.enable(parser)
acornParserFunctionParamsStart.enable(parser)
acornParserHTMLComment.enable(parser)
acornParserImport.enable(parser)
Expand Down
6 changes: 3 additions & 3 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const {

const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer")
const OptimizeJsPlugin = require("optimize-js-plugin")
const UglifyJSPlugin = require("uglifyjs-webpack-plugin")
const TerserPlugin = require("terser-webpack-plugin")
const UnusedPlugin = require("unused-webpack-plugin")

class WebpackRequirePlugin {
Expand Down Expand Up @@ -60,7 +60,7 @@ const hosted = [
]

const babelOptions = require("./.babel.config.js")
const uglifyOptions = fs.readJSONSync("./.uglifyrc")
const terserOptions = fs.readJSONSync("./.terserrc")

const config = {
devtool: false,
Expand All @@ -80,7 +80,7 @@ const config = {
},
optimization: {
minimizer: [
new UglifyJSPlugin({ uglifyOptions })
new TerserPlugin({ terserOptions })
],
nodeEnv: false
},
Expand Down

0 comments on commit 487d64a

Please sign in to comment.