@stacksjs/actions 0.70.156 → 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 +13 -9
- package/dist/bump.js +14 -6
- package/dist/upgrade/framework-hooks.d.ts +14 -0
- package/dist/upgrade/framework-hooks.js +11 -0
- package/dist/upgrade/framework.js +6 -8
- package/package.json +18 -18
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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)}
|
|
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
|
|
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);
|
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, writeFileSync } from "node:fs";
|
|
5
|
+
import { existsSync, 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)
|
|
@@ -126,11 +126,19 @@ async function writeChangelog() {
|
|
|
126
126
|
await writeChangelog();
|
|
127
127
|
if (!isDryRun && isFrameworkRelease)
|
|
128
128
|
pinMetaCoreDeps(nextVersion);
|
|
129
|
-
if (!isDryRun && existsSync(p.projectPath("bun.lock")))
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
if (!isDryRun && existsSync(p.projectPath("bun.lock"))) {
|
|
130
|
+
const lockPath = p.projectPath("bun.lock"), previousLock = readFileSync(lockPath);
|
|
131
|
+
unlinkSync(lockPath);
|
|
132
|
+
try {
|
|
133
|
+
await execSync(["bun", "install", "--lockfile-only"], {
|
|
134
|
+
cwd: p.projectPath(),
|
|
135
|
+
stdin: "inherit"
|
|
136
|
+
});
|
|
137
|
+
} catch (error) {
|
|
138
|
+
writeFileSync(lockPath, previousLock);
|
|
139
|
+
throw error;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
134
142
|
function pinMetaCoreDeps(version) {
|
|
135
143
|
const metaPath = p.frameworkPath("core/package.json"), meta = JSON.parse(readFileSync(metaPath, "utf-8"));
|
|
136
144
|
let pinned = 0;
|
|
@@ -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
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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.
|
|
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.
|
|
65
|
+
"@stacksjs/config": "0.70.159",
|
|
66
66
|
"@stacksjs/bumpx": "^0.2.6",
|
|
67
|
-
"@stacksjs/bunpress": "^0.1.
|
|
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.
|
|
74
|
-
"@stacksjs/cli": "0.70.
|
|
75
|
-
"@stacksjs/config": "0.70.
|
|
76
|
-
"@stacksjs/database": "0.70.
|
|
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.
|
|
80
|
-
"@stacksjs/enums": "0.70.
|
|
81
|
-
"@stacksjs/env": "0.70.
|
|
82
|
-
"@stacksjs/error-handling": "0.70.
|
|
83
|
-
"@stacksjs/logging": "0.70.
|
|
84
|
-
"@stacksjs/path": "0.70.
|
|
85
|
-
"@stacksjs/security": "0.70.
|
|
86
|
-
"@stacksjs/storage": "0.70.
|
|
87
|
-
"@stacksjs/strings": "0.70.
|
|
88
|
-
"@stacksjs/utils": "0.70.
|
|
89
|
-
"@stacksjs/validation": "0.70.
|
|
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"
|