Skip to content
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

Sort package.json alphabetically #1791

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
yarn sort:packagejson
git add .
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is dangeorus as I can have some files that I don't want it to be added to the commit that'll be added silently.

Suggested change
git add .
git add package.json

Copy link
Collaborator

@alfonsomthd alfonsomthd Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SanjalKatiyar Instead of adding any file, we can make pre-commit fail so the contributor can run yarn sort:packagejson manually and commit again. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move forward with #1792 instead of any manual efforts... I will close this PR.

101 changes: 51 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,77 @@
{
"name": "odf-plugin",
"version": "0.0.0",
"private": true,
"description": "ODF plugin",
"repository": "[email protected]:red-hat-storage/odf-console.git",
"license": "Apache-2.0",
"private": true,
"workspaces": [
"packages/*"
],
"repository": "[email protected]:red-hat-storage/odf-console.git",
"scripts": {
"analyze-client": "PLUGIN=client yarn analyze-common && PLUGIN=client yarn tsx ./analyzeTest.ts",
"analyze-common": "yarn build:generate && NODE_ENV=production I8N_NS=${I8N_NS} ANALYZE_BUNDLE=true yarn tsx ./node_modules/.bin/webpack -c ./webpack.config.ts",
"analyze-mco": "PLUGIN=mco yarn analyze-common && PLUGIN=mco yarn tsx ./analyzeTest.ts",
"analyze-odf": "PLUGIN=odf yarn analyze-common && PLUGIN=odf yarn tsx ./analyzeTest.ts",
"build": "NODE_ENV=production PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build-client": "NODE_ENV=production PLUGIN=client I8N_NS=plugin__odf-client-console yarn build:plugin",
"build-dev": "NODE_ENV=development PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build-mco": "NODE_ENV=production PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn build:plugin",
"build:generate": "yarn clean-${PLUGIN} && tsx ./scripts/versionCheck.mts --plugin ${PLUGIN} && tsx ./scripts/generatePluginPackage.mts --plugin ${PLUGIN}",
"build:plugin": "yarn build:generate && NODE_OPTIONS='--max-old-space-size=4096' yarn tsx node_modules/.bin/webpack -c ./webpack.config.ts",
"clean": "yarn clean-mco && yarn clean-odf",
"clean-client": "cd plugins/client && rm -rf ./dist",
"clean-mco": "cd plugins/mco && rm -rf ./dist",
"clean-odf": "cd plugins/odf && rm -rf ./dist",
"clean-client": "cd plugins/client && rm -rf ./dist",
"cypress-merge": "mochawesome-merge ./gui-test-screenshots/cypress_report*.json > ./gui-test-screenshots/cypress.json",
"cypress-generate": "marge -o ./gui-test-screenshots/ -f cypress-report -t 'OpenShift Console Cypress Test Results' -p 'OpenShift Cypress Test Results' --showPassed false --assetsDir ./gui-test-screenshots/cypress/assets ./gui-test-screenshots/cypress.json",
"cypress-merge": "mochawesome-merge ./gui-test-screenshots/cypress_report*.json > ./gui-test-screenshots/cypress.json",
"cypress-postreport": "yarn cypress-merge && yarn cypress-generate",
"test": "jest --config=jest/config.js",
"test-silent": "JEST_SILENT_REPORTER_DOTS=true jest --config=jest/config.js --reporters jest-silent-reporter",
"test-coverage": "jest --config=jest/config.js --silent --coverage --coverageReporters text-summary",
"test-cypress": "node_modules/.bin/cypress open --e2e --config-file ./cypress/cypress.config.ts --env openshift=true",
"test-cypress-headless": "node --max-old-space-size=4096 node_modules/.bin/cypress run --e2e --config-file ./cypress/cypress.config.ts --env openshift=true --browser ${BRIDGE_E2E_BROWSER_NAME:=chrome} --headless",
"build:generate": "yarn clean-${PLUGIN} && tsx ./scripts/versionCheck.mts --plugin ${PLUGIN} && tsx ./scripts/generatePluginPackage.mts --plugin ${PLUGIN}",
"build:plugin": "yarn build:generate && NODE_OPTIONS='--max-old-space-size=4096' yarn tsx node_modules/.bin/webpack -c ./webpack.config.ts",
"build": "NODE_ENV=production PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"build-mco": "NODE_ENV=production PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn build:plugin",
"build-client": "NODE_ENV=production PLUGIN=client I8N_NS=plugin__odf-client-console yarn build:plugin",
"build-dev": "NODE_ENV=development PLUGIN=odf I8N_NS=plugin__odf-console yarn build:plugin",
"server:plugin": "yarn build:generate && I8N_NS=${I8N_NS} yarn tsx ./node_modules/.bin/webpack serve -c ./webpack.config.ts --progress",
"analyze-common": "yarn build:generate && NODE_ENV=production I8N_NS=${I8N_NS} ANALYZE_BUNDLE=true yarn tsx ./node_modules/.bin/webpack -c ./webpack.config.ts",
"analyze-odf": "PLUGIN=odf yarn analyze-common && PLUGIN=odf yarn tsx ./analyzeTest.ts",
"analyze-mco": "PLUGIN=mco yarn analyze-common && PLUGIN=mco yarn tsx ./analyzeTest.ts",
"analyze-client": "PLUGIN=client yarn analyze-common && PLUGIN=client yarn tsx ./analyzeTest.ts",
"dev": "PLUGIN=odf I8N_NS=plugin__odf-console yarn server:plugin",
"dev:no-type-check": "DEV_NO_TYPE_CHECK=true yarn dev",
"dev-mco": "PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn server:plugin",
"dev-client": "PLUGIN=client I8N_NS=plugin__odf-client-console yarn server:plugin",
"serve-local-build": "./http-server.sh ./plugins/odf/dist",
"serve-local-build:c": "yarn ocp-console & yarn serve-local-build & wait",
"serve-local-build-mco": "./http-server.sh ./plugins/mco/dist",
"lint-css": "yarn stylelint packages/**/**/*.scss",
"lint-css-fix": "yarn stylelint packages/**/**/*.scss --fix",
"lint-ts": "yarn eslint --ext .ts,.tsx .",
"lint-ts-fix": "yarn eslint --fix --ext .ts,.tsx .",
"lint": "yarn lint-ts && yarn lint-css",
"lint-fix": "yarn lint-ts-fix && yarn lint-css-fix",
"dev-mco": "PLUGIN=mco I8N_NS=plugin__odf-multicluster-console yarn server:plugin",
"dev:c": "yarn ocp-console & PLUGIN=${PLUGIN:=odf} I8N_NS=${I8N_NS} yarn server:plugin & wait",
"dev:no-type-check": "DEV_NO_TYPE_CHECK=true yarn dev",
"export-pos": "./scripts/i18n/export-pos.sh",
"format": "yarn prettier -w .",
"format-test": "yarn prettier -c .",
"prepare": "husky install",
"i18n": "i18next \"packages/**/*.{ts,tsx}\" [-oc] -c i18next-parser.config.js",
"i18n-test": "yarn i18n --fail-on-update",
"i18n-to-po": "node ./scripts/i18n/i18n-to-po.js",
"po-to-i18n": "node ./scripts/i18n/po-to-i18n.js",
"export-pos": "./scripts/i18n/export-pos.sh",
"memsource-upload": "./scripts/i18n/memsource-upload.sh",
"lint": "yarn lint-ts && yarn lint-css",
"lint-css": "yarn stylelint packages/**/**/*.scss",
"lint-css-fix": "yarn stylelint packages/**/**/*.scss --fix",
"lint-fix": "yarn lint-ts-fix && yarn lint-css-fix",
"lint-ts": "yarn eslint --ext .ts,.tsx .",
"lint-ts-fix": "yarn eslint --fix --ext .ts,.tsx .",
"memsource-download": "./scripts/i18n/memsource-download.sh",
"memsource-upload": "./scripts/i18n/memsource-upload.sh",
"ocp-console": "./scripts/start-ocp-console.sh",
"dev:c": "yarn ocp-console & PLUGIN=${PLUGIN:=odf} I8N_NS=${I8N_NS} yarn server:plugin & wait"
"po-to-i18n": "node ./scripts/i18n/po-to-i18n.js",
"prepare": "husky install",
"serve-local-build": "./http-server.sh ./plugins/odf/dist",
"serve-local-build-mco": "./http-server.sh ./plugins/mco/dist",
"serve-local-build:c": "yarn ocp-console & yarn serve-local-build & wait",
"server:plugin": "yarn build:generate && I8N_NS=${I8N_NS} yarn tsx ./node_modules/.bin/webpack serve -c ./webpack.config.ts --progress",
"sort:packagejson": "npx sort-package-json **/package.json",
"test": "jest --config=jest/config.js",
"test-coverage": "jest --config=jest/config.js --silent --coverage --coverageReporters text-summary",
"test-cypress": "node_modules/.bin/cypress open --e2e --config-file ./cypress/cypress.config.ts --env openshift=true",
"test-cypress-headless": "node --max-old-space-size=4096 node_modules/.bin/cypress run --e2e --config-file ./cypress/cypress.config.ts --env openshift=true --browser ${BRIDGE_E2E_BROWSER_NAME:=chrome} --headless",
"test-silent": "JEST_SILENT_REPORTER_DOTS=true jest --config=jest/config.js --reporters jest-silent-reporter"
},
"lint-staged": {
"*.{ts,tsx,mts}": "eslint --cache --fix -c ./.eslintrc.js",
"*.css": "stylelint --fix",
"*": "prettier --ignore-unknown --write"
},
"resolutions": {
"cross-spawn": "^7.0.6",
"nanoid": "^3.3.8",
"postcss": "^8.4.49",
"tough-cookie": "^4.1.3",
"webpack": "^5.96.1",
"webpack-bundle-analyzer/ws": "^7.5.10",
"webpack-dev-server/express": "^4.21.0"
},
"dependencies": {
"@aws-sdk/client-s3": "3.667.0",
Expand Down Expand Up @@ -183,21 +198,7 @@
"stylelint-order": "^6.0.4",
"webpack-dev-server": "^5.1.0"
},
"resolutions": {
"webpack": "^5.96.1",
"webpack-bundle-analyzer/ws": "^7.5.10",
"webpack-dev-server/express": "^4.21.0",
"tough-cookie": "^4.1.3",
"cross-spawn": "^7.0.6",
"postcss": "^8.4.49",
"nanoid": "^3.3.8"
},
"engines": {
"node": ">=20.x"
},
"lint-staged": {
"*.{ts,tsx,mts}": "eslint --cache --fix -c ./.eslintrc.js",
"*.css": "stylelint --fix",
"*": "prettier --ignore-unknown --write"
}
}
12 changes: 6 additions & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@odf/client",
"description": "UI plugin for ODF client mode cluster",
"version": "0.0.0",
"dependencies": {
"@odf/ocs": "0.0.0",
"@odf/core": "0.0.0",
"@odf/shared": "file:../shared"
},
"description": "UI plugin for ODF client mode cluster",
"scripts": {
"build": "NODE_ENV=production PLUGIN=client I8N_NS=plugin__odf-client yarn --cwd ../.. build:plugin",
"dev": "PLUGIN=client I8N_NS=plugin__odf-client yarn --cwd ../.. server:plugin"
},
"dependencies": {
"@odf/core": "0.0.0",
"@odf/ocs": "0.0.0",
"@odf/shared": "file:../shared"
}
}
6 changes: 3 additions & 3 deletions packages/ibm/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@odf/ibm",
"description": "IBM External Storage Platform",
"version": "0.0.0",
"description": "IBM External Storage Platform",
"dependencies": {
"@odf/shared": "file:../shared",
"@odf/core": "0.0.0",
"@odf/odf-plugin-sdk": "0.0.0",
"@odf/core": "0.0.0"
"@odf/shared": "file:../shared"
}
}
2 changes: 1 addition & 1 deletion packages/mco/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@odf/mco",
"description": "Hosts the UI for Multicluster Orchestartor Operator and is displayed under `All clusters` perspective of OCP console.",
"version": "0.0.0",
"description": "Hosts the UI for Multicluster Orchestartor Operator and is displayed under `All clusters` perspective of OCP console.",
"dependencies": {
"@odf/shared": "file:../shared"
}
Expand Down
6 changes: 3 additions & 3 deletions packages/ocs/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@odf/ocs",
"description": "Ceph and MCG components",
"version": "0.0.0",
"description": "Ceph and MCG components",
"dependencies": {
"@odf/shared": "file:../shared",
"@odf/core": "0.0.0"
"@odf/core": "0.0.0",
"@odf/shared": "file:../shared"
}
}
4 changes: 2 additions & 2 deletions packages/odf-plugin-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@odf/odf-plugin-sdk",
"description": "SDK for interacting with ODF pages",
"version": "0.0.0"
"version": "0.0.0",
"description": "SDK for interacting with ODF pages"
}
6 changes: 3 additions & 3 deletions packages/odf/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "@odf/core",
"description": "Core ODF components",
"version": "0.0.0",
"description": "Core ODF components",
"dependencies": {
"@odf/shared": "file:../shared",
"@odf/odf-plugin-sdk": "0.0.0"
"@odf/odf-plugin-sdk": "0.0.0",
"@odf/shared": "file:../shared"
}
}
12 changes: 6 additions & 6 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "@odf-console/shared",
"description": "ODF console shared code.",
"version": "0.0.0-beta15",
"license": "Apache-2.0",
"private": false,
"main": "src/index.ts",
"files": [
"src"
],
"description": "ODF console shared code.",
"keywords": [
"openshift",
"odf",
"console",
"plugin",
"library"
],
"license": "Apache-2.0",
"main": "src/index.ts",
"files": [
"src"
],
"scripts": {
"build": "rm -rf build && mkdir build && cp -r src package.json LICENSE build",
"publish-new": "scripts/publish-new.sh"
Expand Down
Loading