@player-tools/cli 0.4.2-next.0 → 0.4.2-next.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.
@@ -1,6 +1,6 @@
1
1
  import type { PlayerLanguageService } from '@player-tools/json-language-service';
2
2
  import type { PlayerCLIPlugin } from './index';
3
- export interface Config {
3
+ export interface LSPAssetsPluginConfig {
4
4
  /** the path to the asset library to load */
5
5
  path: string;
6
6
  /** Provides experimental language features */
@@ -23,7 +23,7 @@ export interface Config {
23
23
  */
24
24
  export declare class LSPAssetsPlugin implements PlayerCLIPlugin {
25
25
  private config;
26
- constructor(config: Config);
26
+ constructor(config: LSPAssetsPluginConfig);
27
27
  onCreateLanguageService(lsp: PlayerLanguageService, exp: boolean): Promise<void>;
28
28
  }
29
29
  //# sourceMappingURL=LSPAssetsPlugin.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { PlayerLanguageService, PlayerLanguageServicePlugin } from '@player-tools/json-language-service';
2
+ import type { PlayerCLIPlugin } from './index';
3
+ /**
4
+ * Handles adding a LSP Plugin to the LSP
5
+ */
6
+ export declare class LSPPluginPlugin implements PlayerCLIPlugin {
7
+ private plugin;
8
+ constructor(plugin: PlayerLanguageServicePlugin);
9
+ onCreateLanguageService(lsp: PlayerLanguageService, exp: boolean): Promise<void>;
10
+ }
11
+ //# sourceMappingURL=LSPPluginPlugin.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LSPPluginPlugin = void 0;
13
+ /**
14
+ * Handles adding a LSP Plugin to the LSP
15
+ */
16
+ class LSPPluginPlugin {
17
+ constructor(plugin) {
18
+ this.plugin = plugin;
19
+ }
20
+ onCreateLanguageService(lsp, exp) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ lsp.addLSPPlugin(this.plugin);
23
+ });
24
+ }
25
+ }
26
+ exports.LSPPluginPlugin = LSPPluginPlugin;
@@ -0,0 +1,12 @@
1
+ import type { PlayerLanguageService } from '@player-tools/json-language-service';
2
+ import type { TransformFunction } from '@player-tools/xlr';
3
+ import type { PlayerCLIPlugin } from './index';
4
+ /**
5
+ * Handles adding XLR transforms to the LSP's XLR SDK
6
+ */
7
+ export declare class LSPTransformsPlugin implements PlayerCLIPlugin {
8
+ private functionsToLoad;
9
+ constructor(functionsToLoad: Record<string, TransformFunction>);
10
+ onCreateLanguageService(lsp: PlayerLanguageService, exp: boolean): Promise<void>;
11
+ }
12
+ //# sourceMappingURL=LSPTransformsPlugin.d.ts.map
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LSPTransformsPlugin = void 0;
13
+ /**
14
+ * Handles adding XLR transforms to the LSP's XLR SDK
15
+ */
16
+ class LSPTransformsPlugin {
17
+ constructor(functionsToLoad) {
18
+ this.functionsToLoad = functionsToLoad;
19
+ }
20
+ onCreateLanguageService(lsp, exp) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ lsp.addXLRTransforms(this.functionsToLoad);
23
+ });
24
+ }
25
+ }
26
+ exports.LSPTransformsPlugin = LSPTransformsPlugin;
@@ -4,6 +4,8 @@ import type { ExportTypes } from '@player-tools/xlr-sdk';
4
4
  import type { TransformFunction } from '@player-tools/xlr';
5
5
  import type { CompilationContext } from '../utils/compilation-context';
6
6
  export * from './LSPAssetsPlugin';
7
+ export * from './LSPPluginPlugin';
8
+ export * from './LSPTransformsPlugin';
7
9
  export interface PlayerCLIPlugin {
8
10
  /**
9
11
  * Handler when an LSP instance is created
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./LSPAssetsPlugin"), exports);
18
+ __exportStar(require("./LSPPluginPlugin"), exports);
19
+ __exportStar(require("./LSPTransformsPlugin"), exports);
@@ -1 +1 @@
1
- {"version":"0.4.2-next.0","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.2-next.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.4.2-next.0",
3
+ "version": "0.4.2-next.1",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
@@ -30,11 +30,11 @@
30
30
  "vscode-languageserver-textdocument": "^1.0.1",
31
31
  "vscode-languageserver-types": "^3.15.1",
32
32
  "typescript": "4.8.4",
33
- "@player-tools/dsl": "0.4.2-next.0",
34
- "@player-tools/json-language-service": "0.4.2-next.0",
35
- "@player-tools/xlr-sdk": "0.4.2-next.0",
36
- "@player-tools/xlr-utils": "0.4.2-next.0",
37
- "@player-tools/xlr-converters": "0.4.2-next.0"
33
+ "@player-tools/dsl": "0.4.2-next.1",
34
+ "@player-tools/json-language-service": "0.4.2-next.1",
35
+ "@player-tools/xlr-sdk": "0.4.2-next.1",
36
+ "@player-tools/xlr-utils": "0.4.2-next.1",
37
+ "@player-tools/xlr-converters": "0.4.2-next.1"
38
38
  },
39
39
  "main": "./dist/index.js",
40
40
  "module": "dist/index.esm.js",