-
Notifications
You must be signed in to change notification settings - Fork 16
chore: migrate to pnpm #229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,24 +18,22 @@ FROM registry.access.redhat.com/ubi9/nodejs-22 AS builder | |
|
|
||
| USER root | ||
|
|
||
| # Install Yarn | ||
| RUN npm install --global yarn | ||
| # Install pnpm | ||
| RUN npm install --global pnpm | ||
|
|
||
| COPY ["package.json", "yarn.lock", "./"] | ||
| COPY ["package.json", "pnpm-lock.yaml", "./"] | ||
|
|
||
| RUN yarn install --no-progress --non-interactive | ||
| RUN pnpm install --no-frozen-lockfile --ignore-scripts | ||
|
|
||
| ADD . /usr/src/app | ||
| WORKDIR /usr/src/app | ||
|
|
||
| RUN yarn install --network-timeout 600000 && \ | ||
| yarn cache clean | ||
|
|
||
| RUN yarn install --no-progress --non-interactive | ||
| RUN pnpm install --no-frozen-lockfile && \ | ||
| pnpm store prune | ||
|
Comment on lines
+21
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n "packageManager" package.jsonRepository: redhat-developer/gitops-console-plugin Length of output: 176 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== package.json ==\n'
sed -n '1,120p' package.json
printf '\n== pnpm-lock.yaml head ==\n'
sed -n '1,40p' pnpm-lock.yaml
printf '\n== .konflux/Containerfile.plugin ==\n'
nl -ba .konflux/Containerfile.plugin | sed -n '1,80p'Repository: redhat-developer/gitops-console-plugin Length of output: 5151 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Check whether corepack or pnpm version pinning is already used elsewhere
rg -n "corepack|pnpm@|packageManager|frozen-lockfile|no-frozen-lockfile" -S .Repository: redhat-developer/gitops-console-plugin Length of output: 176 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect lockfile version semantics without executing repo code
python3 - <<'PY'
from pathlib import Path
import re
text = Path('pnpm-lock.yaml').read_text()
m = re.search(r'^lockfileVersion:\s*(.+)$', text, re.M)
print('lockfileVersion:', m.group(1).strip() if m else 'MISSING')
PYRepository: redhat-developer/gitops-console-plugin Length of output: 199 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf '\n== .konflux/Containerfile.plugin ==\n'
sed -n '1,80p' .konflux/Containerfile.plugin
printf '\n== pnpm pinning / corepack references ==\n'
grep -RInE 'corepack|pnpm@|packageManager|frozen-lockfile|no-frozen-lockfile' . --exclude-dir=.git || trueRepository: redhat-developer/gitops-console-plugin Length of output: 50394 Pin pnpm and restore frozen installs in the container build.
Use a pinned pnpm version (or Corepack) and switch back to frozen-lockfile behavior for the image build. 🤖 Prompt for AI Agents |
||
|
|
||
| COPY [".", "."] | ||
|
|
||
| RUN yarn build | ||
| RUN pnpm build | ||
|
|
||
| #################################################################################################### | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| public-hoist-pattern[]=*types* | ||
| public-hoist-pattern[]=*eslint* | ||
| public-hoist-pattern[]=*prettier* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,19 +3,21 @@ | |
| "description": "OpenShift Console plugin for GitOps.", | ||
| "version": "0.0.1", | ||
| "private": true, | ||
| "packageManager": "pnpm@10.33.2", | ||
| "license": "Apache-2.0", | ||
| "scripts": { | ||
| "preinstall": "npx only-allow pnpm", | ||
| "http-server": "./http-server.sh ./dist", | ||
| "clean": "rm -rf dist", | ||
| "build": "yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack", | ||
| "build-dev": "yarn clean && yarn ts-node node_modules/.bin/webpack", | ||
| "start": "yarn ts-node node_modules/.bin/webpack serve", | ||
| "build": "pnpm clean && NODE_ENV=production pnpm ts-node node_modules/webpack-cli/bin/cli.js", | ||
| "build-dev": "pnpm clean && pnpm ts-node node_modules/webpack-cli/bin/cli.js", | ||
| "start": "pnpm ts-node node_modules/webpack-cli/bin/cli.js serve", | ||
| "start-console": "./start-console.sh", | ||
| "i18n": "i18next \"src/**/*.{js,jsx,ts,tsx}\" [-oc] -c i18next-parser.config.js", | ||
| "ts-node": "ts-node -O '{\"module\":\"commonjs\"}'", | ||
| "lint": "eslint ./src --fix", | ||
| "test": "jest", | ||
| "test:update": "jest -u", | ||
| "test:update": "jest --updateSnapshot", | ||
| "test:coverage": "jest --coverage" | ||
| }, | ||
| "devDependencies": { | ||
|
|
@@ -28,13 +30,19 @@ | |
| "@patternfly/react-charts": "^8.4.0", | ||
| "@patternfly/react-core": "^6.4.0", | ||
| "@patternfly/react-data-view": "^6.4.0", | ||
| "@patternfly/react-component-groups": "^6.3.0", | ||
| "@patternfly/react-icons": "^6.4.0", | ||
| "@patternfly/react-styles": "^6.4.0", | ||
| "@patternfly/react-table": "^6.4.0", | ||
| "@patternfly/react-tokens": "6.4.0", | ||
| "@patternfly/react-topology": "^6.2.0", | ||
| "@svgr/webpack": "^8.1.0", | ||
| "@types/classnames": "^2.3.1", | ||
| "@jest/types": "^29.0.0", | ||
| "@types/jest": "^29.0.0", | ||
| "@types/dagre": "^0.7.53", | ||
| "@types/git-url-parse": "^9.0.0", | ||
| "@types/lodash": "^4.14.0", | ||
| "@types/node": "^17.0.21", | ||
| "@types/react": "17.0.91", | ||
| "@types/react-redux": "7.1.34", | ||
|
|
@@ -59,46 +67,58 @@ | |
| "http-server": "0.12.x", | ||
| "i18next": "^19.8.3", | ||
| "i18next-parser": "^3.3.0", | ||
| "lodash-es": "^4.17.23", | ||
| "marked": "15.0.12", | ||
| "mobx-react": "^7.6.0", | ||
| "prettier": "^2.6.0", | ||
| "prop-types": "15.8.x", | ||
| "react": "17.0.2", | ||
| "react-dom": "17.0.2", | ||
| "react-i18next": "^11.7.3", | ||
| "react-router": "5.3.4", | ||
| "semver": "^7.0.0", | ||
| "sass": "^1.42.1", | ||
| "sass-loader": "^10.1.1", | ||
| "style-loader": "^2.0.0", | ||
| "ts-loader": "^9.5.1", | ||
| "ts-node": "^10.7.0", | ||
| "tsconfig-paths-webpack-plugin": "^4.1.0", | ||
| "jest": "^29.0.0", | ||
| "jest-environment-jsdom": "^29.0.0", | ||
| "ts-jest": "^29.0.0", | ||
| "typesafe-actions": "^4.4.2", | ||
| "typescript": "5.9.3", | ||
| "webpack": "^5.1.0", | ||
| "webpack-cli": "^4.9.2", | ||
| "webpack-dev-server": "^4.9.3", | ||
| "jest": "^29.7.0", | ||
| "ts-jest": "^29.3.4", | ||
| "@types/jest": "^29.5.0", | ||
| "jest-environment-jsdom": "^29.7.0" | ||
| "webpack-dev-server": "^4.9.3" | ||
| }, | ||
| "resolutions": { | ||
| "glob-parent": "^6.0.0", | ||
| "showdown": "^2.1.0", | ||
| "express": "4.22.1", | ||
| "@types/jest": "^29.5.0", | ||
| "hosted-git-info": "^3.0.8", | ||
| "jquery": "4.0.0", | ||
| "lodash-es": "^4.18.1", | ||
| "lodash": "^4.18.1", | ||
| "minimist": "1.2.8", | ||
| "ua-parser-js": "^0.7.24", | ||
| "jest": "^29.7.0", | ||
| "postcss": "^8.2.13" | ||
| "pnpm": { | ||
| "overrides": { | ||
| "glob-parent": "^6.0.0", | ||
| "showdown": "^2.1.0", | ||
| "express": "4.22.1", | ||
| "@types/jest": "^29.5.0", | ||
| "hosted-git-info": "^3.0.8", | ||
| "jquery": "4.0.0", | ||
| "lodash-es": "^4.18.1", | ||
| "lodash": "^4.18.1", | ||
| "minimist": "1.2.8", | ||
| "ua-parser-js": "^0.7.24", | ||
| "jest": "^29.7.0", | ||
| "postcss": "^8.2.13" | ||
| } | ||
| }, | ||
| "consolePlugin": { | ||
| "name": "gitops-plugin", | ||
| "version": "0.0.17", | ||
| "version": "0.0.16", | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dkarpele , the version is downgraded. Could you change this back to 0.0.17? |
||
| "displayName": "GitOps Plugin", | ||
| "description": "OpenShift Console plugin for GitOps.", | ||
| "exposedModules": { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you might be using an older version of the console plugin. Could you remove this? We got rid of ./components in master. |
||
| "environments": "./components/ApplicationListPage", | ||
| "detailsPage": "./components/EnvironmentDetailsPageTabs", | ||
| "gitopsFlags": "./components/utils/flags", | ||
| "topology": "./components/topology" | ||
| }, | ||
| "dependencies": { | ||
| "@console/pluginAPI": "*" | ||
| } | ||
|
|
@@ -107,6 +127,7 @@ | |
| "classnames": "^2.3.2", | ||
| "dagre": "^0.8.5", | ||
| "git-url-parse": "^13.1.0", | ||
| "lodash": "^4.18.1", | ||
| "react": "17.0.2", | ||
| "react-helmet": "^6.1.0", | ||
| "react-redux": "7.2.9", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This brings up a good question. Here, it is --no-frozen-lockfiler, but in the Dockerfile, we are using -frozen-lockfile to ensure we are using the same dependencies specified in the pnpm-lock.yaml file. Do you think we should be updating the lockfile for the konflux build?