@platforma-sdk/block-tools 2.11.3 → 2.11.4

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.
Files changed (51) hide show
  1. package/dist/cli.js +13 -13
  2. package/dist/cli.js.map +1 -1
  3. package/dist/cli.mjs +634 -580
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/config-BmJWc8sR.js +3 -0
  6. package/dist/config-BmJWc8sR.js.map +1 -0
  7. package/dist/{config-DpfTzcgG.mjs → config-CiC347sB.mjs} +453 -398
  8. package/dist/config-CiC347sB.mjs.map +1 -0
  9. package/dist/index.js +1 -1
  10. package/dist/index.mjs +15 -15
  11. package/dist/structure/engine/discovery.d.ts +2 -3
  12. package/dist/structure/rules/block-package-json.d.ts +3 -3
  13. package/dist/structure/rules/shared/pascal-case.d.ts +1 -0
  14. package/dist/v2/index.d.ts +1 -0
  15. package/dist/v2/model/block_components.d.ts +11 -0
  16. package/dist/v2/model/block_meta.d.ts +7 -0
  17. package/dist/v2/registry/schema_public.d.ts +3600 -3600
  18. package/dist/v2/resolve_to_registry.d.ts +37 -0
  19. package/dist/v2/source_package.d.ts +12 -0
  20. package/package.json +7 -7
  21. package/src/cmd/publish.test.ts +35 -0
  22. package/src/cmd/publish.ts +20 -0
  23. package/src/structure/__tests__/discovery-shortname.test.ts +3 -0
  24. package/src/structure/__tests__/facade-end-state.test.ts +195 -0
  25. package/src/structure/__tests__/model-package-json.snapshot.test.ts +1 -1
  26. package/src/structure/engine/__tests__/discovery.test.ts +22 -26
  27. package/src/structure/engine/discovery.ts +12 -30
  28. package/src/structure/rules/block-package-json.ts +146 -64
  29. package/src/structure/rules/block.ts +40 -5
  30. package/src/structure/rules/model-package-json.ts +6 -1
  31. package/src/structure/rules/shared/pascal-case.ts +16 -0
  32. package/src/structure/rules/software-package-json.ts +6 -1
  33. package/src/structure/rules/test-package-json.ts +5 -1
  34. package/src/structure/rules/ui-package-json.ts +5 -1
  35. package/src/structure/rules/workflow-package-json.ts +5 -1
  36. package/src/structure/templates/static/block/src/AGENTS.ts +5 -0
  37. package/src/structure/templates/static/block/src/agents-extra.ts +8 -0
  38. package/src/structure/templates/static/block/src/block-extra.ts +9 -0
  39. package/src/structure/templates/static/block/tsconfig.json +4 -0
  40. package/src/structure/templates/text/block/src/index.tpl.ts +55 -0
  41. package/src/v2/from_pack_v2.test.ts +142 -0
  42. package/src/v2/index.ts +1 -0
  43. package/src/v2/model/block_components.ts +33 -0
  44. package/src/v2/model/block_meta.ts +18 -0
  45. package/src/v2/resolve_to_registry.ts +84 -0
  46. package/src/v2/source_package.ts +34 -1
  47. package/dist/config-DpfTzcgG.mjs.map +0 -1
  48. package/dist/config-xxVy3IQR.js +0 -3
  49. package/dist/config-xxVy3IQR.js.map +0 -1
  50. package/src/structure/templates/static/block/index.d.ts +0 -6
  51. package/src/structure/templates/static/block/index.js +0 -8
