@g3nomaly/ui 0.3.1 → 0.3.3
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 +123 -0
- package/dist/cli/adapter.d.ts +48 -10
- package/dist/cli/adapter.d.ts.map +1 -1
- package/dist/cli/adapter.js +34 -7
- package/dist/cli/adapter.js.map +1 -1
- package/dist/cli/commands/add.d.ts +11 -3
- package/dist/cli/commands/add.d.ts.map +1 -1
- package/dist/cli/commands/add.js +5 -1
- package/dist/cli/commands/add.js.map +1 -1
- package/dist/cli/commands/init.d.ts +25 -2
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +23 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/ls.d.ts +12 -3
- package/dist/cli/commands/ls.d.ts.map +1 -1
- package/dist/cli/commands/ls.js +6 -1
- package/dist/cli/commands/ls.js.map +1 -1
- package/dist/cli/commands/manifest.d.ts +8 -1
- package/dist/cli/commands/manifest.d.ts.map +1 -1
- package/dist/cli/commands/manifest.js +15 -3
- package/dist/cli/commands/manifest.js.map +1 -1
- package/dist/cli/commands/remove.d.ts +6 -1
- package/dist/cli/commands/remove.d.ts.map +1 -1
- package/dist/cli/commands/remove.js +5 -1
- package/dist/cli/commands/remove.js.map +1 -1
- package/dist/cli/commands/source.d.ts +24 -5
- package/dist/cli/commands/source.d.ts.map +1 -1
- package/dist/cli/commands/source.js +18 -3
- package/dist/cli/commands/source.js.map +1 -1
- package/dist/cli/commands/update.d.ts +6 -1
- package/dist/cli/commands/update.d.ts.map +1 -1
- package/dist/cli/commands/update.js +5 -1
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/components/basic/Card.debug.ts +1 -1
- package/dist/components/basic/Card.tsx +8 -3
- package/dist/components/basic/CardFooter.debug.ts +1 -1
- package/dist/components/basic/CardFooter.tsx +7 -3
- package/dist/components/basic/CardHeader.debug.ts +1 -1
- package/dist/components/basic/CardHeader.tsx +7 -3
- package/dist/components/basic/card.meta.ts +1 -0
- package/dist/components/basic/cardfooter.meta.ts +1 -0
- package/dist/components/basic/cardheader.meta.ts +1 -0
- package/dist/components/input/Button.debug.ts +1 -1
- package/dist/components/input/Button.tsx +6 -3
- package/dist/components/input/button.meta.ts +1 -0
- package/dist/components.json +32 -32
- package/dist/registry/adapters/shadcn.adapter.d.ts +14 -8
- package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -1
- package/dist/registry/adapters/shadcn.adapter.js +23 -7
- package/dist/registry/adapters/shadcn.adapter.js.map +1 -1
- package/dist/registry/componentsJson.d.ts +6 -5
- package/dist/registry/componentsJson.d.ts.map +1 -1
- package/dist/registry/componentsJson.js +6 -5
- package/dist/registry/componentsJson.js.map +1 -1
- package/dist/registry/manifest.d.ts +5 -3
- package/dist/registry/manifest.d.ts.map +1 -1
- package/dist/registry/manifest.js +17 -5
- package/dist/registry/manifest.js.map +1 -1
- package/dist/registry/readSource.d.ts +23 -6
- package/dist/registry/readSource.d.ts.map +1 -1
- package/dist/registry/readSource.js +17 -3
- package/dist/registry/readSource.js.map +1 -1
- package/dist/registry/types.d.ts +16 -4
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/types.js +10 -6
- package/dist/registry/types.js.map +1 -1
- package/dist/sources/builtins.d.ts +1 -1
- package/dist/sources/builtins.js +1 -1
- package/package.json +2 -2
|
@@ -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;AAG5C,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CA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AE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzE,IAAI,MAAM,CAAC,MAAM,KAAK,aAAa;YAAE,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;QAE5D,MAAM,OAAO,GAAI,MAAM,yBAAyB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;QAC3E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,MAAM,GAAe,CAAC,IAAI,EAAE,EAAE;YAClC,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxC,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;QACnE,CAAC,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -3,9 +3,9 @@ import type { PackagedComponent } from "./types";
|
|
|
3
3
|
export declare const COMPONENTS_DIR: string;
|
|
4
4
|
export declare const COMPONENTS_JSON: string;
|
|
5
5
|
/**
|
|
6
|
-
* Builds `components.json` from every `*.meta.ts` under the built components
|
|
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. Run by `scripts/build-registry.ts`.
|
|
8
|
+
* version, the meta file itself included. Run by `packages/ui/scripts/build-registry.ts`.
|
|
9
9
|
*
|
|
10
10
|
* @param componentsDir - Absolute built components folder, e.g. `<package>/dist/components`
|
|
11
11
|
* @param outFile - Absolute path to write, e.g. `<package>/dist/components.json`
|
|
@@ -14,10 +14,11 @@ export declare const COMPONENTS_JSON: string;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function writeComponentsJson(componentsDir: string, outFile: string, version: string): Promise<number>;
|
|
16
16
|
/**
|
|
17
|
-
* Reads a package's `components.json`, keyed by lowercase component key.
|
|
17
|
+
* @brief Reads a package's `components.json`, keyed by lowercase component key.
|
|
18
18
|
*
|
|
19
|
-
* @param packageRoot - Absolute folder holding `dist/components.json
|
|
20
|
-
* @
|
|
19
|
+
* @param packageRoot - Absolute folder holding `dist/components.json`, e.g. `<package>`.
|
|
20
|
+
* @returns Components by lowercase key.
|
|
21
|
+
* @throws {Error} naming the file when it is missing, not JSON, or does not match the schema
|
|
21
22
|
*/
|
|
22
23
|
export declare function readComponentsJson(packageRoot: string): Record<string, PackagedComponent>;
|
|
23
24
|
//# sourceMappingURL=componentsJson.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentsJson.d.ts","sourceRoot":"","sources":["../../src/registry/componentsJson.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,mGAAmG;AACnG,eAAO,MAAM,cAAc,QAAmC,CAAC;AAC/D,eAAO,MAAM,eAAe,QAAuC,CAAC;AAIpE;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlH;AAED
|
|
1
|
+
{"version":3,"file":"componentsJson.d.ts","sourceRoot":"","sources":["../../src/registry/componentsJson.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEjD,mGAAmG;AACnG,eAAO,MAAM,cAAc,QAAmC,CAAC;AAC/D,eAAO,MAAM,eAAe,QAAuC,CAAC;AAIpE;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBlH;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAMzF"}
|
|
@@ -12,9 +12,9 @@ export const COMPONENTS_DIR = path.join("dist", "components");
|
|
|
12
12
|
export const COMPONENTS_JSON = path.join("dist", "components.json");
|
|
13
13
|
const ComponentsJsonSchema = z.record(z.string(), PackagedComponentSchema);
|
|
14
14
|
/**
|
|
15
|
-
* Builds `components.json` from every `*.meta.ts` under the built components
|
|
15
|
+
* @brief Builds `components.json` from every `*.meta.ts` under the built components
|
|
16
16
|
* folder: each component with its files hashed and stamped with the package
|
|
17
|
-
* version, the meta file itself included. Run by `scripts/build-registry.ts`.
|
|
17
|
+
* version, the meta file itself included. Run by `packages/ui/scripts/build-registry.ts`.
|
|
18
18
|
*
|
|
19
19
|
* @param componentsDir - Absolute built components folder, e.g. `<package>/dist/components`
|
|
20
20
|
* @param outFile - Absolute path to write, e.g. `<package>/dist/components.json`
|
|
@@ -38,10 +38,11 @@ export async function writeComponentsJson(componentsDir, outFile, version) {
|
|
|
38
38
|
return Object.keys(store.store.state).length;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Reads a package's `components.json`, keyed by lowercase component key.
|
|
41
|
+
* @brief Reads a package's `components.json`, keyed by lowercase component key.
|
|
42
42
|
*
|
|
43
|
-
* @param packageRoot - Absolute folder holding `dist/components.json
|
|
44
|
-
* @
|
|
43
|
+
* @param packageRoot - Absolute folder holding `dist/components.json`, e.g. `<package>`.
|
|
44
|
+
* @returns Components by lowercase key.
|
|
45
|
+
* @throws {Error} naming the file when it is missing, not JSON, or does not match the schema
|
|
45
46
|
*/
|
|
46
47
|
export function readComponentsJson(packageRoot) {
|
|
47
48
|
const file = path.join(packageRoot, COMPONENTS_JSON);
|
|
@@ -1 +1 @@
|
|
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
|
|
4
|
+
* @brief Path of the project's g3nui manifest.
|
|
5
5
|
*
|
|
6
|
+
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
6
7
|
* @returns absolute path, e.g. `/home/me/app/.g3n/.g3nui-manifest.json`
|
|
7
8
|
*/
|
|
8
9
|
export declare function uiManifestPath(projectRoot: string): string;
|
|
9
10
|
/**
|
|
10
|
-
* Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
11
|
+
* @brief Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
11
12
|
* a flat `.g3nui-manifest.json`, or a `.g3nui-manifest.ts` whose `registry`
|
|
12
13
|
* export becomes the JSON file and is then deleted. Does nothing when the
|
|
13
14
|
* manifest is already in the shared shape or does not exist.
|
|
14
15
|
*
|
|
16
|
+
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
15
17
|
* @returns the path that was migrated, or `null` when nothing changed
|
|
16
|
-
* @throws
|
|
18
|
+
* @throws {Error} When a legacy manifest does not match the old entry shape.
|
|
17
19
|
*/
|
|
18
20
|
export declare function migrateLegacyManifest(projectRoot: string): Promise<string | null>;
|
|
19
21
|
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAYA,wDAAwD;AACxD,eAAO,MAAM,aAAa,WAAW,CAAC;AAetC
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAYA,wDAAwD;AACxD,eAAO,MAAM,aAAa,WAAW,CAAC;AAetC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE1D;AA8BD;;;;;;;;;GASG;AACH,wBAAsB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBvF"}
|
|
@@ -22,14 +22,20 @@ const LegacyEntrySchema = z.object({
|
|
|
22
22
|
files: z.array(ComponentFileSchema).min(1),
|
|
23
23
|
});
|
|
24
24
|
/**
|
|
25
|
-
* Path of the project's g3nui manifest.
|
|
25
|
+
* @brief Path of the project's g3nui manifest.
|
|
26
26
|
*
|
|
27
|
+
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
27
28
|
* @returns absolute path, e.g. `/home/me/app/.g3n/.g3nui-manifest.json`
|
|
28
29
|
*/
|
|
29
30
|
export function uiManifestPath(projectRoot) {
|
|
30
31
|
return path.join(projectRoot, MANIFEST_DIR, `${MANIFEST_BASE}.json`);
|
|
31
32
|
}
|
|
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
|
+
*/
|
|
33
39
|
function migrateEntry(entry) {
|
|
34
40
|
const { packageOrigin, group, ...rest } = entry;
|
|
35
41
|
const shadcn = packageOrigin === SHADCN_SOURCE;
|
|
@@ -39,20 +45,26 @@ function migrateEntry(entry) {
|
|
|
39
45
|
origin: shadcn ? { source: SHADCN_SOURCE, dir: "" } : { source: "g3nui", dir: COMPONENTS_DIR, version: entry.version },
|
|
40
46
|
};
|
|
41
47
|
}
|
|
42
|
-
/**
|
|
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
|
+
*/
|
|
43
54
|
function writeMigrated(projectRoot, legacy) {
|
|
44
55
|
const entries = Object.fromEntries(Object.entries(z.record(z.string(), LegacyEntrySchema).parse(legacy)).map(([key, entry]) => [key, migrateEntry(entry)]));
|
|
45
56
|
fs.mkdirSync(path.join(projectRoot, MANIFEST_DIR), { recursive: true });
|
|
46
57
|
fs.writeFileSync(uiManifestPath(projectRoot), JSON.stringify({ sources: {}, entries }, null, 2) + "\n");
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
|
-
* Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
60
|
+
* @brief Rewrites a manifest from before the shared `{ sources, entries }` shape:
|
|
50
61
|
* a flat `.g3nui-manifest.json`, or a `.g3nui-manifest.ts` whose `registry`
|
|
51
62
|
* export becomes the JSON file and is then deleted. Does nothing when the
|
|
52
63
|
* manifest is already in the shared shape or does not exist.
|
|
53
64
|
*
|
|
65
|
+
* @param projectRoot - Absolute project root, e.g. `/home/me/app`.
|
|
54
66
|
* @returns the path that was migrated, or `null` when nothing changed
|
|
55
|
-
* @throws
|
|
67
|
+
* @throws {Error} When a legacy manifest does not match the old entry shape.
|
|
56
68
|
*/
|
|
57
69
|
export async function migrateLegacyManifest(projectRoot) {
|
|
58
70
|
const jsonPath = uiManifestPath(projectRoot);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../src/registry/manifest.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAG9C,MAAM,YAAY,GAAI,MAAM,CAAC;AAC7B,MAAM,aAAa,GAAG,iBAAiB,CAAC;AAExC,wDAAwD;AACxD,MAAM,CAAC,MAAM,aAAa,GAAG,QAAQ,CAAC;AAEtC,wFAAwF;AACxF,MAAM,iBAA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,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,SAAS,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,CAAC,CAAC;QACjG,IAAI,MAAM;YAAE,OAAO,IAAI,CAAC;QACxB,aAAa,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,IAAI,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;QAC/E,aAAa,CAAC,WAAW,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC5C,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAClB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,20 +1,37 @@
|
|
|
1
1
|
import type { ReadSource } from "@g3nomaly/core/installer";
|
|
2
2
|
import type { ComponentFile, ComponentMeta, PackagedComponent } from "./types";
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* @brief Which optional files of a component get installed.
|
|
5
|
+
*
|
|
6
|
+
* @property includeDebug - Install `.debug.ts` files.
|
|
7
|
+
* @property includeMeta - Install `.meta.ts` files.
|
|
8
|
+
*/
|
|
4
9
|
export interface ComponentFileFlags {
|
|
5
|
-
/** Install `.debug.ts` files */
|
|
6
10
|
includeDebug: boolean;
|
|
7
|
-
/** Install `.meta.ts` files */
|
|
8
11
|
includeMeta: boolean;
|
|
9
12
|
}
|
|
10
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* @brief The files of a component the flags allow: `.debug.ts` and `.meta.ts` files only when asked for.
|
|
15
|
+
*
|
|
16
|
+
* @param files - Files of one component, each with its path and type.
|
|
17
|
+
* @param flags - Which optional files to keep.
|
|
18
|
+
* @returns The kept files, in their original order.
|
|
19
|
+
*/
|
|
11
20
|
export declare function filterFiles(files: readonly ComponentFile[], flags: ComponentFileFlags): ComponentFile[];
|
|
12
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @brief A component's display group: its category, else the first folder of its first file.
|
|
23
|
+
*
|
|
24
|
+
* @param meta - Component whose `category` and `files` decide the group.
|
|
25
|
+
* @returns The group name, or `unknown` when the first file sits at the top level.
|
|
26
|
+
*/
|
|
13
27
|
export declare function groupOf(meta: Pick<PackagedComponent, "category" | "files">): string;
|
|
14
28
|
/**
|
|
15
|
-
* Reader for a source that is a component package: its `dist/components.json`,
|
|
29
|
+
* @brief Reader for a source that is a component package: its `dist/components.json`,
|
|
16
30
|
* with the files the flags leave out dropped. Handed to `loadSourceRegistry`
|
|
17
31
|
* by every g3nui command.
|
|
32
|
+
*
|
|
33
|
+
* @param flags - Which optional files to keep.
|
|
34
|
+
* @returns Reader that yields the package's components, skipping any left with no files.
|
|
18
35
|
*/
|
|
19
36
|
export declare function readComponentSource(flags: ComponentFileFlags): ReadSource<ComponentMeta>;
|
|
20
37
|
//# sourceMappingURL=readSource.d.ts.map
|
|
@@ -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;AAE3D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE/E
|
|
1
|
+
{"version":3,"file":"readSource.d.ts","sourceRoot":"","sources":["../../src/registry/readSource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAE3D,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;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,GAAG,UAAU,CAAC,aAAa,CAAC,CAmBxF"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { COMPONENTS_DIR, readComponentsJson } from "./componentsJson";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* @brief The files of a component the flags allow: `.debug.ts` and `.meta.ts` files only when asked for.
|
|
4
|
+
*
|
|
5
|
+
* @param files - Files of one component, each with its path and type.
|
|
6
|
+
* @param flags - Which optional files to keep.
|
|
7
|
+
* @returns The kept files, in their original order.
|
|
8
|
+
*/
|
|
3
9
|
export function filterFiles(files, flags) {
|
|
4
10
|
return files.filter((file) => {
|
|
5
11
|
if (file.path.endsWith(".debug.ts"))
|
|
@@ -9,7 +15,12 @@ export function filterFiles(files, flags) {
|
|
|
9
15
|
return true;
|
|
10
16
|
});
|
|
11
17
|
}
|
|
12
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* @brief A component's display group: its category, else the first folder of its first file.
|
|
20
|
+
*
|
|
21
|
+
* @param meta - Component whose `category` and `files` decide the group.
|
|
22
|
+
* @returns The group name, or `unknown` when the first file sits at the top level.
|
|
23
|
+
*/
|
|
13
24
|
export function groupOf(meta) {
|
|
14
25
|
if (meta.category !== undefined)
|
|
15
26
|
return meta.category;
|
|
@@ -17,9 +28,12 @@ export function groupOf(meta) {
|
|
|
17
28
|
return first.includes("/") ? first.split("/")[0] ?? "unknown" : "unknown";
|
|
18
29
|
}
|
|
19
30
|
/**
|
|
20
|
-
* Reader for a source that is a component package: its `dist/components.json`,
|
|
31
|
+
* @brief Reader for a source that is a component package: its `dist/components.json`,
|
|
21
32
|
* with the files the flags leave out dropped. Handed to `loadSourceRegistry`
|
|
22
33
|
* by every g3nui command.
|
|
34
|
+
*
|
|
35
|
+
* @param flags - Which optional files to keep.
|
|
36
|
+
* @returns Reader that yields the package's components, skipping any left with no files.
|
|
23
37
|
*/
|
|
24
38
|
export function readComponentSource(flags) {
|
|
25
39
|
return async (checkout) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readSource.js","sourceRoot":"","sources":["../../src/registry/readSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"readSource.js","sourceRoot":"","sources":["../../src/registry/readSource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AActE;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAA+B,EAAE,KAAyB;IACpF,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3B,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YAAE,OAAO,KAAK,CAAC,YAAY,CAAC;QAC/D,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;YAAG,OAAO,KAAK,CAAC,WAAW,CAAC;QAC9D,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAmD;IACzE,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtD,MAAM,KAAK,GAAG,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declare const ComponentFileTypeSchema: z.ZodEnum<{
|
|
|
7
7
|
type: "type";
|
|
8
8
|
util: "util";
|
|
9
9
|
}>;
|
|
10
|
+
/** Kind of a component file: `component`, `style`, `util`, `hook`, `type` or `meta`. */
|
|
10
11
|
export type ComponentFileType = z.infer<typeof ComponentFileTypeSchema>;
|
|
11
12
|
/** One file of a component; `path` is relative to the components directory, e.g. `basic/Card.tsx`. */
|
|
12
13
|
export declare const ComponentFileSchema: z.ZodObject<{
|
|
@@ -22,10 +23,15 @@ export declare const ComponentFileSchema: z.ZodObject<{
|
|
|
22
23
|
util: "util";
|
|
23
24
|
}>;
|
|
24
25
|
}, z.core.$strip>;
|
|
26
|
+
/** A file of a component: the base file entry plus its `ComponentFileType`. */
|
|
25
27
|
export type ComponentFile = z.infer<typeof ComponentFileSchema>;
|
|
26
28
|
/**
|
|
27
|
-
* A component as it ships: what a `*.meta.ts` file declares and what
|
|
29
|
+
* @brief A component as it ships: what a `*.meta.ts` file declares and what
|
|
28
30
|
* `dist/components.json` holds per component, before a source reads it.
|
|
31
|
+
*
|
|
32
|
+
* @property version - Set at build time from the package version.
|
|
33
|
+
* @property registryDependencies - Keys of components this one needs installed beside it, e.g. `button`.
|
|
34
|
+
* @property files - Files of the component, each with its path and `ComponentFileType`.
|
|
29
35
|
*/
|
|
30
36
|
export declare const PackagedComponentSchema: z.ZodObject<{
|
|
31
37
|
name: z.ZodString;
|
|
@@ -48,12 +54,15 @@ export declare const PackagedComponentSchema: z.ZodObject<{
|
|
|
48
54
|
}>;
|
|
49
55
|
}, z.core.$strip>>;
|
|
50
56
|
}, z.core.$strip>;
|
|
57
|
+
/** A component as it ships, the type `PackagedComponentSchema` parses. */
|
|
51
58
|
export type PackagedComponent = z.infer<typeof PackagedComponentSchema>;
|
|
52
59
|
/**
|
|
53
|
-
* One installable component, read from a source by `readComponentSource`
|
|
60
|
+
* @brief One installable component, read from a source by `readComponentSource`
|
|
54
61
|
* or the shadcn adapter, and written per install into the g3nui manifest by
|
|
55
|
-
* the `add` and `update` commands.
|
|
56
|
-
*
|
|
62
|
+
* the `add` and `update` commands.
|
|
63
|
+
*
|
|
64
|
+
* @property group - Display group: the category, or the first folder of the first file, e.g. `basic`.
|
|
65
|
+
* @property files - Files the install writes, each with its path and `ComponentFileType`.
|
|
57
66
|
*/
|
|
58
67
|
export declare const ComponentMetaSchema: z.ZodObject<{
|
|
59
68
|
name: z.ZodString;
|
|
@@ -66,6 +75,7 @@ export declare const ComponentMetaSchema: z.ZodObject<{
|
|
|
66
75
|
commit: z.ZodOptional<z.ZodString>;
|
|
67
76
|
version: z.ZodOptional<z.ZodString>;
|
|
68
77
|
}, z.core.$strip>;
|
|
78
|
+
forkedFrom: z.ZodOptional<z.ZodString>;
|
|
69
79
|
group: z.ZodString;
|
|
70
80
|
category: z.ZodOptional<z.ZodString>;
|
|
71
81
|
author: z.ZodOptional<z.ZodString>;
|
|
@@ -83,6 +93,8 @@ export declare const ComponentMetaSchema: z.ZodObject<{
|
|
|
83
93
|
}>;
|
|
84
94
|
}, z.core.$strip>>;
|
|
85
95
|
}, z.core.$strip>;
|
|
96
|
+
/** One installable component, the type `ComponentMetaSchema` parses. */
|
|
86
97
|
export type ComponentMeta = z.infer<typeof ComponentMetaSchema>;
|
|
98
|
+
/** Installable components by key, e.g. `button` or `@shadcn/button`. */
|
|
87
99
|
export type ComponentRegistry = Record<string, ComponentMeta>;
|
|
88
100
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;EAOlC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,sGAAsG;AACtG,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAE9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,uBAAuB;;;;;;;EAOlC,CAAC;AAEH,wFAAwF;AACxF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,sGAAsG;AACtG,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAE9B,CAAC;AAEH,+EAA+E;AAC/E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;iBAQlC,CAAC;AAEH,0EAA0E;AAC1E,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAK9B,CAAC;AAEH,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAO,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACpE,wEAAwE;AACxE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC"}
|
package/dist/registry/types.js
CHANGED
|
@@ -15,25 +15,29 @@ export const ComponentFileSchema = BaseFileEntrySchema.extend({
|
|
|
15
15
|
type: ComponentFileTypeSchema,
|
|
16
16
|
});
|
|
17
17
|
/**
|
|
18
|
-
* A component as it ships: what a `*.meta.ts` file declares and what
|
|
18
|
+
* @brief A component as it ships: what a `*.meta.ts` file declares and what
|
|
19
19
|
* `dist/components.json` holds per component, before a source reads it.
|
|
20
|
+
*
|
|
21
|
+
* @property version - Set at build time from the package version.
|
|
22
|
+
* @property registryDependencies - Keys of components this one needs installed beside it, e.g. `button`.
|
|
23
|
+
* @property files - Files of the component, each with its path and `ComponentFileType`.
|
|
20
24
|
*/
|
|
21
25
|
export const PackagedComponentSchema = z.object({
|
|
22
26
|
name: z.string().min(1),
|
|
23
27
|
description: z.string().optional(),
|
|
24
|
-
/** Set at build time from the package version */
|
|
25
28
|
version: z.string().min(1).optional(),
|
|
26
29
|
category: z.string().optional(),
|
|
27
30
|
author: z.string().optional(),
|
|
28
|
-
/** Keys of components this one needs installed beside it */
|
|
29
31
|
registryDependencies: z.array(z.string()).optional(),
|
|
30
32
|
files: z.array(ComponentFileSchema).min(1),
|
|
31
33
|
});
|
|
32
34
|
/**
|
|
33
|
-
* One installable component, read from a source by `readComponentSource`
|
|
35
|
+
* @brief One installable component, read from a source by `readComponentSource`
|
|
34
36
|
* or the shadcn adapter, and written per install into the g3nui manifest by
|
|
35
|
-
* the `add` and `update` commands.
|
|
36
|
-
*
|
|
37
|
+
* the `add` and `update` commands.
|
|
38
|
+
*
|
|
39
|
+
* @property group - Display group: the category, or the first folder of the first file, e.g. `basic`.
|
|
40
|
+
* @property files - Files the install writes, each with its path and `ComponentFileType`.
|
|
37
41
|
*/
|
|
38
42
|
export const ComponentMetaSchema = OriginEntrySchema.extend({
|
|
39
43
|
group: z.string().min(1),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,IAA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C1D,CAAC,CAAC;AAKH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IAC1D,KAAK,EAAK,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAI,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAK,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC9C,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SourceRecord } from "@g3nomaly/core/sources";
|
|
2
2
|
/**
|
|
3
|
-
* Sources every project has without registering them; they cannot be
|
|
3
|
+
* @brief Sources every project has without registering them; they cannot be
|
|
4
4
|
* removed. `g3nui` is this package's own folder, so the components always
|
|
5
5
|
* match the CLI that installs them.
|
|
6
6
|
*/
|
package/dist/sources/builtins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findPackageRoot } from "@g3nomaly/core/utils";
|
|
2
2
|
/**
|
|
3
|
-
* Sources every project has without registering them; they cannot be
|
|
3
|
+
* @brief Sources every project has without registering them; they cannot be
|
|
4
4
|
* removed. `g3nui` is this package's own folder, so the components always
|
|
5
5
|
* match the CLI that installs them.
|
|
6
6
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@g3nomaly/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Component library with CLI installer for g3n projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@clack/prompts": "^1.7.0",
|
|
50
|
-
"@g3nomaly/core": "^0.3.
|
|
50
|
+
"@g3nomaly/core": "^0.3.3",
|
|
51
51
|
"chalk": "^6.0.0",
|
|
52
52
|
"commander": "^15.0.0",
|
|
53
53
|
"glob": "^13.0.6",
|