-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/pantheon-systems/pantheon-c…
…ontent-cloud-sdk into od/graphql/update-pagination-format
- Loading branch information
Showing
152 changed files
with
24,547 additions
and
16,372 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,4 @@ jobs: | |
run: pnpm --filter '*cli*' build:test | ||
|
||
- name: Test | ||
run: pnpm --filter '*cli*' test | ||
run: pnpm test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
shamefully-hoist=true | ||
save-workspace-protocol=false | ||
prefer-workspace-packages=true | ||
prefer-workspace-packages=true | ||
link-workspace-packages=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
const fs = require("fs"); | ||
const path = require("path"); | ||
|
||
/** | ||
* This pnpm install hook links all packages in the monorepo to their local versions. | ||
* This allows us to use published version numbers in package.json files, while still | ||
* depending on the local version of the package when inside the monorepo. | ||
*/ | ||
const monorepoRoot = findMonorepoRoot(process.cwd()); | ||
const workspacePackageDirectories = [ | ||
"packages", | ||
"starters", | ||
"configs", | ||
"local_testing", | ||
]; | ||
const workspacePackages = new Map(); | ||
|
||
workspacePackageDirectories.forEach((workspacePackageDir) => { | ||
const allDirs = fs.readdirSync(path.join(monorepoRoot, workspacePackageDir)); | ||
allDirs | ||
.filter((dir) => { | ||
return fs | ||
.statSync(path.join(monorepoRoot, workspacePackageDir, dir)) | ||
.isDirectory(); | ||
}) | ||
.forEach((dir) => { | ||
const pkgPath = path.join(monorepoRoot, workspacePackageDir, dir); | ||
const pkgName = require(path.join(pkgPath, "package.json")).name; | ||
workspacePackages.set(pkgName, pkgPath); | ||
}); | ||
}); | ||
|
||
module.exports = { | ||
hooks: { | ||
// This runs after package.json is parsed but before versions are resolved | ||
// We just set the dependencies to the local version if they are in the monorepo | ||
// These changes to the package.json are not saved to disk, but the resolved versions | ||
// are, which is fine for us because users cloning the starterkits will not use the | ||
// monorepo's lockfile | ||
readPackage(pkg) { | ||
for (const dep in pkg.dependencies) { | ||
if (workspacePackages.has(dep)) { | ||
console.log(`INFO: Linking ${pkg.name} to local version of ${dep}`); | ||
pkg.dependencies[dep] = `workspace:*`; | ||
} | ||
} | ||
for (const dep in pkg.devDependencies) { | ||
if (workspacePackages.has(dep)) { | ||
console.log(`INFO: Linking ${pkg.name} to local version of ${dep}`); | ||
pkg.devDependencies[dep] = `workspace:*`; | ||
} | ||
} | ||
|
||
return pkg; | ||
}, | ||
}, | ||
}; | ||
|
||
function findMonorepoRoot(currentDir) { | ||
let dir = currentDir; | ||
while (dir !== path.parse(dir).root) { | ||
if (fs.existsSync(path.join(dir, "pnpm-workspace.yaml"))) { | ||
return dir; | ||
} | ||
dir = path.dirname(dir); | ||
} | ||
return null; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.