chore: fix eslint

This commit is contained in:
alexander.akait 2023-04-12 21:09:24 +03:00
parent f1ef2eded2
commit 1cab8f4fd6
162 changed files with 347 additions and 408 deletions

View File

@ -1,26 +1,28 @@
# Ignore node_modules
node_modules
# Ignore some test files
test/**/*.*
!test/*.js
!test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
test/cases/parsing/es2022/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js
!test/helpers/*.*
# Ignore some folders
benchmark
coverage
# Ignore generated files
*.check.js
# Ignore not supported files
!.*.js
.eslintrc.js
*.d.ts
# Ignore precompiled schemas
schemas/**/*.check.js
# Ignore some test files
test/*
!test/*Cases
!test/helpers
!test/*.js
test/*Cases/**/*.js
!test/*Cases/**/webpack.config.js
# Ignore some examples files
examples/**/*.js
!examples/*/webpack.config.js

View File

@ -2,7 +2,7 @@
<!-- Before creating an issue please make sure you are using the latest version of webpack. -->
<!-- Also consider trying the webpack@beta version, maybe it's already fixed. -->
**Do you want to request a *feature* or report a *bug*?**
**Do you want to request a _feature_ or report a _bug_?**
<!-- Please ask questions on StackOverflow or the webpack Gitter (https://gitter.im/webpack/webpack). -->
<!-- Issues which contain questions or support requests will be closed. -->

View File

@ -15,10 +15,8 @@ about: Create a report to help us improve
**What is the current behavior?**
**If the current behavior is a bug, please provide the steps to reproduce.**
<!-- A great way to do this is to provide your configuration via a GitHub repository -->
<!-- The most helpful is a minimal reproduction with instructions on how to reproduce -->
<!-- Repositories with too many files or large `webpack.config.js` files are not suitable -->
@ -28,12 +26,11 @@ about: Create a report to help us improve
**What is the expected behavior?**
<!-- "It should work" is not a helpful explanation -->
<!-- Explain exactly how it should behave -->
**Other relevant information:**
webpack version:
Node.js version:
Operating System:
Node.js version:
Operating System:
Additional tools:

View File

@ -1,7 +1,6 @@
---
name: Feature request
about: Suggest an idea for this project
---
<!-- Please don't delete this template or we'll close your issue -->
@ -16,12 +15,9 @@ about: Suggest an idea for this project
**What is the expected behavior?**
**What is motivation or use case for adding/changing the behavior?**
**How should this be implemented in your opinion?**
**Are you willing to work on this yourself?**
yes

View File

@ -1,7 +1,6 @@
---
name: Other
about: Something else
---
<!-- Bug reports and Feature requests must use other templates, or will be closed -->

View File

@ -4,10 +4,14 @@
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->
## Summary
## Summary
<!-- cspell:disable-next-line -->
copilot:summary
## Details
## Details
<!-- cspell:disable-next-line -->
copilot:walkthrough

View File

@ -2,7 +2,6 @@
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
<!-- Try to link to an open issue for more information. -->
<!-- In addition to that please answer these questions: -->
**What kind of change does this PR introduce?**

View File

@ -1,14 +1,30 @@
package.json
# Ignore test fixtures
test/*.*
# Ignore some test files
test/**/*.*
!test/*.js
!test/**/webpack.config.js
!test/**/test.config.js
!test/**/test.filter.js
!test/**/errors.js
!test/**/warnings.js
!test/**/deprecations.js
!test/*.md
!test/helpers/*.*
# Ignore example fixtures
examples/*.*
!examples/**/webpack.config.js
# Ignore some folders
benchmark/
coverage/
# Ignore generated files
*.check.js
# Ignore not supported files
*.d.ts
# Ignore precompiled schemas
schemas/**/*.check.js
# Ignore example fixtures
examples/
!examples/**/webpack.config.js

View File

@ -1,6 +1,4 @@
{
"extends": "assemblyscript/std/assembly.json",
"include": [
"./**/*.asm.ts"
]
"include": ["./**/*.asm.ts"]
}

View File

