@stacksjs/actions 0.70.157 → 0.70.159

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.
package/dist/blog.js CHANGED
@@ -39,14 +39,18 @@ async function loadBunPress() {
39
39
  bunpressPromise = (async () => {
40
40
  const candidates = [
41
41
  join(homedir(), "Code/Tools/bunpress/packages/bunpress/dist/src/index.js"),
42
- join(process.cwd(), "pantry/@stacksjs/bunpress/dist/src/index.js"),
43
- "@stacksjs/bunpress"
44
- ];
45
- for (const entry of candidates)
42
+ join(process.cwd(), "pantry/@stacksjs/bunpress/dist/src/index.js")
43
+ ].filter((entry) => existsSync(entry));
44
+ try {
45
+ candidates.push(Bun.resolveSync("@stacksjs/bunpress", import.meta.dir));
46
+ } catch {}
47
+ for (const entry of new Set(candidates))
46
48
  try {
47
- if (entry.startsWith("@") || existsSync(entry))
48
- return await import(entry);
49
- } catch {}
49
+ return await import(entry);
50
+ } catch (cause) {
51
+ const detail = cause instanceof Error ? cause.message : String(cause);
52
+ throw Error(`[blog] Failed to import BunPress from ${entry}: ${detail}`, { cause });
53
+ }
50
54
  return null;
51
55
  })();
52
56
  return bunpressPromise;
