Skip to content

Commit

Permalink
Merge tag 'v4.25.0' into next
Browse files Browse the repository at this point in the history
4.25.0
  • Loading branch information
sokra committed Nov 5, 2018
2 parents e1c77f6 + 290094e commit 8cf1cdb
Show file tree
Hide file tree
Showing 41 changed files with 832 additions and 117 deletions.
68 changes: 55 additions & 13 deletions azure-pipelines.yml
Expand Up @@ -4,9 +4,9 @@ jobs:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "^10.10.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -26,17 +26,32 @@ jobs:
- script: |
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn test:basic --ci
yarn test:unit --ci
export JEST_JUNIT_OUTPUT=./basic-junit.xml
yarn test:basic --ci --reporters=jest-junit
export JEST_JUNIT_OUTPUT=./unit-junit.xml
yarn test:unit --ci --reporters=jest-junit
displayName: "Run basic tests"
- task: PublishTestResults@2
inputs:
testRunTitle: "basic"
testResultsFiles: "**/basic-junit.xml"
condition: succeededOrFailed()
displayName: "Publish basic test results"
- task: PublishTestResults@2
inputs:
testRunTitle: "unit"
testResultsFiles: "**/unit-junit.xml"
condition: succeededOrFailed()
displayName: "Publish unit test results"

- job: lint
pool:
vmImage: ubuntu-16.04
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: "^10.10.0"
displayName: "Install Node.js"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -58,7 +73,14 @@ jobs:
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn lint
displayName: "Run linting"
- job: linux
- task: PublishTestResults@2
inputs:
testRunTitle: "lint"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish lint results"

- job: Linux
dependsOn:
- basic
- lint
Expand All @@ -73,9 +95,9 @@ jobs:
node_version: ^8.12.0
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -96,9 +118,16 @@ jobs:
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:init
yarn cover:integration --ci --maxWorkers=2
yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
displayName: "Run tests with coverage"
- job: macos
- task: PublishTestResults@2
inputs:
testRunTitle: "Linux with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"

- job: macOS
dependsOn:
- basic
- lint
Expand All @@ -113,9 +142,9 @@ jobs:
node_version: ^8.12.0
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
curl -o- -L https://yarnpkg.com/install.sh | bash
displayName: "Install Yarn"
Expand All @@ -136,9 +165,16 @@ jobs:
set -e
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn cover:init
yarn cover:integration --ci
yarn cover:integration --ci --reporters=jest-junit
displayName: "Run tests with coverage"
- job: windows
- task: PublishTestResults@2
inputs:
testRunTitle: "macOS with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"

