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

feat: next major version #4296

Merged
merged 24 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a082ef7
build!: the minimum required Node.js version is `18.12.0` (#4291)
snitin315 Oct 21, 2024
f454de6
chore: update dev deps (#4292)
snitin315 Oct 21, 2024
f74c60a
chore: remove obselete snapshots (#4298)
snitin315 Oct 22, 2024
af01f44
ci: avoid multiple CI runs when pushed to next (#4300)
snitin315 Oct 22, 2024
fa6057c
refactor!: remove `init`, `loader`, & `plugin` commands (#4297)
snitin315 Oct 22, 2024
a61a15a
refactor!: drop support for webpack-dev-server@v4 (#4301)
snitin315 Oct 23, 2024
59e9117
refactor!: minimum supported webpack version is `5.82.0` (#4303)
snitin315 Oct 23, 2024
540d501
chore: update commander.js to v12 (#4315)
snitin315 Nov 4, 2024
ca462df
fix: improve help output for possible values (#4316)
snitin315 Nov 4, 2024
c7f5264
ci: update `pnpm/action-setup` to v4 (#4320)
snitin315 Nov 6, 2024
6dfc362
chore: update normalizedStderr (#4319)
snitin315 Nov 6, 2024
9e91679
feat!: remove `--define-process-env-node-env` in favor of `--config-n…
snitin315 Nov 6, 2024
2163b6a
ci: add Node.js v23 (#4331)
snitin315 Dec 17, 2024
20648c7
chore: fix todo
alexander-akait Dec 18, 2024
c9ad814
test: fix
alexander-akait Dec 18, 2024
3e8ef63
docs: fix
alexander-akait Dec 18, 2024
1329f29
refactor: types
alexander-akait Dec 18, 2024
56c7690
chore: webpack-merge
alexander-akait Dec 18, 2024
23df936
fix: single element config array in `webpack.config.js` now works in …
alexander-akait Dec 18, 2024
aff5e97
refactor: resolve todo
alexander-akait Dec 18, 2024
f0b8b40
chore(deps): `@inquirer/prompts`
alexander-akait Dec 18, 2024
63f05e3
chore(deps): avoid using `rimraf`
alexander-akait Dec 18, 2024
1dcdad5
test: fix
alexander-akait Dec 18, 2024
b4f9b0c
docs: improvement
alexander-akait Dec 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ module.exports = {
extends: ["eslint:recommended", "plugin:n/recommended", "prettier"],
parserOptions: { ecmaVersion: 2018, sourceType: "script" },
plugins: ["n"],
settings: {
n: {
allowModules: ["@webpack-cli/generators"],
},
},
env: {
node: true,
es6: true,
Expand Down
29 changes: 3 additions & 26 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@ on:
push:
branches:
- master
- next
pull_request:
branches:
- master
- next
workflow_dispatch:
inputs:
tags:
description: "Test description"

permissions:
contents: read
Expand Down Expand Up @@ -63,23 +58,10 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
node-version: [18.x, 20.x, 22.x]
node-version: [18.x, 20.x, 22.x, 23.x]
shard: ["1/4", "2/4", "3/4", "4/4"]
webpack-version: [latest]
dev-server-version: [latest]
include:
- node-version: 14.x
os: ubuntu-latest
dev-server-version: 4
- node-version: 16.x
os: ubuntu-latest
dev-server-version: 4
- node-version: 18.x
os: ubuntu-latest
dev-server-version: 4
- node-version: 20.x
os: ubuntu-latest
dev-server-version: 4

steps:
- uses: actions/checkout@v4
Expand All @@ -92,18 +74,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: "yarn"

# Setup pnpm v7 for tests which is compatible with Node.js >=14
- uses: pnpm/action-setup@v2
- uses: pnpm/action-setup@v4
with:
version: 7
version: 9

- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines --ignore-scripts

- name: Install webpack-dev-server ${{ matrix.dev-server-version }}
if: matrix.dev-server-version == '4'
run: yarn add -W -D webpack-dev-server@${{ matrix.dev-server-version }} --ignore-engines --ignore-scripts

- name: Prepare environment for tests
run: yarn build:ci

Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ Thus, webpack CLI provides different commands for many common tasks.
- [`build|bundle|b [entries...] [options]`](https://webpack.js.org/api/cli/#build) - Run webpack (default command, can be omitted).
- [`configtest|t [config-path]`](https://webpack.js.org/api/cli/#configtest) - Validate a webpack configuration.
- [`help|h [command] [option]`](https://webpack.js.org/api/cli/#help) - Display help for commands and options.
- [`init|create|new|c|n [generation-path] [options]`](https://webpack.js.org/api/cli/#init) - Create a new webpack project.
- [`info|i [options]`](https://webpack.js.org/api/cli/#info) - Returns information related to the local environment.
- [`plugin|p [output-path] [options]`](https://webpack.js.org/api/cli/#plugin) - Initiate new plugin project.
- [`loader|l [output-path] [options]`](https://webpack.js.org/api/cli/#loader) - Initiate new loader project.
- [`serve|server|s [entries...] [options]`](https://webpack.js.org/api/cli/#serve) - Use webpack with a development server that provides live reloading.
- [`version|v [commands...]`](https://webpack.js.org/api/cli/#version) - Output the version number of `webpack`, `webpack-cli`, `webpack-dev-server`, and commands.
- [`watch|w [entries...] [options]`](https://webpack.js.org/api/cli/#watch) - Run webpack and watch for files changes.
Expand All @@ -74,14 +71,10 @@ If you have followed the [Getting Started](https://webpack.js.org/guides/getting

Otherwise, you would need to install webpack CLI and the packages you want to use.

If you want to create a fresh webpack project, the `init` command will guide you through setting up a project. Run the command as stated below.
If you want to create a fresh webpack project run the command as stated below:

```sh
npm i webpack-cli @webpack-cli/init
```

```sh
npx webpack-cli init
npx create-webpack-app init
```

You will then be prompted for some questions about which features you want to use, such as `scss`, `typescript`, `PWA` support or other features.
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"url": "https://opencollective.com/webpack"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"keywords": [
"webpack",
Expand Down Expand Up @@ -67,8 +67,8 @@
"colorette": "^2.0.16",
"concat-stream": "^2.0.0",
"cspell": "^8.3.2",
"css-loader": "^6.10.0",
"del-cli": "^5.0.0",
"css-loader": "^7.1.2",
"del-cli": "^6.0.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-n": "^17.10.2",
Expand All @@ -80,14 +80,13 @@
"lerna": "^8.1.8",
"lint-staged": "^15.2.9",
"mini-css-extract-plugin": "^2.6.1",
"nyc": "^15.1.0",
"nyc": "^17.1.0",
"prettier": "^3.3.3",
"readable-stream": "^4.5.2",
"rimraf": "^3.0.2",
"sass": "^1.54.9",
"sass-loader": "^13.0.2",
"sass-loader": "^16.0.2",
"strip-ansi": "^6.0.1",
"style-loader": "^3.3.1",
"style-loader": "^4.0.0",
"ts-jest": "^29.0.1",
"ts-loader": "^9.3.1",
"ts-node": "^10.9.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/configtest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"types": "lib/index.d.ts",
"license": "MIT",
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"publishConfig": {
"access": "public"
Expand Down
28 changes: 25 additions & 3 deletions packages/create-webpack-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## About

- `create-webpack-app` is a cli tool that enables developers to scaffold a new webpack project quickly. It provides developers with a flexible set of commands to increase speed when setting up a custom webpack project. webpack CLI addresses these needs by providing tools to improve the setup of custom webpack configuration.
- It also supports several front-end frameworks and libraries like React, Angular, Vue, Svelte, etc.
- It also supports several front-end frameworks and libraries like React, Vue, Svelte and pure project.
- Webpack Loader and Plugin scaffolding is also supported.

## Supported arguments and commands
Expand All @@ -20,6 +20,12 @@
npx create-webpack-app [command] [options]
```

### Commands

- `init` (also used by default when nothing specified) - project generator
- `loader` - loader generator
- `plugin` - plugin generator

### CLI options

**To generate default template**
Expand All @@ -31,7 +37,13 @@ npx create-webpack-app
**To generate with default answers**

```bash
npx create-webpack-app -f, --force
npx create-webpack-app -f
```

or

```bash
npx create-webpack-app --force
```

**To generate in a specified path**
Expand All @@ -44,5 +56,15 @@ npx create-webpack-app [generation-path]

```bash
npx create-webpack-app --template <template-name>

```

Available templates:

- `default` (used by default when nothing specified) - generate a basic template for JS(TS)/CSS/HTML without any frameworks
- [`react`](https://react.dev/)
- [`vue`](https://vuejs.org/)
- [`svelte`](https://svelte.dev/)

Available templates for `loader` and `plugin` generators:

- `default` (used by default when nothing specified) - generate bootstrap code
2 changes: 1 addition & 1 deletion packages/create-webpack-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"webpack-cli": "^5.x.x"
},
"dependencies": {
"@inquirer/prompts": "^5.1.2",
"@inquirer/prompts": "^7.2.0",
"colorette": "^2.0.20",
"commander": "^12.1.0",
"cross-spawn": "^7.0.3",
Expand Down
Loading
Loading