@surreal-ui/cli 0.6.0 → 0.6.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/index.js +14 -11
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -11,9 +11,6 @@ import pc from "picocolors";
|
|
|
11
11
|
import prompts from "prompts";
|
|
12
12
|
|
|
13
13
|
// src/utils/registry.ts
|
|
14
|
-
import {
|
|
15
|
-
RegistryService
|
|
16
|
-
} from "@surreal-ui/core";
|
|
17
14
|
var DEFAULT_REGISTRY_URL = "https://surreal-ui.com/r";
|
|
18
15
|
async function fetchRegistryItem(options) {
|
|
19
16
|
const { componentId, aestheticId, framework = "svelte", registryUrl } = options;
|
|
@@ -32,12 +29,15 @@ async function fetchRegistryItem(options) {
|
|
|
32
29
|
}
|
|
33
30
|
}
|
|
34
31
|
try {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
32
|
+
const core = await import("@surreal-ui/core");
|
|
33
|
+
if (core?.RegistryService) {
|
|
34
|
+
const localItem = await core.RegistryService.getRegistryItem({
|
|
35
|
+
componentId,
|
|
36
|
+
aestheticId,
|
|
37
|
+
framework
|
|
38
|
+
});
|
|
39
|
+
if (localItem) return localItem;
|
|
40
|
+
}
|
|
41
41
|
} catch {
|
|
42
42
|
}
|
|
43
43
|
if (!registryUrl) {
|
|
@@ -72,8 +72,11 @@ async function fetchRegistryIndex(options = {}) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
try {
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
75
|
+
const core = await import("@surreal-ui/core");
|
|
76
|
+
if (core?.RegistryService) {
|
|
77
|
+
const localIndex = await core.RegistryService.getRegistryIndex(framework);
|
|
78
|
+
if (localIndex && localIndex.length > 0) return localIndex;
|
|
79
|
+
}
|
|
77
80
|
} catch {
|
|
78
81
|
}
|
|
79
82
|
if (!registryUrl) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surreal-ui/cli",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Surreal UI CLI - Add multi-platform UI components directly to your codebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"surreal-ui": "
|
|
9
|
-
"surreal": "
|
|
8
|
+
"surreal-ui": "dist/index.js",
|
|
9
|
+
"surreal": "dist/index.js"
|
|
10
10
|
},
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
@@ -14,13 +14,7 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsup",
|
|
19
|
-
"dev": "tsup --watch",
|
|
20
|
-
"test": "tsx --test test/*.test.ts"
|
|
21
|
-
},
|
|
22
17
|
"dependencies": {
|
|
23
|
-
"@surreal-ui/core": "workspace:*",
|
|
24
18
|
"commander": "^13.1.0",
|
|
25
19
|
"picocolors": "^1.1.1",
|
|
26
20
|
"prompts": "^2.4.2"
|
|
@@ -30,6 +24,12 @@
|
|
|
30
24
|
"@types/prompts": "^2.4.9",
|
|
31
25
|
"tsup": "^8.0.2",
|
|
32
26
|
"tsx": "^4.23.12",
|
|
33
|
-
"typescript": "^5.5.0"
|
|
27
|
+
"typescript": "^5.5.0",
|
|
28
|
+
"@surreal-ui/core": "0.6.1"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsup",
|
|
32
|
+
"dev": "tsup --watch",
|
|
33
|
+
"test": "tsx --test test/*.test.ts"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|