@@ -373,10 +377,10 @@ export async function renderBlogFeed(req) {
373
377
  export async function buildBlog(options = { outDir: "dist/blog" }) {
374
378
  const outDir = options.outDir || "dist/blog", siteUrl = (await site()).url, baseUrl = usableOrigin(options.baseUrl) || usableOrigin(siteUrl) || siteUrl.replace(/\/$/, "");
375
379
  if (options.baseUrl && !usableOrigin(options.baseUrl))
376
- console.warn(`[blog] ignoring unusable baseUrl ${JSON.stringify(options.baseUrl)} \u2014 falling back to ${baseUrl}`);
380
+ console.warn(`[blog] ignoring unusable baseUrl ${JSON.stringify(options.baseUrl)}; falling back to ${baseUrl}`);
377
381
  const bp = await loadBunPress();
378
382
  if (!bp)
379
- throw Error("[blog] BunPress not found \u2014 cannot build the blog.");
383
+ throw Error("[blog] BunPress not found; cannot build the blog.");
380
384
  mkdirSync(outDir, { recursive: !0 });
381
385
  const write = (rel, content) => {
382
386
  const target = join(outDir, rel);
@@ -11,6 +11,15 @@ export declare function shouldRunPostSyncHooks(changeCount: number, alreadyResta
11
11
  * choice whenever post-sync work crosses that process boundary.
12
12
  */
13
13
  export declare function shouldRefreshPostSyncDependencies(corePackageChanged: boolean, alreadyRestarted: boolean): boolean;
14
+ /**
15
+ * Fully refresh dependencies after replacing vendored workspace manifests.
16
+ *
17
+ * A plain `bun install` may reuse the existing nested package placement and
18
+ * leave a lockfile that changes in a clean checkout. `--force` makes Bun
19
+ * resolve the complete workspace graph so the resulting lockfile is valid for
20
+ * subsequent frozen installs.
21
+ */
22
+ export declare function runPostSyncDependencyRefresh(options: PostSyncDependencyOptions): Promise<void>;
14
23
  /**
15
24
  * Run the migration hook after a vendored framework upgrade.
16
25
  *
@@ -35,4 +44,9 @@ declare interface PostSyncMigrationOptions {
35
44
  projectRoot: string
36
45
  spawn: PostSyncSpawn
37
46
  }
47
+ declare interface PostSyncDependencyOptions {
48
+ bunExecutable: string
49
+ projectRoot: string
50
+ spawn: PostSyncSpawn
51
+ }
38
52
  declare type PostSyncSpawn = (options: PostSyncSpawnOptions) => { exited: Promise<number> }
@@ -4,6 +4,17 @@ export function shouldRunPostSyncHooks(changeCount, alreadyRestarted) {
4
4
  export function shouldRefreshPostSyncDependencies(corePackageChanged, alreadyRestarted) {
5
5
  return corePackageChanged || alreadyRestarted;
6
6
  }
7
+ export async function runPostSyncDependencyRefresh(options) {
8
+ const code = await options.spawn({
9
+ cmd: [options.bunExecutable, "install", "--force"],
10
+ cwd: options.projectRoot,
11
+ stdin: "ignore",
12
+ stdout: "inherit",
13
+ stderr: "inherit"
14
+ }).exited;
15
+ if (code !== 0)
16
+ throw Error(`Post-upgrade dependency refresh exited with code ${code}.`);
17
+ }
7
18
  export async function runPostSyncMigration(options) {
8
19
  const code = await options.spawn({
9
20
  cmd: [options.bunExecutable, options.migrateScript, "migrate", "--force"],
@@ -26,6 +26,7 @@ import {
26
26
  writeSyncedVersion
27
27
  } from "./framework-utils";
28
28
  import {
29
+ runPostSyncDependencyRefresh,
29
30
  runPostSyncMigration,
30
31
  shouldRefreshPostSyncDependencies,
31
32
  shouldRunPostSyncHooks
@@ -423,14 +424,11 @@ async function runPostSyncHooks(args) {
423
424
  }), alreadyRestarted)) {
424
425
  console.log("Running `bun install` to refresh dependencies...");
425
426
  try {
426
- const code = await Bun.spawn({
427
- cmd: [process.argv[0] || "bun", "install"],
428
- cwd: projectRoot,
429
- stdout: "inherit",
430
- stderr: "inherit"
431
- }).exited;
432
- if (code !== 0)
433
- console.warn(` bun install exited with code ${code} (non-fatal)`);
427
+ await runPostSyncDependencyRefresh({
428
+ bunExecutable: process.argv[0] || "bun",
429
+ projectRoot,
430
+ spawn: (spawnOptions) => Bun.spawn(spawnOptions)
431
+ });
434
432
  } catch (err) {
435
433
  console.warn(` bun install failed (non-fatal): ${err?.message || err}`);
436
434
  }
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.157",
5
+ "version": "0.70.159",
6
6
  "description": "The Stacks actions.",
7
7
  "author": "Chris Breuer",
8
8
  "contributors": [
@@ -62,31 +62,31 @@
62
62
  "prepublishOnly": "bun run build"
63
63
  },
64
64
  "dependencies": {
65
- "@stacksjs/config": "0.70.157",
65
+ "@stacksjs/config": "0.70.159",
66
66
  "@stacksjs/bumpx": "^0.2.6",
67
- "@stacksjs/bunpress": "^0.1.12",
67
+ "@stacksjs/bunpress": "^0.1.14",
68
68
  "@stacksjs/logsmith": "^0.2.3",
69
69
  "@stacksjs/ts-cloud": "^0.7.47",
70
70
  "@stacksjs/ts-md": "^0.1.1"
71
71
  },
72
72
  "devDependencies": {
73
- "@stacksjs/api": "0.70.157",
74
- "@stacksjs/cli": "0.70.157",
75
- "@stacksjs/config": "0.70.157",
76
- "@stacksjs/database": "0.70.157",
73
+ "@stacksjs/api": "0.70.159",
74
+ "@stacksjs/cli": "0.70.159",
75
+ "@stacksjs/config": "0.70.159",
76
+ "@stacksjs/database": "0.70.159",
77
77
  "@stacksjs/tlsx": "^0.13.2",
78
78
  "better-dx": "^0.2.17",
79
- "@stacksjs/dns": "0.70.157",
80
- "@stacksjs/enums": "0.70.157",
81
- "@stacksjs/env": "0.70.157",
82
- "@stacksjs/error-handling": "0.70.157",
83
- "@stacksjs/logging": "0.70.157",
84
- "@stacksjs/path": "0.70.157",
85
- "@stacksjs/security": "0.70.157",
86
- "@stacksjs/storage": "0.70.157",
87
- "@stacksjs/strings": "0.70.157",
88
- "@stacksjs/utils": "0.70.157",
89
- "@stacksjs/validation": "0.70.157"
79
+ "@stacksjs/dns": "0.70.159",
80
+ "@stacksjs/enums": "0.70.159",
81
+ "@stacksjs/env": "0.70.159",
82
+ "@stacksjs/error-handling": "0.70.159",
83
+ "@stacksjs/logging": "0.70.159",
84
+ "@stacksjs/path": "0.70.159",
85
+ "@stacksjs/security": "0.70.159",
86
+ "@stacksjs/storage": "0.70.159",
87
+ "@stacksjs/strings": "0.70.159",
88
+ "@stacksjs/utils": "0.70.159",
89
+ "@stacksjs/validation": "0.70.159"
90
90
  },
91
91
  "peerDependencies": {
92
92
  "pickier": "^0.1.35"