Skip to content

Commit e36ff57

Browse files
authored
Merge pull request #229 from dkarpele/dk-GITOPS-9128
chore: migrate to pnpm
2 parents 64f8706 + 5721524 commit e36ff57

9 files changed

Lines changed: 12614 additions & 10648 deletions

File tree

.github/workflows/unit-tests.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ jobs:
1515
- uses: actions/setup-node@v4
1616
with:
1717
node-version: '22'
18-
cache: 'yarn'
1918

20-
- run: yarn install --frozen-lockfile
19+
- uses: pnpm/action-setup@v4
20+
with:
21+
run_install: false
22+
23+
- run: pnpm install --frozen-lockfile
2124

22-
- run: yarn test:coverage
25+
- run: pnpm test:coverage
2326

2427
- uses: codecov/codecov-action@v5
2528
with:

.konflux/Containerfile.plugin

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,19 @@ FROM registry.access.redhat.com/ubi9/nodejs-22 AS builder
1818

1919
USER root
2020

21-
# Install Yarn
22-
RUN npm install --global yarn
21+
# Install pnpm
22+
RUN npm install --global pnpm@10.33.2
2323

24-
COPY ["package.json", "yarn.lock", "./"]
25-
26-
RUN yarn install --no-progress --non-interactive
27-
28-
ADD . /usr/src/app
2924
WORKDIR /usr/src/app
3025

31-
RUN yarn install --network-timeout 600000 && \
32-
yarn cache clean
26+
COPY ["package.json", "pnpm-lock.yaml", ".npmrc", "./"]
3327

34-
RUN yarn install --no-progress --non-interactive
28+
RUN pnpm install --frozen-lockfile && \
29+
pnpm store prune
3530

36-
COPY [".", "."]
31+
COPY . .
3732

38-
RUN yarn build
33+
RUN pnpm build
3934

4035
####################################################################################################
4136

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
public-hoist-pattern[]=*types*
2+
public-hoist-pattern[]=*eslint*
3+
public-hoist-pattern[]=*prettier*

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
FROM docker.io/library/node:23 AS build
22

3+
RUN corepack enable && corepack prepare pnpm@10.33.2 --activate
4+
35
ADD . /usr/src/app
46
WORKDIR /usr/src/app
5-
RUN yarn config set network-timeout 600000 -g
6-
RUN yarn install && yarn build
7+
RUN pnpm config set fetchTimeout 600000 -g
8+
RUN pnpm install --frozen-lockfile && pnpm build
79

