Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…nfo_arch.json as source for View Components (#4)

closes #3
  • Loading branch information
gr2m committed Jun 2, 2023
1 parent b7f5fd4 commit 5fe5508
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions patches/@changesets+cli+2.26.1.patch
@@ -1,5 +1,5 @@
diff --git a/node_modules/@changesets/cli/dist/cli.cjs.dev.js b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
index 73ab02a..f78765a 100644
index 73ab02a..70bb64b 100644
--- a/node_modules/@changesets/cli/dist/cli.cjs.dev.js
+++ b/node_modules/@changesets/cli/dist/cli.cjs.dev.js
@@ -101,7 +101,7 @@ function _objectSpread2(target) {
Expand Down Expand Up @@ -57,19 +57,19 @@ index 73ab02a..f78765a 100644
+ ...Object.values(components).map((component) => component.name)
+ );
+ } else if (pkg.name === "@primer/view-components") {
+ logger.log(
+ `Loading components information for ${pkg.name} from https://primer.github.io/view_components/components.json`
+ const componentsPath = path__default["default"].join(
+ process.cwd(),
+ "static/info_arch.json"
+ );
+
+ if (!globalThis?.fetch) {
+ throw new Error(`This CLI must be run in a Node.js 18+`);
+ }
+ logger.log(
+ `Loading components information for ${pkg.name} from ${componentsPath}`
+ );
+
+ const response = await fetch(
+ "https://primer.github.io/view_components/components.json"
+ const components = require(componentsPath);
+ primerPackages.push(
+ ...Object.values(components).map((component) => component.fully_qualified_name)
+ );
+ const components = await response.json();
+ primerPackages.push(...components.map((component) => component.id));
+ } else {
+ if (!SUPPORTED_PRIMER_PACKAGES.includes(pkg.name)) {
+ throw new Error(
Expand Down

0 comments on commit 5fe5508

Please sign in to comment.