@player-tools/cli 0.2.1-next.3 → 0.2.1
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.
|
@@ -107,20 +107,26 @@ class XLRCompile extends base_command_1.BaseCommand {
|
|
|
107
107
|
if (symbol) {
|
|
108
108
|
// look at what they implement
|
|
109
109
|
(_a = node.heritageClauses) === null || _a === void 0 ? void 0 : _a.forEach((heritage) => {
|
|
110
|
-
var _a;
|
|
111
|
-
capabilities.pluginName =
|
|
112
|
-
((_a = node.name) === null || _a === void 0 ? void 0 : _a.text) || capabilities.pluginName;
|
|
113
110
|
heritage.types.forEach((hInterface) => {
|
|
114
|
-
var _a, _b, _c;
|
|
111
|
+
var _a, _b, _c, _d;
|
|
115
112
|
// check if heritage is right one
|
|
116
113
|
if (hInterface.expression.getText() !== PLAYER_PLUGIN_INTERFACE_NAME) {
|
|
117
114
|
return;
|
|
118
115
|
}
|
|
116
|
+
// Get registration name of plugin
|
|
117
|
+
const nameProperty = node.members.find((member) => {
|
|
118
|
+
var _a;
|
|
119
|
+
return typescript_1.default.isPropertyDeclaration(member) &&
|
|
120
|
+
((_a = member.name) === null || _a === void 0 ? void 0 : _a.getText()) === 'name';
|
|
121
|
+
});
|
|
122
|
+
if (nameProperty && nameProperty.initializer) {
|
|
123
|
+
capabilities.pluginName = (_a = nameProperty.initializer) === null || _a === void 0 ? void 0 : _a.getText().replace(/['"]+/g, '');
|
|
124
|
+
}
|
|
119
125
|
const provides = new Map();
|
|
120
126
|
const typeArgs = hInterface.typeArguments;
|
|
121
|
-
const pluginDec = (
|
|
127
|
+
const pluginDec = (_c = (_b = checker.getTypeAtLocation(hInterface).symbol) === null || _b === void 0 ? void 0 : _b.declarations) === null || _c === void 0 ? void 0 : _c[0];
|
|
122
128
|
// process type parameters to figure out what capabilities are provided
|
|
123
|
-
(
|
|
129
|
+
(_d = pluginDec === null || pluginDec === void 0 ? void 0 : pluginDec.typeParameters) === null || _d === void 0 ? void 0 : _d.forEach((param, index) => {
|
|
124
130
|
var _a;
|
|
125
131
|
const capabilityType = param.name.getText();
|
|
126
132
|
if (index < ((_a = typeArgs === null || typeArgs === void 0 ? void 0 : typeArgs.length) !== null && _a !== void 0 ? _a : 0)) {
|
|
@@ -197,11 +203,11 @@ class XLRCompile extends base_command_1.BaseCommand {
|
|
|
197
203
|
const tsManifestFile = `${[...((_b = (_a = capabilities.capabilities) === null || _a === void 0 ? void 0 : _a.values()) !== null && _b !== void 0 ? _b : [])]
|
|
198
204
|
.flat(2)
|
|
199
205
|
.map((capability) => {
|
|
200
|
-
return `
|
|
206
|
+
return `const ${capability} = require('./${capability}.json')`;
|
|
201
207
|
})
|
|
202
208
|
.join('\n')}
|
|
203
209
|
|
|
204
|
-
|
|
210
|
+
module.exports = {
|
|
205
211
|
"pluginName": "${capabilities.pluginName}",
|
|
206
212
|
"capabilities": {
|
|
207
213
|
${[...((_d = (_c = capabilities.capabilities) === null || _c === void 0 ? void 0 : _c.entries()) !== null && _d !== void 0 ? _d : [])]
|
|
@@ -9,6 +9,7 @@ export declare abstract class BaseCommand extends Command {
|
|
|
9
9
|
static flags: {
|
|
10
10
|
config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
11
|
};
|
|
12
|
+
static strict: boolean;
|
|
12
13
|
private resolvedConfig;
|
|
13
14
|
private loadConfig;
|
|
14
15
|
private resolveConfig;
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.2.1
|
|
1
|
+
{"version":"0.2.1","commands":{"dsl:compile":{"id":"dsl:compile","description":"Compile Player DSL files into JSON","strict":false,"pluginName":"@player-tools/cli","pluginAlias":"@player-tools/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","description":"Path to a specific config file to load.\nBy default, will automatically search for an rc or config file to load","multiple":false},"input":{"name":"input","type":"option","char":"i","description":"An input directory to compile.\nAny jsx/ts/tsx files will be loaded via babel-require automatically.","multiple":false},"output":{"name":"output","type":"option","char":"o","description":"Output directory to write results to.","multiple":false},"skip-validation":{"name":"skip-validation","type":"boolean","description":"Option to skip validating the generated JSON","allowNo":false},"exp":{"name":"exp","type":"boolean","description":"Use experimental language features","allowNo":false}},"args":[],"_globalFlags":{}},"json:validate":{"id":"json:validate","description":"Validate Player JSON content","strict":false,"pluginName":"@player-tools/cli","pluginAlias":"@player-tools/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","description":"Path to a specific config file to load.\nBy default, will automatically search for an rc or config file to load","multiple":false},"files":{"name":"files","type":"option","char":"f","description":"A list of files or globs to validate","multiple":true},"exp":{"name":"exp","type":"boolean","description":"Use experimental language features","allowNo":false}},"args":[],"_globalFlags":{}},"xlr:compile":{"id":"xlr:compile","description":"Compiles typescript files to XLRs format","strict":false,"pluginName":"@player-tools/cli","pluginAlias":"@player-tools/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","description":"Path to a specific config file to load.\nBy default, will automatically search for an rc or config file to load","multiple":false},"input":{"name":"input","type":"option","char":"i","description":"An input directory to search for types to export","multiple":false,"default":"./src"},"output":{"name":"output","type":"option","char":"o","description":"Output directory to write results to.","multiple":false,"default":"./dist"},"mode":{"name":"mode","type":"option","char":"m","description":"Search strategy for types to export: plugin (default, looks for exported EnchancedPlayerPlugin classes) or type (all exported types)","helpValue":"(plugin|types)","multiple":false,"options":["plugin","types"],"default":"plugin"}},"args":[],"_globalFlags":{}},"xlr:convert":{"id":"xlr:convert","description":"Exports XLRs files to a specific language","strict":false,"pluginName":"@player-tools/cli","pluginAlias":"@player-tools/cli","pluginType":"core","aliases":[],"flags":{"config":{"name":"config","type":"option","char":"c","description":"Path to a specific config file to load.\nBy default, will automatically search for an rc or config file to load","multiple":false},"input":{"name":"input","type":"option","char":"i","description":"An input directory to search for types to export","multiple":false,"default":"./dist"},"output":{"name":"output","type":"option","char":"o","description":"Output directory to write results to.","multiple":false},"lang":{"name":"lang","type":"option","char":"l","description":"Search strategy for types to export: plugin (default, looks for exported EnchancedPlayerPlugin classes) or type (all exported types)","helpValue":"(TypeScript)","multiple":false,"options":["TypeScript"]}},"args":[],"_globalFlags":{}}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-tools/cli",
|
|
3
|
-
"version": "0.2.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"mkdirp": "^1.0.4",
|
|
28
28
|
"vscode-languageserver-textdocument": "^1.0.1",
|
|
29
29
|
"vscode-languageserver-types": "^3.15.1",
|
|
30
|
-
"@player-tools/dsl": "0.2.1
|
|
31
|
-
"@player-tools/language-service": "0.2.1
|
|
32
|
-
"@player-tools/xlr-sdk": "0.2.1
|
|
33
|
-
"@player-tools/xlr-utils": "0.2.1
|
|
34
|
-
"@player-tools/xlr-converters": "0.2.1
|
|
30
|
+
"@player-tools/dsl": "0.2.1",
|
|
31
|
+
"@player-tools/language-service": "0.2.1",
|
|
32
|
+
"@player-tools/xlr-sdk": "0.2.1",
|
|
33
|
+
"@player-tools/xlr-utils": "0.2.1",
|
|
34
|
+
"@player-tools/xlr-converters": "0.2.1"
|
|
35
35
|
},
|
|
36
36
|
"main": "./dist/index.js",
|
|
37
37
|
"module": "dist/index.esm.js",
|