@pbuilder/sdk 0.16.0 → 0.17.0
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 +52 -1
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.d.ts +48 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.js +46 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/ops.d.ts +11 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/aspnet/ops.js +126 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/ast.d.ts +29 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/ast.js +41 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.d.ts +44 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.js +45 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/names.d.ts +7 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/names.js +72 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/ops.d.ts +19 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/ops.js +255 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/pack.d.ts +9 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/pack.js +2 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/syntax.d.ts +26 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/syntax.js +111 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/tree-sitter-c_sharp.LICENSE +23 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/tree-sitter-c_sharp.wasm +0 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/ast.d.ts +22 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/ast.js +17 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.d.ts +37 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.js +38 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/ops.d.ts +2 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/ops.js +93 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/xml.d.ts +20 -0
- package/dist/bounded-contexts/authoring/infrastructure/out/dialects/msbuild/xml.js +50 -0
- package/dist/dialects/aspnet/index.d.ts +1 -0
- package/dist/dialects/aspnet/index.js +1 -0
- package/dist/dialects/csharp/index.d.ts +1 -0
- package/dist/dialects/csharp/index.js +1 -0
- package/dist/dialects/msbuild/index.d.ts +1 -0
- package/dist/dialects/msbuild/index.js +1 -0
- package/dist/runner-manifest.json +6 -2
- package/package.json +20 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One element with its source offsets: `start` is its `<`, `openEnd` is just past its open
|
|
3
|
+
* tag's `>`, `closeStart` is the `<` of its close tag, and `end` is just past the element.
|
|
4
|
+
* A self-closing element has `openEnd === closeStart === end`.
|
|
5
|
+
*/
|
|
6
|
+
export interface XmlElement {
|
|
7
|
+
name: string;
|
|
8
|
+
attributes: ReadonlyMap<string, string>;
|
|
9
|
+
start: number;
|
|
10
|
+
openEnd: number;
|
|
11
|
+
closeStart: number;
|
|
12
|
+
end: number;
|
|
13
|
+
selfClosing: boolean;
|
|
14
|
+
children: XmlElement[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Reads the element tree of `text`, or `undefined` for an empty text, throwing on anything
|
|
18
|
+
* that is not well-formed XML 1.0.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readElements(text: string): XmlElement | undefined;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { SaxesParser } from "saxes";
|
|
2
|
+
/**
|
|
3
|
+
* Reads the element tree of `text`, or `undefined` for an empty text, throwing on anything
|
|
4
|
+
* that is not well-formed XML 1.0.
|
|
5
|
+
*/
|
|
6
|
+
export function readElements(text) {
|
|
7
|
+
if (text === "")
|
|
8
|
+
return undefined;
|
|
9
|
+
const parser = new SaxesParser({ position: true });
|
|
10
|
+
const stack = [];
|
|
11
|
+
let root;
|
|
12
|
+
let failed = false;
|
|
13
|
+
parser.on("error", () => {
|
|
14
|
+
failed = true;
|
|
15
|
+
});
|
|
16
|
+
// `position` sits just past the tag's `>`; a raw `<` cannot occur inside a tag, so the last
|
|
17
|
+
// one before it is the tag's start.
|
|
18
|
+
parser.on("opentag", (node) => {
|
|
19
|
+
const openEnd = parser.position;
|
|
20
|
+
const element = {
|
|
21
|
+
name: node.name,
|
|
22
|
+
attributes: new Map(Object.entries(node.attributes)),
|
|
23
|
+
start: text.lastIndexOf("<", openEnd - 1),
|
|
24
|
+
openEnd,
|
|
25
|
+
closeStart: openEnd,
|
|
26
|
+
end: openEnd,
|
|
27
|
+
selfClosing: node.isSelfClosing,
|
|
28
|
+
children: [],
|
|
29
|
+
};
|
|
30
|
+
(stack.at(-1)?.children ?? []).push(element);
|
|
31
|
+
root ??= element;
|
|
32
|
+
stack.push(element);
|
|
33
|
+
});
|
|
34
|
+
parser.on("closetag", () => {
|
|
35
|
+
const element = stack.pop();
|
|
36
|
+
if (element.selfClosing)
|
|
37
|
+
return;
|
|
38
|
+
element.end = parser.position;
|
|
39
|
+
element.closeStart = text.lastIndexOf("<", element.end - 1);
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
parser.write(text).close();
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
failed = true;
|
|
46
|
+
}
|
|
47
|
+
if (failed || root === undefined)
|
|
48
|
+
throw new Error("invalid XML");
|
|
49
|
+
return root;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/aspnet/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/csharp/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.ts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../../bounded-contexts/authoring/infrastructure/out/dialects/msbuild/index.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifestVersion": 1,
|
|
3
3
|
"algorithm": "sha256",
|
|
4
4
|
"entry": "dist/bin/pbuilder-runner.js",
|
|
5
|
-
"packageVersion": "0.
|
|
5
|
+
"packageVersion": "0.17.0",
|
|
6
6
|
"files": [
|
|
7
7
|
{
|
|
8
8
|
"path": "dist/acl/irwire/frame-reader.js",
|
|
@@ -76,6 +76,10 @@
|
|
|
76
76
|
"path": "dist/bounded-contexts/authoring/domain/valueobjects/wire.js",
|
|
77
77
|
"sha256": "965bd72c7ec6f914edc717cf2fd4aaff6395857fb486f0301e2fb4e0977e0616"
|
|
78
78
|
},
|
|
79
|
+
{
|
|
80
|
+
"path": "dist/bounded-contexts/authoring/infrastructure/out/dialects/csharp/tree-sitter-c_sharp.wasm",
|
|
81
|
+
"sha256": "e137386fcdfc2562a058f8048c76ab77b0663a318cb62d8026cd4d2e94944231"
|
|
82
|
+
},
|
|
79
83
|
{
|
|
80
84
|
"path": "dist/bounded-contexts/authoring/infrastructure/out/fs/package-files.js",
|
|
81
85
|
"sha256": "58a0bef6c4a7649dbbd5b5890f5cdeacb85bfdf9f805d973b22f2ce2e09e79da"
|
|
@@ -118,7 +122,7 @@
|
|
|
118
122
|
},
|
|
119
123
|
{
|
|
120
124
|
"path": "package.json",
|
|
121
|
-
"sha256": "
|
|
125
|
+
"sha256": "3eb04bed3bfdd43ea2f25b0c13267688c052056eddc410ec6cfc0b7f0f7df927"
|
|
122
126
|
}
|
|
123
127
|
]
|
|
124
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pbuilder/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The public TypeScript/Bun authoring layer for Project Builder schematics. Authors file mutations (create, replaceContent, 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",
|
|
@@ -92,6 +92,21 @@
|
|
|
92
92
|
"types": "./dist/dialects/css/index.d.ts",
|
|
93
93
|
"import": "./dist/dialects/css/index.js",
|
|
94
94
|
"default": "./dist/dialects/css/index.js"
|
|
95
|
+
},
|
|
96
|
+
"./csharp": {
|
|
97
|
+
"types": "./dist/dialects/csharp/index.d.ts",
|
|
98
|
+
"import": "./dist/dialects/csharp/index.js",
|
|
99
|
+
"default": "./dist/dialects/csharp/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./aspnet": {
|
|
102
|
+
"types": "./dist/dialects/aspnet/index.d.ts",
|
|
103
|
+
"import": "./dist/dialects/aspnet/index.js",
|
|
104
|
+
"default": "./dist/dialects/aspnet/index.js"
|
|
105
|
+
},
|
|
106
|
+
"./msbuild": {
|
|
107
|
+
"types": "./dist/dialects/msbuild/index.d.ts",
|
|
108
|
+
"import": "./dist/dialects/msbuild/index.js",
|
|
109
|
+
"default": "./dist/dialects/msbuild/index.js"
|
|
95
110
|
}
|
|
96
111
|
},
|
|
97
112
|
"scripts": {
|
|
@@ -99,7 +114,8 @@
|
|
|
99
114
|
"typecheck": "tsc --noEmit",
|
|
100
115
|
"typecheck:permissive-proof": "tsc --noEmit -p tsconfig.permissive-proof.json",
|
|
101
116
|
"prebuild": "rm -rf dist",
|
|
102
|
-
"build": "tsc -p tsconfig.build.json && bun run build:codegen && bun run build:manifest",
|
|
117
|
+
"build": "tsc -p tsconfig.build.json && bun run build:assets && bun run build:codegen && bun run build:manifest",
|
|
118
|
+
"build:assets": "bun scripts/copy-dist-assets.ts",
|
|
103
119
|
"build:codegen": "bun build bin/pbuilder-codegen.ts --outfile dist/bin/pbuilder-codegen.js --target node --banner \"#!/usr/bin/env node\"",
|
|
104
120
|
"build:manifest": "bun scripts/generate-runner-manifest.ts",
|
|
105
121
|
"regen:closure-baseline": "bun scripts/regen-closure-baseline.ts",
|
|
@@ -124,7 +140,9 @@
|
|
|
124
140
|
"dependencies": {
|
|
125
141
|
"jsonc-parser": "3.3.1",
|
|
126
142
|
"postcss": "8.5.30",
|
|
143
|
+
"saxes": "6.0.0",
|
|
127
144
|
"ts-morph": "28.0.0",
|
|
145
|
+
"web-tree-sitter": "0.27.2",
|
|
128
146
|
"yaml": "2.9.1"
|
|
129
147
|
}
|
|
130
148
|
}
|