Skip to content

Commit

Permalink
Remove package.json workarounds (#670)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus authored Jun 23, 2023
1 parent 42232f6 commit 9813214
Show file tree
Hide file tree
Showing 6 changed files with 241 additions and 3,374 deletions.
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.1.cjs

This file was deleted.

874 changes: 0 additions & 874 deletions .yarn/releases/yarn-3.6.0.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ defaultSemverRangePrefix: ""

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-3.6.0.cjs
yarnPath: ./homeassistant-frontend/.yarn/releases/yarn-3.6.0.cjs
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
"@vue/web-component-wrapper": "1.3.0",
"@webcomponents/scoped-custom-element-registry": "0.0.9",
"@webcomponents/webcomponentsjs": "2.8.0",
"app-datepicker": "5.0.1",
"app-datepicker": "5.1.1",
"chart.js": "3.3.2",
"comlink": "4.4.1",
"core-js": "3.31.0",
Expand Down Expand Up @@ -237,15 +237,13 @@
"workbox-strategies": "7.0.0",
"xss": "1.0.14"
},
"resolutionsOverride": {
"@polymer/polymer": "patch:@polymer/[email protected]#./homeassistant-frontend/.yarn/patches/@polymer/polymer/pr-5569.patch"
},
"dependenciesOverride": {
"app-datepicker": "5.0.1"
},
"resolutionsOverride": {},
"dependenciesOverride": {},
"devDependenciesOverride": {},
"packageManager": "[email protected]",
"resolutions": {
"@polymer/polymer": "patch:@polymer/[email protected]#./homeassistant-frontend/.yarn/patches/@polymer/polymer/pr-5569.patch"
"@polymer/polymer": "patch:@polymer/[email protected]#./homeassistant-frontend/.yarn/patches/@polymer/polymer/pr-5569.patch",
"@material/mwc-button@^0.25.3": "^0.27.0",
"[email protected]": "patch:sortablejs@npm%3A1.15.0#./homeassistant-frontend/.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch"
}
}
11 changes: 4 additions & 7 deletions script/merge_requirements.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,14 @@ let rawhacs = fs.readFileSync("./package.json");
const core = JSON.parse(rawcore);
const hacs = JSON.parse(rawhacs);

fs.mkdirSync(".yarn/releases", { recursive: true });
fs.readdirSync("./homeassistant-frontend/.yarn/releases").forEach((file) => {
fs.copyFileSync(`./homeassistant-frontend/.yarn/releases/${file}`, `./.yarn/releases/${file}`);
});

fs.writeFileSync(
".yarnrc.yml",
`
defaultSemverRangePrefix: ""
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-${core.packageManager.split("@")[1]}.cjs
yarnPath: ./homeassistant-frontend/.yarn/releases/yarn-${core.packageManager.split("@")[1]}.cjs
`
);

Expand All @@ -37,7 +32,9 @@ fs.writeFileSync(
JSON.stringify(
{
...hacs,
resolutions: { ...hacs.resolutionsOverride },
resolutions: { ...Object.fromEntries(
Object.entries(core.resolutions).map(([key, val]) => [key, val.replace("#.yarn/patches/", "#./homeassistant-frontend/.yarn/patches/").replace("#./.yarn/patches/", "#./homeassistant-frontend/.yarn/patches/")]),
), ...hacs.resolutionsOverride },
dependencies: { ...core.dependencies, ...hacs.dependenciesOverride },
devDependencies: { ...core.devDependencies, ...hacs.devDependenciesOverride },
packageManager: core.packageManager,
Expand Down
Loading

0 comments on commit 9813214

Please sign in to comment.