@platforma-sdk/block-tools 2.19.0 → 2.19.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/dist/cli.js +6 -6
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +139 -138
- package/dist/cli.mjs.map +1 -1
- package/package.json +3 -3
- package/src/structure/__tests__/facade-end-state.test.ts +2 -0
- package/src/structure/rules/block-package-json.ts +10 -3
- package/src/structure/rules/block.ts +8 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/block-tools",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.2",
|
|
4
4
|
"description": "Utility to manipulate Platforma Blocks and Block Registry",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@milaboratories/pl-http": "1.2.6",
|
|
29
29
|
"@milaboratories/pl-model-backend": "1.4.46",
|
|
30
30
|
"@milaboratories/pl-model-common": "1.55.2",
|
|
31
|
-
"@milaboratories/pl-model-middle-layer": "1.
|
|
31
|
+
"@milaboratories/pl-model-middle-layer": "1.39.0",
|
|
32
32
|
"@milaboratories/resolve-helper": "1.1.3",
|
|
33
33
|
"@milaboratories/ts-helpers": "1.9.1",
|
|
34
34
|
"@platforma-sdk/blocks-deps-updater": "2.2.2",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@milaboratories/build-configs": "2.0.3",
|
|
47
|
-
"@milaboratories/ts-builder": "1.
|
|
47
|
+
"@milaboratories/ts-builder": "1.8.0",
|
|
48
48
|
"@milaboratories/ts-configs": "1.4.1",
|
|
49
49
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
50
50
|
"@types/mime-types": "^2.1.4",
|
|
@@ -123,6 +123,8 @@ describe("facade: slim `package.json` end-state", () => {
|
|
|
123
123
|
// Author-owned seed + engine-managed components both present.
|
|
124
124
|
expect(p.block.components).toBeTruthy();
|
|
125
125
|
expect(p.block.meta).toBeTruthy();
|
|
126
|
+
// The changelog is the facade's own, the file changesets writes.
|
|
127
|
+
expect(p.block.meta.changelog).toBe("file:CHANGELOG.md");
|
|
126
128
|
});
|
|
127
129
|
});
|
|
128
130
|
|
|
@@ -110,6 +110,11 @@ const FACADE_EXPORTS = {
|
|
|
110
110
|
},
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
/** `block.meta.changelog`: the facade's own `CHANGELOG.md`, the only changelog
|
|
114
|
+
* changesets writes for the published package. Not author-owned — any other
|
|
115
|
+
* path shows release notes that never change. */
|
|
116
|
+
const BLOCK_CHANGELOG = "file:CHANGELOG.md";
|
|
117
|
+
|
|
113
118
|
/** Fail loudly if any required `block.*` field is empty — a missing
|
|
114
119
|
* title / description / logo / organization or empty components map would
|
|
115
120
|
* otherwise produce an init block that `block-tools pack` rejects only
|
|
@@ -167,6 +172,7 @@ export function blockPackageJsonInitial(ctx: RunContext): Record<string, unknown
|
|
|
167
172
|
title: v.shortName,
|
|
168
173
|
description: `${v.shortName} block`,
|
|
169
174
|
logo: "file:logos/block-logo.png",
|
|
175
|
+
changelog: BLOCK_CHANGELOG,
|
|
170
176
|
organization: {
|
|
171
177
|
name: v.orgScope,
|
|
172
178
|
url: "https://example.com",
|
|
@@ -244,10 +250,11 @@ export function blockPackageJsonRules(ctx: RunContext): void {
|
|
|
244
250
|
ensureDevDep("typescript", "catalog:");
|
|
245
251
|
|
|
246
252
|
// `block.components` is fully determined by the discovered modules — keep it
|
|
247
|
-
// in sync on refresh. `block.meta` is deliberately NOT touched:
|
|
248
|
-
// author-owned seed (set once in the init package.json), so refresh
|
|
249
|
-
// never overwrite the author's title / description / logo.
|
|
253
|
+
// in sync on refresh. The rest of `block.meta` is deliberately NOT touched:
|
|
254
|
+
// it is an author-owned seed (set once in the init package.json), so refresh
|
|
255
|
+
// must never overwrite the author's title / description / logo.
|
|
250
256
|
ensureField("block.components", blockComponents(ctx));
|
|
257
|
+
ensureField("block.meta.changelog", BLOCK_CHANGELOG);
|
|
251
258
|
|
|
252
259
|
// The author owns `name` and `version`; `version` MUST be present (the
|
|
253
260
|
// facade publishes).
|
|
@@ -52,6 +52,14 @@ export function blockRules(): void {
|
|
|
52
52
|
seed("logos/block-logo.png", binaryFile("block/logos/block-logo.png"));
|
|
53
53
|
seed("logos/organization-logo.png", binaryFile("block/logos/organization-logo.png"));
|
|
54
54
|
|
|
55
|
+
// Target of `block.meta.changelog`. Changesets writes the facade's release
|
|
56
|
+
// notes here; the header-only file keeps `block-tools pack` resolvable
|
|
57
|
+
// before the first release.
|
|
58
|
+
scaffold(
|
|
59
|
+
"CHANGELOG.md",
|
|
60
|
+
generate((ctx) => `# ${ctx.blockVars.facadeName}\n`),
|
|
61
|
+
);
|
|
62
|
+
|
|
55
63
|
managed(
|
|
56
64
|
"package.json",
|
|
57
65
|
generate((ctx) => blockPackageJsonInitial(ctx)),
|