@stacksjs/actions 0.70.234 → 0.70.235

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 (2) hide show
  1. package/dist/bump.js +35 -24
  2. package/package.json +18 -18
package/dist/bump.js CHANGED
@@ -2,7 +2,7 @@ import { execSync, log, parseOptions } from "@stacksjs/cli";
2
2
  import { path as p } from "@stacksjs/path";
3
3
  import { versionBump } from "@stacksjs/bumpx";
4
4
  import { generateChangelog, loadLogsmithConfig } from "@stacksjs/logsmith";
5
- import { existsSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
5
+ import { existsSync, readdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
6
6
  import { join, relative } from "node:path";
7
7
  const options = parseOptions(), allowedBumps = new Set(["patch", "minor", "major", "prepatch", "preminor", "premajor", "prerelease"]), rawBump = options?.bump?.toString(), bumpArg = rawBump ? allowedBumps.has(rawBump) || /^\d+\.\d+\.\d+(?:-[\w.]+)?$/.test(rawBump) ? rawBump : null : null;
8
8
  if (rawBump && !bumpArg)
@@ -127,7 +127,7 @@ async function writeChangelog() {
127
127
  }
128
128
  await writeChangelog();
129
129
  if (!isDryRun && isFrameworkRelease)
130
- pinMetaCoreDeps(nextVersion);
130
+ pinLockstepDeps(nextVersion);
131
131
  if (!isDryRun && existsSync(p.projectPath("bun.lock"))) {
132
132
  const lockPath = p.projectPath("bun.lock"), previousLock = readFileSync(lockPath);
133
133
  unlinkSync(lockPath);
@@ -146,36 +146,47 @@ if (!isDryRun && existsSync(p.projectPath("bun.lock"))) {
146
146
  throw Error(`Release aborted: regenerating bun.lock produced lockfileVersion ${producedVersion ?? "unknown"}, but CI's Bun (1.3.x) requires v${expectedLockfileVersion}. You are releasing with a newer Bun (1.4.x writes v2). Re-run the release with Bun 1.3.x (e.g. via \`bunx bun@1.3.14\`) so CI can parse the lockfile.`);
147
147
  }
148
148
  }
149
- function pinMetaCoreDeps(version) {
150
- const metaPath = p.frameworkPath("core/package.json"), meta = JSON.parse(readFileSync(metaPath, "utf-8"));
151
- let pinned = 0;
152
- for (const field of ["dependencies", "devDependencies"]) {
153
- const deps = meta[field];
154
- if (!deps)
149
+ function lockstepPackages(version) {
150
+ const names = new Set;
151
+ for (const entry of readdirSync(p.frameworkPath("core"), { withFileTypes: !0 })) {
152
+ if (!entry.isDirectory())
155
153
  continue;
156
- for (const name of Object.keys(deps)) {
157
- if (!name.startsWith("@stacksjs/"))
158
- continue;
159
- const dir = name.slice(10), localPkgPath = p.frameworkPath(`core/${dir}/package.json`);
160
- if (!existsSync(localPkgPath))
161
- continue;
162
- const localPkg = JSON.parse(readFileSync(localPkgPath, "utf-8"));
163
- if (localPkg.name !== name)
164
- continue;
165
- if (localPkg.version !== version)
154
+ const manifest = p.frameworkPath(`core/${entry.name}/package.json`);
155
+ if (!existsSync(manifest))
156
+ continue;
157
+ const pkg = JSON.parse(readFileSync(manifest, "utf-8"));
158
+ if (pkg.name?.startsWith("@stacksjs/") && pkg.version === version)
159
+ names.add(pkg.name);
160
+ }
161
+ return names;
162
+ }
163
+ function pinLockstepDeps(version) {
164
+ const lockstep = lockstepPackages(version), next = `^${version}`, manifests = [
165
+ p.frameworkPath("core/package.json"),
166
+ ...readdirSync(p.frameworkPath("core"), { withFileTypes: !0 }).filter((entry) => entry.isDirectory()).map((entry) => p.frameworkPath(`core/${entry.name}/package.json`)).filter((path) => existsSync(path))
167
+ ];
168
+ let pinned = 0;
169
+ for (const manifestPath of manifests) {
170
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf-8"));
171
+ let changed = !1;
172
+ for (const field of ["dependencies", "devDependencies"]) {
173
+ const deps = manifest[field];
174
+ if (!deps)
166
175
  continue;
167
- const next = `^${version}`;
168
- if (deps[name] !== next) {
176
+ for (const name of Object.keys(deps)) {
177
+ if (!lockstep.has(name) || deps[name].startsWith("workspace:") || deps[name] === next)
178
+ continue;
169
179
  deps[name] = next;
180
+ changed = !0;
170
181
  pinned++;
171
182
  }
172
183
  }
173
- }
174
- if (pinned > 0) {
175
- writeFileSync(metaPath, `${JSON.stringify(meta, null, 2)}
184
+ if (changed)
185
+ writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}
176
186
  `);
177
- log.debug(`Pinned ${pinned} lockstep core dep(s) in the stacks meta to ^${version}`);
178
187
  }
188
+ if (pinned > 0)
189
+ log.debug(`Pinned ${pinned} lockstep core dep(s) to ^${version}`);
179
190
  }
180
191
  if (!isDryRun) {
181
192
  await git(["add", "--all"]);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@stacksjs/actions",
3
3
  "type": "module",
4
4
  "sideEffects": false,
5
- "version": "0.70.234",
5
+ "version": "0.70.235",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -59,33 +59,33 @@
59
59
  "prepublishOnly": "bun run build"
60
60
  },
61
61
  "dependencies": {
62
- "@stacksjs/config": "0.70.234",
62
+ "@stacksjs/config": "0.70.235",
63
63
  "@stacksjs/bumpx": "^0.2.6",
64
64
  "@stacksjs/bunpress": "^0.1.18",
65
65
  "@stacksjs/logsmith": "^0.2.3",
66
- "@stacksjs/registry": "0.70.234",
66
+ "@stacksjs/registry": "0.70.235",
67
67
  "@stacksjs/stx": "^0.2.148",
68
68
  "@stacksjs/ts-cloud": "^0.7.92",
69
69
  "@stacksjs/ts-md": "^0.1.1"
70
70
  },
71
71
  "devDependencies": {
72
- "@stacksjs/api": "0.70.234",
73
- "@stacksjs/cli": "0.70.234",
74
- "@stacksjs/database": "0.70.234",
72
+ "@stacksjs/api": "0.70.235",
73
+ "@stacksjs/cli": "0.70.235",
74
+ "@stacksjs/database": "0.70.235",
75
75
  "@stacksjs/tlsx": "^0.13.2",
76
76
  "better-dx": "^0.2.17",
77
- "@stacksjs/dns": "0.70.234",
78
- "@stacksjs/enums": "0.70.234",
79
- "@stacksjs/env": "0.70.234",
80
- "@stacksjs/error-handling": "0.70.234",
81
- "@stacksjs/image": "0.70.234",
82
- "@stacksjs/logging": "0.70.234",
83
- "@stacksjs/path": "0.70.234",
84
- "@stacksjs/security": "0.70.234",
85
- "@stacksjs/storage": "0.70.234",
86
- "@stacksjs/strings": "0.70.234",
87
- "@stacksjs/utils": "0.70.234",
88
- "@stacksjs/validation": "0.70.234"
77
+ "@stacksjs/dns": "0.70.235",
78
+ "@stacksjs/enums": "0.70.235",
79
+ "@stacksjs/env": "0.70.235",
80
+ "@stacksjs/error-handling": "0.70.235",
81
+ "@stacksjs/image": "0.70.235",
82
+ "@stacksjs/logging": "0.70.235",
83
+ "@stacksjs/path": "0.70.235",
84
+ "@stacksjs/security": "0.70.235",
85
+ "@stacksjs/storage": "0.70.235",
86
+ "@stacksjs/strings": "0.70.235",
87
+ "@stacksjs/utils": "0.70.235",
88
+ "@stacksjs/validation": "0.70.235"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "pickier": "^0.1.35"