@jskit-ai/jskit-cli 0.2.20 → 0.2.22
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/jskit-cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.22",
|
|
4
4
|
"description": "Bundle and package orchestration CLI for JSKIT apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"test": "node --test"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@jskit-ai/jskit-catalog": "0.1.
|
|
23
|
+
"@jskit-ai/jskit-catalog": "0.1.22"
|
|
24
24
|
},
|
|
25
25
|
"engines": {
|
|
26
26
|
"node": "20.x"
|
package/src/server/cliRuntime.js
CHANGED
|
@@ -43,6 +43,11 @@ import { createCommandHandlers } from "./commandHandlers.js";
|
|
|
43
43
|
import { parseArgs, printUsage } from "./argParser.js";
|
|
44
44
|
import { createCommandHandlerDeps } from "./runtimeDeps.js";
|
|
45
45
|
import { createRunCli } from "./runCli.js";
|
|
46
|
+
import {
|
|
47
|
+
toScopedPackageId,
|
|
48
|
+
resolvePackageIdInput,
|
|
49
|
+
resolveInstalledPackageIdInput
|
|
50
|
+
} from "./packageIdHelpers.js";
|
|
46
51
|
|
|
47
52
|
const LOCK_RELATIVE_PATH = ".jskit/lock.json";
|
|
48
53
|
const LOCK_VERSION = 1;
|
|
@@ -518,47 +523,6 @@ function upsertManagedMigrationRecord(managedMigrations, record) {
|
|
|
518
523
|
records.push(nextRecord);
|
|
519
524
|
}
|
|
520
525
|
|
|
521
|
-
function toScopedPackageId(input) {
|
|
522
|
-
const raw = String(input || "").trim();
|
|
523
|
-
if (!raw) {
|
|
524
|
-
return "";
|
|
525
|
-
}
|
|
526
|
-
if (raw.startsWith("@")) {
|
|
527
|
-
return raw;
|
|
528
|
-
}
|
|
529
|
-
return `@jskit-ai/${raw}`;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
function resolvePackageIdInput(input, packageRegistry) {
|
|
533
|
-
const raw = String(input || "").trim();
|
|
534
|
-
if (!raw) {
|
|
535
|
-
return "";
|
|
536
|
-
}
|
|
537
|
-
if (packageRegistry.has(raw)) {
|
|
538
|
-
return raw;
|
|
539
|
-
}
|
|
540
|
-
const scoped = toScopedPackageId(raw);
|
|
541
|
-
if (scoped && packageRegistry.has(scoped)) {
|
|
542
|
-
return scoped;
|
|
543
|
-
}
|
|
544
|
-
return "";
|
|
545
|
-
}
|
|
546
|
-
|
|
547
|
-
function resolveInstalledPackageIdInput(input, installedPackages) {
|
|
548
|
-
const raw = String(input || "").trim();
|
|
549
|
-
if (!raw) {
|
|
550
|
-
return "";
|
|
551
|
-
}
|
|
552
|
-
if (Object.prototype.hasOwnProperty.call(installedPackages, raw)) {
|
|
553
|
-
return raw;
|
|
554
|
-
}
|
|
555
|
-
const scoped = toScopedPackageId(raw);
|
|
556
|
-
if (scoped && Object.prototype.hasOwnProperty.call(installedPackages, scoped)) {
|
|
557
|
-
return scoped;
|
|
558
|
-
}
|
|
559
|
-
return "";
|
|
560
|
-
}
|
|
561
|
-
|
|
562
526
|
async function fileExists(absolutePath) {
|
|
563
527
|
try {
|
|
564
528
|
await access(absolutePath, fsConstants.F_OK);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function toScopedPackageId(input) {
|
|
2
|
+
const raw = String(input || "").trim();
|
|
3
|
+
if (!raw) {
|
|
4
|
+
return "";
|
|
5
|
+
}
|
|
6
|
+
if (raw.startsWith("@")) {
|
|
7
|
+
return raw;
|
|
8
|
+
}
|
|
9
|
+
return `@jskit-ai/${raw}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function resolvePackageIdInput(input, packageRegistry) {
|
|
13
|
+
const raw = String(input || "").trim();
|
|
14
|
+
if (!raw) {
|
|
15
|
+
return "";
|
|
16
|
+
}
|
|
17
|
+
if (packageRegistry?.has(raw)) {
|
|
18
|
+
return raw;
|
|
19
|
+
}
|
|
20
|
+
const scoped = toScopedPackageId(raw);
|
|
21
|
+
if (scoped && packageRegistry?.has(scoped)) {
|
|
22
|
+
return scoped;
|
|
23
|
+
}
|
|
24
|
+
return "";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function resolveInstalledPackageIdInput(input, installedPackages) {
|
|
28
|
+
const raw = String(input || "").trim();
|
|
29
|
+
if (!raw) {
|
|
30
|
+
return "";
|
|
31
|
+
}
|
|
32
|
+
if (Object.prototype.hasOwnProperty.call(installedPackages || {}, raw)) {
|
|
33
|
+
return raw;
|
|
34
|
+
}
|
|
35
|
+
const scoped = toScopedPackageId(raw);
|
|
36
|
+
if (scoped && Object.prototype.hasOwnProperty.call(installedPackages || {}, scoped)) {
|
|
37
|
+
return scoped;
|
|
38
|
+
}
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
toScopedPackageId,
|
|
44
|
+
resolvePackageIdInput,
|
|
45
|
+
resolveInstalledPackageIdInput
|
|
46
|
+
};
|