@ -150,7 +150,7 @@
"pretest": "yarn lint",
"prelint": "yarn setup",
"lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck",
"code-lint": "eslint . --ext '.js' --cache",
"code-lint": "eslint --cache .",
"type-lint": "tsc",
"typings-test": "tsc -p tsconfig.types.test.json",
"module-typings-test": "tsc -p tsconfig.module.test.json",
@ -159,9 +159,8 @@
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
"fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
"prepare": "husky install",
"pretty-lint-base": "prettier \"*.{ts,json,yml,yaml,md}\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.json\" \"examples/*.md\"",
"pretty-lint-base-all": "yarn pretty-lint-base \"*.js\" \"{setup,lib,bin,hot,benchmark,tooling,schemas}/**/*.js\" \"module.d.ts\" \"test/*.js\" \"test/helpers/*.js\" \"test/{configCases,watchCases,statsCases,hotCases,benchmarkCases}/**/webpack.config.js\" \"examples/**/webpack.config.js\"",
"pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write",
"pretty-lint-base": "prettier --cache .",
"pretty-lint-fix": "yarn pretty-lint-base --loglevel warn --write",
"pretty-lint": "yarn pretty-lint-base --check",
"yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock",
"yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock",
@ -179,11 +178,11 @@
"cover:report": "nyc report -t coverage"
},
"lint-staged": {
"*.js|{lib,setup,bin,hot,tooling,schemas}/**/*.js|test/*.js|{test,examples}/**/webpack.config.js}": [
"eslint --cache"
"*.{js,cjs,mjs}": [
"eslint --cache --fix"
],
"*.{ts,json,yml,yaml,md}|examples/*.md": [
"prettier --check"
"*": [
"prettier --cache --ignore-unknown"
],
"*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [
"cspell"

View File

@ -1,20 +1,25 @@
# Welcome to the webpack test suite!!!!
Every pull request that you submit to webpack (besides README and spelling corrections in comments) requires tests that are created.
But don't give up hope!!! Although our tests may appear complex and overwhelming, once you become familiar with the test suite and structure, adding and creating tests will be fun and beneficial as you work inside the codebase! ❤
## tl;dr
Run all tests (this automatically runs the setup):
```sh
yarn test
```
Run an individual suite:
```sh
yarn jest ConfigTestCases
```
Watch mode:
```sh
yarn jest --watch ConfigTestCases
```
@ -22,16 +27,20 @@ yarn jest --watch ConfigTestCases
See also: [Jest CLI docs](https://jestjs.io/docs/cli)
## Test suite overview
We use Jest for our tests. For more information on Jest you can visit their [homepage](https://jestjs.io/)!
### Class Tests
All test files can be found in *.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation).
All test files can be found in \*.test.js. There are many tests that simply test APIs of a specific class/file (such as `Compiler`, `Errors`, Integration, `Parser`, `RuleSet`, Validation).
If the feature you are contributing involves one of those classes, then best to start there to understand the structure.
### xCases
In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding *.test.js files.
In addition to Class specific tests, there are also directories that end in "Cases". The suites for these cases also have corresponding \*.test.js files.
#### cases (`TestCases.test.js`) <sup>1</sup>
Cases are a set of general purpose tests that will run against a variety of permutations of webpack configurations. When you are making a general purpose change that doesn't require you to have a special configuration, you would likely add your tests here. Inside of the `./test/cases` directory you will find tests are broken into thematic sub directories. Take a moment to explore the different options.
To add a new case, create a new directory inside of the top level test groups, and then add an `index.js` file (and any other supporting files).
@ -39,11 +48,13 @@ To add a new case, create a new directory inside of the top level test groups, a
By default this file will be the entry point for the test suite and you can add your `it()`'s there. This will also become bundled so that node env support happens as well.
#### configCases (`ConfigTestCases.basictest.js`) <sup>1</sup>
If you are trying to solve a bug which is reproducible when x and y properties are used together in a config, then configCases is the place to be!!!!
In addition to an `index.js`, these configCases require a `webpack.config.js` is located inside of your test suite. This will run this specific config through `webpack` just as you were building individually. They will use the same loading/bundling technique of your `it()` tests, however you now have a more specific config use cases that you can write even before you start coding.
#### statsCases (`StatsTestCases.basictest.js`)
Stats cases are similar to configCases except specifically focusing on the `expected` output of your stats. Instead of writing to the console, however the output of stats will be written to disk.
By default, the "expected" outcome is a pain to write by hand so instead when statsCases are run, runner is checking output using jest's awesome snapshot functionality.
@ -52,21 +63,23 @@ Basically you don't need to write any expected behaviors yourself. The assumptio
Please follow the approach described below:
* write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js`
- write your test code in `statsCases/` folder by creating a separate folder for it, for example `statsCases/some-file-import-stats/index.js`
```javascript
import("./someModule");
```
* don't forget the `webpack.config.js`
* run the test
* jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there
* Next time test will run -> runner will compare results against your output written to snapshot previously
- don't forget the `webpack.config.js`
- run the test
- jest will automatically add the output from your test code to `StatsTestCases.test.js.snap` and you can always check your results there
- Next time test will run -> runner will compare results against your output written to snapshot previously
You can read more about SnapShot testing [right here](https://jestjs.io/docs/snapshot-testing)
## Questions? Comments?
If you are still nervous or don't quite understand, please submit an issue and tag us in it, and provide a relevant PR while working on!
## Footnotes
<sup>1</sup> webpack's parser supports the use of ES2015 features like arrow functions, harmony exports, etc. However as a library we follow Node.js' timeline for dropping older versions of node. Because of this we expect your tests on GitHub Actions to pass all the way back to NodeJS v10; Therefore if you would like specific tests that use these features to be ignored if they are not supported, then you should add a `test.filter.js` file. This allows you to import the syntax needed for that test, meanwhile ignoring it on node versions (during CI) that don't support it. webpack has a variety of helpful examples you can refer to if you are just starting out. See the `./helpers` folder to find a list of the versions.

View File

@ -1,4 +1,4 @@
module.exports = function(config) {
module.exports = function (config) {
// This test can't run in development mode as it depends on the flagIncludedChunks optimization
return config.mode !== "development";
};

View File

@ -1,3 +1,5 @@
module.exports = [
[/It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./],
[
/It's not allowed to load an initial chunk on demand\. The chunk name "main" is already used by an entrypoint\./
]
];

View File

@ -1,6 +1,3 @@
module.exports = [
[
/Module build failed( \(from [^)]+\))?:\nMessage/,
{details: /Stack/}
]
[/Module build failed( \(from [^)]+\))?:\nMessage/, { details: /Stack/ }]
];

View File

@ -1,3 +1,3 @@
module.exports = [
[/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/],
[/Critical dependency: Contexts can't use RegExps with the 'g' or 'y' flags/]
];

View File

@ -1,6 +1,6 @@
var fs = require("fs");
var path = require("path");
module.exports = function(config) {
module.exports = function (config) {
return fs.existsSync(path.join(__dirname, "TEST.FILTER.JS"));
};

View File

@ -1,4 +1,12 @@
module.exports = [
[/There are multiple modules with names that only differ in casing/, /case-sensitive.A\.js/, /case-sensitive.a\.js/],
[/There are multiple modules with names that only differ in casing/, /case-sensitive.B.file\.js/, /case-sensitive.b.file\.js/]
[
/There are multiple modules with names that only differ in casing/,
/case-sensitive.A\.js/,
/case-sensitive.a\.js/
],
[
/There are multiple modules with names that only differ in casing/,
/case-sensitive.B.file\.js/,
/case-sensitive.b.file\.js/
]
];

View File

@ -1,3 +1 @@
module.exports = [
[/Module not found/],
];
module.exports = [[/Module not found/]];

View File

@ -1,5 +1 @@
module.exports = [
[
/Can't resolve '.\/missing'/
]
];
module.exports = [[/Can't resolve '.\/missing'/]];

View File

@ -1,8 +1 @@
module.exports = [
[
/err: abc/,
],
[
/The loaded module contains errors/,
],
];
module.exports = [[/err: abc/], [/The loaded module contains errors/]];

View File

@ -1,12 +1,4 @@
module.exports = [
[
/abc/,
/Emitted value instead of an instance of Error/,
/error-loader\.js/
],
[
/def/,
/Emitted value instead of an instance of Error/,
/error-loader\.js/
]
[/abc/, /Emitted value instead of an instance of Error/, /error-loader\.js/],
[/def/, /Emitted value instead of an instance of Error/, /error-loader\.js/]
];

View File

@ -1,7 +1,3 @@
module.exports = [
[
/xyz/,
/Emitted value instead of an instance of Error/,
/warning-loader\.js/
]
[/xyz/, /Emitted value instead of an instance of Error/, /warning-loader\.js/]
];

View File

@ -1,10 +1,16 @@
module.exports = [
[
{moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/},
{
moduleName:
/\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/file\.js/
},
/Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/
],
[
{moduleName: /\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/},
{
moduleName:
/\.\/loaders\/no-string\/loader\.js!\.\/loaders\/no-string\/pitch-loader\.js!\.\/loaders\/no-string\/file\.js/
},
/Module build failed: Error: Final loader \(\.\/loaders\/no-string\/loader\.js\) didn't return a Buffer or String/
]
];

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return !config.minimize;
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return !config.minimize;
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1 @@
module.exports = [
[/Critical dependency: Accessing import\.meta/]
];
module.exports = [[/Critical dependency: Accessing import\.meta/]];

View File

@ -1,4 +1,4 @@
module.exports = function(config) {
module.exports = function (config) {
// terser doesn't support static {}
if (config.mode === "production") return false;

View File

@ -1,3 +1,3 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/b' /, {details: /b\.js/}]
[/Module not found/, /Can't resolve '\.\/b' /, { details: /b\.js/ }]
];

View File

@ -1,3 +1,7 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /extract-require\/index.js/}]
[
/Module not found/,
/Can't resolve '\.\/missingModule' /,
{ moduleName: /extract-require\/index.js/ }
]
];

View File

@ -1,4 +1,4 @@
module.exports = function(config) {
module.exports = function (config) {
// This test can't run in development mode
return config.mode !== "development";
};

View File

@ -1,3 +1,5 @@
module.exports = [
[/export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/]
[
/export 'default' \(imported as 'defaultImport'\) was not found in '.\/a' \(possible exports: a, b, c, d, e, f\)/
]
];

View File

@ -1,3 +1 @@
module.exports = [
[/Empty dependency/]
];
module.exports = [[/Empty dependency/]];

View File

@ -1,3 +1 @@
module.exports = [
[/Can't resolve 'missing'/]
];
module.exports = [[/Can't resolve 'missing'/]];

View File

@ -1,3 +1 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /]
];
module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]];

View File

@ -1,3 +1 @@
module.exports = [
[/Critical dependency/]
];
module.exports = [[/Critical dependency/]];

View File

@ -1,3 +1,3 @@
module.exports = function(config) {
module.exports = function (config) {
return config.mode !== "development";
};

View File

@ -1,3 +1 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /]
];
module.exports = [[/Module not found/, /Can't resolve '\.\/missingModule' /]];

View File

@ -1,5 +1,5 @@
var supportsLogicalAssignment = require("../../../helpers/supportsLogicalAssignment");
module.exports = function(config) {
module.exports = function (config) {
return supportsLogicalAssignment();
};

View File

@ -1,6 +1,6 @@
const supportsOptionalCatchBinding = require("../../../helpers/supportsOptionalCatchBinding");
module.exports = function(config) {
module.exports = function (config) {
// XXX: Disable this test if Terser is used because it does not support ES 2019
if (config.mode === "production") {
return false;

View File

@ -1,5 +1,5 @@
var supportsSpread = require("../../../helpers/supportsSpread");
module.exports = function(config) {
module.exports = function (config) {
return supportsSpread();
};

View File

@ -3,4 +3,4 @@ module.exports = [
[/Module not found/, /recursive-file\/b/, /Recursion in resolving/],
[/Module not found/, /recursive-file\/c/, /Recursion in resolving/],
[/Module not found/, /recursive-file\/d/, /Recursion in resolving/]
];
];

View File

@ -1,3 +1,7 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule' /, {moduleName: /error-handling\/index.js/}]
[
/Module not found/,
/Can't resolve '\.\/missingModule' /,
{ moduleName: /error-handling\/index.js/ }
]
];

View File

@ -1,3 +1,7 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/missingModule2' /, {moduleName: /error-handling\/index.js/}]
[
/Module not found/,
/Can't resolve '\.\/missingModule2' /,
{ moduleName: /error-handling\/index.js/ }
]
];

View File

@ -1,3 +1 @@
module.exports = [
[/Module not found/, /Can't resolve '\.\/someModule' /],
];
module.exports = [[/Module not found/, /Can't resolve '\.\/someModule' /]];

View File

@ -3,10 +3,12 @@ var supportDefaultAssignment = require("../../../helpers/supportDefaultAssignmen
var supportsObjectDestructuring = require("../../../helpers/supportsObjectDestructuring");
var supportsIteratorDestructuring = require("../../../helpers/supportsIteratorDestructuring");
module.exports = function(config) {
return !config.minimize &&
module.exports = function (config) {
return (
!config.minimize &&
supportsES6() &&
supportDefaultAssignment() &&
supportsObjectDestructuring() &&
supportsIteratorDestructuring();
supportsIteratorDestructuring()
);
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
const supports = require("webassembly-feature");
module.exports = function(config) {
module.exports = function (config) {
return supports["simd"]();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,8 +1,8 @@
const supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
const supportsFeature = require("webassembly-feature");
// const supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
// const supportsFeature = require("webassembly-feature");
module.exports = function (config) {
// TODO fails with CompileError: WebAssembly.instantiate(): Compiling function #0 failed: memory instruction with no memory @+24
return false;
return supportsWebAssembly() && supportsFeature.simd();
// return supportsWebAssembly() && supportsFeature.simd();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -1,5 +1,5 @@
var supportsWebAssembly = require("../../../helpers/supportsWebAssembly");
module.exports = function(config) {
module.exports = function (config) {
return supportsWebAssembly();
};

View File

@ -5,11 +5,15 @@ module.exports = {
beforeExecute() {
try {
fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock"));
} catch (e) {}
} catch (e) {
// Empty
}
},
afterExecute() {
try {
fs.unlinkSync(path.join(__dirname, "dev-defaults.webpack.lock"));
} catch (e) {}
} catch (e) {
// Empty
}
}
};

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
return ["a.js", "b.js"];
}
};

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
return ["entry1.js", "entry2.js"];
}
};

View File

@ -1,3 +1 @@
module.exports = [
[/hashed/, /deprecated/]
];
module.exports = [[/hashed/, /deprecated/]];

View File

@ -1,3 +1 @@
module.exports = [
/not found/
];
module.exports = [/not found/];

View File

@ -1,3 +1 @@
module.exports = [
/not found/
];
module.exports = [/not found/];

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
return ["entry1.js", "entry2.js"];
}
};

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
return ["runtime.js", "common-index_js.js", "main.js"];
}
};

View File

@ -4,7 +4,7 @@ const allAssets = new Set();
const allBundles = new Set();
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
allBundles.add(/\.([^.]+)\./.exec(bundle)[1]);
@ -12,11 +12,11 @@ module.exports = {
switch (i) {
case 0:
asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'img')[0];
asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "img")[0];
break;
case 1:
case 5:
asset = findOutputFiles(options, /^1\.[^\.]*\.jpg$/, 'asset')[0];
asset = findOutputFiles(options, /^1\.[^.]*\.jpg$/, "asset")[0];
break;
}

View File

@ -4,7 +4,7 @@ const allFilenameHashes = new Set();
const allChunkHashes = new Set();
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
const filename = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
const filenameHash = /\.([a-f0-9]+)\.js$/.exec(filename)[1];
allFilenameHashes.add(filenameHash);

View File

@ -4,7 +4,7 @@ const allAssets = new Set();
const allBundles = new Set();
module.exports = {
findBundle: function(i, options) {
findBundle: function (i, options) {
const bundle = findOutputFiles(options, new RegExp(`^bundle${i}`))[0];
allBundles.add(/\.([^.]+)\./.exec(bundle)[1]);

View File

@ -1,3 +1 @@
module.exports = [
[/hashed/, /deprecated/]
];
module.exports = [[/hashed/, /deprecated/]];

View File

@ -1,3 +1 @@
module.exports = [
[/hashed/, /deprecated/]
];
module.exports = [[/hashed/, /deprecated/]];

View File

@ -1,8 +1,5 @@
module.exports = {
findBundle: function() {
return [
"./runtime~main.js",
"./main.js"
]
findBundle: function () {
return ["./runtime~main.js", "./main.js"];
}
};

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function() {
findBundle: function () {
return ["./app.js", "./react-vendors.js"];
}
};

View File

@ -1,8 +1,5 @@
module.exports = {
findBundle: function() {
return [
"./a.js",
"./b.js"
]
findBundle: function () {
return ["./a.js", "./b.js"];
}
};

View File

@ -1,8 +1,5 @@
module.exports = {
findBundle: function() {
return [
"./a.js",
"./b.js"
]
findBundle: function () {
return ["./a.js", "./b.js"];
}
};

View File

@ -1,8 +1,5 @@
module.exports = {
findBundle: function() {
return [
"./a.js",
"./b.js"
]
findBundle: function () {
return ["./a.js", "./b.js"];
}
};

View File

@ -1,3 +1 @@
module.exports = [
[/^Module not found/, /.\/index\.js/]
];
module.exports = [[/^Module not found/, /.\/index\.js/]];

View File

@ -1,3 +1 @@
module.exports = [
[/Module not found/]
];
module.exports = [[/Module not found/]];

View File

@ -1,9 +1,5 @@
module.exports = {
findBundle: function() {
return [
"./a.js",
"./b.js",
"./bundle0.js"
]
findBundle: function () {
return ["./a.js", "./b.js", "./bundle0.js"];
}
};

View File

@ -1,8 +1,5 @@
module.exports = {
findBundle: function(i, options) {
return [
"./common.js",
"./main.js"
]
findBundle: function (i, options) {
return ["./common.js", "./main.js"];
}
};

View File

@ -1,14 +1,14 @@
const System = require("../../../helpers/fakeSystem");
module.exports = {
target: 'web',
target: "web",
beforeExecute: () => {
System.init();
},
moduleScope(scope) {
scope.window.windowExt = 'works';
scope.rootExt = 'works';
scope.varExt = 'works';
scope.window.windowExt = "works";
scope.rootExt = "works";
scope.varExt = "works";
scope.System = System;
},
afterExecute: () => {

View File

@ -1,3 +1,3 @@
module.exports = function () {
return process.version.slice(0, 4) !== "v10."
return process.version.slice(0, 4) !== "v10.";
};

View File

@ -1,9 +1,9 @@
var fs = require('fs');
var fs = require("fs");
module.exports = {
noTests: true,
findBundle: function(i, options) {
var regex = new RegExp("^bundle\." + options.name, "i");
findBundle: function (i, options) {
var regex = new RegExp("^bundle." + options.name, "i");
var files = fs.readdirSync(options.output.path);
var bundle = files.find(function (file) {
return regex.test(file);

View File

@ -1,10 +1,12 @@
module.exports = [
{
code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/,
message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/
message:
/Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[2\]\.options\)/
},
{
code: /DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING/,
message: /Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/
message:
/Using a string as loader options is deprecated \(ruleSet\[1\]\.rules\[3\]\.use\[0\]\.options\)/
}
];

View File

@ -1,3 +1 @@
module.exports = [
[/hashed/, /deprecated/]
];
module.exports = [[/hashed/, /deprecated/]];

Some files were not shown because too many files have changed in this diff Show More