@g3nomaly/ui 0.3.0 → 0.3.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.
Files changed (92) hide show
  1. package/LICENSE +95 -0
  2. package/dist/cli/adapter.d.ts +48 -0
  3. package/dist/cli/adapter.d.ts.map +1 -0
  4. package/dist/cli/adapter.js +87 -0
  5. package/dist/cli/adapter.js.map +1 -0
  6. package/dist/cli/commands/add.d.ts +16 -0
  7. package/dist/cli/commands/add.d.ts.map +1 -0
  8. package/dist/cli/commands/add.js +20 -0
  9. package/dist/cli/commands/add.js.map +1 -0
  10. package/dist/cli/commands/index.d.ts +15 -0
  11. package/dist/cli/commands/index.d.ts.map +1 -0
  12. package/dist/cli/commands/index.js +9 -0
  13. package/dist/cli/commands/index.js.map +1 -0
  14. package/dist/cli/commands/init.d.ts +25 -0
  15. package/dist/cli/commands/init.d.ts.map +1 -0
  16. package/dist/cli/commands/init.js +148 -0
  17. package/dist/cli/commands/init.js.map +1 -0
  18. package/dist/cli/commands/ls.d.ts +11 -0
  19. package/dist/cli/commands/ls.d.ts.map +1 -0
  20. package/dist/cli/commands/ls.js +20 -0
  21. package/dist/cli/commands/ls.js.map +1 -0
  22. package/dist/cli/commands/manifest.d.ts +12 -0
  23. package/dist/cli/commands/manifest.d.ts.map +1 -0
  24. package/dist/cli/commands/manifest.js +83 -0
  25. package/dist/cli/commands/manifest.js.map +1 -0
  26. package/dist/cli/commands/remove.d.ts +10 -0
  27. package/dist/cli/commands/remove.d.ts.map +1 -0
  28. package/dist/cli/commands/remove.js +12 -0
  29. package/dist/cli/commands/remove.js.map +1 -0
  30. package/dist/cli/commands/source.d.ts +22 -0
  31. package/dist/cli/commands/source.d.ts.map +1 -0
  32. package/dist/cli/commands/source.js +23 -0
  33. package/dist/cli/commands/source.js.map +1 -0
  34. package/dist/cli/commands/update.d.ts +11 -0
  35. package/dist/cli/commands/update.d.ts.map +1 -0
  36. package/dist/cli/commands/update.js +13 -0
  37. package/dist/cli/commands/update.js.map +1 -0
  38. package/dist/cli/index.d.ts +3 -0
  39. package/dist/cli/index.d.ts.map +1 -0
  40. package/dist/cli/index.js +90 -0
  41. package/dist/cli/index.js.map +1 -0
  42. package/dist/components/basic/Card.css +32 -0
  43. package/dist/components/basic/Card.debug.ts +5 -0
  44. package/dist/components/basic/Card.tsx +26 -0
  45. package/dist/components/basic/CardFooter.css +16 -0
  46. package/dist/components/basic/CardFooter.debug.ts +5 -0
  47. package/dist/components/basic/CardFooter.tsx +25 -0
  48. package/dist/components/basic/CardHeader.css +14 -0
  49. package/dist/components/basic/CardHeader.debug.ts +5 -0
  50. package/dist/components/basic/CardHeader.tsx +25 -0
  51. package/dist/components/basic/card.meta.ts +13 -0
  52. package/dist/components/basic/cardfooter.meta.ts +13 -0
  53. package/dist/components/basic/cardheader.meta.ts +13 -0
  54. package/dist/components/input/Button.css +34 -0
  55. package/dist/components/input/Button.debug.ts +5 -0
  56. package/dist/components/input/Button.tsx +25 -0
  57. package/dist/components/input/button.meta.ts +13 -0
  58. package/dist/components.json +138 -0
  59. package/dist/index.d.ts +2 -0
  60. package/dist/index.d.ts.map +1 -0
  61. package/dist/index.js +3 -0
  62. package/dist/index.js.map +1 -0
  63. package/dist/registry/adapters/shadcn.adapter.d.ts +35 -0
  64. package/dist/registry/adapters/shadcn.adapter.d.ts.map +1 -0
  65. package/dist/registry/adapters/shadcn.adapter.js +107 -0
  66. package/dist/registry/adapters/shadcn.adapter.js.map +1 -0
  67. package/dist/registry/componentsJson.d.ts +23 -0
  68. package/dist/registry/componentsJson.d.ts.map +1 -0
  69. package/dist/registry/componentsJson.js +55 -0
  70. package/dist/registry/componentsJson.js.map +1 -0
  71. package/dist/registry/index.d.ts +6 -0
  72. package/dist/registry/index.d.ts.map +1 -0
  73. package/dist/registry/index.js +6 -0
  74. package/dist/registry/index.js.map +1 -0
  75. package/dist/registry/manifest.d.ts +19 -0
  76. package/dist/registry/manifest.d.ts.map +1 -0
  77. package/dist/registry/manifest.js +76 -0
  78. package/dist/registry/manifest.js.map +1 -0
  79. package/dist/registry/readSource.d.ts +20 -0
  80. package/dist/registry/readSource.d.ts.map +1 -0
  81. package/dist/registry/readSource.js +44 -0
  82. package/dist/registry/readSource.js.map +1 -0
  83. package/dist/registry/types.d.ts +88 -0
  84. package/dist/registry/types.d.ts.map +1 -0
  85. package/dist/registry/types.js +44 -0
  86. package/dist/registry/types.js.map +1 -0
  87. package/dist/sources/builtins.d.ts +8 -0
  88. package/dist/sources/builtins.d.ts.map +1 -0
  89. package/dist/sources/builtins.js +10 -0
  90. package/dist/sources/builtins.js.map +1 -0
  91. package/package.json +84 -3
  92. package/README.md +0 -3
