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

kie-issues#1365: Revisit all React-dependent packages on kie-tools declaring react as a dependency instead of a peerDependency #2559

Merged
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: 1 addition & 1 deletion .github/workflows/ci_check_dependencies_consistency.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ jobs:
shell: bash
run: |
pnpm bootstrap:root
npx --yes syncpack@6.2.0 list-mismatches
npx --yes syncpack@13.0.0 list-mismatches
10 changes: 10 additions & 0 deletions .syncpackrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"@kie-tools/uniforms-patternfly-codegen",
"@kie-tools/yaml-language-server"
]
},
{
"dependencies": ["react", "react-dom"],
"policy": "sameRange"
},
{
"label": "Use workspace protocol when developing local packages",
"dependencies": ["$LOCAL"],
"dependencyTypes": ["prod", "dev"],
"pinVersion": "workspace:*"
}
]
}
8 changes: 5 additions & 3 deletions examples/base64png-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools-core/workspace": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"react": "^17.0.2",
"react-dom": "^17.0.2"
Comment on lines -32 to -33
Copy link
Contributor

Choose a reason for hiding this comment

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

[curious-question] Shouldn't we move this react and react-dom to the devDependencies object so we can still work with this editor in dev mode without accounting for another package in this workspace to bring them? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lordrip Shouldn't be the final package, importing @kie-tools-examples/base64png-editor, to provide react in dependencies of devDependencies?

Copy link
Contributor

Choose a reason for hiding this comment

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

@fantonangeli , yes, the final package (consumer) should definitively provide react. I was referring to another case though.

Let's ignore for a moment that @kie-tools-examples/base64png-editor belongs to this repository, so the package json for it would look like the following:

{
  "name": "@kie-tools-examples/base64png-editor",
  ...
  "dependencies": {},
  "devDependencies": {
    "typescript": "5.0.0"
  },
  "peerDependencies": {
    "react": ">=17.0.2 <19.0.0",
    "react-dom": ">=17.0.2 <19.0.0"
  }
}

Now, performing a yarn install won't bring react to the project, so the project will fail when trying to run it in standalone mode as there's no react dependency in the node_modules.

Now, this repository is slightly different as it's very likely that some other package is bringing react to the node_modules, hence making it work, but if by any chance I bootstrap just the @kie-tools-examples/base64png-editor maybe it will fail, as some dependencies of other packages won't be brought?

I'm not familiar with how pnpm works in terms of bootstraping packages and whether if it will download dependencies for unresolved packages, but if it does, then I think we're good, otherwise, 💥

Maybe 💥 is a bit too dramatic

"@patternfly/react-icons": "^4.93.6"
},
"devDependencies": {
"@kie-tools/root-env": "workspace:*",
Expand All @@ -40,5 +38,9 @@
"copyfiles": "^2.4.1",
"rimraf": "^3.0.2",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions examples/ping-pong-view-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"dependencies": {
"@kie-tools-core/envelope": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"@kie-tools-examples/ping-pong-view": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@kie-tools-examples/ping-pong-view": "workspace:*"
},
"devDependencies": {
"@kie-tools/root-env": "workspace:*",
Expand All @@ -37,5 +35,9 @@
"copyfiles": "^2.4.1",
"rimraf": "^3.0.2",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions examples/ping-pong-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
},
"dependencies": {
"@kie-tools-core/envelope": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@kie-tools-core/envelope-bus": "workspace:*"
},
"devDependencies": {
"@kie-tools/root-env": "workspace:*",
Expand All @@ -32,5 +30,9 @@
"@types/react-dom": "^17.0.5",
"rimraf": "^3.0.2",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions examples/todo-list-view/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
},
"dependencies": {
"@kie-tools-core/envelope": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@kie-tools-core/envelope-bus": "workspace:*"
},
"devDependencies": {
"@kie-tools/root-env": "workspace:*",
Expand All @@ -35,5 +33,9 @@
"copyfiles": "^2.4.1",
"rimraf": "^3.0.2",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/boxed-expression-component/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
"@patternfly/react-styles": "^4.92.6",
"@patternfly/react-table": "^4.112.39",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-resizable": "^1.11.0",
"react-table": "^7.6.2",
"uuid": "^8.3.2"
Expand Down Expand Up @@ -84,5 +82,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/chrome-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools-core/workspace": "workspace:*",
"@octokit/rest": "^18.5.3",
"minimatch": "^3.0.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"minimatch": "^3.0.5"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -58,5 +56,9 @@
"rimraf": "^3.0.2",
"ts-jest": "^29.1.5",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 4 additions & 4 deletions packages/dashbuilder-component-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
"lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"",
"test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\""
},
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
Expand All @@ -48,5 +44,9 @@
"rimraf": "^3.0.2",
"ts-jest": "^29.1.5",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-component-echarts-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\""
},
"dependencies": {
"echarts": "^5.3.2",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"echarts": "^5.3.2"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -41,5 +39,9 @@
"copyfiles": "^2.4.1",
"rimraf": "^3.0.2",
"typescript": "^5.5.3"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-component-echarts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
},
"dependencies": {
"@kie-tools/dashbuilder-component-api": "workspace:*",
"@kie-tools/dashbuilder-component-echarts-base": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@kie-tools/dashbuilder-component-echarts-base": "workspace:*"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -46,5 +44,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/dashbuilder-component-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools/dashbuilder-component-api": "workspace:*",
"d3-scale": "^4.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-simple-maps": "^3.0.0"
},
"devDependencies": {
Expand All @@ -50,5 +48,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-component-svg-heatmap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
"dependencies": {
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools/dashbuilder-component-api": "workspace:*",
"heatmap.js": "^2.0.5",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"heatmap.js": "^2.0.5"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -47,5 +45,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-component-table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools/dashbuilder-component-api": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-table": "^4.112.39",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@patternfly/react-table": "^4.112.39"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -49,5 +47,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-component-timeseries/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
},
"dependencies": {
"@kie-tools/dashbuilder-component-api": "workspace:*",
"@kie-tools/dashbuilder-component-echarts-base": "workspace:*",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@kie-tools/dashbuilder-component-echarts-base": "workspace:*"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -46,5 +44,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/dashbuilder-component-uniforms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"@patternfly/react-table": "^4.112.39",
"ajv": "^6.12.6",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"uniforms": "^3.10.2",
"uniforms-bridge-json-schema": "^3.10.2"
},
Expand All @@ -52,5 +50,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/dashbuilder-component-victory-charts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-table": "^4.112.39",
"numeral": "^2.0.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"victory-zoom-container": "^35.11.4"
},
"devDependencies": {
Expand All @@ -53,5 +51,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/dashbuilder-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
"json-schema": "^0.4.0",
"monaco-editor": "^0.39.0",
"monaco-yaml": "^4.0.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"vscode-languageserver-types": "^3.16.0"
},
"devDependencies": {
Expand All @@ -69,5 +67,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
8 changes: 5 additions & 3 deletions packages/dashbuilder-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools-core/workspace": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"react": "^17.0.2",
"react-dom": "^17.0.2"
"@patternfly/react-icons": "^4.93.6"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -59,5 +57,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
6 changes: 4 additions & 2 deletions packages/dev-deployment-dmn-form-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
"@readme/openapi-parser": "^2.5.0",
"json-refs": "^3.0.15",
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
Expand Down Expand Up @@ -76,5 +74,9 @@
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.9.0"
},
"peerDependencies": {
"react": ">=17.0.2 <19.0.0",
"react-dom": ">=17.0.2 <19.0.0"
}
}
Loading
Loading