@player-tools/cli 0.13.0-next.4 → 0.13.0-next.5
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.
|
@@ -128,7 +128,7 @@ class XLRCompile extends base_command_1.BaseCommand {
|
|
|
128
128
|
const tsManifestFile = `${[...(capabilities.capabilities?.values() ?? [])]
|
|
129
129
|
.flat(2)
|
|
130
130
|
.map((capability) => {
|
|
131
|
-
return `const ${capability} = require("./${capability}.json")`;
|
|
131
|
+
return `const ${capability.replace(".", "_")} = require("./${capability}.json")`;
|
|
132
132
|
})
|
|
133
133
|
.join("\n")}
|
|
134
134
|
|
|
@@ -137,7 +137,7 @@ class XLRCompile extends base_command_1.BaseCommand {
|
|
|
137
137
|
"capabilities": {
|
|
138
138
|
${[...(capabilities.capabilities?.entries() ?? [])]
|
|
139
139
|
.map(([capabilityName, provides]) => {
|
|
140
|
-
return `"${capabilityName}":[${provides.join(",")}],`;
|
|
140
|
+
return `"${capabilityName}":[${provides.join(",").replaceAll(".", "_")}],`;
|
|
141
141
|
})
|
|
142
142
|
.join("\n\t\t")}
|
|
143
143
|
},
|
package/dist/utils/xlr/consts.js
CHANGED
|
@@ -88,13 +88,13 @@ function runPlayerPostProcessing(node, xlr, checker) {
|
|
|
88
88
|
/**
|
|
89
89
|
* Generated the XLR for a Capability, writes it to the specified path, and returns the name
|
|
90
90
|
*/
|
|
91
|
-
function generateXLR(node, checker, converter, outputDirectory) {
|
|
91
|
+
function generateXLR(node, capabilityType, checker, converter, outputDirectory) {
|
|
92
92
|
if (typescript_1.default.isTypeReferenceNode(node) || typescript_1.default.isTypeQueryNode(node)) {
|
|
93
93
|
const varDecl = getUnderlyingNode(node, checker);
|
|
94
94
|
if (varDecl) {
|
|
95
95
|
let capabilityDescription = converter.convertTopLevelNode(varDecl);
|
|
96
96
|
capabilityDescription = runPlayerPostProcessing(varDecl, capabilityDescription, checker);
|
|
97
|
-
const capabilityName = capabilityDescription?.name ?? "error"
|
|
97
|
+
const capabilityName = `${capabilityType}.${capabilityDescription?.name ?? "error"}`;
|
|
98
98
|
fs_1.default.writeFileSync(path_1.default.join(outputDirectory, `${capabilityName}.json`), JSON.stringify(capabilityDescription, undefined, 4));
|
|
99
99
|
return capabilityName;
|
|
100
100
|
}
|
|
@@ -143,12 +143,12 @@ function pluginVisitor(args) {
|
|
|
143
143
|
const exportedCapabilities = typeArgs?.[index];
|
|
144
144
|
// if its an array process each type
|
|
145
145
|
if (typescript_1.default.isTupleTypeNode(exportedCapabilities)) {
|
|
146
|
-
const capabilityNames = exportedCapabilities.elements.map((element) => generateXLR(element, checker, converter, outputDirectory));
|
|
146
|
+
const capabilityNames = exportedCapabilities.elements.map((element) => generateXLR(element, capabilityType, checker, converter, outputDirectory));
|
|
147
147
|
provides.set(capabilityType, capabilityNames);
|
|
148
148
|
}
|
|
149
149
|
else if (typescript_1.default.isTypeReferenceNode(exportedCapabilities) ||
|
|
150
150
|
typescript_1.default.isTypeQueryNode(exportedCapabilities)) {
|
|
151
|
-
const capabilityName = generateXLR(exportedCapabilities, checker, converter, outputDirectory);
|
|
151
|
+
const capabilityName = generateXLR(exportedCapabilities, capabilityType, checker, converter, outputDirectory);
|
|
152
152
|
provides.set(capabilityType, [capabilityName]);
|
|
153
153
|
}
|
|
154
154
|
else {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
7
|
"name": "@player-tools/cli",
|
|
8
|
-
"version": "0.13.0-next.
|
|
8
|
+
"version": "0.13.0-next.5",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"oclif": {
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"player": "bin/run"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@player-tools/dsl": "0.13.0-next.
|
|
25
|
-
"@player-tools/json-language-service": "0.13.0-next.
|
|
26
|
-
"@player-tools/xlr": "0.13.0-next.
|
|
27
|
-
"@player-tools/xlr-converters": "0.13.0-next.
|
|
28
|
-
"@player-tools/xlr-sdk": "0.13.0-next.
|
|
29
|
-
"@player-tools/xlr-utils": "0.13.0-next.
|
|
24
|
+
"@player-tools/dsl": "0.13.0-next.5",
|
|
25
|
+
"@player-tools/json-language-service": "0.13.0-next.5",
|
|
26
|
+
"@player-tools/xlr": "0.13.0-next.5",
|
|
27
|
+
"@player-tools/xlr-converters": "0.13.0-next.5",
|
|
28
|
+
"@player-tools/xlr-sdk": "0.13.0-next.5",
|
|
29
|
+
"@player-tools/xlr-utils": "0.13.0-next.5",
|
|
30
30
|
"@babel/plugin-transform-react-jsx-source": "^7.23.3",
|
|
31
31
|
"@babel/preset-env": "^7.23.3",
|
|
32
32
|
"@babel/preset-react": "^7.23.3",
|