Skip to content

Commit

Permalink
build: add dependency alignment to constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
castastrophe committed Feb 1, 2025
1 parent 6185287 commit 13aae1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "minor",
"updateInternalDependencies": "patch",
"ignore": []
}
12 changes: 8 additions & 4 deletions yarn.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = defineConfig({
* @param {string} folderName
* @returns {void}
*/
function updateComponentPackageJson(workspace, folderName) {
function validateComponentPackageJson(workspace, folderName) {
// Only update the homepage if it does not already exist
if (!workspace.manifest.homepage) {
workspace.set("homepage", `https://opensource.adobe.com/spectrum-css/?path=/docs/components-${folderName}--docs`);
Expand Down Expand Up @@ -88,7 +88,7 @@ module.exports = defineConfig({
* @param {Workspace} workspace
* @returns {void}
*/
function updatePackageJson(workspace) {
function validatePackageJson(workspace) {
const isRoot = workspace.cwd === ".";
const isComponent = components.includes(workspace.cwd);
const isToken = workspace.cwd === "tokens";
Expand All @@ -114,7 +114,7 @@ module.exports = defineConfig({
*/
if (isComponent) {
const folderName = workspace.cwd?.split("/")?.[1];
updateComponentPackageJson(workspace, folderName);
validateComponentPackageJson(workspace, folderName);
validateLocalPackages(workspace);
}
/**
Expand Down Expand Up @@ -144,8 +144,12 @@ module.exports = defineConfig({
}
}

/**
* This loop iterates over all the workspaces in the project
* and updates the package.json file with the necessary
*/
for (const workspace of Yarn.workspaces()) {
updatePackageJson(workspace);
validatePackageJson(workspace);
}
},
});

0 comments on commit 13aae1d

Please sign in to comment.