Skip to content

Commit acda9ed

Browse files
committed
test pnpm migration
1 parent 8bb56c8 commit acda9ed

File tree

15 files changed

+6645
-16292
lines changed

15 files changed

+6645
-16292
lines changed

.github/workflows/applications.yml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,27 @@ jobs:
4242
- name: Get sources
4343
uses: actions/checkout@v4
4444

45-
- name: Run npm install
45+
- name: Set up Node.js
46+
uses: actions/setup-node@v4
47+
with:
48+
node-version: ${{ matrix.NODE }}
49+
cache: 'pnpm'
50+
cache-dependency-path: pnpm-lock.yaml
51+
52+
- name: Enable Corepack
53+
run: corepack enable
54+
55+
- name: Install dependencies
4656
env:
4757
PUPPETEER_SKIP_DOWNLOAD: true
48-
run: npm install --no-audit --no-fund
58+
run: pnpm install --frozen-lockfile
4959

5060
- uses: browser-actions/setup-chrome@v1
5161
id: setup-chrome
5262
- run: ${{ steps.setup-chrome.outputs.chrome-path }} --version
5363

54-
- name: Set Legacy-peer-deps=true
55-
run: npm config set legacy-peer-deps true
56-
5764
- name: Create ${{ matrix.APPROACH }} application
58-
run: npm run create-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
65+
run: pnpm run create-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
5966
timeout-minutes: 30
6067

6168
- name: Install Internal Packages
@@ -65,14 +72,14 @@ jobs:
6572

6673
- name: Lint created application
6774
if: ${{ matrix.OS != 'windows-latest' }}
68-
run: npm run lint-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
75+
run: pnpm run lint-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
6976

7077
- name: Run template tests
7178
if: ${{ matrix.OS != 'windows-latest' }}
7279
env:
7380
LAUNCH_BROWSER: true
7481
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
75-
run: npm run test-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
82+
run: pnpm run test-template -- -- -e ${{ matrix.APPROACH }} ${{ env.DEPS_VERSION_TAG_PARAM }}
7683
timeout-minutes: 40
7784

7885
- name: Archive artifacts
@@ -105,17 +112,20 @@ jobs:
105112
- name: Get sources
106113
uses: actions/checkout@v4
107114

108-
- name: Set up Node.js and restore cache
115+
- name: Set up Node.js
109116
uses: actions/setup-node@v4
110117
with:
111118
node-version: 20
112-
cache: 'npm'
113-
cache-dependency-path: '**/package-lock.json'
119+
cache: 'pnpm'
120+
cache-dependency-path: pnpm-lock.yaml
121+
122+
- name: Enable Corepack
123+
run: corepack enable
114124

115-
- name: Run npm install
125+
- name: Run pnpm install
116126
env:
117127
PUPPETEER_SKIP_DOWNLOAD: true
118-
run: npm install --no-package-lock --no-audit --no-fund
128+
run: pnpm install --frozen-lockfile
119129

120130
- name: Run schematics tests
121-
run: cd packages/devextreme-schematics && npm run test
131+
run: pnpm --filter devextreme-schematics test

.github/workflows/lint.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ jobs:
2020
uses: actions/setup-node@v4
2121
with:
2222
node-version: '20'
23+
cache: 'pnpm'
24+
cache-dependency-path: pnpm-lock.yaml
2325

24-
- name: Run npm install
26+
- name: Enable Corepack
27+
run: corepack enable
28+
29+
- name: Install dependencies
2530
env:
2631
PUPPETEER_SKIP_DOWNLOAD: true
27-
run: npm install --no-package-lock --no-audit --no-fund
32+
run: pnpm install --frozen-lockfile
2833

2934
- name: Run tests
30-
run: npm run lint
35+
run: pnpm run lint

.github/workflows/publish.yml

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,62 @@ jobs:
2323
- name: Get sources
2424
uses: actions/checkout@v4
2525

26-
- name: Run npm install - root
27-
run: npm install --no-audit --no-fund
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: 'pnpm'
31+
cache-dependency-path: pnpm-lock.yaml
2832

