@g3nomaly/ui 0.3.3 → 0.3.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.
- package/README.md +47 -25
- package/dist/cli/adapter.d.ts +14 -6
- package/dist/cli/adapter.d.ts.map +1 -1
- package/dist/cli/adapter.js +23 -18
- package/dist/cli/adapter.js.map +1 -1
- package/dist/cli/afterInstall.d.ts +26 -0
- package/dist/cli/afterInstall.d.ts.map +1 -0
- package/dist/cli/afterInstall.js +54 -0
- package/dist/cli/afterInstall.js.map +1 -0
- package/dist/cli/commands/add.d.ts +8 -2
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +9 -4
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +16 -5
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +59 -13
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +1 -1
- package/dist/cli/commands/manifest.js +1 -1
- package/dist/cli/commands/manifest.js.map +1 -1
- package/dist/cli/commands/source.d.ts +2 -1
- package/dist/cli/commands/source.d.ts.map +1 -1
- package/dist/cli/commands/source.js +29 -2
- package/dist/cli/commands/source.js.map +1 -1
- package/dist/cli/commands/sourceInit.d.ts +9 -0
- package/dist/cli/commands/sourceInit.d.ts.map +1 -0
- package/dist/cli/commands/sourceInit.js +77 -0
- package/dist/cli/commands/sourceInit.js.map +1 -0
- package/dist/cli/commands/update.d.ts +10 -3
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +9 -4
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/index.js +15 -5
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/npmDependencies.d.ts +11 -0
- package/dist/cli/npmDependencies.d.ts.map +1 -0
- package/dist/cli/npmDependencies.js +67 -0
- package/dist/cli/npmDependencies.js.map +1 -0
- package/dist/cli/packageFiles.d.ts +15 -0
- package/dist/cli/packageFiles.d.ts.map +1 -0
- package/dist/cli/packageFiles.js +54 -0
- package/dist/cli/packageFiles.js.map +1 -0
- package/dist/cli/themeTokens.d.ts +12 -0
- package/dist/cli/themeTokens.d.ts.map +1 -0
- package/dist/cli/themeTokens.js +52 -0
- package/dist/cli/themeTokens.js.map +1 -0
- package/dist/packages/dependencies.d.ts +44 -0
- package/dist/packages/dependencies.d.ts.map +1 -0
- package/dist/packages/dependencies.js +60 -0
- package/dist/packages/dependencies.js.map +1 -0
- package/dist/packages/install.d.ts +10 -0
- package/dist/packages/install.d.ts.map +1 -0
- package/dist/packages/install.js +21 -0
- package/dist/packages/install.js.map +1 -0
- package/dist/registry/adapters/shadcn.adapter.d.ts +32 -7
- package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -1
- package/dist/registry/adapters/shadcn.adapter.js +75 -20
- package/dist/registry/adapters/shadcn.adapter.js.map +1 -1
- package/dist/registry/adapters/shadcnImports.d.ts +10 -0
- package/dist/registry/adapters/shadcnImports.d.ts.map +1 -0
- package/dist/registry/adapters/shadcnImports.js +18 -0
- package/dist/registry/adapters/shadcnImports.js.map +1 -0
- package/dist/registry/componentsJson.d.ts +3 -1
- package/dist/registry/componentsJson.d.ts.map +1 -1
- package/dist/registry/componentsJson.js +15 -1
- package/dist/registry/componentsJson.js.map +1 -1
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest.d.ts +2 -13
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/registry/manifest.js +4 -76
- package/dist/registry/manifest.js.map +1 -1
- package/dist/registry/packageExports.d.ts +9 -0
- package/dist/registry/packageExports.d.ts.map +1 -0
- package/dist/registry/packageExports.js +50 -0
- package/dist/registry/packageExports.js.map +1 -0
- package/dist/registry/readSource.d.ts +4 -2
- package/dist/registry/readSource.d.ts.map +1 -1
- package/dist/registry/readSource.js +27 -3
- package/dist/registry/readSource.js.map +1 -1
- package/dist/registry/types.d.ts +86 -3
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +46 -3
- package/dist/registry/types.js.map +1 -1
- package/dist/sources/builtins.d.ts +1 -5
- package/dist/sources/builtins.d.ts.map +1 -1
- package/dist/sources/builtins.js +2 -7
- package/dist/sources/builtins.js.map +1 -1
- package/dist/theme/cssVars.d.ts +30 -0
- package/dist/theme/cssVars.d.ts.map +1 -0
- package/dist/theme/cssVars.js +92 -0
- package/dist/theme/cssVars.js.map +1 -0
- package/dist/theme/detectCssFile.d.ts +9 -0
- package/dist/theme/detectCssFile.d.ts.map +1 -0
- package/dist/theme/detectCssFile.js +41 -0
- package/dist/theme/detectCssFile.js.map +1 -0
- package/package.json +8 -21
- package/template/build.ts +25 -0
- package/template/package.json +18 -0
- package/template/src/components/example/Example.css +20 -0
- package/template/src/components/example/Example.tsx +26 -0
- package/template/src/components/example/example.meta.ts +61 -0
- package/dist/components/basic/Card.css +0 -32
- package/dist/components/basic/Card.debug.ts +0 -5
- package/dist/components/basic/Card.tsx +0 -31
- package/dist/components/basic/CardFooter.css +0 -16
- package/dist/components/basic/CardFooter.debug.ts +0 -5
- package/dist/components/basic/CardFooter.tsx +0 -29
- package/dist/components/basic/CardHeader.css +0 -14
- package/dist/components/basic/CardHeader.debug.ts +0 -5
- package/dist/components/basic/CardHeader.tsx +0 -29
- package/dist/components/basic/card.meta.ts +0 -14
- package/dist/components/basic/cardfooter.meta.ts +0 -14
- package/dist/components/basic/cardheader.meta.ts +0 -14
- package/dist/components/input/Button.css +0 -34
- package/dist/components/input/Button.debug.ts +0 -5
- package/dist/components/input/Button.tsx +0 -28
- package/dist/components/input/button.meta.ts +0 -14
- package/dist/components.json +0 -138
|
@@ -1,10 +1,31 @@
|
|
|
1
1
|
// packages/ui/src/registry/adapters/shadcn.adapter.ts
|
|
2
|
+
import fs from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
5
|
+
import { z } from "zod";
|
|
4
6
|
import { OriginEntrySchema } from "@g3nomaly/core/installer";
|
|
5
7
|
import { SHADCN_SOURCE } from "../manifest";
|
|
8
|
+
import { rewriteRegistryImports } from "./shadcnImports";
|
|
6
9
|
const require = createRequire(import.meta.url);
|
|
7
|
-
|
|
10
|
+
/** Every item of the `new-york-v4` style, the style the shadcn package fetches files in. */
|
|
11
|
+
const SHADCN_INDEX_URL = "https://ui.shadcn.com/r/styles/new-york-v4/registry.json";
|
|
12
|
+
/** Item types offered for install. Blocks, examples and themes are left out. */
|
|
13
|
+
const INSTALLABLE_TYPES = new Set(["registry:ui", "registry:hook", "registry:lib"]);
|
|
14
|
+
/**
|
|
15
|
+
* @brief The shadcn registry listing of one style: every item, each with its files as paths and types,
|
|
16
|
+
* the names of the shadcn items it needs (without the `@shadcn/` prefix) and its npm packages.
|
|
17
|
+
*/
|
|
18
|
+
const ShadcnIndexSchema = z.object({
|
|
19
|
+
items: z.array(z.object({
|
|
20
|
+
name: z.string().min(1),
|
|
21
|
+
type: z.string(),
|
|
22
|
+
description: z.string().optional(),
|
|
23
|
+
files: z.array(z.object({ path: z.string().min(1), type: z.string() })).optional(),
|
|
24
|
+
registryDependencies: z.array(z.string()).optional(),
|
|
25
|
+
dependencies: z.array(z.string()).optional(),
|
|
26
|
+
devDependencies: z.array(z.string()).optional(),
|
|
27
|
+
})),
|
|
28
|
+
});
|
|
8
29
|
/**
|
|
9
30
|
* @brief Root of the installed shadcn package.
|
|
10
31
|
*
|
|
@@ -15,10 +36,20 @@ function resolveShadcnRoot() {
|
|
|
15
36
|
return path.dirname(require.resolve("shadcn/package.json"));
|
|
16
37
|
}
|
|
17
38
|
/**
|
|
18
|
-
* @brief
|
|
39
|
+
* @brief Version of the installed shadcn package, which the app's `package.json` decides.
|
|
40
|
+
*
|
|
41
|
+
* @param root - Root of the installed shadcn package.
|
|
42
|
+
* @returns The version, e.g. `4.22.1`.
|
|
43
|
+
*/
|
|
44
|
+
function readShadcnVersion(root) {
|
|
45
|
+
const manifest = z.object({ version: z.string().min(1) }).parse(JSON.parse(fs.readFileSync(path.join(root, "package.json"), "utf8")));
|
|
46
|
+
return manifest.version;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @brief The ui file type for a shadcn registry file type.
|
|
19
50
|
*
|
|
20
51
|
* @param shadcnType - shadcn registry file type, e.g. `registry:ui`.
|
|
21
|
-
* @returns The
|
|
52
|
+
* @returns The ui `ComponentFileType`; `component` for any type not listed.
|
|
22
53
|
*/
|
|
23
54
|
function mapShadcnType(shadcnType) {
|
|
24
55
|
if (shadcnType === "registry:ui")
|
|
@@ -42,15 +73,27 @@ function normalizeFilePath(fullPath) {
|
|
|
42
73
|
const parts = fullPath.split("/");
|
|
43
74
|
return `shadcn/${parts[parts.length - 1]}`;
|
|
44
75
|
}
|
|
76
|
+
/**
|
|
77
|
+
* @brief Key a shadcn component is offered under.
|
|
78
|
+
*
|
|
79
|
+
* @param name - shadcn component name, e.g. `alert-dialog`.
|
|
80
|
+
* @returns The key, e.g. `@shadcn/alert-dialog`.
|
|
81
|
+
*/
|
|
82
|
+
export function shadcnKey(name) {
|
|
83
|
+
return `@shadcn/${name.toLowerCase()}`;
|
|
84
|
+
}
|
|
45
85
|
/**
|
|
46
86
|
* @brief Fetches the shadcn component index as entries keyed `@shadcn/<name>`,
|
|
47
|
-
* recorded under the `shadcn` source
|
|
87
|
+
* recorded under the `shadcn` source with the installed shadcn version as
|
|
88
|
+
* their version, so `update` shows the change after shadcn is upgraded.
|
|
89
|
+
* Hashes are absent until install.
|
|
48
90
|
*
|
|
49
91
|
* @returns no entries and a warning when shadcn is not installed or the index cannot be fetched
|
|
50
92
|
*/
|
|
51
93
|
export async function readShadcnEntries() {
|
|
94
|
+
let version;
|
|
52
95
|
try {
|
|
53
|
-
resolveShadcnRoot();
|
|
96
|
+
version = readShadcnVersion(resolveShadcnRoot());
|
|
54
97
|
}
|
|
55
98
|
catch {
|
|
56
99
|
return { entries: [], warnings: ["shadcn is not installed: run `bun add shadcn@latest`"] };
|
|
@@ -60,43 +103,53 @@ export async function readShadcnEntries() {
|
|
|
60
103
|
const res = await fetch(SHADCN_INDEX_URL);
|
|
61
104
|
if (!res.ok)
|
|
62
105
|
throw new Error(`HTTP ${res.status}`);
|
|
63
|
-
items = (await res.json());
|
|
106
|
+
items = ShadcnIndexSchema.parse(await res.json()).items;
|
|
64
107
|
}
|
|
65
108
|
catch (err) {
|
|
66
109
|
return { entries: [], warnings: [`the shadcn index could not be fetched: ${String(err)}`] };
|
|
67
110
|
}
|
|
68
111
|
const entries = [];
|
|
69
112
|
for (const item of items) {
|
|
70
|
-
if (!item.
|
|
113
|
+
if (!INSTALLABLE_TYPES.has(item.type) || !item.files?.length)
|
|
71
114
|
continue;
|
|
72
|
-
entries.push([
|
|
115
|
+
entries.push([shadcnKey(item.name), {
|
|
73
116
|
name: item.name,
|
|
74
117
|
description: item.description,
|
|
118
|
+
version,
|
|
75
119
|
group: SHADCN_SOURCE,
|
|
76
|
-
origin: { source: SHADCN_SOURCE, dir: "" },
|
|
77
|
-
registryDependencies: (item.registryDependencies ?? []).map(
|
|
120
|
+
origin: { source: SHADCN_SOURCE, dir: "", version },
|
|
121
|
+
registryDependencies: (item.registryDependencies ?? []).map(shadcnKey),
|
|
122
|
+
dependencies: item.dependencies,
|
|
123
|
+
devDependencies: item.devDependencies,
|
|
78
124
|
files: item.files.map((f) => ({ path: normalizeFilePath(f.path), type: mapShadcnType(f.type) })),
|
|
79
125
|
}]);
|
|
80
126
|
}
|
|
81
127
|
return { entries, warnings: [] };
|
|
82
128
|
}
|
|
83
129
|
/**
|
|
84
|
-
* @brief Fetches
|
|
85
|
-
*
|
|
130
|
+
* @brief Fetches one shadcn component through the installed shadcn package: its file contents,
|
|
131
|
+
* with registry imports rewritten to the installed siblings, and the npm packages and theme tokens
|
|
132
|
+
* it lists. The index lacks the theme tokens, so they are only known here.
|
|
86
133
|
*
|
|
87
134
|
* @param name - Component name without the `@shadcn/` prefix, e.g. `button`.
|
|
88
|
-
* @returns Files
|
|
135
|
+
* @returns Files and fields; no files when the component is unknown or lists none.
|
|
89
136
|
*/
|
|
90
|
-
export async function
|
|
137
|
+
export async function fetchShadcnComponent(name) {
|
|
91
138
|
// Imported on use, so only commands that install shadcn components need the package.
|
|
92
139
|
const { getRegistryItems } = await import("shadcn/registry");
|
|
93
140
|
const items = await getRegistryItems([name]);
|
|
94
141
|
const item = items[0];
|
|
142
|
+
const fields = {
|
|
143
|
+
dependencies: item?.dependencies ?? [],
|
|
144
|
+
devDependencies: item?.devDependencies ?? [],
|
|
145
|
+
...(item?.cssVars === undefined ? {} : { cssVars: item.cssVars }),
|
|
146
|
+
};
|
|
95
147
|
if (!item?.files?.length)
|
|
96
|
-
return [];
|
|
97
|
-
|
|
148
|
+
return { files: [], fields };
|
|
149
|
+
const files = item.files
|
|
98
150
|
.filter((f) => typeof f.content === "string")
|
|
99
|
-
.map((f) => ({ path: normalizeFilePath(f.path), content: f.content, type: mapShadcnType(f.type) }));
|
|
151
|
+
.map((f) => ({ path: normalizeFilePath(f.path), content: rewriteRegistryImports(f.content), type: mapShadcnType(f.type) }));
|
|
152
|
+
return { files, fields };
|
|
100
153
|
}
|
|
101
154
|
/**
|
|
102
155
|
* @brief Entry source that fetches shadcn components, one request per component,
|
|
@@ -104,15 +157,17 @@ export async function fetchShadcnComponentFiles(name) {
|
|
|
104
157
|
* `fallback`.
|
|
105
158
|
*
|
|
106
159
|
* @param fallback - Entry source for every entry of another source.
|
|
160
|
+
* @param fetchedByKey - Filled with the npm packages and theme tokens of each shadcn component fetched, by component key.
|
|
107
161
|
* @returns Entry source that serves shadcn entries and delegates the rest to `fallback`.
|
|
108
162
|
*/
|
|
109
|
-
export function shadcnFileSource(fallback) {
|
|
163
|
+
export function shadcnFileSource(fallback, fetchedByKey) {
|
|
110
164
|
return async (entry) => {
|
|
111
165
|
const { origin } = OriginEntrySchema.pick({ origin: true }).parse(entry);
|
|
112
166
|
if (origin.source !== SHADCN_SOURCE)
|
|
113
167
|
return fallback(entry);
|
|
114
|
-
const fetched = await
|
|
115
|
-
|
|
168
|
+
const fetched = await fetchShadcnComponent(entry.name.toLowerCase());
|
|
169
|
+
fetchedByKey.set(shadcnKey(entry.name), fetched.fields);
|
|
170
|
+
const contents = new Map(fetched.files.map((f) => [f.path, f.content]));
|
|
116
171
|
const source = (file) => {
|
|
117
172
|
const content = contents.get(file.path);
|
|
118
173
|
return content === undefined ? null : { kind: "write", content };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shadcn.adapter.js","sourceRoot":"","sources":["../../../src/registry/adapters/shadcn.adapter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"shadcn.adapter.js","sourceRoot":"","sources":["../../../src/registry/adapters/shadcn.adapter.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IA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@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @brief Points imports into the shadcn registry at the installed sibling file. The registry serves
|
|
3
|
+
* files with imports such as `@/registry/new-york-v4/ui/button`, which only resolve inside the shadcn
|
|
4
|
+
* repository. Every shadcn file is installed into the same `shadcn/` folder, so each becomes `./button`.
|
|
5
|
+
*
|
|
6
|
+
* @param content - File content as the shadcn registry serves it.
|
|
7
|
+
* @returns The content with every registry specifier replaced by a relative one.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteRegistryImports(content: string): string;
|
|
10
|
+
//# sourceMappingURL=shadcnImports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadcnImports.d.ts","sourceRoot":"","sources":["../../../src/registry/adapters/shadcnImports.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// packages/ui/src/registry/adapters/shadcnImports.ts
|
|
2
|
+
/**
|
|
3
|
+
* A module specifier into the shadcn registry, quoted, e.g. `"@/registry/new-york-v4/ui/button"`.
|
|
4
|
+
* Group 1 is the quote, group 2 the last path segment.
|
|
5
|
+
*/
|
|
6
|
+
const REGISTRY_SPECIFIER = /(["'])@\/registry\/[^"'/]+\/(?:[^"']*\/)?([^"'/]+)\1/g;
|
|
7
|
+
/**
|
|
8
|
+
* @brief Points imports into the shadcn registry at the installed sibling file. The registry serves
|
|
9
|
+
* files with imports such as `@/registry/new-york-v4/ui/button`, which only resolve inside the shadcn
|
|
10
|
+
* repository. Every shadcn file is installed into the same `shadcn/` folder, so each becomes `./button`.
|
|
11
|
+
*
|
|
12
|
+
* @param content - File content as the shadcn registry serves it.
|
|
13
|
+
* @returns The content with every registry specifier replaced by a relative one.
|
|
14
|
+
*/
|
|
15
|
+
export function rewriteRegistryImports(content) {
|
|
16
|
+
return content.replace(REGISTRY_SPECIFIER, (_match, quote, name) => `${quote}./${name}${quote}`);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=shadcnImports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadcnImports.js","sourceRoot":"","sources":["../../../src/registry/adapters/shadcnImports.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD;;;GAGG;AACH,MAAM,kBAAkB,GAAG,uDAAuD,CAAC;AAEnF;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAe;IACpD,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,KAAa,EAAE,IAAY,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC;AACnH,CAAC"}
|
|
@@ -5,12 +5,14 @@ export declare const COMPONENTS_JSON: string;
|
|
|
5
5
|
/**
|
|
6
6
|
* @brief Builds `components.json` from every `*.meta.ts` under the built components
|
|
7
7
|
* folder: each component with its files hashed and stamped with the package
|
|
8
|
-
* version, the meta file itself included.
|
|
8
|
+
* version, the meta file itself included. Files marked `install: "package"` must
|
|
9
|
+
* be reachable through the package's `exports`, since apps import them from it.
|
|
9
10
|
*
|
|
10
11
|
* @param componentsDir - Absolute built components folder, e.g. `<package>/dist/components`
|
|
11
12
|
* @param outFile - Absolute path to write, e.g. `<package>/dist/components.json`
|
|
12
13
|
* @param version - Package version stamped on every component and file
|
|
13
14
|
* @returns how many components were written
|
|
15
|
+
* @throws {Error} naming each file marked `install: "package"` that the package's `exports` does not reach
|
|
14
16
|
*/
|
|
15
17
|
export declare function writeComponentsJson(componentsDir: string, outFile: string, version: string): Promise<number>;
|
|
16
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentsJson.d.ts","sourceRoot":"","sources":["../../src/registry/componentsJson.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentsJson.d.ts","sourceRoot":"","sources":["../../src/registry/componentsJson.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,mGAAmG;AACnG,eAAO,MAAM,cAAc,QAAmC,CAAC;AAC/D,eAAO,MAAM,eAAe,QAAuC,CAAC;AAIpE;;;;;;;;;;;GAWG;AACH,wBAAsB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA6BlH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAMzF"}
|
|
@@ -6,6 +6,8 @@ import { z } from "zod";
|
|
|
6
6
|
import { createRegistryStore, jsonHandler, register, writeTo } from "@g3nomaly/core/registry";
|
|
7
7
|
import { hashFile } from "@g3nomaly/core/hash";
|
|
8
8
|
import { getSafeObject } from "@g3nomaly/core/security";
|
|
9
|
+
import { findPackageRoot } from "@g3nomaly/core/utils";
|
|
10
|
+
import { unexportedFiles } from "./packageExports";
|
|
9
11
|
import { PackagedComponentSchema } from "./types";
|
|
10
12
|
/** Where a package keeps its built components and their registry, relative to the package root. */
|
|
11
13
|
export const COMPONENTS_DIR = path.join("dist", "components");
|
|
@@ -14,12 +16,14 @@ const ComponentsJsonSchema = z.record(z.string(), PackagedComponentSchema);
|
|
|
14
16
|
/**
|
|
15
17
|
* @brief Builds `components.json` from every `*.meta.ts` under the built components
|
|
16
18
|
* folder: each component with its files hashed and stamped with the package
|
|
17
|
-
* version, the meta file itself included.
|
|
19
|
+
* version, the meta file itself included. Files marked `install: "package"` must
|
|
20
|
+
* be reachable through the package's `exports`, since apps import them from it.
|
|
18
21
|
*
|
|
19
22
|
* @param componentsDir - Absolute built components folder, e.g. `<package>/dist/components`
|
|
20
23
|
* @param outFile - Absolute path to write, e.g. `<package>/dist/components.json`
|
|
21
24
|
* @param version - Package version stamped on every component and file
|
|
22
25
|
* @returns how many components were written
|
|
26
|
+
* @throws {Error} naming each file marked `install: "package"` that the package's `exports` does not reach
|
|
23
27
|
*/
|
|
24
28
|
export async function writeComponentsJson(componentsDir, outFile, version) {
|
|
25
29
|
const store = createRegistryStore();
|
|
@@ -34,6 +38,16 @@ export async function writeComponentsJson(componentsDir, outFile, version) {
|
|
|
34
38
|
})));
|
|
35
39
|
register(store, meta.name.toLowerCase(), { ...meta, version, files: hashed });
|
|
36
40
|
}
|
|
41
|
+
const packageRoot = findPackageRoot(componentsDir);
|
|
42
|
+
const packageFiles = Object.values(store.store.state).flatMap((meta) => meta.files.filter((file) => file.install === "package").map((file) => path.relative(packageRoot, path.join(componentsDir, file.path))));
|
|
43
|
+
const unexported = unexportedFiles(packageRoot, packageFiles);
|
|
44
|
+
if (unexported.length > 0) {
|
|
45
|
+
throw new Error([
|
|
46
|
+
"files marked install: \"package\" are not in the exports of package.json, so apps cannot import them:",
|
|
47
|
+
...unexported.map((file) => ` ${file}`),
|
|
48
|
+
`add an export that reaches them, e.g. "exports": { "./*": "./${path.relative(packageRoot, componentsDir).split(path.sep).join("/")}/*.ts" }`,
|
|
49
|
+
].join("\n"));
|
|
50
|
+
}
|
|
37
51
|
writeTo(store, outFile, jsonHandler);
|
|
38
52
|
return Object.keys(store.store.state).length;
|
|
39
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentsJson.js","sourceRoot":"","sources":["../../src/registry/componentsJson.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,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MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,gEAAgE,CAAC,CAAC;IACnH,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACzF,IAAI,CAAC,MAAM,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,qCAAqC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClH,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AACzG,CAAC"}
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export * from "./types";
|
|
|
2
2
|
export { COMPONENTS_DIR, COMPONENTS_JSON, readComponentsJson, writeComponentsJson } from "./componentsJson";
|
|
3
3
|
export { readComponentSource, filterFiles, groupOf } from "./readSource";
|
|
4
4
|
export type { ComponentFileFlags } from "./readSource";
|
|
5
|
-
export { uiManifestPath,
|
|
5
|
+
export { uiManifestPath, SHADCN_SOURCE } from "./manifest";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACzE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/registry/index.js
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
export * from "./types";
|
|
3
3
|
export { COMPONENTS_DIR, COMPONENTS_JSON, readComponentsJson, writeComponentsJson } from "./componentsJson";
|
|
4
4
|
export { readComponentSource, filterFiles, groupOf } from "./readSource";
|
|
5
|
-
export { uiManifestPath,
|
|
5
|
+
export { uiManifestPath, SHADCN_SOURCE } from "./manifest";
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,21 +1,10 @@
|
|
|
1
1
|
/** Source name shadcn components are recorded under. */
|
|
2
2
|
export declare const SHADCN_SOURCE = "shadcn";
|
|
3
3
|
/**
|
|
4
|
-
* @brief Path of the project's
|
|
4
|
+
* @brief Path of the project's component manifest.
|
|
5
5
|
*
|
|
6
6
|
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
7
|
-
* @returns absolute path, e.g. `/home/me/app/.g3n
|
|
7
|
+
* @returns absolute path, e.g. `/home/me/app/.g3n/ui.json`
|
|
8
8
|
*/
|
|
9
9
|
export declare function uiManifestPath(projectRoot: string): string;
|
|
10
|
-
/**
|
|
11
|
-
* @brief Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
12
|
-
* a flat `.g3nui-manifest.json`, or a `.g3nui-manifest.ts` whose `registry`
|
|
13
|
-
* export becomes the JSON file and is then deleted. Does nothing when the
|
|
14
|
-
* manifest is already in the shared shape or does not exist.
|
|
15
|
-
*
|
|
16
|
-
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
17
|
-
* @returns the path that was migrated, or `null` when nothing changed
|
|
18
|
-
* @throws {Error} When a legacy manifest does not match the old entry shape.
|
|
19
|
-
*/
|
|
20
|
-
export declare function migrateLegacyManifest(projectRoot: string): Promise<string | null>;
|
|
21
10
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAMA,wDAAwD;AACxD,eAAO,MAAM,aAAa,WAAW,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -1,88 +1,16 @@
|
|
|
1
1
|
// packages/ui/src/registry/manifest.ts
|
|
2
|
-
import fs from "node:fs";
|
|
3
2
|
import path from "node:path";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
import { COMPONENTS_DIR } from "./componentsJson";
|
|
6
|
-
import { groupOf } from "./readSource";
|
|
7
|
-
import { ComponentFileSchema } from "./types";
|
|
8
3
|
const MANIFEST_DIR = ".g3n";
|
|
9
|
-
const
|
|
4
|
+
const MANIFEST_FILE = "ui.json";
|
|
10
5
|
/** Source name shadcn components are recorded under. */
|
|
11
6
|
export const SHADCN_SOURCE = "shadcn";
|
|
12
|
-
/** An entry as manifests before the shared `{ sources, entries }` shape recorded it. */
|
|
13
|
-
const LegacyEntrySchema = z.object({
|
|
14
|
-
name: z.string().min(1),
|
|
15
|
-
description: z.string().optional(),
|
|
16
|
-
version: z.string().optional(),
|
|
17
|
-
category: z.string().optional(),
|
|
18
|
-
group: z.string().optional(),
|
|
19
|
-
author: z.string().optional(),
|
|
20
|
-
packageOrigin: z.string().optional(),
|
|
21
|
-
registryDependencies: z.array(z.string()).optional(),
|
|
22
|
-
files: z.array(ComponentFileSchema).min(1),
|
|
23
|
-
});
|
|
24
7
|
/**
|
|
25
|
-
* @brief Path of the project's
|
|
8
|
+
* @brief Path of the project's component manifest.
|
|
26
9
|
*
|
|
27
10
|
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
28
|
-
* @returns absolute path, e.g. `/home/me/app/.g3n
|
|
11
|
+
* @returns absolute path, e.g. `/home/me/app/.g3n/ui.json`
|
|
29
12
|
*/
|
|
30
13
|
export function uiManifestPath(projectRoot) {
|
|
31
|
-
return path.join(projectRoot, MANIFEST_DIR,
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @brief Converts one legacy entry to the shared shape, taking its origin from `packageOrigin`.
|
|
35
|
-
*
|
|
36
|
-
* @param entry - Legacy entry as `LegacyEntrySchema` parses it.
|
|
37
|
-
* @returns The entry with `group` and `origin` set, as `ComponentMeta` holds them.
|
|
38
|
-
*/
|
|
39
|
-
function migrateEntry(entry) {
|
|
40
|
-
const { packageOrigin, group, ...rest } = entry;
|
|
41
|
-
const shadcn = packageOrigin === SHADCN_SOURCE;
|
|
42
|
-
return {
|
|
43
|
-
...rest,
|
|
44
|
-
group: group ?? groupOf(entry),
|
|
45
|
-
origin: shadcn ? { source: SHADCN_SOURCE, dir: "" } : { source: "g3nui", dir: COMPONENTS_DIR, version: entry.version },
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @brief Writes legacy entries as a shared-shape manifest at the JSON path.
|
|
50
|
-
*
|
|
51
|
-
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
52
|
-
* @param legacy - Parsed flat manifest: legacy entries keyed by component key.
|
|
53
|
-
*/
|
|
54
|
-
function writeMigrated(projectRoot, legacy) {
|
|
55
|
-
const entries = Object.fromEntries(Object.entries(z.record(z.string(), LegacyEntrySchema).parse(legacy)).map(([key, entry]) => [key, migrateEntry(entry)]));
|
|
56
|
-
fs.mkdirSync(path.join(projectRoot, MANIFEST_DIR), { recursive: true });
|
|
57
|
-
fs.writeFileSync(uiManifestPath(projectRoot), JSON.stringify({ sources: {}, entries }, null, 2) + "\n");
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* @brief Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
61
|
-
* a flat `.g3nui-manifest.json`, or a `.g3nui-manifest.ts` whose `registry`
|
|
62
|
-
* export becomes the JSON file and is then deleted. Does nothing when the
|
|
63
|
-
* manifest is already in the shared shape or does not exist.
|
|
64
|
-
*
|
|
65
|
-
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
66
|
-
* @returns the path that was migrated, or `null` when nothing changed
|
|
67
|
-
* @throws {Error} When a legacy manifest does not match the old entry shape.
|
|
68
|
-
*/
|
|
69
|
-
export async function migrateLegacyManifest(projectRoot) {
|
|
70
|
-
const jsonPath = uiManifestPath(projectRoot);
|
|
71
|
-
const tsPath = path.join(projectRoot, MANIFEST_DIR, `${MANIFEST_BASE}.ts`);
|
|
72
|
-
if (fs.existsSync(jsonPath)) {
|
|
73
|
-
const raw = JSON.parse(fs.readFileSync(jsonPath, "utf8"));
|
|
74
|
-
const shared = typeof raw === "object" && raw !== null && ("entries" in raw || "sources" in raw);
|
|
75
|
-
if (shared)
|
|
76
|
-
return null;
|
|
77
|
-
writeMigrated(projectRoot, raw);
|
|
78
|
-
return jsonPath;
|
|
79
|
-
}
|
|
80
|
-
if (fs.existsSync(tsPath)) {
|
|
81
|
-
const legacy = z.object({ registry: z.unknown() }).parse(await import(tsPath));
|
|
82
|
-
writeMigrated(projectRoot, legacy.registry);
|
|
83
|
-
fs.rmSync(tsPath);
|
|
84
|
-
return tsPath;
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
14
|
+
return path.join(projectRoot, MANIFEST_DIR, MANIFEST_FILE);
|
|
87
15
|
}
|
|
88
16
|
//# sourceMappingURL=manifest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,YAAY,GAAI,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,SAAS,CAAC;AAEhC,wDAAwD;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,WAAmB;IAChD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @brief Files that stay in the package but that its `exports` field does not reach, so an app cannot import them.
|
|
3
|
+
*
|
|
4
|
+
* @param packageRoot - Absolute folder holding the package's `package.json`.
|
|
5
|
+
* @param files - Files to check, relative to the package root, e.g. `dist/components/graph/graphStore.ts`.
|
|
6
|
+
* @returns The files no export reaches, as given.
|
|
7
|
+
*/
|
|
8
|
+
export declare function unexportedFiles(packageRoot: string, files: readonly string[]): string[];
|
|
9
|
+
//# sourceMappingURL=packageExports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageExports.d.ts","sourceRoot":"","sources":["../../src/registry/packageExports.ts"],"names":[],"mappings":"AAkCA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAOvF"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// packages/ui/src/registry/packageExports.ts
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
const PackageExportsSchema = z.object({ name: z.string().min(1), exports: z.unknown().optional() });
|
|
6
|
+
/**
|
|
7
|
+
* @brief Every target path an `exports` field maps to, through nested conditions such as `import` or `types`.
|
|
8
|
+
*
|
|
9
|
+
* @param exports - The `exports` value, or one of its branches.
|
|
10
|
+
* @returns Target paths, e.g. `./dist/components/*.ts`.
|
|
11
|
+
*/
|
|
12
|
+
function exportTargets(exports) {
|
|
13
|
+
if (typeof exports === "string")
|
|
14
|
+
return [exports];
|
|
15
|
+
if (Array.isArray(exports))
|
|
16
|
+
return exports.flatMap(exportTargets);
|
|
17
|
+
if (typeof exports === "object" && exports !== null)
|
|
18
|
+
return Object.values(exports).flatMap(exportTargets);
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* @brief Whether an export target reaches a file: equal to it, or a `*` pattern that matches it.
|
|
23
|
+
*
|
|
24
|
+
* @param target - Export target, e.g. `./dist/components/*.ts`.
|
|
25
|
+
* @param file - Path of the file from the package root, starting with `./`.
|
|
26
|
+
*/
|
|
27
|
+
function reaches(target, file) {
|
|
28
|
+
const star = target.indexOf("*");
|
|
29
|
+
if (star === -1)
|
|
30
|
+
return target === file;
|
|
31
|
+
const prefix = target.slice(0, star);
|
|
32
|
+
const suffix = target.slice(star + 1);
|
|
33
|
+
return file.length >= prefix.length + suffix.length && file.startsWith(prefix) && file.endsWith(suffix);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @brief Files that stay in the package but that its `exports` field does not reach, so an app cannot import them.
|
|
37
|
+
*
|
|
38
|
+
* @param packageRoot - Absolute folder holding the package's `package.json`.
|
|
39
|
+
* @param files - Files to check, relative to the package root, e.g. `dist/components/graph/graphStore.ts`.
|
|
40
|
+
* @returns The files no export reaches, as given.
|
|
41
|
+
*/
|
|
42
|
+
export function unexportedFiles(packageRoot, files) {
|
|
43
|
+
const manifest = PackageExportsSchema.parse(JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8")));
|
|
44
|
+
const targets = exportTargets(manifest.exports);
|
|
45
|
+
return files.filter((file) => {
|
|
46
|
+
const relative = `./${file.split(path.sep).join("/")}`;
|
|
47
|
+
return !targets.some((target) => reaches(target, relative));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=packageExports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageExports.js","sourceRoot":"","sources":["../../src/registry/packageExports.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM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AAM,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IACzH,MAAM,OAAO,GAAI,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACjD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -27,8 +27,10 @@ export declare function filterFiles(files: readonly ComponentFile[], flags: Comp
|
|
|
27
27
|
export declare function groupOf(meta: Pick<PackagedComponent, "category" | "files">): string;
|
|
28
28
|
/**
|
|
29
29
|
* @brief Reader for a source that is a component package: its `dist/components.json`,
|
|
30
|
-
* with the files the flags leave out dropped.
|
|
31
|
-
*
|
|
30
|
+
* with the files the flags leave out dropped. Files marked `install: "package"`
|
|
31
|
+
* move to `packageFiles`: they are never written, and the source package becomes
|
|
32
|
+
* a runtime dependency of the component, since its files import them by package
|
|
33
|
+
* path. Handed to `loadSourceRegistry` by every g3n-ui command.
|
|
32
34
|
*
|
|
33
35
|
* @param flags - Which optional files to keep.
|
|
34
36
|
* @returns Reader that yields the package's components, skipping any left with no files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readSource.d.ts","sourceRoot":"","sources":["../../src/registry/readSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"readSource.d.ts","sourceRoot":"","sources":["../../src/registry/readSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/E;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAG,OAAO,CAAC;CACvB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,EAAE,KAAK,EAAE,kBAAkB,GAAG,aAAa,EAAE,CAMvG;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,OAAO,CAAC,GAAG,MAAM,CAInF;AAaD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,UAAU,CAAC,aAAa,CAAC,CA6BxF"}
|