package/dist/index.mjs CHANGED
@@ -1,20 +1,20 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as h, P as g, Q as _, R as v, S as y, T as b, U as x, V as S, W as C, X as w, Y as T, Z as E, _ as D, a as O, at as k, b as A, c as j, ct as M, d as N, dt as P, et as F, f as I, ft as L, g as R, gt as z, h as B, ht as V, i as H, it as U, j as W, k as G, l as K, lt as q, m as J, mt as Y, nt as X, o as Z, ot as Q, p as $, pt as ee, q as te, r as ne, rt as re, s as ie, st as ae, t as oe, tt as se, u as ce, ut as le, v as ue, w as de, x as fe, y as pe, z as me } from "./config-DpfTzcgG.mjs";
1
+ import { $ as e, A as t, B as n, C as r, Ct as i, D as a, E as o, F as s, G as c, H as l, I as u, J as d, K as f, L as p, M as m, N as h, O as g, P as _, Q as v, R as y, S as b, St as x, T as S, U as C, V as w, W as T, X as E, Y as D, Z as O, _ as k, _t as A, a as j, at as M, b as N, bt as P, c as F, ct as I, d as L, dt as R, et as z, f as B, ft as V, g as H, gt as U, h as W, ht as G, i as K, it as q, j as J, k as Y, l as X, lt as Z, m as Q, mt as $, nt as ee, o as te, ot as ne, p as re, pt as ie, q as ae, r as oe, rt as se, s as ce, st as le, t as ue, tt as de, u as fe, ut as pe, v as me, vt as he, w as ge, wt as _e, x as ve, xt as ye, y as be, yt as xe, z as Se } from "./config-CiC347sB.mjs";
2
2
  //#region src/registry_v1/index.ts
