@pbuilder/sdk 0.2.0 → 0.2.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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifestVersion": 1,
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"entry": "dist/bin/pbuilder-runner.js",
|
|
5
|
-
"packageVersion": "0.2.
|
|
5
|
+
"packageVersion": "0.2.2",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "dist/bin/pbuilder-runner.js",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"path": "package.json",
|
|
101
|
-
"sha256": "
|
|
101
|
+
"sha256": "e67ee94357f6293c57df74c4f8501b9fb013737b7f0c950827d86976bc332a85"
|
|
102
102
|
}
|
|
103
103
|
]
|
|
104
104
|
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Translates on-disk filename tokens to the wire `pathTemplate` syntax the ENGINE
|
|
3
3
|
* substitutes (obs #915 ruling 4) — the SDK never renders these itself, only rewrites the
|
|
4
|
-
* marker syntax. `__name@dasherize__` → `{= name | dasherize =}`; a bare `__name__`
|
|
5
|
-
* (no `@pipe`) → `{= name =}`.
|
|
4
|
+
* marker syntax. `__name@dasherize__` → `{= .name | dasherize =}`; a bare `__name__`
|
|
5
|
+
* (no `@pipe`) → `{= .name =}`. The dotted field reference is REQUIRED by the engine's
|
|
6
|
+
* templating (bare `{= name =}` was migrated away — docs/templating/migration-note.md in
|
|
7
|
+
* the engine repo); emitting the bare form makes every tokenized filename fail
|
|
8
|
+
* path-render at ingest (`path-render-failed`, exit 2).
|
|
6
9
|
*/
|
|
7
10
|
export declare function translateTokens(path: string): string;
|
|
8
11
|
/** REQ-FSC-05 step (3): strips a `.template` suffix from the (post-translation) path. */
|
|
@@ -12,13 +12,16 @@ const TOKEN_PATTERN = /__([A-Za-z_][A-Za-z0-9_]*(?:@[A-Za-z_][A-Za-z0-9_]*)*)__/
|
|
|
12
12
|
/**
|
|
13
13
|
* Translates on-disk filename tokens to the wire `pathTemplate` syntax the ENGINE
|
|
14
14
|
* substitutes (obs #915 ruling 4) — the SDK never renders these itself, only rewrites the
|
|
15
|
-
* marker syntax. `__name@dasherize__` → `{= name | dasherize =}`; a bare `__name__`
|
|
16
|
-
* (no `@pipe`) → `{= name =}`.
|
|
15
|
+
* marker syntax. `__name@dasherize__` → `{= .name | dasherize =}`; a bare `__name__`
|
|
16
|
+
* (no `@pipe`) → `{= .name =}`. The dotted field reference is REQUIRED by the engine's
|
|
17
|
+
* templating (bare `{= name =}` was migrated away — docs/templating/migration-note.md in
|
|
18
|
+
* the engine repo); emitting the bare form makes every tokenized filename fail
|
|
19
|
+
* path-render at ingest (`path-render-failed`, exit 2).
|
|
17
20
|
*/
|
|
18
21
|
export function translateTokens(path) {
|
|
19
22
|
return path.replace(TOKEN_PATTERN, (_match, inner) => {
|
|
20
23
|
const [field, ...pipes] = inner.split("@");
|
|
21
|
-
return pipes.length > 0 ? `{=
|
|
24
|
+
return pipes.length > 0 ? `{= .${field} | ${pipes.join(" | ")} =}` : `{= .${field} =}`;
|
|
22
25
|
});
|
|
23
26
|
}
|
|
24
27
|
/** REQ-FSC-05 step (3): strips a `.template` suffix from the (post-translation) path. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pbuilder/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "The public TypeScript/Bun authoring layer for Project Builder schematics. Authors file mutations (create, modify, remove, rename, move, copy, copyIn), lowers them to IR, and talks to the Project Builder engine over framed stdio (see docs/engine-sdk-wire-spec.md).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|