@catladder/cli 0.0.0-next-31a23584 → 0.0.0-next-41642e39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/apps/cli/src/publish/npmPublishJob.js +17 -12
  2. package/dist/apps/cli/src/publish/npmPublishJob.js.map +1 -1
  3. package/dist/bundles/catci/index.js +2 -2
  4. package/dist/bundles/catenv/index.js +140 -43
  5. package/dist/bundles/cli/index.js +140 -43
  6. package/dist/bundles/skills/catladder-deploys/SKILL.md +31 -2
  7. package/dist/bundles/skills/catladder-deploys/references/deploy-types.md +10 -0
  8. package/dist/packages/pipeline/src/build/node/cache.js +33 -36
  9. package/dist/packages/pipeline/src/build/node/cache.js.map +1 -1
  10. package/dist/packages/pipeline/src/deploy/base/deploy.js +5 -3
  11. package/dist/packages/pipeline/src/deploy/base/deploy.js.map +1 -1
  12. package/dist/packages/pipeline/src/deploy/custom/deployJob.js +3 -0
  13. package/dist/packages/pipeline/src/deploy/custom/deployJob.js.map +1 -1
  14. package/dist/packages/pipeline/src/deploy/index.d.ts +1 -0
  15. package/dist/packages/pipeline/src/deploy/index.js +3 -0
  16. package/dist/packages/pipeline/src/deploy/index.js.map +1 -1
  17. package/dist/packages/pipeline/src/deploy/npmPackage/index.js +4 -4
  18. package/dist/packages/pipeline/src/deploy/npmPackage/index.js.map +1 -1
  19. package/dist/packages/pipeline/src/deploy/pages/deployJob.d.ts +3 -0
  20. package/dist/packages/pipeline/src/deploy/pages/deployJob.js +55 -0
  21. package/dist/packages/pipeline/src/deploy/pages/deployJob.js.map +1 -0
  22. package/dist/packages/pipeline/src/deploy/pages/index.d.ts +2 -0
  23. package/dist/packages/pipeline/src/deploy/pages/index.js +12 -0
  24. package/dist/packages/pipeline/src/deploy/pages/index.js.map +1 -0
  25. package/dist/packages/pipeline/src/deploy/types/base.d.ts +5 -0
  26. package/dist/packages/pipeline/src/deploy/types/custom.d.ts +4 -0
  27. package/dist/packages/pipeline/src/deploy/types/index.d.ts +7 -3
  28. package/dist/packages/pipeline/src/deploy/types/index.js +1 -0
  29. package/dist/packages/pipeline/src/deploy/types/index.js.map +1 -1
  30. package/dist/packages/pipeline/src/deploy/types/pages.d.ts +37 -0
  31. package/dist/packages/pipeline/src/deploy/types/pages.js +3 -0
  32. package/dist/packages/pipeline/src/deploy/types/pages.js.map +1 -0
  33. package/dist/packages/pipeline/src/types/gitlab-types.d.ts +3 -0
  34. package/dist/packages/pipeline/src/types/jobDefinition.d.ts +1 -1
  35. package/dist/packages/pipeline/src/types/jobs.d.ts +8 -0
  36. package/dist/packages/pipeline/src/types/jobs.js.map +1 -1
  37. package/dist/skills/catladder-deploys/SKILL.md +31 -2
  38. package/dist/skills/catladder-deploys/references/deploy-types.md +10 -0
  39. package/dist/tsconfig.tsbuildinfo +1 -1
  40. package/package.json +2 -3
  41. package/src/publish/npmPublishJob.ts +19 -14
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "0.0.0-next-31a23584",
56
+ "version": "0.0.0-next-41642e39",
57
57
  "scripts": {
58
58
  "lint": "eslint \"src/**/*.ts\"",
59
59
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
@@ -116,6 +116,5 @@
116
116
  },
117
117
  "dependencies": {
118
118
  "tsx": "^4.21.0"
119
- },
120
- "stableVersion": "0.0.0"
119
+ }
121
120
  }
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { spawn } from "child_process";
7
7
  import { readFile, writeFile } from "fs/promises";
8
- import { join } from "path";
8
+ import { join, resolve } from "path";
9
9
  import type { NpmPublishContext } from "./npmPublishPlan";
10
10
  import { computeNpmPublishPlan, slugifyRef } from "./npmPublishPlan";
11
11
 
@@ -57,28 +57,29 @@ const setPackageVersion = async (dir: string, version: string) => {
57
57
  };
58
58
 
59
59
  /**
60
- * writes the package-local .npmrc for token auth. npm expands
61
- * `${NPM_TOKEN}` from the job environment at run time, and never
62
- * includes .npmrc in the published tarball.
60
+ * writes the auth .npmrc and returns its absolute path. It is passed to
61
+ * npm as userconfig: in a workspace monorepo npm resolves its project
62
+ * prefix to the workspace ROOT, so a package-local .npmrc would be
63
+ * silently ignored (ENEEDAUTH). npm expands `${NPM_TOKEN}` from the job
64
+ * environment at run time and never includes .npmrc in the tarball.
63
65
  */
64
66
  const writeNpmrc = async (dir: string, registry: string) => {
65
67
  const registryHost = registry.replace(/^https?:/, "").replace(/\/?$/, "/");
68
+ const npmrcPath = resolve(dir, ".npmrc");
66
69
  await writeFile(
67
- join(dir, ".npmrc"),
68
- [
69
- `registry=${registry}`,
70
+ npmrcPath,
70
71
 
71
- `${registryHost}:_authToken=\${NPM_TOKEN}`,
72
- "",
73
- ].join("\n"),
72
+ `${registryHost}:_authToken=\${NPM_TOKEN}\n`,
74
73
  );
74
+ return npmrcPath;
75
75
  };
76
76
 
77
- const npmPublish = (dir: string, args: string[]) =>
77
+ const npmPublish = (dir: string, npmrcPath: string, args: string[]) =>
78
78
  new Promise<void>((resolvePromise, reject) => {
79
79
  const child = spawn("npm", ["publish", ...args], {
80
80
  cwd: dir,
81
81
  stdio: "inherit",
82
+ env: { ...process.env, NPM_CONFIG_USERCONFIG: npmrcPath },
82
83
  });
83
84
  child.on("error", reject);
84
85
  child.on("exit", (code) =>
@@ -102,17 +103,21 @@ export const npmPublishJob = async (options: NpmPublishJobOptions) => {
102
103
  });
103
104
 
104
105
  const name = await setPackageVersion(options.dir, plan.version);
105
- await writeNpmrc(options.dir, registry);
106
+ const npmrcPath = await writeNpmrc(options.dir, registry);
106
107
 
107
108
  console.log(
108
109
  `publishing ${name}@${plan.version} (dist-tag ${plan.distTag}) to ${registry}`,
109
110
  );
110
- await npmPublish(options.dir, [
111
+ await npmPublish(options.dir, npmrcPath, [
111
112
  "--tag",
112
113
  plan.distTag,
113
114
  "--access",
114
115
  options.access ?? "public",
115
- "--no-git-tag-version",
116
+ "--registry",
117
+ registry,
118
+ // publish exactly this package, not the workspace set npm may
119
+ // otherwise derive from the monorepo root
120
+ "--workspaces=false",
116
121
  ]);
117
122
  console.log(`published ${name}@${plan.version} 🚀`);
118
123
  };