@codelitdev/platform-cli 0.8.0 → 0.8.2
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 +3 -1
- package/dist/create.js +1 -1
- package/dist/preset.d.ts +4 -2
- package/dist/preset.js +17 -1
- package/dist/preset.json +12 -12
- package/dist/sync.js +8 -5
- package/package.json +1 -1
- package/template/.github/workflows/code-quality.yml +1 -1
- package/template/.github/workflows/platform-conformance.yml +1 -1
- package/template/apps/api/package.json +1 -1
- package/template/apps/web/package.json +1 -1
- package/template/package.json +3 -3
package/README.md
CHANGED
|
@@ -48,7 +48,9 @@ bunx @codelitdev/platform-cli@0.2.0 sync
|
|
|
48
48
|
replaces a file only when its hash still matches the manifest, and creates a
|
|
49
49
|
newly managed file only when it is absent or already identical. Any other
|
|
50
50
|
difference is a conflict: nothing is written, and you reconcile the file by
|
|
51
|
-
hand.
|
|
51
|
+
hand. To reconcile, make the file match this release's template, for example
|
|
52
|
+
by moving a product change into a product-owned file; the next `sync` records
|
|
53
|
+
it. Writes require a clean Git worktree; `--dry-run` works in a dirty one. If
|
|
52
54
|
writing fails, the CLI restores the files it changed.
|
|
53
55
|
|
|
54
56
|
When a release requires changes to product-owned files, its release notes say
|
package/dist/create.js
CHANGED
|
@@ -67,7 +67,7 @@ function validateGeneratedMetadata(root) {
|
|
|
67
67
|
throw new Error("create_tokens_unresolved");
|
|
68
68
|
}
|
|
69
69
|
const packageJson = JSON.parse(readFileSync(path.join(root, "package.json"), "utf8"));
|
|
70
|
-
if (packageJson.packageManager !== "bun@1.4.
|
|
70
|
+
if (packageJson.packageManager !== "bun@1.4.4") {
|
|
71
71
|
throw new Error("create_metadata_invalid");
|
|
72
72
|
}
|
|
73
73
|
}
|
package/dist/preset.d.ts
CHANGED
|
@@ -5,8 +5,10 @@ export type PackagePin = {
|
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
7
|
* Compatibility rules for products: recommended, supported, and minimum-secure
|
|
8
|
-
* versions of each @codelitdev package, plus
|
|
9
|
-
*
|
|
8
|
+
* versions of each @codelitdev package, plus pins for the external packages
|
|
9
|
+
* the template uses. An external pin is the exact version `create` writes and
|
|
10
|
+
* the floor `doctor` accepts: any later release on the same caret line passes
|
|
11
|
+
* (ADR 0017). `scripts/sync-preset.mjs` writes `recommended`
|
|
10
12
|
* and `external`; `supported` and `minimumSecure` are hand-maintained.
|
|
11
13
|
*/
|
|
12
14
|
export type PresetManifest = {
|
package/dist/preset.js
CHANGED
|
@@ -69,12 +69,28 @@ function satisfies(version, range) {
|
|
|
69
69
|
return result === 0;
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* `^pin`: at or above the pin without crossing the next breaking line
|
|
74
|
+
* (the major, or the minor while the major is 0). Lets products take patch
|
|
75
|
+
* and minor security fixes without a preset release.
|
|
76
|
+
*/
|
|
77
|
+
function satisfiesCaret(version, pin) {
|
|
78
|
+
const v = parseVersion(version);
|
|
79
|
+
const p = parseVersion(pin);
|
|
80
|
+
if (!v || !p)
|
|
81
|
+
return cmp(version, pin) === 0;
|
|
82
|
+
if (v.major !== p.major)
|
|
83
|
+
return false;
|
|
84
|
+
if (p.major === 0 && v.minor !== p.minor)
|
|
85
|
+
return false;
|
|
86
|
+
return cmp(version, pin) >= 0;
|
|
87
|
+
}
|
|
72
88
|
export function validateResolvedVersions(resolved, manifest = loadPresetManifest()) {
|
|
73
89
|
const issues = [];
|
|
74
90
|
for (const [name, version] of Object.entries(resolved)) {
|
|
75
91
|
const pin = manifest.packages[name];
|
|
76
92
|
if (!pin && name in manifest.external) {
|
|
77
|
-
if (
|
|
93
|
+
if (!satisfiesCaret(version, manifest.external[name])) {
|
|
78
94
|
issues.push({
|
|
79
95
|
packageName: name,
|
|
80
96
|
reason: "external_mismatch",
|
package/dist/preset.json
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"runtime": {
|
|
4
|
-
"bun": "1.4.
|
|
4
|
+
"bun": "1.4.4"
|
|
5
5
|
},
|
|
6
6
|
"packages": {
|
|
7
7
|
"@codelitdev/platform": {
|
|
8
|
-
"recommended": "0.8.
|
|
8
|
+
"recommended": "0.8.2",
|
|
9
9
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
10
10
|
"minimumSecure": "0.1.0-alpha.0"
|
|
11
11
|
},
|
|
12
12
|
"@codelitdev/observability": {
|
|
13
|
-
"recommended": "0.8.
|
|
13
|
+
"recommended": "0.8.2",
|
|
14
14
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
15
15
|
"minimumSecure": "0.1.0-alpha.0"
|
|
16
16
|
},
|
|
17
17
|
"@codelitdev/mcp-server-kit": {
|
|
18
|
-
"recommended": "0.8.
|
|
18
|
+
"recommended": "0.8.2",
|
|
19
19
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
20
20
|
"minimumSecure": "0.1.0-alpha.0"
|
|
21
21
|
},
|
|
22
22
|
"@codelitdev/platform-conformance": {
|
|
23
|
-
"recommended": "0.8.
|
|
23
|
+
"recommended": "0.8.2",
|
|
24
24
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
25
25
|
"minimumSecure": "0.1.0-alpha.0"
|
|
26
26
|
},
|
|
27
27
|
"@codelitdev/platform-cli": {
|
|
28
|
-
"recommended": "0.8.
|
|
28
|
+
"recommended": "0.8.2",
|
|
29
29
|
"supported": ">=0.1.0-alpha.0 <2",
|
|
30
30
|
"minimumSecure": "0.1.0-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"@codelitdev/billing": {
|
|
33
|
-
"recommended": "0.8.
|
|
33
|
+
"recommended": "0.8.2",
|
|
34
34
|
"supported": ">=0.1.0-alpha.4 <1",
|
|
35
35
|
"minimumSecure": "0.1.0-alpha.4"
|
|
36
36
|
},
|
|
37
37
|
"@codelitdev/oauth-server-kit": {
|
|
38
|
-
"recommended": "0.8.
|
|
38
|
+
"recommended": "0.8.2",
|
|
39
39
|
"supported": ">=0.1.0-alpha.2 <1",
|
|
40
40
|
"minimumSecure": "0.1.0-alpha.2"
|
|
41
41
|
},
|
|
42
42
|
"@codelitdev/design-system": {
|
|
43
|
-
"recommended": "0.8.
|
|
43
|
+
"recommended": "0.8.2",
|
|
44
44
|
"supported": ">=0.1.0-alpha.7 <1",
|
|
45
45
|
"minimumSecure": "0.1.0-alpha.7"
|
|
46
46
|
}
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"drizzle-orm": "0.45.2",
|
|
60
60
|
"drizzle-kit": "0.31.10",
|
|
61
61
|
"pino": "9.6.0",
|
|
62
|
-
"@types/bun": "1.4.
|
|
62
|
+
"@types/bun": "1.4.4",
|
|
63
63
|
"@electric-sql/pglite": "0.5.8",
|
|
64
|
-
"@modelcontextprotocol/sdk": "1.
|
|
64
|
+
"@modelcontextprotocol/sdk": "1.32.1",
|
|
65
65
|
"dodopayments": "2.48.0",
|
|
66
|
-
"next": "16.3
|
|
66
|
+
"next": "16.4.3",
|
|
67
67
|
"react": "19.2.8",
|
|
68
68
|
"react-dom": "19.2.8"
|
|
69
69
|
}
|
package/dist/sync.js
CHANGED
|
@@ -20,16 +20,19 @@ export function syncProduct(input) {
|
|
|
20
20
|
const plannedWrites = new Map();
|
|
21
21
|
const managedFiles = {};
|
|
22
22
|
// Compute and validate the complete plan before touching any file. A
|
|
23
|
-
// managed hash mismatch is a conflict, not a best-effort warning. A
|
|
24
|
-
//
|
|
23
|
+
// managed hash mismatch is a conflict, not a best-effort warning. A file
|
|
24
|
+
// that already matches the template is never a conflict: that is how a
|
|
25
|
+
// product reconciles a conflict by hand, and how a new managed file is
|
|
26
|
+
// adopted when it exists.
|
|
25
27
|
for (const rel of MANAGED_FILES) {
|
|
26
28
|
const file = path.join(root, rel);
|
|
27
29
|
const desired = renderTemplateFile(rel, manifest.product);
|
|
28
30
|
const recorded = manifest.managedFiles[rel];
|
|
29
31
|
const current = existsSync(file) ? readFileSync(file, "utf8") : undefined;
|
|
30
|
-
const drifted =
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const drifted = current !== desired &&
|
|
33
|
+
(recorded === undefined
|
|
34
|
+
? current !== undefined
|
|
35
|
+
: current === undefined || sha256File(file) !== recorded);
|
|
33
36
|
if (drifted) {
|
|
34
37
|
conflicts.push(rel);
|
|
35
38
|
continue;
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@ jobs:
|
|
|
18
18
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
19
19
|
- uses: oven-sh/setup-bun@v2
|
|
20
20
|
with:
|
|
21
|
-
bun-version: 1.4.
|
|
21
|
+
bun-version: 1.4.4
|
|
22
22
|
# `platform-cli create` intentionally does not resolve dependencies.
|
|
23
23
|
# Bootstrap the product lockfile on its first run; all subsequent CI
|
|
24
24
|
# installs are immutable and use the frozen lockfile below.
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
|
|
16
16
|
- uses: oven-sh/setup-bun@v2
|
|
17
17
|
with:
|
|
18
|
-
bun-version: 1.4.
|
|
18
|
+
bun-version: 1.4.4
|
|
19
19
|
# `platform-cli create` intentionally does not resolve dependencies.
|
|
20
20
|
# Bootstrap the product lockfile on its first run; all subsequent CI
|
|
21
21
|
# installs are immutable and use the frozen lockfile below.
|
package/template/package.json
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"packageManager": "bun@1.4.
|
|
6
|
+
"packageManager": "bun@1.4.4",
|
|
7
7
|
"engines": {
|
|
8
|
-
"bun": ">=1.4.
|
|
8
|
+
"bun": ">=1.4.4"
|
|
9
9
|
},
|
|
10
10
|
"workspaces": [
|
|
11
11
|
"apps/*",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@biomejs/biome": "2.5.12",
|
|
28
|
-
"@types/bun": "1.4.
|
|
28
|
+
"@types/bun": "1.4.4"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"lint": "bun run --workspaces --if-present lint",
|