- job: Windows
dependsOn:
- basic
- lint
Expand All @@ -153,9 +189,9 @@ jobs:
node_version: ^8.12.0
steps:
- task: NodeTool@0
displayName: "Install Node.js"
inputs:
versionSpec: $(node_version)
displayName: "Install Node.js $(node_version)"
- script: |
npm install --global yarn
displayName: "Install Yarn"
Expand All @@ -172,5 +208,11 @@ jobs:
displayName: "Install dependencies"
- script: |
set -e
yarn cover:init && yarn cover:integration --ci --maxWorkers=2
yarn cover:init && yarn cover:integration --ci --maxWorkers=2 --reporters=jest-junit
displayName: "Run tests with coverage"
- task: PublishTestResults@2
inputs:
testRunTitle: "Windows with Node.js $(node_version)"
testResultsFiles: "**/junit.xml"
condition: succeededOrFailed()
displayName: "Publish test results"
4 changes: 4 additions & 0 deletions declarations/plugins/DllPlugin.d.ts
Expand Up @@ -13,6 +13,10 @@ export interface DllPluginOptions {
* If true, only entry points will be exposed
*/
entryOnly?: boolean;
/**
* If true, manifest json file (output) will be formatted
*/
format?: boolean;
/**
* Name of the exposed dll function (external name, use value of 'output.library')
*/
Expand Down
42 changes: 42 additions & 0 deletions declarations/plugins/ProgressPlugin.d.ts
@@ -0,0 +1,42 @@
/**
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn special-lint-fix` to update
*/

export type ProgressPluginArgument = ProgressPluginOptions | HandlerFunction;
/**
* Function that executes for every progress step
*/
export type HandlerFunction = ((
percentage: number,
msg: string,
...args: string[]
) => void);

export interface ProgressPluginOptions {
/**
* Show active modules count and one active module in progress message
*/
activeModules?: boolean;
/**
* Show entries count in progress message
*/
entries?: boolean;
/**
* Function that executes for every progress step
*/
handler?: HandlerFunction;
/**
* Show modules count in progress message
*/
modules?: boolean;
/**
* Minimum modules count to start with. Only for mode=modules. Default: 500
*/
modulesCount?: number;
/**
* Collect profile data for progress steps. Default: false
*/
profile?: true | false | null;
}
43 changes: 39 additions & 4 deletions lib/BasicEvaluatedExpression.js
Expand Up @@ -29,11 +29,13 @@ class BasicEvaluatedExpression {
this.regExp = null;
this.string = null;
this.quasis = null;
this.parts = null;
this.array = null;
this.items = null;
this.options = null;
this.prefix = null;
this.postfix = null;
this.expression = null;
}

isNull() {
Expand Down Expand Up @@ -105,10 +107,36 @@ class BasicEvaluatedExpression {
: undefined;
}
if (this.isTemplateString()) {
for (const quasi of this.quasis) {
if (quasi.asBool()) return true;
const str = this.asString();
if (typeof str === "string") return str !== "";
}
return undefined;
}

asString() {
if (this.isBoolean()) return `${this.bool}`;
if (this.isNull()) return "null";
if (this.isString()) return this.string;
if (this.isNumber()) return `${this.number}`;
if (this.isRegExp()) return `${this.regExp}`;
if (this.isArray()) {
let array = [];
for (const item of this.items) {
const itemStr = item.asString();
if (itemStr === undefined) return undefined;
array.push(itemStr);
}
return `${array}`;
}
if (this.isConstArray()) return `${this.array}`;
if (this.isTemplateString()) {
let str = "";
for (const part of this.parts) {
const partStr = part.asString();
if (partStr === undefined) return undefined;
str += partStr;
}
// can't tell if string will be empty without executing
return str;
}
return undefined;
}
Expand Down Expand Up @@ -184,9 +212,11 @@ class BasicEvaluatedExpression {
return this;
}

setTemplateString(quasis) {
setTemplateString(quasis, parts, kind) {
this.type = TypeTemplateString;
this.quasis = quasis;
this.parts = parts;
this.templateStringKind = kind;
return this;
}

Expand All @@ -206,6 +236,11 @@ class BasicEvaluatedExpression {
this.range = range;
return this;
}

setExpression(expression) {
this.expression = expression;
return this;
}
}

module.exports = BasicEvaluatedExpression;
18 changes: 17 additions & 1 deletion lib/Compilation.js
Expand Up @@ -216,6 +216,13 @@ class Compilation {
/** @type {SyncHook<Module>} */
succeedModule: new SyncHook(["module"]),

/** @type {SyncHook<Dependency, string>} */
addEntry: new SyncHook(["entry", "name"]),
/** @type {SyncHook<Dependency, string, Error>} */
failedEntry: new SyncHook(["entry", "name", "error"]),
/** @type {SyncHook<Dependency, string, Module>} */
succeedEntry: new SyncHook(["entry", "name", "module"]),

/** @type {SyncWaterfallHook<DependencyReference, Dependency, Module>} */
dependencyReference: new SyncWaterfallHook([
"dependencyReference",
Expand Down Expand Up @@ -960,14 +967,23 @@ class Compilation {
* @returns {void} returns
*/
addEntry(context, entry, name, callback) {
this.hooks.addEntry.call(entry, name);

let entriesArray = this.entryDependencies.get(name);
if (entriesArray === undefined) {
entriesArray = [];
this.entryDependencies.set(name, entriesArray);
}
entriesArray.push(entry);

this.addModuleChain(context, entry, callback);
this.addModuleChain(context, entry, (err, module) => {
if (err) {
this.hooks.failedEntry.call(entry, name, err);
return callback(err);
}
this.hooks.succeedEntry.call(entry, name, module);
return callback(null, module);
});
}

/**
Expand Down

0 comments on commit 8cf1cdb

Please sign in to comment.