Skip to content

Commit

Permalink
refactor: change react to a peer dependency
Browse files Browse the repository at this point in the history
BREAKING CHANGE: react is now a peer dependency of our react package.
  • Loading branch information
kyubisation committed Dec 11, 2024
1 parent a59064e commit 1e806ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/react-experimental/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"peerDependencies": {
"@sbb-esta/lyne-elements": "0.0.0-PLACEHOLDER",
"@sbb-esta/lyne-elements-experimental": "0.0.0-PLACEHOLDER",
"@sbb-esta/lyne-react": "0.0.0-PLACEHOLDER"
"@sbb-esta/lyne-react": "0.0.0-PLACEHOLDER",
"react": "^18.2.0 || ^19.0.0"
},
"dependencies": {
"@lit/react": "0.0.0-LITREACT",
"react": "0.0.0-REACT",
"tslib": "0.0.0-TSLIB"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions src/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
],
"type": "module",
"peerDependencies": {
"@sbb-esta/lyne-elements": "0.0.0-PLACEHOLDER"
"@sbb-esta/lyne-elements": "0.0.0-PLACEHOLDER",
"react": "^18.2.0 || ^19.0.0"
},
"dependencies": {
"@lit/react": "0.0.0-LITREACT",
"react": "0.0.0-REACT",
"tslib": "0.0.0-TSLIB"
},
"publishConfig": {
Expand Down
2 changes: 0 additions & 2 deletions tools/vite/package-json-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function packageJsonTemplate(
const litVersion = rootPackageJson.dependencies.lit.match(/\d+\.\d+\.\d+/);
const litObserversVersion =
rootPackageJson.devDependencies['@lit-labs/observers'].match(/\d+\.\d+\.\d+/);
const reactMajorVersion = +rootPackageJson.devDependencies.react.match(/\d+/);
const litReactVersion = rootPackageJson.devDependencies['@lit/react'].match(/\d+\.\d+\.\d+/);
const tslibVersion = rootPackageJson.devDependencies.tslib.match(/\d+\.\d+\.\d+/);
const packageJsonTemplate = readFileSync(
Expand All @@ -41,7 +40,6 @@ export function packageJsonTemplate(
.replaceAll('0.0.0-LITOBSERVERS', `^${litObserversVersion}`)
.replaceAll('0.0.0-LITREACT', `^${litReactVersion}`)
.replaceAll('0.0.0-TSLIB', `^${tslibVersion}`)
.replaceAll('0.0.0-REACT', `^${reactMajorVersion}.0.0`)
.replaceAll('0.0.0-LIT', `^${litVersion}`);
const packageJson = JSON.parse(packageJsonContent);
for (const key of ['author', 'license', 'repository', 'bugs']) {
Expand Down

0 comments on commit 1e806ed

Please sign in to comment.