@player-tools/cli 0.4.0-next.2 → 0.4.0-next.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.
@@ -59,9 +59,9 @@ class DSLCompile extends base_command_1.BaseCommand {
59
59
  const results = {
60
60
  exitCode: 0,
61
61
  };
62
+ const compiler = yield this.createDSLCompiler();
62
63
  /** Compile a file from the DSL format into JSON */
63
64
  const compileFile = (file) => __awaiter(this, void 0, void 0, function* () {
64
- const compiler = yield this.createDSLCompiler();
65
65
  const requiredModule = require(path_1.default.resolve(file));
66
66
  const defaultExport = requiredModule.default;
67
67
  if (!defaultExport) {
@@ -106,6 +106,7 @@ class DSLCompile extends base_command_1.BaseCommand {
106
106
  });
107
107
  }
108
108
  }
109
+ yield compiler.hooks.onEnd.call({ output });
109
110
  if (!skipValidation) {
110
111
  console.log('');
111
112
  const hasOutput = compilerResults.some((r) => { var _a; return ((_a = r.output) === null || _a === void 0 ? void 0 : _a.contentType) === 'flow'; });
package/dist/config.d.ts CHANGED
@@ -33,5 +33,7 @@ export interface PlayerConfigResolvedShape {
33
33
  };
34
34
  /** Flattened list of plugins */
35
35
  plugins: Array<PlayerCLIPlugin>;
36
+ /** Catch for any other things that may be in the config for plugged in functionality */
37
+ [key: string]: any;
36
38
  }
37
39
  //# sourceMappingURL=config.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export { run } from '@oclif/core';
2
2
  export * from './config';
3
3
  export * from './plugins';
4
+ export * from './utils/base-command';
4
5
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -19,3 +19,4 @@ var core_1 = require("@oclif/core");
19
19
  Object.defineProperty(exports, "run", { enumerable: true, get: function () { return core_1.run; } });
20
20
  __exportStar(require("./config"), exports);
21
21
  __exportStar(require("./plugins"), exports);
22
+ __exportStar(require("./utils/base-command"), exports);
@@ -10,11 +10,11 @@ const registerForPaths = () => {
10
10
  (0, register_1.default)({
11
11
  extensions: ['.es6', '.es', '.jsx', '.js', '.mjs', '.tsx', '.ts'],
12
12
  presets: [
13
- ['@babel/preset-env', { modules: 'cjs' }],
14
- '@babel/preset-typescript',
15
- '@babel/preset-react',
13
+ [require.resolve('@babel/preset-env'), { modules: 'cjs' }],
14
+ require.resolve('@babel/preset-typescript'),
15
+ require.resolve('@babel/preset-react'),
16
16
  ],
17
- plugins: ['@babel/plugin-transform-react-jsx-source'],
17
+ plugins: [require.resolve('@babel/plugin-transform-react-jsx-source')],
18
18
  });
19
19
  };
20
20
  exports.registerForPaths = registerForPaths;
@@ -126,7 +126,11 @@ class BaseCommand extends core_1.Command {
126
126
  createDSLCompiler() {
127
127
  var _a, _b;
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
- const compiler = new dsl_1.DSLCompiler();
129
+ const compiler = new dsl_1.DSLCompiler({
130
+ error: this.error.bind(this),
131
+ warn: this.warn.bind(this),
132
+ log: this.log.bind(this),
133
+ });
130
134
  const { plugins } = yield this.getPlayerConfig();
131
135
  for (let i = 0; i < plugins.length; i++) {
132
136
  // eslint-disable-next-line no-await-in-loop
@@ -1 +1 @@
1
- {"version":"0.4.0-next.2","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":{}}}}
1
+ {"version":"0.4.0-next.4","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.4.0-next.2",
3
+ "version": "0.4.0-next.4",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -28,11 +28,11 @@
28
28
  "vscode-languageserver-textdocument": "^1.0.1",
29
29
  "vscode-languageserver-types": "^3.15.1",
30
30
  "typescript": "4.8.4",
31
- "@player-tools/dsl": "0.4.0-next.2",
32
- "@player-tools/json-language-service": "0.4.0-next.2",
33
- "@player-tools/xlr-sdk": "0.4.0-next.2",
34
- "@player-tools/xlr-utils": "0.4.0-next.2",
35
- "@player-tools/xlr-converters": "0.4.0-next.2"
31
+ "@player-tools/dsl": "0.4.0-next.4",
32
+ "@player-tools/json-language-service": "0.4.0-next.4",
33
+ "@player-tools/xlr-sdk": "0.4.0-next.4",
34
+ "@player-tools/xlr-utils": "0.4.0-next.4",
35
+ "@player-tools/xlr-converters": "0.4.0-next.4"
36
36
  },
37
37
  "main": "./dist/index.js",
38
38
  "module": "dist/index.esm.js",
@@ -50,5 +50,8 @@
50
50
  },
51
51
  "bin": {
52
52
  "player": "bin/run"
53
- }
53
+ },
54
+ "plugins": [
55
+ "@oclif/plugin-plugins"
56
+ ]
54
57
  }