3
- var he = /* @__PURE__ */ z({
4
- GlobalOverviewPath: () => ne,
5
- MetaFile: () => H,
6
- PlPackageConfigData: () => j,
7
- PlPackageJsonConfigFile: () => K,
8
- PlPackageYamlConfigFile: () => ce,
9
- PlRegCommonConfigData: () => N,
10
- PlRegFullPackageConfigData: () => I,
11
- PlRegPackageConfig: () => oe,
12
- PlRegPackageConfigDataShard: () => $,
13
- packageContentPrefix: () => O,
14
- packageOverviewPath: () => Z,
15
- payloadFilePath: () => ie
3
+ var Ce = /* @__PURE__ */ _e({
4
+ GlobalOverviewPath: () => oe,
5
+ MetaFile: () => K,
6
+ PlPackageConfigData: () => F,
7
+ PlPackageJsonConfigFile: () => X,
8
+ PlPackageYamlConfigFile: () => fe,
9
+ PlRegCommonConfigData: () => L,
10
+ PlRegFullPackageConfigData: () => B,
11
+ PlRegPackageConfig: () => ue,
12
+ PlRegPackageConfigDataShard: () => re,
13
+ packageContentPrefix: () => j,
14
+ packageOverviewPath: () => te,
15
+ payloadFilePath: () => ce
16
16
  });
17
17
  //#endregion
18
- export { S as BlockDescriptionPackageJsonField, A as BlockRegistryV2, fe as ChannelNameRegexp, y as ChannelsFolder, B as FSStorage, r as GlobalOverviewFileName, de as GlobalOverviewGzFileName, b as GlobalOverviewGzPath, a as GlobalOverviewPath, i as MainPrefix, h as ManifestFileName, G as ManifestSuffix, t as PackageManifestPattern, W as PackageOverview, p as PackageOverviewFileName, m as PackageOverviewVersionEntry, he as RegistryV1, ue as RegistryV2Reader, R as S3Storage, U as absoluteToBase64, k as absoluteToBytes, Q as absoluteToString, te as addRelativePathPrefix, w as blockComponentsManifestToAbsoluteUrl, d as buildBlockPackDist, E as consolidateBlockComponents, u as consolidateBlockPackDescription, e as consolidateBlockPackMeta, ae as cpAbsoluteToRelative, F as embedBlockPackMetaAbsoluteBase64, se as embedBlockPackMetaAbsoluteBytes, X as embedBlockPackMetaBytes, J as folderReaderByUrl, pe as inferUpdateSuggestions, c as loadPackDescription, x as loadPackDescriptionRaw, M as mapLocalToAbsolute, q as packFolderToRelativeTgz, g as packageChannelPrefix, o as packageChannelPrefixInsideV2, l as packageContentPrefix, f as packageContentPrefixInsideV2, v as packageOverviewPath, me as packageOverviewPathInsideV2, n as parseGlobalOverviewReg, C as parsePackageName, le as relativeToContentString, P as relativeToExplicitBinary64, L as relativeToExplicitBytes, ee as relativeToExplicitString, _ as resolveBlockComponents, T as resolveBlockPackDescription, re as resolveBlockPackMeta, Y as resolveModuleFile, V as resolveModuleFolder, D as storageByUrl, s as tryLoadPackDescription };
18
+ export { c as BlockDescriptionPackageJsonField, f as BlockPackFolderName, N as BlockRegistryV2, ve as ChannelNameRegexp, b as ChannelsFolder, W as FSStorage, r as GlobalOverviewFileName, ge as GlobalOverviewGzFileName, S as GlobalOverviewGzPath, o as GlobalOverviewPath, a as MainPrefix, g as ManifestFileName, Y as ManifestSuffix, t as PackageManifestPattern, J as PackageOverview, m as PackageOverviewFileName, h as PackageOverviewVersionEntry, w as PublishedCoordsFileName, Ce as RegistryV1, me as RegistryV2Reader, H as S3Storage, V as absoluteToBase64, ie as absoluteToBytes, $ as absoluteToString, e as addRelativePathPrefix, ee as blockComponentsManifestToAbsoluteUrl, v as buildBlockPackDist, l as buildPublishedCoords, se as consolidateBlockComponents, z as consolidateBlockPackDescription, ne as consolidateBlockPackMeta, G as cpAbsoluteToRelative, le as embedBlockPackMetaAbsoluteBase64, I as embedBlockPackMetaAbsoluteBytes, Z as embedBlockPackMetaBytes, Q as folderReaderByUrl, be as inferUpdateSuggestions, ae as loadPackDescription, d as loadPackDescriptionFromManifest, D as loadPackDescriptionRaw, U as mapLocalToAbsolute, A as packFolderToRelativeTgz, _ as packageChannelPrefix, s as packageChannelPrefixInsideV2, u as packageContentPrefix, p as packageContentPrefixInsideV2, y as packageOverviewPath, Se as packageOverviewPathInsideV2, n as parseGlobalOverviewReg, E as parsePackageName, he as relativeToContentString, xe as relativeToExplicitBinary64, P as relativeToExplicitBytes, ye as relativeToExplicitString, q as resolveBlockComponents, de as resolveBlockPackDescription, pe as resolveBlockPackMeta, M as resolveManifestBlockComponents, R as resolveManifestBlockPackMeta, x as resolveModuleFile, i as resolveModuleFolder, C as resolveToRegistry, k as storageByUrl, O as tryLoadPackDescription, T as writePublishedCoords };
19
19
 
20
20
  //# sourceMappingURL=index.mjs.map
@@ -15,6 +15,7 @@ export type PackageJsonLike = {
15
15
  devDependencies?: Record<string, string>;
16
16
  peerDependencies?: Record<string, string>;
17
17
  optionalDependencies?: Record<string, string>;
18
+ block?: unknown;
18
19
  "block-scope"?: string;
19
20
  "block-software"?: unknown;
20
21
  };
@@ -26,11 +27,9 @@ export declare class DiscoveryError extends Error {
26
27
  * Classify one package.
27
28
  *
28
29
  * @param wp The workspace package.
29
- * @param siblingNames Set of all workspace package `name`s (used by
30
- * rule 4 "block": depends on ≥2 sibling .model/.ui/.workflow).
31
30
  * @returns Scope or `undefined` if unclassified.
32
31
  */
33
- export declare function classifyOne(wp: WorkspacePackage, siblingNames: Set<string>): Scope | undefined;
32
+ export declare function classifyOne(wp: WorkspacePackage): Scope | undefined;
34
33
  /**
35
34
  * Classify a whole workspace. Throws on the first unclassified package
36
35
  * with a message that directs the operator to add `block-scope` to its
@@ -1,8 +1,8 @@
1
1
  import { RunContext } from '../engine/api';
2
2
  /** The facade's `block.components` map: the dist artifact each module build
3
- * emits, keyed by role. Fully determined by the discovered modules — the
4
- * body rule re-asserts this exact value, so it is engine-managed (NOT an
5
- * author seed). Mirrors the artifact paths produced by each scope's build:
3
+ * emits, keyed by role. Fully determined by the discovered modules — the body
4
+ * rule re-asserts this exact value, so it is engine-managed (NOT an author
5
+ * seed). Mirrors the artifact paths produced by each scope's build:
6
6
  * workflow → pl-tengo, model → build-model, ui → ts-builder. */
7
7
  export declare function blockComponents(ctx: RunContext): Record<string, string>;
8
8
  export declare function blockPackageJsonInitial(ctx: RunContext): Record<string, unknown>;
@@ -0,0 +1 @@
1
+ export declare function pascalCase(s: string): string;
@@ -1,4 +1,5 @@
1
1
  export * from './model';
2
2
  export * from './build_dist';
3
3
  export * from './source_package';
4
+ export * from './resolve_to_registry';
4
5
  export * from './registry';
@@ -12,6 +12,17 @@ export type BlockComponentsAbsoluteUrl = BlockComponents<ContentAbsoluteUrl, Con
12
12
  * resolution; the UI request resolves to a folder containing `index.html`.
13
13
  */
14
14
  export declare function resolveBlockComponents(raw: BlockComponentsDescriptionRaw, moduleRoot: string): BlockComponentsDescription;
15
+ /**
16
+ * Resolves a manifest's relative component paths against the `block-pack/`
17
+ * folder of a consumed package. Workflow main and model become absolute-file
18
+ * refs; the UI (a `ui.tgz` archive) resolves to its absolute path carried in
19
+ * the `absolute-folder` slot — `BlockComponentsDescription` types `ui` as a
20
+ * folder, and for manifest-consumed packs that slot holds the tgz file path
21
+ * (the `from-pack-v2` loader reads `.ui.folder` and feeds it to the lazy
22
+ * `local-tgz` frontend). Counterpart to `resolveBlockComponents`, which
23
+ * resolves a raw `package.json` description against authoring source.
24
+ */
25
+ export declare function resolveManifestBlockComponents(manifest: BlockComponentsManifest, blockPackDir: string): BlockComponentsDescription;
15
26
  /**
16
27
  * Copies file references for workflow and model into `dstFolder`, packs the
17
28
  * UI folder into `ui.tgz`, returning the manifest form with relative paths.
@@ -7,6 +7,13 @@ export type BlockPackMetaDescription = BlockPackMeta<ContentAbsoluteTextLocal, C
7
7
  * normalization) to absolute file paths against the module root.
8
8
  */
9
9
  export declare function resolveBlockPackMeta(raw: BlockPackMetaDescriptionRaw, root: string): Promise<BlockPackMetaDescription>;
10
+ /**
11
+ * Resolves a manifest's relative text/binary references against the
12
+ * `block-pack/` folder of a consumed package. Counterpart to
13
+ * `resolveBlockPackMeta` (which resolves raw `package.json` meta against
14
+ * authoring source); inlined explicit content passes through unchanged.
15
+ */
16
+ export declare function resolveManifestBlockPackMeta(manifest: BlockPackMetaManifest, blockPackDir: string): Promise<BlockPackMetaDescription>;
10
17
  /**
11
18
  * Copies absolute text/binary file references into `dstFolder` and returns
12
19
  * the manifest form with relative paths.