Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"Zenitsu",
"quickstart",
"pinia",
"watchpack"
"watchpack",
"Stensberg"
],
"dictionaries": ["npm", "software-terms"],
"ignorePaths": [
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"postCreateCommand": "yarn install && yarn build",
"postCreateCommand": "npm install && npm run build",
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
30 changes: 14 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Table of Contents
- [Your first Contribution](#your-first-contribution)
- [Setup](#setup)
- [Running Tests](#running-tests)
- [Using yarn](#using-yarn)
- [Using npm](#using-npm)
- [Editor Config](#editor-config)
- [Dependencies](#dependencies)
- [Branching Model](#branching-model)
Expand Down Expand Up @@ -57,67 +57,65 @@ In case you are suggesting a new feature, we will match your idea with our curre
- 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`

- We use [yarn](https://yarnpkg.com/lang/en/) workspaces, please install it:
- We use [npm](https://docs.npmjs.com/), please install it:

Read the [Installation Guide](https://yarnpkg.com/en/docs/install) on their official website for detailed instructions on how to install Yarn.

> Using yarn is not a requirement, [npm](https://www.npmjs.com/) is included in node.
Read the [Installation Guide](https://docs.npmjs.com/cli/v11/configuring-npm/install) on their official website for detailed instructions on how to install NPM.

- Install the dependencies:

```bash
yarn install
npm install
```

- Build all the submodules before building for the first time

```bash
yarn build
npm run build
```

> If you are a Docker and Visual Studio Code user, you can quickstart development using [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) Extension

## Running Tests

### Using yarn
### Using npm

- Run all the tests with:

```bash
yarn test
npm run test
```

- Run CLI tests with:

```bash
yarn test:cli
npm run test:cli
```

- Run tests of all packages:

```bash
yarn test:packages
npm run test:packages
```

- Test a single CLI test case:

> Must run from root of the project

```bash
yarn jest path/to/my-test.js
npm run jest path/to/my-test.js
```

- You can also install jest globally and run tests without npx:

```bash
yarn global add jest
npm install --global jest
jest path/to/my-test.js
```

- You can run the linters:

```bash
yarn lint
npm run lint
```

## Editor Config
Expand All @@ -128,7 +126,7 @@ The [.editorconfig](https://github.com/webpack/webpack-cli/blob/main/.editorconf

This is a multi-package repository and dependencies are managed using [lerna](https://lerna.js.org/)

> If you are adding or updating any dependency, please commit the updated `yarn.lock` file.
> If you are adding or updating any dependency, please commit the updated `package-lock.json` file.

To update dependencies, import each dependency and make sure the command line build passes. The dependency should support our minimal supported node version for webpack, found in `package.json`.

Expand Down Expand Up @@ -249,7 +247,7 @@ documentation.

## Releasing

Run `yarn publish:monorepo` to build all packages and bump versions, this will then get published on npm.
Run `npm run publish:monorepo` to build all packages and bump versions, this will then get published on npm.

## Join the development

Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: "npm"

- name: Install dependencies
run: yarn --frozen-lockfile
run: npm ci --force --legacy-peer-deps --strict-peer-deps

- name: Build
run: yarn build
run: npm run build

- name: Lint
run: yarn lint
run: npm run lint

build:
name: Tests and Coverage - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}, DevServer ${{ matrix.dev-server-version }} (${{ matrix.shard }})
Expand Down Expand Up @@ -73,20 +73,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: "npm"

- uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines --ignore-scripts
run: npm ci --ignore-engines --ignore-scripts --force --legacy-peer-deps --strict-peer-deps

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

- name: Run tests and generate coverage
run: yarn test:coverage --ci --shard=${{ matrix.shard }}
run: npm run test:coverage --ci --shard=${{ matrix.shard }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand All @@ -113,16 +113,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: "npm"

- name: Install dependencies
run: yarn --frozen-lockfile --ignore-engines
run: npm ci --ignore-engines --force --legacy-peer-deps --strict-peer-deps

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

- name: Run smoketests
run: yarn test:smoketests
run: npm run test:smoketests

commitlint:
name: Lint Commit Messages
Expand All @@ -138,9 +138,9 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
cache: "yarn"
cache: "npm"

- run: yarn --frozen-lockfile
- run: npm ci --force --legacy-peer-deps --strict-peer-deps

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/update-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
cache: "npm"

- name: Install dependencies
run: yarn --frozen-lockfile
run: npm ci

- name: Install latest webpack and webpack-dev-server version
run: yarn add -W webpack-dev-server@latest webpack@latest
run: npm ci --save webpack-dev-server@latest webpack@latest

- name: Build
run: yarn build
run: npm run build

- name: Update docs
run: yarn update:docs
run: npm run update:docs

- name: Fix formatting
run: yarn lint:prettier --write
run: npm run lint:prettier --write

- name: Commit updated docs
uses: EndBug/add-and-commit@v9.0.0
with:
add: "*.md"
message: "docs: update options"
author_name: Nitin Kumar
author_email: snitin315@gmail.com
author_name: Even Stensberg
author_email: evenstensberg@gmail.com
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ node_modules
test/**/node_modules

# Lock files
yarn.lock
test/**/yarn.lock
test/**/package-json.lock
!test/api/**/yarn.lock
Expand All @@ -40,7 +41,6 @@ lerna-debug.log
.yo-rc.json

# package-lock file
package-lock.json
!test/api/**/package-lock.json

junit.xml
Expand All @@ -56,6 +56,7 @@ packages/**/*.map
# build files
packages/**/lib
packages/**/yarn.lock
packages/**/package-lock.json

# test output files
test/js/*
Expand Down
1 change: 0 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"lerna": "3.20.2",
"packages": ["packages/*"],
"version": "independent",
"npmClient": "yarn",
"command": {
"version": {
"message": "chore(release): publish new version",
Expand Down
Loading
Loading