Skip to content

Commit b4d9af1

Browse files
committed
chore: migrate from yarn to npm
1 parent 911d3d0 commit b4d9af1

File tree

9 files changed

+20761
-52
lines changed

9 files changed

+20761
-52
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@
104104
"Zenitsu",
105105
"quickstart",
106106
"pinia",
107-
"watchpack"
107+
"watchpack",
108+
"Stensberg"
108109
],
109110
"dictionaries": ["npm", "software-terms"],
110111
"ignorePaths": [

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"settings": {
66
"terminal.integrated.shell.linux": "/bin/bash"
77
},
8-
"postCreateCommand": "yarn install && yarn build",
8+
"postCreateCommand": "npm install && npm run build",
99
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
1010
}

.github/CONTRIBUTING.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Table of Contents
1111
- [Your first Contribution](#your-first-contribution)
1212
- [Setup](#setup)
1313
- [Running Tests](#running-tests)
14-
- [Using yarn](#using-yarn)
14+
- [Using npm](#using-npm)
1515
- [Editor Config](#editor-config)
1616
- [Dependencies](#dependencies)
1717
- [Branching Model](#branching-model)
@@ -57,67 +57,65 @@ In case you are suggesting a new feature, we will match your idea with our curre
5757
- Fork the **webpack-cli** repo at [https://github.com/webpack/webpack-cli](https://github.com/webpack/webpack-cli).
5858
- `git clone <your-clone-url> && cd webpack-cli`
5959

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

62-
Read the [Installation Guide](https://yarnpkg.com/en/docs/install) on their official website for detailed instructions on how to install Yarn.
63-
64-
> Using yarn is not a requirement, [npm](https://www.npmjs.com/) is included in node.
62+
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.
6563

6664
- Install the dependencies:
6765

6866
```bash
69-
yarn install
67+
npm install
7068
```
7169

7270
- Build all the submodules before building for the first time
7371

7472
```bash
75-
yarn build
73+
npm run build
7674
```
7775

7876
> 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
7977
8078
## Running Tests
8179

82-
### Using yarn
80+
### Using npm
8381

8482
- Run all the tests with:
8583

8684
```bash
87-
yarn test
85+
npm run test
8886
```
8987

9088
- Run CLI tests with:
9189

9290
```bash
93-
yarn test:cli
91+
npm run test:cli
9492
```
9593

9694
- Run tests of all packages:
9795

9896
```bash
99-
yarn test:packages
97+
npm run test:packages
10098
```
10199

102100
- Test a single CLI test case:
103101

104102
> Must run from root of the project
105103
106104
```bash
107-
yarn jest path/to/my-test.js
105+
npm run jest path/to/my-test.js
108106
```
109107

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

112110
```bash
113-
yarn global add jest
111+
npm install --global jest
114112
jest path/to/my-test.js
115113
```
116114

117115
- You can run the linters:
118116

119117
```bash
120-
yarn lint
118+
npm run lint
121119
```
122120

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

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

131-
> If you are adding or updating any dependency, please commit the updated `yarn.lock` file.
129+
> If you are adding or updating any dependency, please commit the updated `package-lock.json` file.
132130
133131
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`.
134132

@@ -249,7 +247,7 @@ documentation.
249247

250248
## Releasing
251249

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

254252
## Join the development
255253

.github/workflows/nodejs.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,16 @@ jobs:
3636
uses: actions/setup-node@v4
3737
with:
3838
node-version: ${{ matrix.node-version }}
39-
cache: "yarn"
39+
cache: "npm"
4040

4141
- name: Install dependencies
42-
run: yarn --frozen-lockfile
42+
run: npm ci
4343

4444
- name: Build
45-
run: yarn build
45+
run: npm run build
4646

4747
- name: Lint
48-
run: yarn lint
48+
run: npm run lint
4949

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

7878
- uses: pnpm/action-setup@v4
7979
with:
8080
version: 9
8181

8282
- name: Install dependencies
83-
run: yarn --frozen-lockfile --ignore-engines --ignore-scripts
83+
run: npm ci --ignore-engines --ignore-scripts
8484

8585
- name: Prepare environment for tests
86-
run: yarn build:ci
86+
run: npm run build:ci
8787

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

9191
- name: Upload coverage to Codecov
9292
uses: codecov/codecov-action@v5
@@ -113,16 +113,16 @@ jobs:
113113
uses: actions/setup-node@v4
114114
with:
115115
node-version: ${{ matrix.node-version }}
116-
cache: "yarn"
116+
cache: "npm"
117117

118118
- name: Install dependencies
119-
run: yarn --frozen-lockfile --ignore-engines
119+
run: npm ci --ignore-engines
120120

121121
- name: Prepare environment for tests
122-
run: yarn build:ci
122+
run: npm run build:ci
123123

124124
- name: Run smoketests
125-
run: yarn test:smoketests
125+
run: npm run test:smoketests
126126

127127
commitlint:
128128
name: Lint Commit Messages
@@ -138,9 +138,9 @@ jobs:
138138
- uses: actions/setup-node@v4
139139
with:
140140
node-version: "lts/*"
141-
cache: "yarn"
141+
cache: "npm"
142142

143-
- run: yarn --frozen-lockfile
143+
- run: npm ci
144144

145145
- name: Validate PR commits with commitlint
146146
if: github.event_name == 'pull_request'

.github/workflows/update-docs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,27 @@ jobs:
3131
uses: actions/setup-node@v4
3232
with:
3333
node-version: ${{ matrix.node-version }}
34-
cache: "yarn"
34+
cache: "npm"
3535

3636
- name: Install dependencies
37-
run: yarn --frozen-lockfile
37+
run: npm ci
3838

3939
- name: Install latest webpack and webpack-dev-server version
40-
run: yarn add -W webpack-dev-server@latest webpack@latest
40+
run: npm install --save webpack-dev-server@latest webpack@latest
4141

4242
- name: Build
43-
run: yarn build
43+
run: npm run build
4444

4545
- name: Update docs
46-
run: yarn update:docs
46+
run: npm run update:docs
4747

4848
- name: Fix formatting
49-
run: yarn lint:prettier --write
49+
run: npm run lint:prettier --write
5050

5151
- name: Commit updated docs
5252
uses: EndBug/[email protected]
5353
with:
5454
add: "*.md"
5555
message: "docs: update options"
56-
author_name: Nitin Kumar
57-
author_email: snitin315@gmail.com
56+
author_name: Even Stensberg
57+
author_email: evenstensberg@gmail.com

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ node_modules
1818
test/**/node_modules
1919

2020
# Lock files
21+
yarn.lock
2122
test/**/yarn.lock
2223
test/**/package-json.lock
2324
!test/api/**/yarn.lock
@@ -40,7 +41,6 @@ lerna-debug.log
4041
.yo-rc.json
4142

4243
# package-lock file
43-
package-lock.json
4444
!test/api/**/package-lock.json
4545

4646
junit.xml
@@ -56,6 +56,7 @@ packages/**/*.map
5656
# build files
5757
packages/**/lib
5858
packages/**/yarn.lock
59+
packages/**/package-lock.json
5960

6061
# test output files
6162
test/js/*

lerna.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"lerna": "3.20.2",
33
"packages": ["packages/*"],
44
"version": "independent",
5-
"npmClient": "yarn",
65
"command": {
76
"version": {
87
"message": "chore(release): publish new version",

0 commit comments

Comments
 (0)