29-
- name: Run npm install - devextreme-schematics
30-
working-directory: packages/devextreme-schematics
31-
run: npm install --no-audit --no-fund
33+
- name: Enable Corepack
34+
run: corepack enable
35+
36+
- name: Install dependencies
37+
env:
38+
PUPPETEER_SKIP_DOWNLOAD: true
39+
run: pnpm install --frozen-lockfile
3240

3341
- name: Test devextreme-schematics
34-
working-directory: packages/devextreme-schematics
35-
run: npm run test
42+
run: pnpm --filter devextreme-schematics test
3643

3744
- name: Build devextreme-schematics
38-
working-directory: packages/devextreme-schematics
39-
run: npm run build
45+
run: pnpm --filter devextreme-schematics build
4046

4147
- uses: fregante/setup-git-user@v2
4248

43-
- name: Update NPM config
44-
run: npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
49+
- name: Bump package versions
50+
run: node ./scripts/bump-version.mjs ${{ github.event.inputs.version }}
51+
52+
- name: Refresh lockfile
53+
run: pnpm install --lockfile-only
54+
55+
- name: Capture release versions
56+
id: versions
57+
run: |
58+
echo "cli=$(node -p \"require('./packages/devextreme-cli/package.json').version\")" >> $GITHUB_OUTPUT
59+
echo "schematics=$(node -p \"require('./packages/devextreme-schematics/package.json').version\")" >> $GITHUB_OUTPUT
60+
61+
- name: Commit version update
62+
run: |
63+
git add packages/devextreme-cli/package.json packages/devextreme-schematics/package.json pnpm-lock.yaml
64+
git commit -m "chore: release devextreme-cli v${{ steps.versions.outputs.cli }}" --no-verify
65+
66+
- name: Tag release
67+
run: |
68+
git tag devextreme-cli@${{ steps.versions.outputs.cli }}
69+
git tag devextreme-schematics@${{ steps.versions.outputs.schematics }}
4570
46-
- name: Publish package
71+
- name: Configure npm auth
72+
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
73+
74+
- name: Push changes
4775
env:
4876
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
run: git push --follow-tags origin master
78+
79+
- name: Publish packages
80+
env:
81+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5082
run: |
51-
npx lerna version ${{ github.event.inputs.version }} -y --no-push
52-
git push -f --follow-tags --no-verify --atomic origin master
53-
npx lerna publish from-git -y
83+
pnpm --filter devextreme-cli publish --access public --no-git-checks
84+
pnpm --filter devextreme-schematics publish --access public --no-git-checks

.github/workflows/themebuilder.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,16 @@ jobs:
2222
uses: actions/setup-node@v4
2323
with:
2424
node-version: ${{ matrix.NODE }}
25+
cache: 'pnpm'
26+
cache-dependency-path: pnpm-lock.yaml
2527

26-
- name: Restore npm cache
27-
uses: actions/cache@v4
28-
with:
29-
path: ~/.npm
30-
key: themebuilder-${{ runner.os }}-node-${{ matrix.NODE }}-${{ hashFiles('**/package-lock.json') }}
31-
restore-keys: |
32-
themebuilder-${{ runner.os }}-node-${{ matrix.NODE }}
33-
themebuilder-${{ runner.os }}-node-
28+
- name: Enable Corepack
29+
run: corepack enable
3430

35-
- name: Run npm install
31+
- name: Install dependencies
3632
env:
3733
PUPPETEER_SKIP_DOWNLOAD: true
38-
run: npm install --no-package-lock --no-audit --no-fund
34+
run: pnpm install --frozen-lockfile
3935

