Skip to content

Commit a827743

Browse files
authored
chore: migrate from npm to pnpm (#1534)
1 parent 49e6362 commit a827743

25 files changed

+11361
-17768
lines changed

.github/workflows/springwolf-plugins.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
report_paths: '**/build/test-results/test/TEST-*.xml'
7171

7272
- name: Run e2e tests
73-
run: ./gradlew -p springwolf-examples/e2e npm_run_test
73+
run: ./gradlew -p springwolf-examples/e2e pnpm_run_install_deps test
7474
env:
7575
SPRINGWOLF_EXAMPLE: ${{ matrix.plugin }}
7676
- uses: actions/upload-artifact@v5

.github/workflows/springwolf-ui.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: ./gradlew -p ${{ env.project }} spotlessCheck
4242

4343
- name: Test
44-
run: ./gradlew -p ${{ env.project }} npm_run_test
44+
run: ./gradlew -p ${{ env.project }} test
4545
- name: Publish Test Report
4646
uses: mikepenz/action-junit-report@v6
4747
if: success() || failure()

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jackson-core = "2.20.1"
1010
kotlin = "2.2.21"
1111
node-plugin = "7.1.0"
1212
nodeVersion = "22.12.0"
13-
npm = "10.9.0"
13+
pnpm = "10.24.0"
1414
openapi-gradle = "1.9.0"
1515
org-junit-jupiter = "6.0.1"
1616
org-junit-plattform = "6.0.1"

springwolf-examples/e2e/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ To use the playwright ui, run
1414
npm run start
1515
```
1616

17-
For ci/cd or cli environments, use `../../gradlew npm_run_test` or
17+
For ci/cd or cli environments, use `../../gradlew pnpm_run_test` or
1818
```bash
1919
npm run test
2020
```

springwolf-examples/e2e/build.gradle

Lines changed: 51 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,81 @@ plugins {
55

66
node {
77
version = libs.versions.nodeVersion
8-
npmVersion = libs.versions.npm
9-
npmInstallCommand = 'ci'
8+
pnpmVersion = libs.versions.pnpm
109
download = true
1110
}
1211

13-
npm_run_test {
14-
dependsOn spotlessCheck
12+
tasks.register('pnpm_run_install_deps', PnpmTask) {
13+
group = "pnpm"
14+
dependsOn pnpmInstall
15+
16+
args = ['run', 'install:deps']
17+
18+
inputs.file 'playwright.config.ts'
19+
inputs.file 'package.json'
20+
inputs.file 'pnpm-lock.yaml'
21+
outputs.upToDateWhen { true }
22+
}
23+
24+
tasks.register('pnpm_run_lint', PnpmTask) {
25+
group = "pnpm"
26+
dependsOn pnpmInstall
27+
28+
args = ['run', 'lint']
29+
30+
inputs.files fileTree("tests")
31+
inputs.files fileTree("util")
32+
inputs.file 'playwright.config.ts'
33+
inputs.file 'package.json'
34+
inputs.file 'pnpm-lock.yaml'
35+
outputs.upToDateWhen { true }
36+
}
37+
tasks.register('pnpm_run_lint_fix', PnpmTask) {
38+
group = "pnpm"
39+
dependsOn pnpmInstall
40+
41+
args = ['run', 'lint:fix']
42+
43+
inputs.files fileTree("tests")
44+
inputs.files fileTree("util")
45+
inputs.file 'playwright.config.ts'
46+
inputs.file 'package.json'
47+
inputs.file 'pnpm-lock.yaml'
48+
outputs.upToDateWhen { true }
49+
}
50+
51+
tasks.register('pnpm_run_test', PnpmTask) {
52+
group = "pnpm"
53+
dependsOn pnpmInstall
1554
def springwolfExample = System.getenv("SPRINGWOLF_EXAMPLE") ?: "kafka"
1655
dependsOn(":springwolf-examples:springwolf-$springwolfExample-example:dockerBuildImage")
1756

57+
args = ['run', 'test']
58+
1859
inputs.files fileTree("tests")
1960
inputs.files fileTree("util")
2061
inputs.file 'playwright.config.ts'
2162
inputs.file 'package.json'
22-
inputs.file 'package-lock.json'
63+
inputs.file 'pnpm-lock.yaml'
64+
outputs.upToDateWhen { true }
2365
}
2466

2567
spotless {
2668
encoding 'UTF-8'
2769

28-
def npmExec = System.getProperty('os.name').toLowerCase().contains('windows') ? '/npm.cmd' : '/bin/npm'
29-
def nodeExec = System.getProperty('os.name').toLowerCase().contains('windows') ? '/node.exe' : '/bin/node'
30-
3170
format 'styling', {
3271
target 'tests/**/*.ts', 'tests/**/*.js', 'util/**/*.ts', 'util/**/*.js'
3372

34-
prettier()
35-
.npmExecutable("${tasks.named('npmSetup').get().npmDir.get()}${npmExec}")
36-
.nodeExecutable("${tasks.named('nodeSetup').get().nodeDir.get()}${nodeExec}")
37-
3873
licenseHeader("/* SPDX-License-Identifier: Apache-2.0 */", "import|export|.* \\{")
3974

4075
trimTrailingWhitespace()
4176
endWithNewline()
4277
}
4378
}
4479

80+
tasks.test.configure {
81+
dependsOn('pnpm_run_test', 'pnpm_run_lint_fix')
82+
}
4583
tasks.named('spotlessStyling').configure {
46-
it.dependsOn('nodeSetup', 'npmSetup')
84+
it.dependsOn('nodeSetup', 'pnpmSetup', 'pnpm_run_lint')
4785
}

springwolf-examples/e2e/package-lock.json

Lines changed: 0 additions & 98 deletions
This file was deleted.

springwolf-examples/e2e/package.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,20 @@
66
"scripts": {
77
"start": "playwright test --ui",
88
"test": "playwright test",
9-
"postinstall": "npx playwright install --with-deps chromium"
9+
"lint": "prettier --check \"(tests|util)/**/*.(js|ts|tsx|json|html|css)\"",
10+
"lint:fix": "prettier --list-different --write \"(tests|util)/**/*.(js|ts|tsx|json|html|css)\"",
11+
"install:deps": "npx playwright install --with-deps chromium"
1012
},
1113
"keywords": [],
1214
"author": "",
1315
"license": "ISC",
1416
"devDependencies": {
1517
"@playwright/test": "^1.49.1",
16-
"@types/node": "^22.10.2"
18+
"@types/node": "^22.10.2",
19+
"prettier": "^3.7.4"
20+
},
21+
"prettier": {
22+
"singleQuote": false,
23+
"trailingComma": "es5"
1724
}
1825
}

springwolf-examples/e2e/pnpm-lock.yaml

Lines changed: 77 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

springwolf-ui/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ testem.log
4040
# System files
4141
.DS_Store
4242
Thumbs.db
43+
44+
45+
*.actual.json

springwolf-ui/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ __**Note: Check out our [contribution guidelines](../CONTRIBUTING.md) before sta
2222

2323
1. Run dependencies `npm i` (`../gradlew npmInstall`)
2424
2. Run development server `npm start` (`../gradlew npmStart`)
25-
3. Test `npm run test` (`../gradlew npm_run_test`)
26-
4. Update with `npm run update` (`../gradlew npm_run_update`)
25+
3. Test `npm run test` (`../gradlew pnpm_run_test`)
26+
4. Update with `npm run update` (`../gradlew pnpm_run_update`)
2727

2828
Note: While npm and nodejs are used, they are managed by the gradle plugin. See commands in brackets in case you do not have a matching node version installed.
2929

0 commit comments

Comments
 (0)