810
FROM --platform=linux/amd64 registry.access.redhat.com/ubi9/httpd-24
911

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Based on [Openshift Console dynamic plugin](https://github.com/openshift/console
77

88
In one terminal window, run:
99

10-
1. `yarn install`
11-
2. `yarn run start`
10+
1. `pnpm install`
11+
2. `pnpm run start`
1212

1313
In another terminal window, run:
1414

@@ -30,15 +30,15 @@ spec:
3030
termination: reencrypt
3131
insecureEdgeTerminationPolicy: Allow
3232
```
33-
3. `yarn run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
33+
3. `pnpm run start-console` (requires [Docker](https://www.docker.com) or [podman 3.2.0+](https://podman.io))
3434

3535
This will run the OpenShift console in a container connected to the cluster
3636
you've logged into. The plugin HTTP server runs on port 9001 with CORS enabled.
3737
Navigate to <http://localhost:9000/envdynamic> to see the running plugin.
3838

3939
#### Running start-console with Apple silicon and podman
4040

41-
If you are using podman on a Mac with Apple silicon, `yarn run start-console`
41+
If you are using podman on a Mac with Apple silicon, `pnpm run start-console`
4242
might fail since it runs an amd64 image. You can work around the problem with
4343
[qemu-user-static](https://github.com/multiarch/qemu-user-static) by running
4444
these commands:
@@ -54,8 +54,8 @@ systemctl reboot
5454

5555
In plugin directory, run
5656

57-
1. `yarn install`
58-
2. `yarn run start`
57+
1. `pnpm install`
58+
2. `pnpm run start`
5959

6060
In your local `console/` directory
6161

@@ -90,13 +90,13 @@ Unit tests use [Jest](https://jestjs.io/) with inline snapshots (`toMatchInlineS
9090

9191
```bash
9292
# Run all tests
93-
yarn test
93+
pnpm test
9494

9595
# Run tests and update inline snapshots
96-
yarn test:update
96+
pnpm test:update
9797

9898
# Run tests with coverage report
99-
yarn test:coverage
99+
pnpm test:coverage
100100
```
101101

102-
When a component's rendered output or a utility's return value changes, the inline snapshots will fail. Run `yarn test:update` to accept the new output — the diff will show exactly what changed.
102+
When a component's rendered output or a utility's return value changes, the inline snapshots will fail. Run `pnpm test:update` to accept the new output — the diff will show exactly what changed.

package.json

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,21 @@
33
"description": "OpenShift Console plugin for GitOps.",
44
"version": "0.0.1",
55
"private": true,
6+
"packageManager": "pnpm@10.33.2",
67
"license": "Apache-2.0",
78
"scripts": {
9+
"preinstall": "npx only-allow pnpm",
810
"http-server": "./http-server.sh ./dist",
911
"clean": "rm -rf dist",
10-
"build": "yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack",
11-
"build-dev": "yarn clean && yarn ts-node node_modules/.bin/webpack",
12-
"start": "yarn ts-node node_modules/.bin/webpack serve",
12+
"build": "pnpm clean && NODE_ENV=production pnpm ts-node node_modules/webpack-cli/bin/cli.js",
13+
"build-dev": "pnpm clean && pnpm ts-node node_modules/webpack-cli/bin/cli.js",
14+
"start": "pnpm ts-node node_modules/webpack-cli/bin/cli.js serve",
1315
"start-console": "./start-console.sh",
1416
"i18n": "i18next \"src/**/*.{js,jsx,ts,tsx}\" [-oc] -c i18next-parser.config.js",
1517
"ts-node": "ts-node -O '{\"module\":\"commonjs\"}'",
1618
"lint": "eslint ./src --fix",
1719
"test": "jest",
18-
"test:update": "jest -u",
20+
"test:update": "jest --updateSnapshot",
1921
"test:coverage": "jest --coverage"
2022
},
2123
"devDependencies": {
@@ -28,13 +30,19 @@
2830
"@patternfly/react-charts": "^8.4.0",
2931
"@patternfly/react-core": "^6.4.0",
3032
"@patternfly/react-data-view": "^6.4.0",
33+
"@patternfly/react-component-groups": "^6.3.0",
3134
"@patternfly/react-icons": "^6.4.0",
35+
"@patternfly/react-styles": "^6.4.0",
3236
"@patternfly/react-table": "^6.4.0",
3337
"@patternfly/react-tokens": "6.4.0",
38+
"@patternfly/react-topology": "^6.2.0",
3439
"@svgr/webpack": "^8.1.0",
3540
"@types/classnames": "^2.3.1",
41+
"@jest/types": "^29.0.0",
42+
"@types/jest": "^29.0.0",
3643
"@types/dagre": "^0.7.53",
3744
"@types/git-url-parse": "^9.0.0",
45+
"@types/lodash": "^4.14.0",
3846
"@types/node": "^17.0.21",
3947
"@types/react": "17.0.91",
4048
"@types/react-redux": "7.1.34",
@@ -59,40 +67,46 @@
5967
"http-server": "0.12.x",
6068
"i18next": "^19.8.3",
6169
"i18next-parser": "^3.3.0",
70+
"lodash-es": "^4.17.23",
6271
"marked": "15.0.12",
72+
"mobx-react": "^7.6.0",
6373
"prettier": "^2.6.0",
6474
"prop-types": "15.8.x",
6575
"react": "17.0.2",
6676
"react-dom": "17.0.2",
6777
"react-i18next": "^11.7.3",
78+
"react-router": "5.3.4",
79+
"semver": "^7.0.0",
6880
"sass": "^1.42.1",
6981
"sass-loader": "^10.1.1",
7082
"style-loader": "^2.0.0",
7183
"ts-loader": "^9.5.1",
7284
"ts-node": "^10.7.0",
7385
"tsconfig-paths-webpack-plugin": "^4.1.0",
86+
"jest": "^29.0.0",
87+
"jest-environment-jsdom": "^29.0.0",
88+
"ts-jest": "^29.0.0",
89+
"typesafe-actions": "^4.4.2",
7490
"typescript": "5.9.3",
7591
"webpack": "^5.1.0",
7692
"webpack-cli": "^4.9.2",
77-
"webpack-dev-server": "^4.9.3",
78-
"jest": "^29.7.0",
79-
"ts-jest": "^29.3.4",
80-
"@types/jest": "^29.5.0",
81-
"jest-environment-jsdom": "^29.7.0"
93+
"webpack-dev-server": "^4.9.3"
8294
},
83-
"resolutions": {
84-
"glob-parent": "^6.0.0",
85-
"showdown": "^2.1.0",
86-
"express": "4.22.1",
87-
"@types/jest": "^29.5.0",
88-
"hosted-git-info": "^3.0.8",
89-
"jquery": "4.0.0",
90-
"lodash-es": "^4.18.1",
91-
"lodash": "^4.18.1",
92-
"minimist": "1.2.8",
93-
"ua-parser-js": "^0.7.24",
94-
"jest": "^29.7.0",
95-
"postcss": "^8.2.13"
95+
"pnpm": {
96+
"overrides": {
97+
"glob-parent": "^6.0.0",
98+
"showdown": "^2.1.0",
99+
"express": "4.22.1",
100+
"@types/jest": "^29.5.0",
101+
"hosted-git-info": "^3.0.8",
102+
"jquery": "4.0.0",
103+
"lodash-es": "^4.18.1",
104+
"lodash": "^4.18.1",
105+
"minimist": "1.2.8",
106+
"ua-parser-js": "^0.7.24",
107+
"jest": "^29.7.0",
108+
"postcss": "^8.2.13"
109+
}
96110
},
97111
"consolePlugin": {
98112
"name": "gitops-plugin",
@@ -107,6 +121,7 @@
107121
"classnames": "^2.3.2",
108122
"dagre": "^0.8.5",
109123
"git-url-parse": "^13.1.0",
124+
"lodash": "^4.18.1",
110125
"react": "17.0.2",
111126
"react-helmet": "^6.1.0",
112127
"react-redux": "7.2.9",

0 commit comments

Comments
 (0)