@player-cli/cli 0.1.1-next.0 → 0.1.1-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.
- package/dist/commands/dependency-versions/check.d.ts +1 -1
- package/dist/commands/dependency-versions/check.js +20 -20
- package/dist/commands/dsl/compile.js +2 -2
- package/dist/commands/xlr/compile.js +1 -1
- package/dist/commands/xlr/convert.js +1 -1
- package/dist/plugins/LSPAssetsPlugin.d.ts +2 -2
- package/dist/plugins/LSPPluginPlugin.d.ts +1 -1
- package/dist/plugins/LSPTransformsPlugin.d.ts +2 -2
- package/dist/plugins/index.d.ts +4 -4
- package/dist/utils/base-command.d.ts +4 -4
- package/dist/utils/base-command.js +3 -3
- package/dist/utils/compilation-context.d.ts +1 -1
- package/dist/utils/compilation-context.js +2 -2
- package/dist/utils/compile-renderer.d.ts +1 -1
- package/dist/utils/xlr/visitors/file.d.ts +1 -1
- package/dist/utils/xlr/visitors/plugin.d.ts +1 -1
- package/dist/utils/xlr/visitors/plugin.js +1 -1
- package/dist/utils/xlr/visitors/types.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from "../../utils/base-command";
|
|
2
|
-
/** A command to get @player-ui/@player-
|
|
2
|
+
/** A command to get @player-ui/@player-lang dependency versions and issue warnings/recommendations based on them */
|
|
3
3
|
export default class DependencyVersionsCheck extends BaseCommand {
|
|
4
4
|
static summary: string;
|
|
5
5
|
static description: string;
|
|
@@ -8,15 +8,15 @@ const easy_table_1 = tslib_1.__importDefault(require("easy-table"));
|
|
|
8
8
|
const child_process_1 = tslib_1.__importDefault(require("child_process"));
|
|
9
9
|
const core_1 = require("@oclif/core");
|
|
10
10
|
const base_command_1 = require("../../utils/base-command");
|
|
11
|
-
/** A command to get @player-ui/@player-
|
|
11
|
+
/** A command to get @player-ui/@player-lang dependency versions and issue warnings/recommendations based on them */
|
|
12
12
|
class DependencyVersionsCheck extends base_command_1.BaseCommand {
|
|
13
|
-
static summary = "Checks for @player-ui/@player-
|
|
13
|
+
static summary = "Checks for @player-ui/@player-lang dependency version mismatches and issues warnings/solutions accordingly";
|
|
14
14
|
static description = `Consider the following:
|
|
15
15
|
- The interpretation of TOP-LEVEL and NESTED dependencies is as follows:
|
|
16
16
|
a. TOP-LEVEL dependencies only have one 'node_modules' in their path
|
|
17
17
|
b. NESTED dependencies have more than one 'node_modules' in their path
|
|
18
|
-
- @player-ui/@player-
|
|
19
|
-
For example, if you have some 'node_modules' inside of a 'packages' folder that contains @player-ui/@player-
|
|
18
|
+
- @player-ui/@player-lang dependencies are fetched not only from inside the 'node_modules' at the top of the repository in which it is run but also from 'node_modules' in sub-directories.
|
|
19
|
+
For example, if you have some 'node_modules' inside of a 'packages' folder that contains @player-ui/@player-lang dependencies, then these will also be fetched.
|
|
20
20
|
The display of such dependencies also depends on the first bullet point.
|
|
21
21
|
`;
|
|
22
22
|
static flags = {
|
|
@@ -78,7 +78,7 @@ class DependencyVersionsCheck extends base_command_1.BaseCommand {
|
|
|
78
78
|
else {
|
|
79
79
|
console.log("To add string pattern(s) for files to exclude, consider adding them after the -i flag.");
|
|
80
80
|
}
|
|
81
|
-
console.log("Inspecting the @player-ui/@player-
|
|
81
|
+
console.log("Inspecting the @player-ui/@player-lang dependencies in the current repository...");
|
|
82
82
|
let packageJsons = globby_1.default.sync("**/node_modules/{@player,@player-language,@web-player}/*/package.json");
|
|
83
83
|
if (ignore) {
|
|
84
84
|
// It is necessary to filter here rather than to pass extra options to globSync.
|
|
@@ -201,11 +201,11 @@ class DependencyVersionsCheck extends base_command_1.BaseCommand {
|
|
|
201
201
|
console.log(table.toString());
|
|
202
202
|
}
|
|
203
203
|
if (topLevelVersionsExist) {
|
|
204
|
-
console.log("\nTOP-LEVEL @player-ui/@player-
|
|
204
|
+
console.log("\nTOP-LEVEL @player-ui/@player-lang DEPENDENCIES:");
|
|
205
205
|
printTable(versionToTopLevelDependencyMap, sortedTopLevelVersions, topLevelDependenciesTable);
|
|
206
206
|
}
|
|
207
207
|
if (nestedVersionsExist) {
|
|
208
|
-
console.log("\nNESTED @player-ui/@player-
|
|
208
|
+
console.log("\nNESTED @player-ui/@player-lang DEPENDENCIES:");
|
|
209
209
|
printTable(versionToNestedDependencyMap, sortedNestedVersions, nestedDependenciesTable);
|
|
210
210
|
}
|
|
211
211
|
if ((!topLevelVersionsExist && nestedVersions.length === 1) ||
|
|
@@ -213,51 +213,51 @@ class DependencyVersionsCheck extends base_command_1.BaseCommand {
|
|
|
213
213
|
(!nestedVersionsExist && !topLevelVersionsExist) ||
|
|
214
214
|
singleVersionsMatch) {
|
|
215
215
|
if (singleVersionsMatch) {
|
|
216
|
-
console.log("Unique top-level and nested @player-ui/@player-
|
|
216
|
+
console.log("Unique top-level and nested @player-ui/@player-lang versions match. ");
|
|
217
217
|
}
|
|
218
218
|
if (!topLevelVersionsExist && nestedVersions.length === 1) {
|
|
219
|
-
console.log(`No top-level @player-ui/@player-
|
|
219
|
+
console.log(`No top-level @player-ui/@player-lang dependencies exist. Only a single nested @player-ui/@player-lang version exists, ${nestedVersions[0]}`);
|
|
220
220
|
}
|
|
221
221
|
if (!nestedVersionsExist && topLevelVersions.length === 1) {
|
|
222
|
-
console.log(`No nested @player-ui/@player-
|
|
222
|
+
console.log(`No nested @player-ui/@player-lang dependencies exist. Only a single top-level @player-ui/@player-lang version exists, ${topLevelVersions[0]}`);
|
|
223
223
|
}
|
|
224
224
|
if (!nestedVersionsExist && !topLevelVersionsExist) {
|
|
225
|
-
console.log("No @player-ui/@player-
|
|
225
|
+
console.log("No @player-ui/@player-lang dependencies exist.");
|
|
226
226
|
}
|
|
227
|
-
console.log("There are no issues related to @player-ui/@player-
|
|
227
|
+
console.log("There are no issues related to @player-ui/@player-lang dependency versioning. You are good to go! ");
|
|
228
228
|
this.exit(results.exitCode);
|
|
229
229
|
return results;
|
|
230
230
|
}
|
|
231
231
|
console.log(chalkNegative("WARNINGS:"));
|
|
232
232
|
if (multipleTopLevelVersionsDetected) {
|
|
233
|
-
console.log("- There are multiple top-level @player-ui/@player-
|
|
233
|
+
console.log("- There are multiple top-level @player-ui/@player-lang dependency versions.");
|
|
234
234
|
}
|
|
235
235
|
if (multipleNestedVersionsDetected) {
|
|
236
|
-
console.log("- There are multiple nested @player-ui/@player-
|
|
236
|
+
console.log("- There are multiple nested @player-ui/@player-lang dependency versions.");
|
|
237
237
|
}
|
|
238
238
|
if (singleVersionsMismatch) {
|
|
239
|
-
console.log("- Mismatch between the top-level and the nested @player-ui/@player-
|
|
239
|
+
console.log("- Mismatch between the top-level and the nested @player-ui/@player-lang dependency.");
|
|
240
240
|
}
|
|
241
241
|
console.log(chalkPositive("RECOMMENDATIONS:"));
|
|
242
242
|
if (multipleTopLevelVersionsDetected) {
|
|
243
|
-
console.log(`- Resolve all top-level @player-ui/@player-
|
|
243
|
+
console.log(`- Resolve all top-level @player-ui/@player-lang dependencies to the same version. Consider updating them to the latest player version you have, ${highestTopLevelVersion}. When all top-level @player-ui/@player-lang dependencies are resolved, run the current CLI again to obtain recommendations about nested @player-ui/@player-lang dependencies.`);
|
|
244
244
|
}
|
|
245
245
|
else if (highestTopLevelVersion && highestNestedVersion) {
|
|
246
246
|
// highestTopLevelVersion && highestNestedVersion defined means: single top-level version, one or more nested versions
|
|
247
247
|
if (cmp(highestTopLevelVersion, highestNestedVersion) >= 1) {
|
|
248
248
|
// when only a single top-level version is detected, it is simply the highest
|
|
249
|
-
console.log(`- The highest @player-ui/@player-
|
|
249
|
+
console.log(`- The highest @player-ui/@player-lang version is ${highestTopLevelVersion} at the top level. Please add resolutions for all nested @player-ui/@player-lang versions to this version or bump the nested versions to it.`);
|
|
250
250
|
}
|
|
251
251
|
else {
|
|
252
|
-
console.log(`- The highest @player-ui/@player-
|
|
252
|
+
console.log(`- The highest @player-ui/@player-lang version is ${highestNestedVersion} at the nested level. Please bump the top-level version, ${highestTopLevelVersion}, to ${highestNestedVersion}.`);
|
|
253
253
|
if (multipleNestedVersionsDetected) {
|
|
254
|
-
console.log(`- Also, please add resolutions or bump the versions for nested @player-ui/@player-
|
|
254
|
+
console.log(`- Also, please add resolutions or bump the versions for nested @player-ui/@player-lang dependencies whose version is not ${highestNestedVersion}.`);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
258
|
else if (highestNestedVersion && multipleNestedVersionsDetected) {
|
|
259
259
|
// no top-level version defined, multiple nested versions
|
|
260
|
-
console.log(`- The highest @player-ui/@player-
|
|
260
|
+
console.log(`- The highest @player-ui/@player-lang version is ${highestNestedVersion} at the nested level. Please add resolutions for all nested @player-ui/@player-lang versions to this version or bump the nested versions to it.`);
|
|
261
261
|
}
|
|
262
262
|
// Although no errors have occurred when the code reaches here, a non-zero exit code of WARNING_EXIT_CODE = 1 is still used to indicate
|
|
263
263
|
// the idea of "warnings" being issued due to dependency version discrepancies
|
|
@@ -9,7 +9,7 @@ const mkdirp_1 = tslib_1.__importDefault(require("mkdirp"));
|
|
|
9
9
|
const log_symbols_1 = tslib_1.__importDefault(require("log-symbols"));
|
|
10
10
|
const figures_1 = tslib_1.__importDefault(require("figures"));
|
|
11
11
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
12
|
-
const
|
|
12
|
+
const react_dsl_1 = require("@player-lang/react-dsl");
|
|
13
13
|
const base_command_1 = require("../../utils/base-command");
|
|
14
14
|
const fs_2 = require("../../utils/fs");
|
|
15
15
|
const babel_register_1 = require("../../utils/babel-register");
|
|
@@ -89,7 +89,7 @@ class DSLCompile extends base_command_1.BaseCommand {
|
|
|
89
89
|
}
|
|
90
90
|
const preProcessedValue = await context.dslCompiler.hooks.preProcessFlow.call(defaultExport);
|
|
91
91
|
const { type: contentType, extension: ext } = (await context.hooks.identifyContentType.call(file, preProcessedValue)) || {
|
|
92
|
-
type: (0,
|
|
92
|
+
type: (0, react_dsl_1.fingerprintContent)(preProcessedValue, file) || "unknown",
|
|
93
93
|
extension: ".json",
|
|
94
94
|
};
|
|
95
95
|
let relativePath = path_1.default.relative(input, file);
|
|
@@ -7,7 +7,7 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
|
7
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
8
|
const globby_1 = tslib_1.__importDefault(require("globby"));
|
|
9
9
|
const log_symbols_1 = tslib_1.__importDefault(require("log-symbols"));
|
|
10
|
-
const xlr_converters_1 = require("@
|
|
10
|
+
const xlr_converters_1 = require("@xlr-lib/xlr-converters");
|
|
11
11
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
12
12
|
const base_command_1 = require("../../utils/base-command");
|
|
13
13
|
const visitors_1 = require("../../utils/xlr/visitors");
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
6
6
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
-
const xlr_sdk_1 = require("@
|
|
8
|
+
const xlr_sdk_1 = require("@xlr-lib/xlr-sdk");
|
|
9
9
|
const log_symbols_1 = tslib_1.__importDefault(require("log-symbols"));
|
|
10
10
|
const base_command_1 = require("../../utils/base-command");
|
|
11
11
|
const PlayerImportMap = new Map([
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PlayerLanguageService } from "@player-
|
|
1
|
+
import type { PlayerLanguageService } from "@player-lang/json-language-service";
|
|
2
2
|
import type { PlayerCLIPlugin } from "./index";
|
|
3
|
-
import { TSManifest } from "@
|
|
3
|
+
import { TSManifest } from "@xlr-lib/xlr";
|
|
4
4
|
/** Loads XLRs into the LSP via the manifest.js file */
|
|
5
5
|
export interface LSPAssetsPluginModuleConfig {
|
|
6
6
|
type: "module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PlayerLanguageService, PlayerLanguageServicePlugin } from "@player-
|
|
1
|
+
import type { PlayerLanguageService, PlayerLanguageServicePlugin } from "@player-lang/json-language-service";
|
|
2
2
|
import type { PlayerCLIPlugin } from "./index";
|
|
3
3
|
/**
|
|
4
4
|
* Handles adding a LSP Plugin to the LSP
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PlayerLanguageService } from "@player-
|
|
2
|
-
import type { TransformFunction } from "@
|
|
1
|
+
import type { PlayerLanguageService } from "@player-lang/json-language-service";
|
|
2
|
+
import type { TransformFunction } from "@xlr-lib/xlr";
|
|
3
3
|
import type { PlayerCLIPlugin } from "./index";
|
|
4
4
|
/**
|
|
5
5
|
* Handles adding XLR transforms to the LSP's XLR SDK
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { PlayerLanguageService } from "@player-
|
|
2
|
-
import type { DSLCompiler } from "@player-
|
|
3
|
-
import type { ExportTypes } from "@
|
|
4
|
-
import type { TransformFunction } from "@
|
|
1
|
+
import type { PlayerLanguageService } from "@player-lang/json-language-service";
|
|
2
|
+
import type { DSLCompiler } from "@player-lang/react-dsl";
|
|
3
|
+
import type { ExportTypes } from "@xlr-lib/xlr-sdk";
|
|
4
|
+
import type { TransformFunction } from "@xlr-lib/xlr";
|
|
5
5
|
import type { CompilationContext } from "../utils/compilation-context";
|
|
6
6
|
export * from "./LSPAssetsPlugin";
|
|
7
7
|
export * from "./LSPPluginPlugin";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
|
-
import { PlayerLanguageService } from "@player-
|
|
3
|
-
import { DSLCompiler } from "@player-
|
|
4
|
-
import type { ExportTypes } from "@
|
|
5
|
-
import type { TransformFunction } from "@
|
|
2
|
+
import { PlayerLanguageService } from "@player-lang/json-language-service";
|
|
3
|
+
import { DSLCompiler } from "@player-lang/react-dsl";
|
|
4
|
+
import type { ExportTypes } from "@xlr-lib/xlr-sdk";
|
|
5
|
+
import type { TransformFunction } from "@xlr-lib/xlr";
|
|
6
6
|
import type { PlayerConfigResolvedShape } from "../config";
|
|
7
7
|
import { CompilationContext } from "./compilation-context";
|
|
8
8
|
/** The common configs for all */
|
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
8
|
-
const json_language_service_1 = require("@player-
|
|
9
|
-
const
|
|
8
|
+
const json_language_service_1 = require("@player-lang/json-language-service");
|
|
9
|
+
const react_dsl_1 = require("@player-lang/react-dsl");
|
|
10
10
|
const compilation_context_1 = require("./compilation-context");
|
|
11
11
|
const log_levels_1 = require("./log-levels");
|
|
12
12
|
const configLoader = (0, cosmiconfig_1.cosmiconfig)("player");
|
|
@@ -118,7 +118,7 @@ class BaseCommand extends core_1.Command {
|
|
|
118
118
|
return lsp;
|
|
119
119
|
}
|
|
120
120
|
async createDSLCompiler() {
|
|
121
|
-
const compiler = new
|
|
121
|
+
const compiler = new react_dsl_1.DSLCompiler({
|
|
122
122
|
error: this.error.bind(this),
|
|
123
123
|
warn: this.warn.bind(this),
|
|
124
124
|
log: this.log.bind(this),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DSLCompiler, SerializeContext } from "@player-
|
|
1
|
+
import type { DSLCompiler, SerializeContext } from "@player-lang/react-dsl";
|
|
2
2
|
import { AsyncSeriesBailHook } from "tapable-ts";
|
|
3
3
|
export interface identifyContentReturn {
|
|
4
4
|
/** The identified type the content should be compiled as */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CompilationContext = void 0;
|
|
4
|
-
const
|
|
4
|
+
const react_dsl_1 = require("@player-lang/react-dsl");
|
|
5
5
|
const tapable_ts_1 = require("tapable-ts");
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -39,7 +39,7 @@ class CompilationContext {
|
|
|
39
39
|
constructor(dslCompiler) {
|
|
40
40
|
this.dslCompiler = dslCompiler;
|
|
41
41
|
this.hooks.compileContent.tap("default", async ({ type }, content) => {
|
|
42
|
-
if ((0,
|
|
42
|
+
if ((0, react_dsl_1.isDefaultCompilerContentType)(type)) {
|
|
43
43
|
const compilationResults = await this.dslCompiler.serialize(content, {
|
|
44
44
|
type,
|
|
45
45
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Manifest } from "@
|
|
1
|
+
import type { Manifest } from "@xlr-lib/xlr";
|
|
2
2
|
import type { VisitorProps } from "./types";
|
|
3
3
|
/** export all exported types in the file */
|
|
4
4
|
export declare function fileVisitor(args: VisitorProps): Manifest | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Manifest } from "@
|
|
1
|
+
import type { Manifest } from "@xlr-lib/xlr";
|
|
2
2
|
import type { VisitorProps } from "./types";
|
|
3
3
|
/** visit nodes finding exported classes */
|
|
4
4
|
export declare function pluginVisitor(args: VisitorProps): Manifest | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.pluginVisitor = pluginVisitor;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const xlr_utils_1 = require("@
|
|
5
|
+
const xlr_utils_1 = require("@xlr-lib/xlr-utils");
|
|
6
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
7
|
const typescript_1 = tslib_1.__importDefault(require("typescript"));
|
|
8
8
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
7
7
|
"name": "@player-cli/cli",
|
|
8
|
-
"version": "0.1.1-next.
|
|
8
|
+
"version": "0.1.1-next.1",
|
|
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-
|
|
25
|
-
"@player-
|
|
26
|
-
"@
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
24
|
+
"@player-lang/react-dsl": "0.0.2-next.0",
|
|
25
|
+
"@player-lang/json-language-service": "0.0.2-next.0",
|
|
26
|
+
"@xlr-lib/xlr": "0.1.1-next.1",
|
|
27
|
+
"@xlr-lib/xlr-converters": "^0.1.1-next.1",
|
|
28
|
+
"@xlr-lib/xlr-sdk": "0.1.1-next.1",
|
|
29
|
+
"@xlr-lib/xlr-utils": "0.1.1-next.1",
|
|
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",
|