Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack-cli V2 #207

Merged
merged 110 commits into from
Dec 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
62b332d
add remove and add options
evenstensberg Dec 6, 2017
d3c33e0
initial work on add
evenstensberg Dec 6, 2017
356ed35
refactor for use in remove also
evenstensberg Dec 6, 2017
75089eb
[WIP]
evenstensberg Dec 9, 2017
ecb615e
do some refactoring
evenstensberg Dec 9, 2017
d018b24
refactoring
evenstensberg Dec 9, 2017
832997d
Refactor & WIP on add/remove
evenstensberg Dec 9, 2017
1f5e978
[WIP] add plugin
evenstensberg Dec 10, 2017
bb12ecb
[WIP] refactoring
evenstensberg Dec 10, 2017
77c399d
add update and its relative generators
evenstensberg Dec 10, 2017
cf09852
[WIP] add api
evenstensberg Dec 11, 2017
b265fbe
add glob for multiple path searches
evenstensberg Dec 11, 2017
ea19c66
[WIP] plugins API
evenstensberg Dec 12, 2017
9a72beb
Use env preset (#197)
Dec 12, 2017
a5abdfe
wip
evenstensberg Dec 12, 2017
c8f661f
update package.lock
evenstensberg Dec 12, 2017
495e274
[WIP] ast modification API
evenstensberg Dec 12, 2017
2865b40
[WIP] AST modification API
evenstensberg Dec 12, 2017
83e368a
use webpack-next dep to get UT to pass
evenstensberg Dec 12, 2017
736b7d2
add update alias
evenstensberg Dec 13, 2017
82c64db
add support for npm installation
evenstensberg Dec 13, 2017
541ba62
RawList -> List
evenstensberg Dec 13, 2017
d6b7475
[WIP] entry api
evenstensberg Dec 13, 2017
ea5ec2d
Entry api
evenstensberg Dec 13, 2017
2e6774e
remove validate schema & some mocks
evenstensberg Dec 13, 2017
50ca316
remove some dependencies & update travis temporarily
evenstensberg Dec 13, 2017
ee31b67
use webpack as optional dependency (#202)
evenstensberg Dec 13, 2017
757d5eb
use yarn instead of npm (#203)
evenstensberg Dec 13, 2017
688c426
downgrade prettier-eslint-cli and remove ajv deps
evenstensberg Dec 13, 2017
db79b30
[WIP] transformations
evenstensberg Dec 13, 2017
a8a291c
yarn commands on CI
evenstensberg Dec 13, 2017
8f20915
re-add travis versions
evenstensberg Dec 14, 2017
426e841
cleanup: Refactor for readability, run formatter
Dec 15, 2017
b639c77
Refactor for readability (v2 branch) (#214)
Dec 15, 2017
804554d
remove dist
evenstensberg Dec 15, 2017
0807aa3
remove comment in add generator
evenstensberg Dec 15, 2017
ce31e81
use devServerSchema
evenstensberg Dec 15, 2017
3a49e16
add support for enum props too
evenstensberg Dec 15, 2017
a8da6b4
feature(defaults): remove entry and output.path validation (#217)
TheLarkInn Dec 16, 2017
6827398
[WIP] working on support for all props
evenstensberg Dec 16, 2017
75e6006
Comment the generator, polish last draft of it
evenstensberg Dec 16, 2017
a4e5921
Add add transform for context
evenstensberg Dec 16, 2017
524ef4b
update tests and fix lint errors
evenstensberg Dec 17, 2017
b4b874b
update testfixtures
evenstensberg Dec 17, 2017
fd32a9a
tests for devServer & set up ast for it
evenstensberg Dec 17, 2017
76885e0
fix devtool transform and add unit test
evenstensberg Dec 17, 2017
518915f
add entry transform and tests on add
evenstensberg Dec 17, 2017
3e0310a
add testfixtures
evenstensberg Dec 17, 2017
577f881
add yarn commands on pkg.json and disable some wip tests
evenstensberg Dec 17, 2017
700bf0f
Bugfix/user friendly startup message (#218)
sumit-gupta91 Dec 17, 2017
c3cb2c1
cli and webpack are both supported
evenstensberg Dec 17, 2017
d8b357e
add before install to travis config
evenstensberg Dec 17, 2017
88aaaa2
add plugins for travis
evenstensberg Dec 17, 2017
972d4cd
use prettier at migrate
evenstensberg Dec 17, 2017
e1f512c
add mode transform and tests
evenstensberg Dec 17, 2017
48294ee
add unit test for emptycallablefunc + testfixtures
evenstensberg Dec 17, 2017
769e92e
update webpack-addons
evenstensberg Dec 17, 2017
fba04da
update yarn.lock
evenstensberg Dec 17, 2017
b416d9c
remove fork of recast
evenstensberg Dec 17, 2017
28680c9
add tests for others and new transforms
evenstensberg Dec 17, 2017
47de46a
cleanup some conventions
evenstensberg Dec 18, 2017
285846a
add JSdoc & documentation
evenstensberg Dec 18, 2017
f400c24
remove jsdoc from npm dep
evenstensberg Dec 18, 2017
017108b
add entry questions
evenstensberg Dec 18, 2017
8b1ee49
underscore on empty params
evenstensberg Dec 18, 2017
6ddbf08
work on unit tests
evenstensberg Dec 18, 2017
0abb277
adds unit tests for watch
evenstensberg Dec 18, 2017
c9ee350
add utest for topscope add
evenstensberg Dec 18, 2017
c4c68e8
add testfixture for topScope
evenstensberg Dec 18, 2017
5d4430a
add migration validation
evenstensberg Dec 18, 2017
992bfe2
adds serve alias
evenstensberg Dec 18, 2017
1f24d19
small improvements
evenstensberg Dec 19, 2017
ab94211
adds @std/esm and babel-register alias/compat
evenstensberg Dec 19, 2017
595ca69
small tweaks to jsdoc & depepdencies
evenstensberg Dec 19, 2017
a894b18
merge master to v2
evenstensberg Dec 19, 2017
b996799
update testresults
evenstensberg Dec 19, 2017
2f10715
node 5 is supported
evenstensberg Dec 19, 2017
fee29ff
adds schema for plugins
evenstensberg Dec 19, 2017
d86e1ce
node 7 on CI
evenstensberg Dec 19, 2017
4f9a4f8
[WIP] webpack make
evenstensberg Dec 19, 2017
9190c00
[WIP] esm support
evenstensberg Dec 19, 2017
2fcc814
don't invoke function on require
evenstensberg Dec 19, 2017
595117d
update supported targets
evenstensberg Dec 19, 2017
9b2f6f5
fix -r issues & add tests + update docs
evenstensberg Dec 19, 2017
c5c9746
add initial appveyor config
evenstensberg Dec 19, 2017
b548783
add initial codecov config
evenstensberg Dec 19, 2017
ed68dbc
ci tests for jest fix
evenstensberg Dec 19, 2017
a6bb9e4
fix typo in test case
evenstensberg Dec 19, 2017
4d22670
change devServer location
evenstensberg Dec 19, 2017
65511f2
fix invalid uglify warning
evenstensberg Dec 20, 2017
14c1369
add coverage collecting
evenstensberg Dec 20, 2017
07e18f4
update README.md
evenstensberg Dec 20, 2017
975fe51
adds codecov after-suc
evenstensberg Dec 20, 2017
e36f45b
new ci commands
evenstensberg Dec 20, 2017
9a0bddf
specify report
evenstensberg Dec 20, 2017
8269461
Remove mention of commit validator from docs (#222)
peter-mouland Dec 20, 2017
7c713ce
remove before-script cmd on codecov
evenstensberg Dec 20, 2017
3c90e83
add ResolveLoader distinguished from resolve
evenstensberg Dec 20, 2017
6a50dcf
resolve and resolveLoader is fixed
evenstensberg Dec 20, 2017
d468a90
fixing plugins api for add
evenstensberg Dec 20, 2017
0a4114b
remove some args
evenstensberg Dec 20, 2017
8ae1f41
remove return from require
evenstensberg Dec 20, 2017
5ce0c9b
normalize test paths for appveyor to be happy
evenstensberg Dec 20, 2017
5a83c5c
use snapshots for migrate testing
evenstensberg Dec 20, 2017
dd20dca
add codecov to appveyor build
evenstensberg Dec 20, 2017
7e57314
add codecov as ci cmd
evenstensberg Dec 20, 2017
0564ceb
add v8-compile-cache and fix error with pluginSchema
evenstensberg Dec 21, 2017
04f0f66
adds module ast
evenstensberg Dec 21, 2017
8112b98
[Feature] Open bot to the webpack-cli (#224)
ematipico Dec 21, 2017
cce928a
adds new jsdocs
evenstensberg Dec 21, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
29 changes: 29 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
clone_depth: 10

version: "{build}"

environment:
fast_finish: true
matrix:
- nodejs_version: "6"
platform: x86

build: off

install:
- ps: Install-Product node $env:nodejs_version $env:platform
- npm install yarn -g
- yarn
- yarn add global codecov

test_script:
- node --version
- npm --version
- yarn --version
- which yarn
- yarn prepare
- yarn lint
- yarn test:ci

cache:
- node_modules -> appveyor.yml,package.json,yarn.lock
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"presets": ["es2015", "stage-3", "flow"]
"presets": ["env", "stage-3", "flow"]
}
15 changes: 15 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
comment: off

parsers:
javascript:
enable_partials: yes

coverage:
status:
project:
default:
threshold: 1%
if_not_found: success
patch:
default:
if_not_found: success
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
coverage
test
dist
docs
9 changes: 8 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ module.exports = {
}
],
"node/no-unpublished-bin": "error",
"node/no-unpublished-require": "error",
"node/no-unpublished-require": [
"error",
{
"allowModules": [
"webpack"
]
}
],
"eol-last": ["error", "always"],
"newline-per-chained-call": "off",
"node/process-exit-as-throw": "error"
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# External dependencies
# IDE folders
.idea

# Mac OS X Finder
.DS_Store
Expand All @@ -13,7 +14,7 @@ npm-debug.*
yarn-error.log

# Jest Coverage
coverage
/coverage

# Distribution Build
dist
Expand Down
5 changes: 4 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ lib
.vscode
.editorconfig
.eslintignore
__mocks__
__testfixtures__
*.test.js
*.input.js
types.js
*.spec.js
docs
jsdoc.json
.appveyor.yml
.codecov.yml
34 changes: 24 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
language: node_js

node_js:
- "4"
- "5"
- "6"
- "stable"
matrix:
include:
- os: linux
node_js: "stable"
env: JOB_PART=lint
- os: linux
node_js: "stable"
env: JOB_PART=integration
- os: linux
node_js: "8"
env: JOB_PART=integration
- os: linux
node_js: "7"
env: JOB_PART=integration
- os: linux
node_js: "6"
env: JOB_PART=integration

sudo: false

notifications:
email: false

install:
- yarn add global codecov

before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- bash <(curl -s https://codecov.io/bash)

script:
- npm run prepublish
- npm run lint
- npm run test
after_success:
- bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

script: npm run travis:$JOB_PART
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ In case you are suggesting a new feature, we will match your idea with our curre
*Note: Node 6 or greater would be better for "best results".*
* Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli).
* `git clone <your-clone-url> && cd webpack-cli`
* Install the commit validator: `npm run install-commit-validator`

### Setup with npm
* Install the dependencies: `npm install`
Expand Down
8 changes: 4 additions & 4 deletions MIGRATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## webpack-migrate

The `migrate` feature eases the transition from [version 1](http://webpack.github.io/docs/) to [version 2](https://gist.github.com/sokra/27b24881210b56bbaff7). `migrate`
The `migrate` feature eases the transition from [version 1](http://webpack.github.io/docs/) to [version 2](https://gist.github.com/sokra/27b24881210b56bbaff7). `migrate`
also allows users to switch to the new version of webpack without having to extensively [refactor](https://webpack.js.org/guides/migrating/).

### Usage
Expand Down Expand Up @@ -39,7 +39,7 @@ module.exports = {
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015']
presets: ['env']
}
},
{
Expand Down Expand Up @@ -122,7 +122,7 @@ module.exports = {
loader: 'babel-loader'
}],
options: {
presets: ['es2015']
presets: ['env']
}
},
{
Expand Down Expand Up @@ -153,7 +153,7 @@ module.exports = {

In summary, we can see the follow changes were made
1. The webpack schema for using loaders has changed
- `loaders` is now `module.rules`
- `loaders` is now `module.rules`
- `query` is now `options`
1. All loaders now have to have the *loader* suffix, e.g. `babel` -> `babel-loader`

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</div>

[![Build Status](https://travis-ci.org/webpack/webpack-cli.svg)](https://travis-ci.org/webpack/webpack-cli)
[![Build status](https://ci.appveyor.com/api/projects/status/c2a37nlrfv9mg64f?svg=true)](https://ci.appveyor.com/project/ev1stensberg/webpack-cli)
[![Dependency Status](https://david-dm.org/webpack/webpack-cli.svg)](https://david-dm.org/webpack/webpack-cli)
[![Code Climate](https://codeclimate.com/github/webpack/webpack-cli/badges/gpa.svg)](https://codeclimate.com/github/webpack/webpack-cli)
[![chat on gitter](https://badges.gitter.im/webpack/webpack.svg)](https://gitter.im/webpack/webpack)
Expand All @@ -28,3 +29,8 @@ The `init` feature allows users to get started with webpack, fast. Through scaff
`webpack-cli init webpack-addons-<package>`

[Read more about scaffolding](SCAFFOLDING.md)

## Contributing and Internal Documentation

The webpack family welcomes any contributor, small or big. We are happy to elaborate, guide you through the source code and find issues you might want to work on! To get started have a look at our [documentation on contributing](CONTRIBUTING.md), or our [Internal Documentation]()

23 changes: 0 additions & 23 deletions __mocks__/creator/validate-options.mock.js

This file was deleted.

39 changes: 0 additions & 39 deletions __mocks__/inquirer/resolve.mock.js

This file was deleted.

34 changes: 32 additions & 2 deletions bin/config-yargs.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function(yargs) {
describe:
"Initializes a new webpack configuration or loads a" +
"\n" +
"plugin if specified",
"addon if specified",
group: INIT_GROUP
},
migrate: {
Expand All @@ -28,6 +28,28 @@ module.exports = function(yargs) {
"Migrate your webpack configuration from webpack 1 to webpack 2",
group: INIT_GROUP
},
add: {
type: "boolean",
describe: "Adds a webpack component to your configuration file",
group: INIT_GROUP
},
/*
remove: {
type: "boolean",
describe: "Removes a webpack component to your configuration file",
group: INIT_GROUP
},
update: {
type: "boolean",
describe: "Updates a webpack component to your configuration file",
group: INIT_GROUP
},
make: {
type: "boolean",
describe: "Converts a webpack configuration to a makefile",
group: INIT_GROUP
},
*/
"generate-loader": {
type: "boolean",
describe: "Generates a new webpack loader project",
Expand All @@ -38,14 +60,22 @@ module.exports = function(yargs) {
describe: "Generates a new webpack plugin project",
group: INIT_GROUP
},

config: {
type: "string",
describe: "Path to the config file",
group: CONFIG_GROUP,
defaultDescription: "webpack.config.js or webpackfile.js",
requiresArg: true
},
"config-register": {
type: "array",
alias: "r",
describe:
"Preload one or more modules before loading the webpack configuration",
group: CONFIG_GROUP,
defaultDescription: "module id or path",
requiresArg: true
},
"config-name": {
type: "string",
describe: "Name of the config to use",
Expand Down
Loading