@stacksjs/actions 0.70.160 → 0.70.162
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/README.md +1 -1
- package/dist/blog.js +1 -1
- package/dist/build/desktop.js +58 -4
- package/dist/build/views.js +11 -6
- package/dist/build.d.ts +1 -1
- package/dist/build.js +2 -2
- package/dist/copy-types.js +0 -1
- package/dist/dev/components.js +1 -1
- package/dist/dev/dashboard.js +8 -8
- package/dist/dev/desktop.d.ts +1 -1
- package/dist/dev/desktop.js +1 -5
- package/dist/dev/system-tray.js +171 -4
- package/dist/examples.js +2 -2
- package/dist/helpers/lib-entries.js +3 -3
- package/dist/helpers/vscode-custom-data.d.ts +1 -0
- package/dist/helpers/vscode-custom-data.js +32 -2
- package/dist/make.d.ts +2 -0
- package/dist/make.js +10 -4
- package/dist/stacks.d.ts +1 -1
- package/dist/stacks.js +208 -157
- package/dist/templates.js +11 -8
- package/dist/test/feature.js +2 -11
- package/dist/test/index.js +2 -11
- package/dist/test/runner.d.ts +1 -0
- package/dist/test/runner.js +30 -0
- package/dist/test/unit.js +2 -11
- package/dist/upgrade/packages.d.ts +18 -0
- package/dist/upgrade/packages.js +49 -8
- package/package.json +20 -19
package/dist/upgrade/packages.js
CHANGED
|
@@ -2,6 +2,34 @@ import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { runCommand } from "@stacksjs/cli";
|
|
5
|
+
export function hasStacksDependency(pkg) {
|
|
6
|
+
return Boolean(pkg.dependencies?.stacks || pkg.devDependencies?.stacks);
|
|
7
|
+
}
|
|
8
|
+
export function standalonePackageUpdateCommand() {
|
|
9
|
+
return "bun update";
|
|
10
|
+
}
|
|
11
|
+
async function updateStandalonePackage(projectRoot, options) {
|
|
12
|
+
console.log(`
|
|
13
|
+
Standalone package detected. No Stacks framework source is installed.`);
|
|
14
|
+
if (options.dryRun) {
|
|
15
|
+
console.log(" --dry-run: would refresh the package dependencies with `bun update`. No files were changed.\n");
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
if (options.noPostinstall) {
|
|
19
|
+
console.log(" --no-postinstall: skipping the dependency refresh. Run `bun update` when ready.\n");
|
|
20
|
+
process.exit(0);
|
|
21
|
+
}
|
|
22
|
+
console.log(` Refreshing declared dependencies...
|
|
23
|
+
`);
|
|
24
|
+
if ((await runCommand(standalonePackageUpdateCommand(), { cwd: projectRoot })).isErr) {
|
|
25
|
+
console.error("\n\u2717 The dependency refresh failed. Resolve the reported error and re-run `buddy update`.\n");
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
console.log(`
|
|
29
|
+
\u2714 Standalone package dependencies are up to date.
|
|
30
|
+
`);
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
5
33
|
async function resolveTarget(options) {
|
|
6
34
|
const res = await fetch("https://registry.npmjs.org/stacks").catch(() => null);
|
|
7
35
|
if (!res || !res.ok)
|
|
@@ -18,17 +46,27 @@ async function resolveTarget(options) {
|
|
|
18
46
|
throw Error(`The \`${tag}\` dist-tag is not published for \`stacks\`.`);
|
|
19
47
|
version = resolved;
|
|
20
48
|
}
|
|
21
|
-
const
|
|
22
|
-
return { version,
|
|
49
|
+
const metaDeps = versions[version]?.dependencies ?? {};
|
|
50
|
+
return { version, metaDeps };
|
|
51
|
+
}
|
|
52
|
+
export function baseVersion(range) {
|
|
53
|
+
return range.replace(/^[\^~>=<\s]+/, "").trim();
|
|
54
|
+
}
|
|
55
|
+
export function lockstepPackages(metaDeps, target) {
|
|
56
|
+
const lockstep = new Set(["stacks"]);
|
|
57
|
+
for (const [name, range] of Object.entries(metaDeps))
|
|
58
|
+
if (name.startsWith("@stacksjs/") && baseVersion(range) === target)
|
|
59
|
+
lockstep.add(name);
|
|
60
|
+
return lockstep;
|
|
23
61
|
}
|
|
24
|
-
function applyBumps(pkg, target,
|
|
25
|
-
const changes = []
|
|
62
|
+
export function applyBumps(pkg, target, lockstep) {
|
|
63
|
+
const changes = [];
|
|
26
64
|
for (const field of ["dependencies", "devDependencies"]) {
|
|
27
65
|
const deps = pkg[field];
|
|
28
66
|
if (!deps)
|
|
29
67
|
continue;
|
|
30
68
|
for (const [name, spec] of Object.entries(deps)) {
|
|
31
|
-
if (!
|
|
69
|
+
if (!lockstep.has(name))
|
|
32
70
|
continue;
|
|
33
71
|
const next = `${/^[\^~]/.test(spec) ? spec[0] : /^\d/.test(spec) ? "" : "^"}${target}`;
|
|
34
72
|
if (spec !== next) {
|
|
@@ -45,7 +83,10 @@ export async function upgradeStacksPackages(projectRoot, options) {
|
|
|
45
83
|
console.error("No package.json found \u2014 nothing to upgrade.");
|
|
46
84
|
process.exit(1);
|
|
47
85
|
}
|
|
48
|
-
const raw = readFileSync(pkgPath, "utf-8"), pkg = JSON.parse(raw), current = pkg.dependencies?.stacks ?? pkg.devDependencies?.stacks
|
|
86
|
+
const raw = readFileSync(pkgPath, "utf-8"), pkg = JSON.parse(raw), current = pkg.dependencies?.stacks ?? pkg.devDependencies?.stacks;
|
|
87
|
+
if (!hasStacksDependency(pkg))
|
|
88
|
+
return updateStandalonePackage(projectRoot, options);
|
|
89
|
+
const { version: target, metaDeps } = await resolveTarget(options).catch((err) => {
|
|
49
90
|
console.error(`\u2717 ${err.message}`);
|
|
50
91
|
process.exit(1);
|
|
51
92
|
});
|
|
@@ -54,7 +95,7 @@ export async function upgradeStacksPackages(projectRoot, options) {
|
|
|
54
95
|
if (current)
|
|
55
96
|
console.log(` current \`stacks\` constraint: ${current}
|
|
56
97
|
`);
|
|
57
|
-
const changes = applyBumps(pkg, target,
|
|
98
|
+
const lockstep = lockstepPackages(metaDeps, target), changes = applyBumps(pkg, target, lockstep);
|
|
58
99
|
if (changes.length === 0 && !options.force) {
|
|
59
100
|
console.log(`\u2714 Already up to date \u2014 every framework dependency matches the target.
|
|
60
101
|
`);
|
|
@@ -79,7 +120,7 @@ export async function upgradeStacksPackages(projectRoot, options) {
|
|
|
79
120
|
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}${trailing}`);
|
|
80
121
|
console.log("\u2714 Updated package.json");
|
|
81
122
|
}
|
|
82
|
-
const frameworkPkgs = [
|
|
123
|
+
const frameworkPkgs = [...lockstep];
|
|
83
124
|
if (options.noPostinstall) {
|
|
84
125
|
console.log(" --no-postinstall: skipping install. Run this to pull the new versions:");
|
|
85
126
|
console.log(` bun update ${frameworkPkgs.slice(0, 3).join(" ")} \u2026
|
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.162",
|
|
6
6
|
"description": "The Stacks actions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"contributors": [
|
|
@@ -62,31 +62,32 @@
|
|
|
62
62
|
"prepublishOnly": "bun run build"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@stacksjs/config": "0.70.
|
|
65
|
+
"@stacksjs/config": "0.70.162",
|
|
66
66
|
"@stacksjs/bumpx": "^0.2.6",
|
|
67
|
-
"@stacksjs/bunpress": "^0.1.
|
|
67
|
+
"@stacksjs/bunpress": "^0.1.18",
|
|
68
68
|
"@stacksjs/logsmith": "^0.2.3",
|
|
69
|
-
"@stacksjs/
|
|
69
|
+
"@stacksjs/registry": "0.70.162",
|
|
70
|
+
"@stacksjs/ts-cloud": "^0.7.56",
|
|
70
71
|
"@stacksjs/ts-md": "^0.1.1"
|
|
71
72
|
},
|
|
72
73
|
"devDependencies": {
|
|
73
|
-
"@stacksjs/api": "0.70.
|
|
74
|
-
"@stacksjs/cli": "0.70.
|
|
75
|
-
"@stacksjs/config": "0.70.
|
|
76
|
-
"@stacksjs/database": "0.70.
|
|
74
|
+
"@stacksjs/api": "0.70.162",
|
|
75
|
+
"@stacksjs/cli": "0.70.162",
|
|
76
|
+
"@stacksjs/config": "0.70.162",
|
|
77
|
+
"@stacksjs/database": "0.70.162",
|
|
77
78
|
"@stacksjs/tlsx": "^0.13.2",
|
|
78
79
|
"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.
|
|
80
|
+
"@stacksjs/dns": "0.70.162",
|
|
81
|
+
"@stacksjs/enums": "0.70.162",
|
|
82
|
+
"@stacksjs/env": "0.70.162",
|
|
83
|
+
"@stacksjs/error-handling": "0.70.162",
|
|
84
|
+
"@stacksjs/logging": "0.70.162",
|
|
85
|
+
"@stacksjs/path": "0.70.162",
|
|
86
|
+
"@stacksjs/security": "0.70.162",
|
|
87
|
+
"@stacksjs/storage": "0.70.162",
|
|
88
|
+
"@stacksjs/strings": "0.70.162",
|
|
89
|
+
"@stacksjs/utils": "0.70.162",
|
|
90
|
+
"@stacksjs/validation": "0.70.162"
|
|
90
91
|
},
|
|
91
92
|
"peerDependencies": {
|
|
92
93
|
"pickier": "^0.1.35"
|