4036
- name: Run tests
41-
run: npm run test-themebuilder
37+
run: pnpm run test-themebuilder

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node-linker=hoisted
2+
strict-peer-dependencies=false

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,12 @@ Familiarize yourself with the [DevExtreme License](https://js.devexpress.com/Lic
1717
## Support & Feedback ##
1818

1919
If you want to report a bug, request a feature, or ask a question, contact us at the [DevExpress Support Center](https://www.devexpress.com/Support/Center).
20+
21+
## Development
22+
23+
This repository is managed with [pnpm workspaces](https://pnpm.io/workspaces). Enable Corepack and install dependencies before running the developer scripts described in `README_DEVELOPERS.md`:
24+
25+
```sh
26+
corepack enable
27+
pnpm install
28+
```

README_DEVELOPERS.md

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
1+
# Setup
2+
3+
Use [Corepack](https://nodejs.org/api/corepack.html) (bundled with Node.js 20+) to activate pnpm and install workspace dependencies:
4+
5+
```sh
6+
corepack enable
7+
pnpm install
8+
```
9+
110
# Testing
211

312
## Build docker image
413
```sh
5-
$ lerna run docker:build
14+
pnpm --filter devextreme-cli docker:build
615
```
716

817
## Run docker image with browser
918
```sh
10-
$ lerna run docker:run
19+
pnpm --filter devextreme-cli docker:run
1120
```
1221

1322
## Run tests
1423

1524
To run tests for all target frameworks, use the following command:
1625

1726
```sh
18-
$ npm run test
27+
$ pnpm run test
1928
```
2029

2130
This script creates test applications in the `testing/sandbox` folder, starts a web server for each framework, and runs the snapshot tests.
@@ -29,61 +38,61 @@ You can find test results in the following folders:
2938
## Generate Applications
3039

3140
```sh
32-
npm run create-template
41+
pnpm run create-template
3342
```
3443

3544
## Generate Applications for an Individual Framework
3645

3746
```sh
38-
npm run create-template -- -- -e angular
39-
npm run create-template -- -- -e react
40-
npm run create-template -- -- -e react-ts
41-
npm run create-template -- -- -e vue-v3
47+
pnpm run create-template -- -- -e angular
48+
pnpm run create-template -- -- -e react
49+
pnpm run create-template -- -- -e react-ts
50+
pnpm run create-template -- -- -e vue-v3
4251
```
4352

4453
## Lint Applications
4554

4655
```sh
47-
npm run lint-template
56+
pnpm run lint-template
4857
```
4958

5059
## Lint Applications for an Individual Framework
5160

5261
```sh
53-
npm run lint-template -- -- -e angular
54-
npm run lint-template -- -- -e react
55-
npm run lint-template -- -- -e react-ts
56-
npm run lint-template -- -- -e vue-v3
62+
pnpm run lint-template -- -- -e angular
63+
pnpm run lint-template -- -- -e react
64+
pnpm run lint-template -- -- -e react-ts
65+
pnpm run lint-template -- -- -e vue-v3
5766
```
5867

5968
## Test Applications
6069

6170
```sh
62-
npm run test-template
71+
pnpm run test-template
6372
```
6473

6574
## Test Applications for an Individual Framework
6675

6776
```sh
68-
npm run test-template -- -- -e angular
69-
npm run test-template -- -- -e react
70-
npm run test-template -- -- -e react-ts
71-
npm run test-template -- -- -e vue-v3
77+
pnpm run test-template -- -- -e angular
78+
pnpm run test-template -- -- -e react
79+
pnpm run test-template -- -- -e react-ts
80+
pnpm run test-template -- -- -e vue-v3
7281
```
7382

7483
## Run Tests for Existing Test Applications
7584

7685
```sh
77-
npm run test-dev
86+
pnpm run test-dev
7887
```
7988

8089
## Run Tests for an Individual Framework
8190

8291
```sh
83-
npm run test -- -- -t angular
84-
npm run test -- -- -t react
85-
npm run test -- -- -t react-ts
86-
npm run test -- -- -t vue-v3
92+
pnpm run test -- -- -t angular
93+
pnpm run test -- -- -t react
94+
pnpm run test -- -- -t react-ts
95+
pnpm run test -- -- -t vue-v3
8796
```
8897

8998
## Replace etalon
@@ -99,13 +108,13 @@ Modifying an application template directly is not recommended. Instead, generate
99108
3. Run a script that updates templates for all frameworks:
100109

101110
```sh
102-
npm run update-template
111+
pnpm run update-template
103112
```
104113

105114
... or a script that updates the template for an individual framework:
106115

107116
```sh
108-
npm run update-template -- -p angular
109-
npm run update-template -- -p react-ts
110-
npm run update-template -- -p vue-v3
117+
pnpm run update-template -- -p angular
118+
pnpm run update-template -- -p react-ts
119+
pnpm run update-template -- -p vue-v3
111120
```

lerna.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
{
2-
"packages": [
3-
"packages/*"
4-
],
5-
"version": "1.12.1"
6-
}

0 commit comments

Comments
 (0)