package/LICENSE ADDED
@@ -0,0 +1,95 @@
1
+ Copyright (c) 2026 G3NTs - G3nomaly
2
+
3
+ Elastic License 2.0
4
+
5
+ URL: https://www.elastic.co/licensing/elastic-license
6
+
7
+ ## Acceptance
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
14
+ non-sublicensable, non-transferable license to use, copy, distribute, make
15
+ available, and prepare derivative works of the software, in each case subject to
16
+ the limitations and conditions below.
17
+
18
+ ## Limitations
19
+
20
+ You may not provide the software to third parties as a hosted or managed
21
+ service, where the service provides users with access to any substantial set of
22
+ the features or functionality of the software.
23
+
24
+ You may not move, change, disable, or circumvent the license key functionality
25
+ in the software, and you may not remove or obscure any functionality in the
26
+ software that is protected by the license key.
27
+
28
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
29
+ of the licensor in the software. Any use of the licensor’s trademarks is subject
30
+ to applicable law.
31
+
32
+ ## Patents
33
+
34
+ The licensor grants you a license, under any patent claims the licensor can
35
+ license, or becomes able to license, to make, have made, use, sell, offer for
36
+ sale, import and have imported the software, in each case subject to the
37
+ limitations and conditions in this license. This license does not cover any
38
+ patent claims that you cause to be infringed by modifications or additions to
39
+ the software. If you or your company make any written claim that the software
40
+ infringes or contributes to infringement of any patent, your patent license for
41
+ the software granted under these terms ends immediately. If your company makes
42
+ such a claim, your patent license ends immediately for work on behalf of your
43
+ company.
44
+
45
+ ## Notices
46
+
47
+ You must ensure that anyone who gets a copy of any part of the software from you
48
+ also gets a copy of these terms.
49
+
50
+ If you modify the software, you must include in any modified copies of the
51
+ software prominent notices stating that you have modified the software.
52
+
53
+ ## No Other Rights
54
+
55
+ These terms do not imply any licenses other than those expressly granted in
56
+ these terms.
57
+
58
+ ## Termination
59
+
60
+ If you use the software in violation of these terms, such use is not licensed,
61
+ and your licenses will automatically terminate. If the licensor provides you
62
+ with a notice of your violation, and you cease all violation of this license no
63
+ later than 30 days after you receive that notice, your licenses will be
64
+ reinstated retroactively. However, if you violate these terms after such
65
+ reinstatement, any additional violation of these terms will cause your licenses
66
+ to terminate automatically and permanently.
67
+
68
+ ## No Liability
69
+
70
+ *As far as the law allows, the software comes as is, without any warranty or
71
+ condition, and the licensor will not be liable to you for any damages arising
72
+ out of these terms or the use or nature of the software, under any kind of
73
+ legal claim.*
74
+
75
+ ## Definitions
76
+
77
+ The **licensor** is the entity offering these terms, and the **software** is the
78
+ software the licensor makes available under these terms, including any portion
79
+ of it.
80
+
81
+ **you** refers to the individual or entity agreeing to these terms.
82
+
83
+ **your company** is any legal entity, sole proprietorship, or other kind of
84
+ organization that you work for, plus all organizations that have control over,
85
+ are under the control of, or are under common control with that
86
+ organization. **control** means ownership of substantially all the assets of an
87
+ entity, or the power to direct its management and policies by vote, contract, or
88
+ otherwise. Control can be direct or indirect.
89
+
90
+ **your licenses** are all the licenses granted to you for the software under
91
+ these terms.
92
+
93
+ **use** means anything you do with the software requiring one of your licenses.
94
+
95
+ **trademark** means trademarks, service marks, and similar rights.
@@ -0,0 +1,48 @@
1
+ import { resolveProjectRoot } from "@g3nomaly/core/config";
2
+ import type { G3nConfig } from "@g3nomaly/core/config";
3
+ import type { InstallCommandContext, ManifestTarget, SourceCommandContext } from "@g3nomaly/core/cli";
4
+ import type { SourceRegistry } from "@g3nomaly/core/installer";
5
+ import type { RegisteredSource, SourceRecord } from "@g3nomaly/core/sources";
6
+ import type { ComponentFileFlags } from "../registry/readSource";
7
+ import type { ComponentMeta, ComponentRegistry } from "../registry/types";
8
+ /** Injection points for tests; the real project root comes from git discovery, the components from this package. */
9
+ export interface ProjectDeps {
10
+ resolveProjectRoot?: typeof resolveProjectRoot;
11
+ /** Built-in sources in place of this package's own folder */
12
+ builtins?: SourceRecord;
13
+ }
14
+ /** A project opened for a g3nui command: its root, config, the one install target and the built-in sources. */
15
+ export interface UiProject {
16
+ projectRoot: string;
17
+ config: G3nConfig;
18
+ target: ManifestTarget;
19
+ builtins: SourceRecord;
20
+ }
21
+ /** What the core install commands print, check and fetch for components. */
22
+ export declare const UI_CONTEXT: InstallCommandContext<ComponentMeta>;
23
+ /**
24
+ * Anchors the command to the git project, loads its config, migrates a
25
+ * manifest from before the shared shape, and opens the manifest; exits when
26
+ * outside a repo or when the manifest cannot be read.
27
+ */
28
+ export declare function openUiProject(deps?: ProjectDeps): Promise<UiProject>;
29
+ /** Built-in sources plus those registered in the project's manifest. */
30
+ export declare function uiSources(project: UiProject): RegisteredSource[];
31
+ /** Installed components of the project. */
32
+ export declare function installedComponents(project: UiProject): ComponentRegistry;
33
+ /** Optional files to install: the command's flags, else the project's settings. */
34
+ export declare function fileFlags(project: UiProject, options?: {
35
+ debug?: boolean;
36
+ meta?: boolean;
37
+ }): ComponentFileFlags;
38
+ /**
39
+ * Reads the components of the project's sources, plus shadcn's when it is in
40
+ * `g3nui.settings.registeredPackages`, and prints what could not be read;
41
+ * the caller disposes the result.
42
+ *
43
+ * @param only - Source name to read alone; exits when no such source is registered
44
+ */
45
+ export declare function openComponentRegistry(project: UiProject, flags: ComponentFileFlags, only?: string): Promise<SourceRegistry<ComponentMeta>>;
46
+ /** What the core source commands need to know about components in one project. */
47
+ export declare function uiSourceContext(project: UiProject): SourceCommandContext<ComponentMeta>;
48
+ //# sourceMappingURL=adapter.d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AACnF,wBAAgB,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,kBAAkB,CAKnH;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAkBhJ;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAEvF"}
@@ -0,0 +1,87 @@
1
+ // packages/ui/src/cli/adapter.ts
2
+ import path from "node:path";
3
+ import { loadConfig, resolveProjectRoot } from "@g3nomaly/core/config";
4
+ import { c, lineError, lineInfo, narrowSources, orExit, reportSourceRegistry } from "@g3nomaly/core/cli";
5
+ import { entrySource, installedEntries, loadInstallManifest, loadSourceRegistry, manifestSources } from "@g3nomaly/core/installer";
6
+ import { createRegistryStore, register } from "@g3nomaly/core/registry";
7
+ import { readShadcnEntries, shadcnFileSource } from "../registry/adapters/shadcn.adapter";
8
+ import { SHADCN_SOURCE, migrateLegacyManifest, uiManifestPath } from "../registry/manifest";
9
+ import { readComponentSource } from "../registry/readSource";
10
+ import { ComponentMetaSchema } from "../registry/types";
11
+ import { BUILTIN_SOURCES } from "../sources/builtins";
12
+ /** What the core install commands print, check and fetch for components. */
13
+ export const UI_CONTEXT = {
14
+ bin: "g3nui",
15
+ noun: "component",
16
+ entrySchema: ComponentMetaSchema,
17
+ fileSource: (registry) => shadcnFileSource(entrySource(registry)),
18
+ };
19
+ /**
20
+ * Anchors the command to the git project, loads its config, migrates a
21
+ * manifest from before the shared shape, and opens the manifest; exits when
22
+ * outside a repo or when the manifest cannot be read.
23
+ */
24
+ export async function openUiProject(deps = {}) {
25
+ const projectRoot = (deps.resolveProjectRoot ?? resolveProjectRoot)();
26
+ if (projectRoot === null) {
27
+ console.error(lineError("No g3n project found: run `g3nui init` inside a git repository."));
28
+ process.exit(1);
29
+ }
30
+ const config = await loadConfig(projectRoot);
31
+ const migrated = await migrateLegacyManifest(projectRoot);
32
+ if (migrated !== null)
33
+ console.log(lineInfo(`Migrated ${c.file(path.relative(projectRoot, migrated))} to the shared manifest shape`));
34
+ const manifest = orExit(() => loadInstallManifest(uiManifestPath(projectRoot), ComponentMetaSchema));
35
+ return {
36
+ projectRoot,
37
+ config,
38
+ target: { label: "", installDir: path.join(projectRoot, config.g3nui.settings.componentsDir), store: manifest.store, manifest },
39
+ builtins: deps.builtins ?? BUILTIN_SOURCES,
40
+ };
41
+ }
42
+ /** Built-in sources plus those registered in the project's manifest. */
43
+ export function uiSources(project) {
44
+ return manifestSources([project.target.manifest], project.builtins);
45
+ }
46
+ /** Installed components of the project. */
47
+ export function installedComponents(project) {
48
+ return installedEntries(project.target.manifest, ComponentMetaSchema);
49
+ }
50
+ /** Optional files to install: the command's flags, else the project's settings. */
51
+ export function fileFlags(project, options = {}) {
52
+ return {
53
+ includeDebug: options.debug ?? project.config.g3nui.settings.includeDebugFiles,
54
+ includeMeta: options.meta ?? project.config.g3nui.settings.includeMetaFiles,
55
+ };
56
+ }
57
+ /**
58
+ * Reads the components of the project's sources, plus shadcn's when it is in
59
+ * `g3nui.settings.registeredPackages`, and prints what could not be read;
60
+ * the caller disposes the result.
61
+ *
62
+ * @param only - Source name to read alone; exits when no such source is registered
63
+ */
64
+ export async function openComponentRegistry(project, flags, only) {
65
+ const packages = project.config.g3nui.settings.registeredPackages;
66
+ const shadcnOn = packages.includes(SHADCN_SOURCE);
67
+ const named = narrowSources([...uiSources(project), ...(shadcnOn ? [{ name: SHADCN_SOURCE }] : [])], only, "g3nui").map((s) => s.name);
68
+ const sources = uiSources(project).filter((s) => named.includes(s.name));
69
+ const registry = await loadSourceRegistry(sources, project.projectRoot, readComponentSource(flags));
70
+ if (shadcnOn && named.includes(SHADCN_SOURCE)) {
71
+ const shadcn = await readShadcnEntries();
72
+ const store = createRegistryStore();
73
+ for (const [key, entry] of shadcn.entries)
74
+ register(store, key, entry);
75
+ registry.sources.set(SHADCN_SOURCE, store);
76
+ registry.warnings.push(...shadcn.warnings.map((warning) => `${SHADCN_SOURCE}: ${warning}`));
77
+ }
78
+ for (const name of packages.filter((p) => p !== SHADCN_SOURCE))
79
+ registry.warnings.push(`unknown external package "${name}", skipped`);
80
+ reportSourceRegistry(registry);
81
+ return registry;
82
+ }
83
+ /** What the core source commands need to know about components in one project. */
84
+ export function uiSourceContext(project) {
85
+ return { ...UI_CONTEXT, builtins: project.builtins, readSource: readComponentSource(fileFlags(project)), projectRoot: project.projectRoot };
86
+ }
87
+ //# sourceMappingURL=adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../src/cli/adapter.ts"],"names":[],"mappings":"AAAA,iCAAiC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAEzG,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEnI,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,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AAClF,MAAM,UAAU,eAAe,CAAC,OAAkB;IAChD,OAAO,EAAE,GAAG,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,UAAU,EAAE,mBAAmB,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;AAC9I,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { InstallOptions } from "@g3nomaly/core/cli";
2
+ import type { ProjectDeps } from "../adapter";
3
+ export interface AddOptions extends InstallOptions {
4
+ /** Install `.debug.ts` files; the project setting when absent */
5
+ debug?: boolean;
6
+ /** Install `.meta.ts` files; the project setting when absent */
7
+ meta?: boolean;
8
+ }
9
+ /**
10
+ * Installs components or whole groups from the registered sources, each with
11
+ * the components it depends on, keeping locally modified files. A name more
12
+ * than one source offers is picked as `<name>@<source>`; with no names the
13
+ * user picks from what the sources offer.
14
+ */
15
+ export declare function addCommand(names: string[], options?: AddOptions, deps?: ProjectDeps): Promise<void>;
16
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,iEAAiE;IACjE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gEAAgE;IAChE,IAAI,CAAC,EAAG,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAAe,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQjH"}
@@ -0,0 +1,20 @@
1
+ // packages/ui/src/cli/commands/add.ts
2
+ import { addFromSources } from "@g3nomaly/core/cli";
3
+ import { UI_CONTEXT, fileFlags, openComponentRegistry, openUiProject } from "../adapter";
4
+ /**
5
+ * Installs components or whole groups from the registered sources, each with
6
+ * the components it depends on, keeping locally modified files. A name more
7
+ * than one source offers is picked as `<name>@<source>`; with no names the
8
+ * user picks from what the sources offer.
9
+ */
10
+ export async function addCommand(names, options = {}, deps = {}) {
11
+ const project = await openUiProject(deps);
12
+ const registry = await openComponentRegistry(project, fileFlags(project, options));
13
+ try {
14
+ await addFromSources([project.target], names, registry, options, UI_CONTEXT);
15
+ }
16
+ finally {
17
+ registry.dispose();
18
+ }
19
+ }
20
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/cli/commands/add.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAUzF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,KAAe,EAAE,OAAO,GAAe,EAAE,EAAE,IAAI,GAAgB,EAAE;IAChG,MAAM,OAAO,GAAI,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACnF,IAAI,CAAC;QACH,MAAM,cAAc,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IAC/E,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -0,0 +1,15 @@
1
+ export { initCommand, initDialogue } from "./init";
2
+ export type { InitOptions, UiInitAnswers } from "./init";
3
+ export { addCommand } from "./add";
4
+ export type { AddOptions } from "./add";
5
+ export { removeCommand } from "./remove";
6
+ export type { RemoveOptions } from "./remove";
7
+ export { updateCommand } from "./update";
8
+ export type { UpdateOptions } from "./update";
9
+ export { lsCommand } from "./ls";
10
+ export type { LsOptions } from "./ls";
11
+ export { sourceAddCommand, sourceLsCommand, sourceRemoveCommand } from "./source";
12
+ export type { SourceAddOptions } from "./source";
13
+ export { manifestCommand } from "./manifest";
14
+ export type { ManifestDeps } from "./manifest";
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAClF,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,9 @@
1
+ // packages/ui/src/cli/commands/index.ts
2
+ export { initCommand, initDialogue } from "./init";
3
+ export { addCommand } from "./add";
4
+ export { removeCommand } from "./remove";
5
+ export { updateCommand } from "./update";
6
+ export { lsCommand } from "./ls";
7
+ export { sourceAddCommand, sourceLsCommand, sourceRemoveCommand } from "./source";
8
+ export { manifestCommand } from "./manifest";
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/commands/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEnD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ import type { G3nuiSettings } from "@g3nomaly/core/config";
3
+ import type { Dialogue, DialogueAnswers } from "@g3nomaly/core/cli";
4
+ import type { ProjectDeps } from "../adapter";
5
+ export interface InitOptions {
6
+ force?: boolean;
7
+ installDir?: string;
8
+ /** Preset dialogue answers by step id; skips the terminal prompt. */
9
+ answers?: DialogueAnswers;
10
+ }
11
+ declare const UiInitAnswersSchema: z.ZodObject<{
12
+ componentsDir: z.ZodString;
13
+ includeDebugFiles: z.ZodBoolean;
14
+ includeMetaFiles: z.ZodBoolean;
15
+ }, z.core.$strip>;
16
+ export type UiInitAnswers = z.infer<typeof UiInitAnswersSchema>;
17
+ interface UiInitInput extends Record<string, unknown> {
18
+ settings: G3nuiSettings;
19
+ }
20
+ export declare const orphanDialogue: Dialogue;
21
+ export declare const initDialogue: Dialogue<UiInitInput>;
22
+ /** Initializes the g3nui config in this project. */
23
+ export declare function initCommand(options?: InitOptions, deps?: ProjectDeps): Promise<void>;
24
+ export {};
25
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAI3D,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAGpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAO,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED,QAAA,MAAM,mBAAmB;;;;iBAIvB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,UAAU,WAAY,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACnD,QAAQ,EAAE,aAAa,CAAC;CACzB;AAYD,eAAO,MAAM,cAAc,EAAE,QAQ5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAqB9C,CAAC;AAyBF,oDAAoD;AACpD,wBAAsB,WAAW,CAAC,OAAO,GAAE,WAAgB,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAyElG"}
@@ -0,0 +1,148 @@
1
+ // packages/ui/src/cli/commands/init.ts
2
+ import fs from "node:fs";
3
+ import path from "node:path";
4
+ import chalk from "chalk";
5
+ import * as p from "@clack/prompts";
6
+ import { z } from "zod";
7
+ import { configExists, loadConfig, resolveProjectRoot, saveConfig } from "@g3nomaly/core/config";
8
+ import { entries as storeEntries, unregister } from "@g3nomaly/core/registry";
9
+ import { StepKind, c, orExit, runDialogue, runDialogueValue } from "@g3nomaly/core/cli";
10
+ import { loadInstallManifest, saveInstallManifest } from "@g3nomaly/core/installer";
11
+ import { migrateLegacyManifest, uiManifestPath } from "../../registry/manifest";
12
+ import { ComponentMetaSchema } from "../../registry/types";
13
+ const UiInitAnswersSchema = z.object({
14
+ componentsDir: z.string().min(1),
15
+ includeDebugFiles: z.boolean(),
16
+ includeMetaFiles: z.boolean(),
17
+ });
18
+ const reconfigureDialogue = {
19
+ steps: {
20
+ reconfigure: {
21
+ kind: StepKind.Confirm,
22
+ message: "Config already exists. Reconfigure?",
23
+ initial: false,
24
+ },
25
+ },
26
+ };
27
+ export const orphanDialogue = {
28
+ steps: {
29
+ orphans: {
30
+ kind: StepKind.Confirm,
31
+ message: "Components installed at {dir} will no longer be tracked: {orphans}. Continue and clear the manifest?",
32
+ initial: false,
33
+ },
34
+ },
35
+ };
36
+ export const initDialogue = {
37
+ steps: {
38
+ componentsDir: {
39
+ kind: StepKind.Text,
40
+ message: "Where should components be installed?",
41
+ initial: ({ settings }) => settings.componentsDir,
42
+ validate: (v) => (v?.trim() ? undefined : "Install directory cannot be empty"),
43
+ next: "includeDebugFiles",
44
+ },
45
+ includeDebugFiles: {
46
+ kind: StepKind.Confirm,
47
+ message: "Include .debug.ts files when installing components?",
48
+ initial: ({ settings }) => settings.includeDebugFiles,
49
+ next: "includeMetaFiles",
50
+ },
51
+ includeMetaFiles: {
52
+ kind: StepKind.Confirm,
53
+ message: "Include .meta.ts files when installing components?",
54
+ initial: ({ settings }) => settings.includeMetaFiles,
55
+ },
56
+ },
57
+ };
58
+ /** `true` in green or `false` dimmed, for the settings summary. */
59
+ function boolLabel(v) {
60
+ return v ? chalk.green("true") : chalk.dim("false");
61
+ }
62
+ /** One printed line per g3nui setting. */
63
+ function settingsLines(answers) {
64
+ return [
65
+ ` componentsDir: ${c.dir(answers.componentsDir)}`,
66
+ ` includeDebugFiles: ${boolLabel(answers.includeDebugFiles)}`,
67
+ ` includeMetaFiles: ${boolLabel(answers.includeMetaFiles)}`,
68
+ ];
69
+ }
70
+ /** The init answers that keep the current settings. */
71
+ function currentAnswers(settings) {
72
+ return {
73
+ componentsDir: settings.componentsDir,
74
+ includeDebugFiles: settings.includeDebugFiles,
75
+ includeMetaFiles: settings.includeMetaFiles,
76
+ };
77
+ }
78
+ /** Initializes the g3nui config in this project. */
79
+ export async function initCommand(options = {}, deps = {}) {
80
+ p.intro(chalk.bold.cyan("g3nui init"));
81
+ const projectRoot = (deps.resolveProjectRoot ?? resolveProjectRoot)();
82
+ if (projectRoot === null) {
83
+ console.error(chalk.red("Not inside a git repository — g3n projects are anchored to a repo. Run `git init` first."));
84
+ process.exitCode = 1;
85
+ return;
86
+ }
87
+ const exists = await configExists(projectRoot);
88
+ const config = await loadConfig(projectRoot);
89
+ const preset = options.installDir === undefined
90
+ ? null
91
+ : { ...currentAnswers(config.g3nui.settings), componentsDir: options.installDir };
92
+ if (exists && !options.force && preset === null) {
93
+ console.log(chalk.bold("Current config:"));
94
+ for (const line of settingsLines(currentAnswers(config.g3nui.settings)))
95
+ console.log(line);
96
+ console.log();
97
+ const reconfigure = await runDialogueValue(reconfigureDialogue, {}, options.answers);
98
+ if (reconfigure !== true) {
99
+ p.outro(chalk.dim("No changes made."));
100
+ return;
101
+ }
102
+ }
103
+ let answers;
104
+ if (preset !== null) {
105
+ answers = preset;
106
+ }
107
+ else {
108
+ const record = await runDialogue(initDialogue, { settings: config.g3nui.settings }, options.answers);
109
+ if (typeof record === "symbol") {
110
+ p.outro(chalk.dim("Init cancelled."));
111
+ return;
112
+ }
113
+ answers = UiInitAnswersSchema.parse(record);
114
+ }
115
+ // A changed install dir orphans everything the old manifest tracks —
116
+ // confirm, then clear the manifest so stale entries cannot resurrect.
117
+ const oldSettings = config.g3nui.settings;
118
+ if (exists && oldSettings.componentsDir !== answers.componentsDir) {
119
+ await migrateLegacyManifest(projectRoot);
120
+ const manifest = orExit(() => loadInstallManifest(uiManifestPath(projectRoot), ComponentMetaSchema));
121
+ const orphaned = Object.keys(storeEntries(manifest.store)).sort();
122
+ if (orphaned.length > 0) {
123
+ const proceed = await runDialogueValue(orphanDialogue, {
124
+ dir: c.dir(oldSettings.componentsDir),
125
+ orphans: orphaned.map((k) => c.key(k)).join(", "),
126
+ }, options.answers);
127
+ if (proceed !== true) {
128
+ p.outro(chalk.dim("No changes made."));
129
+ return;
130
+ }
131
+ for (const key of orphaned)
132
+ unregister(manifest.store, key);
133
+ saveInstallManifest(manifest, ComponentMetaSchema);
134
+ }
135
+ }
136
+ await saveConfig(projectRoot, {
137
+ g3nui: {
138
+ settings: {
139
+ componentsDir: answers.componentsDir,
140
+ includeDebugFiles: answers.includeDebugFiles,
141
+ includeMetaFiles: answers.includeMetaFiles,
142
+ },
143
+ },
144
+ });
145
+ fs.mkdirSync(path.join(projectRoot, ".g3n"), { recursive: true });
146
+ p.outro([`Config written to ${c.file(".g3n.config.json")}`, ...settingsLines(answers)].join("\n"));
147
+ }
148
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEjG,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,CAAC,E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AI,CAAC,IAAI,CAAC;aAClD,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACpB,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;gBACrB,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACvC,OAAO;YACT,CAAC;YACD,KAAK,MAAM,GAAG,IAAI,QAAQ;gBAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;YAC5D,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IAED,MAAM,UAAU,CAAC,WAAW,EAAE;QAC5B,KAAK,EAAE;YACL,QAAQ,EAAE;gBACR,aAAa,EAAM,OAAO,CAAC,aAAa;gBACxC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;gBAC5C,gBAAgB,EAAG,OAAO,CAAC,gBAAgB;aAC5C;SACF;KACF,CAAC,CAAC;IACH,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElE,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACrG,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { LSOptions } from "@g3nomaly/core/cli";
2
+ import type { ProjectDeps } from "../adapter";
3
+ export interface LsOptions extends LSOptions {
4
+ /** List what the manifest records instead of what the sources offer */
5
+ installed?: boolean;
6
+ /** Only the components of this source */
7
+ source?: string;
8
+ }
9
+ /** Lists the components the sources offer, `●` marking installed ones, or with `installed` only what is installed. */
10
+ export declare function lsCommand(options?: LsOptions, deps?: ProjectDeps): Promise<void>;
11
+ //# sourceMappingURL=ls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yCAAyC;IACzC,MAAM,CAAC,EAAK,MAAM,CAAC;CACpB;AAED,sHAAsH;AACtH,wBAAsB,SAAS,CAAC,OAAO,GAAE,SAAc,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAe9F"}
@@ -0,0 +1,20 @@
1
+ // packages/ui/src/cli/commands/ls.ts
2
+ import { lsEntries, lsSourceRegistry } from "@g3nomaly/core/cli";
3
+ import { fileFlags, installedComponents, openComponentRegistry, openUiProject, uiSources } from "../adapter";
4
+ /** Lists the components the sources offer, `●` marking installed ones, or with `installed` only what is installed. */
5
+ export async function lsCommand(options = {}, deps = {}) {
6
+ const project = await openUiProject(deps);
7
+ const installed = installedComponents(project);
8
+ if (options.installed === true) {
9
+ lsEntries(installed, options);
10
+ return;
11
+ }
12
+ const registry = await openComponentRegistry(project, fileFlags(project), options.source);
13
+ try {
14
+ lsSourceRegistry(registry, uiSources(project), installed, options);
15
+ }
16
+ finally {
17
+ registry.dispose();
18
+ }
19
+ }
20
+ //# sourceMappingURL=ls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ls.js","sourceRoot":"","sources":["../../../src/cli/commands/ls.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAU7G,sHAAsH;AACtH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,OAAO,GAAc,EAAE,EAAE,IAAI,GAAgB,EAAE;IAC7E,MAAM,OAAO,GAAK,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAE/C,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI,EAAE,CAAC;QAC/B,SAAS,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,qBAAqB,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1F,IAAI,CAAC;QACH,gBAAgB,CAAC,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;YAAS,CAAC;QACT,QAAQ,CAAC,OAAO,EAAE,CAAC;IACrB,CAAC;AACH,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { glob as _glob } from "glob";
2
+ import type { ProjectDeps } from "../adapter";
3
+ export interface ManifestDeps extends ProjectDeps {
4
+ glob?: typeof _glob;
5
+ }
6
+ /**
7
+ * Scans the install directory and rebuilds the manifest from what is on
8
+ * disk: every component the sources offer with at least one file present is
9
+ * recorded, the first source offering a key winning.
10
+ */
11
+ export declare function manifestCommand(deps?: ManifestDeps): Promise<void>;
12
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/manifest.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,MAAM,CAAC;AAQrC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,IAAI,CAAC,EAAE,OAAO,KAAK,CAAC;CACrB;AAmBD;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqE5E"}