Skip to content

Commit fa452a0

Browse files
chore(cli): move to lerna and scoped packages (#434)
* fix(loader,plugin): fix generators path bug * cli(refactor): improve folder structure (#371) * cli(refactor): improve folder structure * chore(linting): fix linter errors * cli(filepath): use local import instead * cli(migrate): refactor error handling * chore(review): fix review comments * chore(review): fix review comments * chore(review): fix review comments * chore(version): v.2.0.14 * Add break as commit type and listed the type of commit in the documentation (#379) * docs(commits): listed the list of type of commits available * cli(init): mode support to config (#364) * cli(init): mode support to config * cli(bugfix): Allow mode "none" in CLI (#381) * cli(init): use extractMiniCSSPlugin (#363) * cli(init): skip redundant question * cli(init): use mini-css-extract-plugin * Retrieve information for CLI option from webpack schema options file (#392) * cli(refactor): fetch available modes directly from webpack options schema * cli(refactor): Retrieve information from webpackOptionSchema * cli(add): write configuration to yeoman file (#348) * misc(add): variable parity, prettify * cli(add): write config to yeoman-rc * misc(add): improve generator questions * fix(init): output file name for single output (#403) improved output filename * cli(migrate): Update migration question (#402) * cli(init): webpack4 ready (#356) * cli(init): webpack4 ready * cli(init): remove unused variable, still @next on etwp * cli(init): Allow to use default entry in `init` * cli(init): Fix typo in comment * cli(init): Optimization transform and tests * cli(init): Fix non-optimized option for splitChunks * cli(init): Add cachingGroup per entry, don't show name in prod * cli(init): Add cachingGroup's defaults, fix entry * cli(init): Add a link to where the defaults live * cli(init): Remove default caching group definition from example * Add NoEmitOnErrorsPlugin transformation (#399) * ast(migrate): handle no emit on error * ast(migrate): handle module concatenation and named modules * ast(migrate): handle module concatenation and named modules * fix(ast): checks validity of an identifier (#360) added test cases for validate identifier * cli(entry): quotes sanitization (#337) * chore: minor doc fixes * cli(entry): quotes sanitization * tests(entry): add test case for double quotes * tests(entry): update snapshots * misc(utils): entry - variable parity * misc(prop-types): sort * cli(entry): multiple entries quotes sanitization * chore(versioning): v 2.0.15 * chore(versioning): push new package version * cli(fix): remove reference to specific version during migration (#410) * fix: remove reference to specific version during migration * fix: rephrase update message * chore(docs): updated old references to the extract text plugin (#412) * chore(dev): added break to the list of type of commit * init(fix): removed references to extract text plugin * fix(commit): rollback * cli(migration): update UglifyJS transformation (#416) * cli(migration): Update UglifyJS migration file to fit webpack4 configuration * cli(migration): Add cases where require variable does not need to exist * cli(migration): Add transformation for usage of webpack.otimization.UglifyPlugin * cli(tests): Update test snapshots after updating transformation * cli(fix): fix expressionContent being null * cli(refactor): remove plugins array if empty Created function on ast-utils so every other transformation can use this. * tests: add tests for new ast-utils method * fix: fix test names and jsdoc * fix: update maxSize for utils folder * ast(cli): Recursively parse AST (#341) * ast(refactor): wip refactor * ast(refactor): wip refactor * ast(init): refactor * test(refactor): refactor test suite * tests(define): swap args * ast(parsing): refactor stuff * ast(init): refactor * ast(init): refactor tests * chore(tests): remove some unneeded tests * chore(pkg): update package.json * chore(project): clear up project structure * chore(cli): remove unneded files * chore(git): add gitignore to yeoman file * chore(deps): update pkg.json * tests(snapshots): update snapshots * tests(jest): use empty module for snapshots * tests(snap): only test one prop * chore(publishing): add semantic-release (#415) * chore(release): [WIP] add semantic-release * test(ci): wip * test(ci): add node versions * test(ci): remove extra test * tests(ci): revise * tests(ci): only push to npm on master * tests(ci): use matrix on jobs * tests(ci): revise * tests(ci): update * tests(ci): test * tests(ci): test * tests(ci): p * tests(ci): update travis.yml * chore(release): revise travis * misc(yeoman): update yeoman * chore(travis): revise travis * misc(travis): revise travis.yml * chore(travis): remove redundant code * chore(pkg): add keywords * 2.1.1 * 2.1.2 * cli(cmds): revise yargs command (#422) * use yargs.command instead of yargs.option for sub-commands * cli(node): Add node flags to CLI (#377) * feat: add support for node flags * tests: Fix node-flags test * misc: Fix test failing due to not-found webpack-cli * misc: remove comment * misc: refactor removing unecessary args * tests: add more tests to prevent argument collision * cli(cmds): remove strict * fix(node): remove node option for now * chore(lerna): refactor * chore(lerna): refactor * chore(refactor): refactor stuff * chore(package): update pkg.lock * chore(templates): Update issue templates (#432) Adds fancy templates * ast(init): add topScope prop * ast(merge): re-add merge prop * cli(lerna): refactor * chore(lerna): refactor * chore(lerna): update * chore(lint): revise * chore(refactor): refactor * chore(tests): use lerna for tests * chore(travis): don't cache me outside * chore(pkg): remove prefer global * chore(release): v.2.1.3 * chore(package.lock): update pkg.lock * fix(loader,plugin): fix generators path bug * chore(version): v.2.0.14 * Add break as commit type and listed the type of commit in the documentation (#379) * docs(commits): listed the list of type of commits available * cli(bugfix): Allow mode "none" in CLI (#381) * cli(init): use extractMiniCSSPlugin (#363) * cli(init): skip redundant question * cli(init): use mini-css-extract-plugin * Retrieve information for CLI option from webpack schema options file (#392) * cli(refactor): fetch available modes directly from webpack options schema * cli(refactor): Retrieve information from webpackOptionSchema * cli(add): write configuration to yeoman file (#348) * misc(add): variable parity, prettify * cli(add): write config to yeoman-rc * misc(add): improve generator questions * fix(init): output file name for single output (#403) improved output filename * cli(migrate): Update migration question (#402) * fix(ast): checks validity of an identifier (#360) added test cases for validate identifier * chore(versioning): v 2.0.15 * chore(versioning): push new package version * cli(fix): remove reference to specific version during migration (#410) * fix: remove reference to specific version during migration * fix: rephrase update message * chore(docs): updated old references to the extract text plugin (#412) * chore(dev): added break to the list of type of commit * init(fix): removed references to extract text plugin * fix(commit): rollback * misc(yeoman): update yeoman * cli(cmds): revise yargs command (#422) * use yargs.command instead of yargs.option for sub-commands * cli(node): Add node flags to CLI (#377) * feat: add support for node flags * tests: Fix node-flags test * misc: Fix test failing due to not-found webpack-cli * misc: remove comment * misc: refactor removing unecessary args * tests: add more tests to prevent argument collision * cli(cmds): remove strict * fix(node): remove node option for now * chore(templates): Update issue templates (#432) Adds fancy templates * cli(lerna): refactor * chore(lerna): refactor * chore(pkg): remove prefer global * chore(travis): Add encrypted private ssh key * fix(pkg): test auto setup * cli(init): revise installation steps (#441) * cli(init): revise installation steps * chore(formatting): format code * cli(tests): refactor tests * chore(travis): run lockfile cmds on tests (#444) * Update dependencies to enable Greenkeeper 🌴 (#443) chore(greenkeeper): Update dependencies to enable Greenkeeper 🌴 * chore(docs): update readme * chore(travis): add Node.js 10 (#425) * chore(travis): move npm ci to install task (#424) * chore(travis): move npm ci to install task * chore: trigger new build * chore: upgrade Node.js for Appveyor to 8 * chore: remove redundanct npm install command
1 parent bdf7e5a commit fa452a0

File tree

250 files changed

+31084
-38916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+31084
-38916
lines changed

.appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ version: "{build}"
55
environment:
66
fast_finish: true
77
matrix:
8-
- nodejs_version: "6"
8+
- nodejs_version: "8"
99
platform: x86
1010

1111
build: off

.cz-config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
// sort type values in asc
2020
types: [
2121
{ value: "ast", name: "ast: init, migrate, add, etc" },
22+
{ value: "break", name: "break: changes that break the behaviour of the cli" },
2223
{ value: "chore", name: "chore: Updating deps, docs, linting, etc" },
2324
{ value: "cli", name: "cli: Core CLI things" },
2425
{ value: "docs", name: "docs: Documentation" },

.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,13 @@ module.exports = {
7878
{
7979
"allowModules": [
8080
"webpack",
81-
"webpack-dev-server"
81+
"webpack-dev-server",
82+
"@webpack-cli/generators",
83+
"@webpack-cli/init",
84+
"@webpack-cli/migrate",
85+
"@webpack-cli/utils",
86+
"@webpack-cli/generate-loader",
87+
"@webpack-cli/generate-plugin"
8288
]
8389
}
8490
],

.github/ISSUE_TEMPLATE/Bug_report.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: "[BUG]: \U0001F41EReport"
3+
about: "Template for \U0001F98E's you encounter with webpack-cli"
4+
5+
---
6+
7+
**Describe the bug**
8+
9+
A 💯 way to do this is to provide your configuration via a GitHub gist and/or to use markdown when describing which commands you used when the error occurred! Be precise and clear in your description of the bug.
10+
11+
**What is the current behavior?**
12+
13+
This is where you elaborate on the current behavior of the cli, how it behaves normally differing from the previous version/build you did.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
**Screenshots**
26+
If applicable, add screenshots to help explain your problem.
27+
28+
**Please paste the results of `webpack-cli info` here, and mention other relevant information*
29+
30+
**Additional context**
31+
Add any other context about the problem here like linking to an similar issue you might think is the cause.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: "[FEATURE]: Feature request \U0001F914"
3+
about: "Suggest ideas you wish webpack-cli had \U0001F680"
4+
5+
---
6+
7+
**Is your feature request related to a problem? Please describe.**
8+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
9+
10+
**Describe the solution you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Describe alternatives you've considered**
14+
A clear and concise description of any alternative solutions or features you've considered.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.

.npmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
test
2+
coverage
3+
lib
4+
.travis.yml
5+
.eslintrc*
6+
.fitcommitjsrc.json
7+
.vscode
8+
.editorconfig
9+
.eslintignore
10+
__testfixtures__
11+
*.test.js
12+
*.input.js
13+
types.js
14+
*.spec.js
15+
docs
16+
jsdoc.json
17+
.appveyor.yml
18+
.codecov.yml
19+
*.snap
20+
open-bot.yml
21+
.nyc_output
22+
git_deploy_key.enc
23+
*.md

.travis.yml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1+
sudo: false
2+
notifications:
3+
email: false
14
language: node_js
5+
node_js:
6+
- "8"
7+
- "7"
8+
- "6"
29

310
matrix:
411
include:
@@ -8,6 +15,9 @@ matrix:
815
- os: linux
916
node_js: "stable"
1017
env: JOB_PART=integration
18+
- os: linux
19+
node_js: "10"
20+
env: JOB_PART=integration
1121
- os: linux
1222
node_js: "8"
1323
env: JOB_PART=integration
@@ -17,23 +27,35 @@ matrix:
1727
- os: linux
1828
node_js: "6"
1929
env: JOB_PART=integration
20-
sudo: false
21-
22-
notifications:
23-
email: false
2430

2531
before_install:
26-
- npm i -g npm
32+
# Decrypt the git_deploy_key.enc key into /tmp/git_deploy_key
33+
- openssl aes-256-cbc -K $encrypted_04be16cef0a7_key -iv $encrypted_04be16cef0a7_iv -in git_deploy_key.enc -out /tmp/git_deploy_key -d
34+
# Make sure only the current user can read the private key
35+
- chmod 600 /tmp/git_deploy_key
36+
# Create a script to return the passphrase environment variable to ssh-add
37+
- echo 'echo ${SSH_PASSPHRASE}' > /tmp/askpass && chmod +x /tmp/askpass
38+
# Start the authentication agent
39+
- eval "$(ssh-agent -s)"
40+
# Add the key to the authentication agent
41+
- DISPLAY=":0.0" SSH_ASKPASS="/tmp/askpass" setsid ssh-add /tmp/git_deploy_key </dev/null
42+
43+
- '[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest' # skipped when using node 9
2744

2845
install:
2946
- npm ci
30-
- npm install --global codecov
31-
- npm install --global eslint
47+
- npm install -g codecov
48+
- npm install -g eslint
49+
- npm install -g greenkeeper-lockfile@1
3250

33-
before_script:
34-
- export DISPLAY=:99.0
35-
- sh -e /etc/init.d/xvfb start
51+
before_script: greenkeeper-lockfile-update
52+
after_script: greenkeeper-lockfile-upload
3653

37-
script:
38-
- npm run travis:$JOB_PART
39-
- commitlint-travis
54+
jobs:
55+
include:
56+
- stage: commit lint
57+
script: commitlint-travis
58+
- stage: NPM release
59+
if: branch = master
60+
node_js: "lts/*"
61+
script: npm run travis-deploy-once "npm run semantic-release"

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
<a name="2.0.14"></a>
2+
# 2.0.14 (2018-04-05)
3+
[Full Changelog](https://github.com/webpack/webpack-cli/compare/2.0.13...2.0.14)
4+
5+
## New Features
6+
7+
* use npm ci for tests (#367) ([#368](https://github.com/webpack/webpack-cli/pull/368))
8+
* add envinfo as `webpack-cli info` command ([51ab19f](https://github.com/webpack/webpack-cli/commit/51ab19f))
9+
* --entry should override config.entry (#155) ([#358](https://github.com/webpack/webpack-cli/pull/358))
10+
11+
## Chore
12+
13+
* coverage: added reporters inside package.json ([c7d80fb](https://github.com/webpack/webpack-cli/commit/c7d80fb))
14+
* upgrade: webpack 4.2 and other dependencies ([#362](https://github.com/webpack/webpack-cli/pull/362))
15+
* version: v.2.0.13 ([2222f1d](https://github.com/webpack/webpack-cli/commit/2222f1d))
16+
17+
## CLI
18+
19+
* refactor: improve folder structure ([#371](https://github.com/webpack/webpack-cli/pull/371))
20+
21+
## Fix
22+
23+
* loader,plugin: fix generators path bug ([b4bfafb](https://github.com/webpack/webpack-cli/commit/b4bfafb))
24+
125
<a name="2.0.13"></a>
226
# 2.0.13 (2018-03-22)
327
[Full Changelog](https://github.com/webpack/webpack-cli/compare/2.0.12...2.0.13)

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,17 @@ format that includes a **type** and a **subject**:
121121
<footer>
122122
```
123123

124+
This is the list of *type* of commits that we accept:
125+
* ast
126+
* chore
127+
* cli
128+
* docs
129+
* feat
130+
* fix
131+
* misc
132+
* tests
133+
* break
134+
124135
The **header** is mandatory.
125136

126137
Any line of the commit message cannot be longer 100 characters. This allows the message to be easier

INIT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This answers to the output directory of your application. The output directory i
1616

1717
3. `Are you going to use this in production? (Y/n)`
1818

19-
If you answer `Yes` to this, we add [`ExtractTextPlugin`](https://github.com/webpack-contrib/extract-text-webpack-plugin) to your project. This means that your style files will be separated in production from the bundles where they are used. If you answer `No`, we will not use the plugin, and `Question 6` will be ignored by default.
19+
If you answer `Yes` to this, we add [`MinCssExtractPlugin`](https://github.com/webpack-contrib/mini-css-extract-plugin) to your project. This means that your style files will be separated in production from the bundles where they are used. If you answer `No`, we will not use the plugin, and `Question 6` will be ignored by default.
2020

2121
4. `Will you be using ES2015? (Y/n)`
2222

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
[![Dependency Status](https://david-dm.org/webpack/webpack-cli.svg)](https://david-dm.org/webpack/webpack-cli)
1212
[![Code Climate](https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg)](https://codeclimate.com/github/webpack/webpack-cli)
1313
[![chat on gitter](https://badges.gitter.im/webpack/webpack.svg)](https://gitter.im/webpack/webpack)
14+
[![Greenkeeper badge](https://badges.greenkeeper.io/webpack/webpack-cli.svg)](https://greenkeeper.io/)
1415

1516
# Webpack CLI
1617

bin/webpack.js renamed to cli.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88
(function() {
99
// wrap in IIFE to be able to use return
1010

11-
const resolveCwd = require("resolve-cwd");
12-
// Local version replace global one
13-
const localCLI = resolveCwd.silent("webpack-cli/bin/webpack");
14-
if (localCLI && localCLI !== __filename) {
15-
require(localCLI);
11+
const importLocal = require("import-local");
12+
// Prefer the local installation of webpack-cli
13+
if (importLocal(__filename)) {
1614
return;
1715
}
1816

1917
require("v8-compile-cache");
20-
const ErrorHelpers = require("./errorHelpers");
18+
const ErrorHelpers = require("./utils/errorHelpers");
2119

2220
const NON_COMPILATION_ARGS = [
2321
"init",
@@ -43,20 +41,23 @@
4341
});
4442

4543
if (NON_COMPILATION_CMD) {
46-
// eslint-disable-next-line
47-
require("../lib/index")(NON_COMPILATION_CMD, process.argv);
44+
// TODO: prompt if package isn't installed, run installed package otherwise.
45+
//return require(`./commands/${NON_COMPILATION_CMD}`)(...process.argv);
4846
return;
4947
}
5048

51-
const yargs = require("yargs").usage(`webpack-cli ${require("../package.json").version}
49+
const yargs = require("yargs").usage(`webpack-cli ${
50+
require("./package.json").version
51+
}
5252
5353
Usage: webpack-cli [options]
5454
webpack-cli [options] --entry <entry> --output <output>
5555
webpack-cli [options] <entries...> --output <output>
56+
webpack-cli <command> [options]
5657
5758
For more information, see https://webpack.js.org/api/cli/.`);
5859

59-
require("./config-yargs")(yargs);
60+
require("./utils/config-yargs")(yargs);
6061

6162
const DISPLAY_GROUP = "Stats options:";
6263
const BASIC_GROUP = "Basic options:";
@@ -236,7 +237,7 @@ For more information, see https://webpack.js.org/api/cli/.`);
236237

237238
let options;
238239
try {
239-
options = require("./convert-argv")(argv);
240+
options = require("./utils/convert-argv")(argv);
240241
} catch (err) {
241242
if (err.name !== "ValidationError") {
242243
throw err;
@@ -482,7 +483,9 @@ For more information, see https://webpack.js.org/api/cli/.`);
482483
} else if (stats.hash !== lastHash) {
483484
lastHash = stats.hash;
484485
const statsString = stats.toString(outputOptions);
485-
const delimiter = outputOptions.buildDelimiter ? `${outputOptions.buildDelimiter}\n` : "";
486+
const delimiter = outputOptions.buildDelimiter
487+
? `${outputOptions.buildDelimiter}\n`
488+
: "";
486489
if (statsString) stdout.write(`${statsString}\n${delimiter}`);
487490
}
488491
if (!options.watch && stats.hasErrors()) {

0 commit comments

Comments
 (0)