@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.
- package/dist/cli.js +13 -13
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +634 -580
- package/dist/cli.mjs.map +1 -1
- package/dist/config-BmJWc8sR.js +3 -0
- package/dist/config-BmJWc8sR.js.map +1 -0
- package/dist/{config-DpfTzcgG.mjs → config-CiC347sB.mjs} +453 -398
- package/dist/config-CiC347sB.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +15 -15
- package/dist/structure/engine/discovery.d.ts +2 -3
- package/dist/structure/rules/block-package-json.d.ts +3 -3
- package/dist/structure/rules/shared/pascal-case.d.ts +1 -0
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/model/block_components.d.ts +11 -0
- package/dist/v2/model/block_meta.d.ts +7 -0
- package/dist/v2/registry/schema_public.d.ts +3600 -3600
- package/dist/v2/resolve_to_registry.d.ts +37 -0
- package/dist/v2/source_package.d.ts +12 -0
- package/package.json +7 -7
- package/src/cmd/publish.test.ts +35 -0
- package/src/cmd/publish.ts +20 -0
- package/src/structure/__tests__/discovery-shortname.test.ts +3 -0
- package/src/structure/__tests__/facade-end-state.test.ts +195 -0
- package/src/structure/__tests__/model-package-json.snapshot.test.ts +1 -1
- package/src/structure/engine/__tests__/discovery.test.ts +22 -26
- package/src/structure/engine/discovery.ts +12 -30
- package/src/structure/rules/block-package-json.ts +146 -64
- package/src/structure/rules/block.ts +40 -5
- package/src/structure/rules/model-package-json.ts +6 -1
- package/src/structure/rules/shared/pascal-case.ts +16 -0
- package/src/structure/rules/software-package-json.ts +6 -1
- package/src/structure/rules/test-package-json.ts +5 -1
- package/src/structure/rules/ui-package-json.ts +5 -1
- package/src/structure/rules/workflow-package-json.ts +5 -1
- package/src/structure/templates/static/block/src/AGENTS.ts +5 -0
- package/src/structure/templates/static/block/src/agents-extra.ts +8 -0
- package/src/structure/templates/static/block/src/block-extra.ts +9 -0
- package/src/structure/templates/static/block/tsconfig.json +4 -0
- package/src/structure/templates/text/block/src/index.tpl.ts +55 -0
- package/src/v2/from_pack_v2.test.ts +142 -0
- package/src/v2/index.ts +1 -0
- package/src/v2/model/block_components.ts +33 -0
- package/src/v2/model/block_meta.ts +18 -0
- package/src/v2/resolve_to_registry.ts +84 -0
- package/src/v2/source_package.ts +34 -1
- package/dist/config-DpfTzcgG.mjs.map +0 -1
- package/dist/config-xxVy3IQR.js +0 -3
- package/dist/config-xxVy3IQR.js.map +0 -1
- package/src/structure/templates/static/block/index.d.ts +0 -6
- 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,
|
|
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
|
|
4
|
-
GlobalOverviewPath: () =>
|
|
5
|
-
MetaFile: () =>
|
|
6
|
-
PlPackageConfigData: () =>
|
|
7
|
-
PlPackageJsonConfigFile: () =>
|
|
8
|
-
PlPackageYamlConfigFile: () =>
|
|
9
|
-
PlRegCommonConfigData: () =>
|
|
10
|
-
PlRegFullPackageConfigData: () =>
|
|
11
|
-
PlRegPackageConfig: () =>
|
|
12
|
-
PlRegPackageConfigDataShard: () =>
|
|
13
|
-
packageContentPrefix: () =>
|
|
14
|
-
packageOverviewPath: () =>
|
|
15
|
-
payloadFilePath: () =>
|
|
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 {
|
|
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
|
|
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
|
-
*
|
|
5
|
-
*
|
|
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;
|
package/dist/v2/index.d.ts
CHANGED
|
@@ -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.
|