trix-ui 0.2.14 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add/analysis.d.ts +4 -4
- package/dist/commands/add/analysis.js +56 -56
- package/dist/commands/add/command.d.ts +2 -2
- package/dist/commands/add/command.js +205 -202
- package/dist/commands/add/command.js.map +1 -1
- package/dist/commands/add/config.d.ts +2 -2
- package/dist/commands/add/config.js +11 -11
- package/dist/commands/add/install.d.ts +27 -27
- package/dist/commands/add/install.js +80 -80
- package/dist/commands/add/package-manager.d.ts +1 -1
- package/dist/commands/add/package-manager.js +4 -4
- package/dist/commands/add/project-files.d.ts +2 -2
- package/dist/commands/add/project-files.js +17 -17
- package/dist/commands/add/prompts.d.ts +3 -3
- package/dist/commands/add/prompts.js +28 -28
- package/dist/commands/add/registry.d.ts +4 -4
- package/dist/commands/add/registry.js +6 -6
- package/dist/commands/add/types.d.ts +33 -33
- package/dist/commands/add/types.js +1 -1
- package/dist/commands/add/ui.d.ts +4 -4
- package/dist/commands/add/ui.js +55 -55
- package/dist/commands/add/validation.d.ts +3 -3
- package/dist/commands/add/validation.js +30 -30
- package/dist/commands/add-collection.d.ts +1 -1
- package/dist/commands/add-collection.js +1 -1
- package/dist/commands/add-composite.d.ts +2 -2
- package/dist/commands/add-composite.js +205 -201
- package/dist/commands/add-composite.js.map +1 -1
- package/dist/commands/add-section.d.ts +2 -2
- package/dist/commands/add-section.js +205 -201
- package/dist/commands/add-section.js.map +1 -1
- package/dist/commands/add-wrapper.d.ts +2 -2
- package/dist/commands/add-wrapper.js +205 -201
- package/dist/commands/add-wrapper.js.map +1 -1
- package/dist/commands/add.d.ts +1 -1
- package/dist/commands/add.js +1 -1
- package/dist/commands/build.d.ts +2 -2
- package/dist/commands/build.js +104 -104
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/doctor.d.ts +2 -2
- package/dist/commands/doctor.js +67 -67
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init/command.d.ts +8 -2
- package/dist/commands/init/command.js +186 -114
- package/dist/commands/init/command.js.map +1 -1
- package/dist/commands/init/config.d.ts +9 -2
- package/dist/commands/init/config.js +45 -25
- package/dist/commands/init/config.js.map +1 -1
- package/dist/commands/init/constants.d.ts +3 -3
- package/dist/commands/init/constants.js +105 -105
- package/dist/commands/init/dependencies.d.ts +22 -5
- package/dist/commands/init/dependencies.js +86 -52
- package/dist/commands/init/dependencies.js.map +1 -1
- package/dist/commands/init/filesystem.d.ts +7 -1
- package/dist/commands/init/filesystem.js +16 -10
- package/dist/commands/init/filesystem.js.map +1 -1
- package/dist/commands/init/lockfile.d.ts +1 -1
- package/dist/commands/init/lockfile.js +1 -1
- package/dist/commands/init/package-json.d.ts +17 -6
- package/dist/commands/init/package-json.js +28 -18
- package/dist/commands/init/package-json.js.map +1 -1
- package/dist/commands/init/project.d.ts +15 -3
- package/dist/commands/init/project.js +120 -97
- package/dist/commands/init/project.js.map +1 -1
- package/dist/commands/init/tailwind.d.ts +14 -3
- package/dist/commands/init/tailwind.js +141 -33
- package/dist/commands/init/tailwind.js.map +1 -1
- package/dist/commands/init/templates.d.ts +15 -3
- package/dist/commands/init/templates.js +27 -15
- package/dist/commands/init/templates.js.map +1 -1
- package/dist/commands/init/tsconfig.d.ts +14 -2
- package/dist/commands/init/tsconfig.js +561 -273
- package/dist/commands/init/tsconfig.js.map +1 -1
- package/dist/commands/init/types.d.ts +34 -33
- package/dist/commands/init/types.js +1 -1
- package/dist/commands/init/ui.d.ts +12 -3
- package/dist/commands/init/ui.js +45 -33
- package/dist/commands/init/ui.js.map +1 -1
- package/dist/commands/init/vite.d.ts +1 -1
- package/dist/commands/init/vite.js +17 -27
- package/dist/commands/init/vite.js.map +1 -1
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/list.d.ts +2 -2
- package/dist/commands/list.js +69 -62
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/remove.d.ts +2 -2
- package/dist/commands/remove.js +95 -93
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/shared/add-collection.d.ts +50 -50
- package/dist/commands/shared/add-collection.js +206 -206
- package/dist/commands/shared/list-entries.d.ts +6 -6
- package/dist/commands/shared/list-entries.js +12 -12
- package/dist/commands/shared/name-utils.d.ts +1 -1
- package/dist/commands/shared/name-utils.js +13 -13
- package/dist/commands/shared/remove-entries.d.ts +16 -16
- package/dist/commands/shared/remove-entries.js +41 -41
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/libraries.d.ts +37 -37
- package/dist/icons/libraries.js +34 -34
- package/dist/index.d.ts +1 -2
- package/dist/index.js +29 -30
- package/dist/index.js.map +1 -1
- package/dist/lib/config.d.ts +45 -45
- package/dist/lib/config.js +97 -97
- package/dist/lib/fs.d.ts +82 -76
- package/dist/lib/fs.js +299 -302
- package/dist/lib/fs.js.map +1 -1
- package/dist/lib/highlighter.d.ts +6 -6
- package/dist/lib/highlighter.js +7 -7
- package/dist/lib/install.d.ts +19 -19
- package/dist/lib/install.js +101 -55
- package/dist/lib/install.js.map +1 -1
- package/dist/lib/lockfile.d.ts +63 -63
- package/dist/lib/lockfile.js +179 -173
- package/dist/lib/lockfile.js.map +1 -1
- package/dist/lib/logger.d.ts +8 -8
- package/dist/lib/logger.js +41 -41
- package/dist/lib/logger.js.map +1 -1
- package/dist/lib/paths.d.ts +14 -14
- package/dist/lib/paths.js +41 -31
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/registry.d.ts +35 -35
- package/dist/lib/registry.js +180 -180
- package/dist/schema/index.d.ts +1128 -1128
- package/dist/schema/index.js +237 -238
- package/dist/schema/index.js.map +1 -1
- package/dist/styles/create-style-map.d.ts +4 -4
- package/dist/styles/create-style-map.js +68 -68
- package/dist/styles/transform-style-map.d.ts +3 -3
- package/dist/styles/transform-style-map.js +428 -428
- package/dist/styles/transform.d.ts +10 -10
- package/dist/styles/transform.js +15 -15
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/index.js +5 -5
- package/dist/utils/transformers/transform-icons.d.ts +2 -2
- package/dist/utils/transformers/transform-icons.js +164 -164
- package/dist/utils/transformers/transform-menu.d.ts +2 -2
- package/dist/utils/transformers/transform-menu.js +39 -39
- package/dist/utils/transformers/transform-render.d.ts +2 -2
- package/dist/utils/transformers/transform-render.js +97 -97
- package/dist/utils/transformers/types.d.ts +14 -14
- package/dist/utils/transformers/types.js +1 -1
- package/package.json +69 -69
- package/dist/__tests__/contracts/registry.test.d.ts +0 -1
- package/dist/__tests__/contracts/registry.test.js +0 -42
- package/dist/__tests__/contracts/registry.test.js.map +0 -1
- package/dist/__tests__/e2e/cli.test.d.ts +0 -1
- package/dist/__tests__/e2e/cli.test.js +0 -67
- package/dist/__tests__/e2e/cli.test.js.map +0 -1
- package/dist/__tests__/helpers/fs.d.ts +0 -5
- package/dist/__tests__/helpers/fs.js +0 -26
- package/dist/__tests__/helpers/fs.js.map +0 -1
- package/dist/__tests__/integration/commands.integration.test.d.ts +0 -1
- package/dist/__tests__/integration/commands.integration.test.js +0 -184
- package/dist/__tests__/integration/commands.integration.test.js.map +0 -1
- package/dist/commands/__tests__/add-composite.test.d.ts +0 -2
- package/dist/commands/__tests__/add-composite.test.js +0 -171
- package/dist/commands/__tests__/add-composite.test.js.map +0 -1
- package/dist/commands/__tests__/add-entry.mocks.d.ts +0 -23
- package/dist/commands/__tests__/add-entry.mocks.js +0 -64
- package/dist/commands/__tests__/add-entry.mocks.js.map +0 -1
- package/dist/commands/__tests__/add-section.test.d.ts +0 -2
- package/dist/commands/__tests__/add-section.test.js +0 -191
- package/dist/commands/__tests__/add-section.test.js.map +0 -1
- package/dist/commands/__tests__/add-wrapper.test.d.ts +0 -2
- package/dist/commands/__tests__/add-wrapper.test.js +0 -171
- package/dist/commands/__tests__/add-wrapper.test.js.map +0 -1
- package/dist/commands/__tests__/cli-mocks.d.ts +0 -1
- package/dist/commands/__tests__/cli-mocks.js +0 -24
- package/dist/commands/__tests__/cli-mocks.js.map +0 -1
- package/dist/commands/__tests__/doctor.mocks.d.ts +0 -6
- package/dist/commands/__tests__/doctor.mocks.js +0 -20
- package/dist/commands/__tests__/doctor.mocks.js.map +0 -1
- package/dist/commands/__tests__/doctor.test.d.ts +0 -2
- package/dist/commands/__tests__/doctor.test.js +0 -80
- package/dist/commands/__tests__/doctor.test.js.map +0 -1
- package/dist/commands/__tests__/list.mocks.d.ts +0 -8
- package/dist/commands/__tests__/list.mocks.js +0 -20
- package/dist/commands/__tests__/list.mocks.js.map +0 -1
- package/dist/commands/__tests__/list.test.d.ts +0 -2
- package/dist/commands/__tests__/list.test.js +0 -60
- package/dist/commands/__tests__/list.test.js.map +0 -1
- package/dist/commands/__tests__/remove.mocks.d.ts +0 -9
- package/dist/commands/__tests__/remove.mocks.js +0 -26
- package/dist/commands/__tests__/remove.mocks.js.map +0 -1
- package/dist/commands/__tests__/remove.test.d.ts +0 -2
- package/dist/commands/__tests__/remove.test.js +0 -116
- package/dist/commands/__tests__/remove.test.js.map +0 -1
- package/dist/commands/add/__tests__/__mocks__/cli-mocks.d.ts +0 -1
- package/dist/commands/add/__tests__/__mocks__/cli-mocks.js +0 -21
- package/dist/commands/add/__tests__/__mocks__/cli-mocks.js.map +0 -1
- package/dist/commands/add/__tests__/add.mocks.d.ts +0 -19
- package/dist/commands/add/__tests__/add.mocks.js +0 -60
- package/dist/commands/add/__tests__/add.mocks.js.map +0 -1
- package/dist/commands/add/__tests__/add.test.d.ts +0 -2
- package/dist/commands/add/__tests__/add.test.js +0 -141
- package/dist/commands/add/__tests__/add.test.js.map +0 -1
- package/dist/commands/init/__tests__/init.mocks.d.ts +0 -24
- package/dist/commands/init/__tests__/init.mocks.js +0 -84
- package/dist/commands/init/__tests__/init.mocks.js.map +0 -1
- package/dist/commands/init/__tests__/init.test.d.ts +0 -2
- package/dist/commands/init/__tests__/init.test.js +0 -283
- package/dist/commands/init/__tests__/init.test.js.map +0 -1
- package/dist/commands/init/__tests__/tailwind.test.d.ts +0 -1
- package/dist/commands/init/__tests__/tailwind.test.js +0 -56
- package/dist/commands/init/__tests__/tailwind.test.js.map +0 -1
- package/dist/commands/init/__tests__/tsconfig.test.d.ts +0 -1
- package/dist/commands/init/__tests__/tsconfig.test.js +0 -108
- package/dist/commands/init/__tests__/tsconfig.test.js.map +0 -1
- package/dist/commands/init/__tests__/vite.test.d.ts +0 -1
- package/dist/commands/init/__tests__/vite.test.js +0 -66
- package/dist/commands/init/__tests__/vite.test.js.map +0 -1
- package/dist/commands/list-sections.d.ts +0 -2
- package/dist/commands/list-sections.js +0 -20
- package/dist/commands/list-sections.js.map +0 -1
- package/dist/commands/list-wrappers.d.ts +0 -2
- package/dist/commands/list-wrappers.js +0 -20
- package/dist/commands/list-wrappers.js.map +0 -1
- package/dist/commands/remove-section.d.ts +0 -2
- package/dist/commands/remove-section.js +0 -37
- package/dist/commands/remove-section.js.map +0 -1
- package/dist/commands/remove-wrapper.d.ts +0 -2
- package/dist/commands/remove-wrapper.js +0 -37
- package/dist/commands/remove-wrapper.js.map +0 -1
- package/dist/lib/__tests__/config.test.d.ts +0 -1
- package/dist/lib/__tests__/config.test.js +0 -49
- package/dist/lib/__tests__/config.test.js.map +0 -1
- package/dist/lib/__tests__/install.test.d.ts +0 -1
- package/dist/lib/__tests__/install.test.js +0 -149
- package/dist/lib/__tests__/install.test.js.map +0 -1
- package/dist/lib/__tests__/lockfile.test.d.ts +0 -1
- package/dist/lib/__tests__/lockfile.test.js +0 -89
- package/dist/lib/__tests__/lockfile.test.js.map +0 -1
- package/dist/lib/__tests__/paths.test.d.ts +0 -1
- package/dist/lib/__tests__/paths.test.js +0 -39
- package/dist/lib/__tests__/paths.test.js.map +0 -1
- package/dist/lib/__tests__/registry.test.d.ts +0 -1
- package/dist/lib/__tests__/registry.test.js +0 -76
- package/dist/lib/__tests__/registry.test.js.map +0 -1
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
export declare const iconLibraries: {
|
|
2
|
-
readonly lucide: {
|
|
3
|
-
readonly name: "lucide";
|
|
4
|
-
readonly title: "Lucide";
|
|
5
|
-
readonly packages: readonly ["lucide-react"];
|
|
6
|
-
readonly import: "import { ICON } from 'lucide-react'";
|
|
7
|
-
readonly usage: "<ICON />";
|
|
8
|
-
readonly export: "lucide-react";
|
|
9
|
-
};
|
|
10
|
-
readonly tabler: {
|
|
11
|
-
readonly name: "tabler";
|
|
12
|
-
readonly title: "Tabler Icons";
|
|
13
|
-
readonly packages: readonly ["@tabler/icons-react"];
|
|
14
|
-
readonly import: "import { ICON } from '@tabler/icons-react'";
|
|
15
|
-
readonly usage: "<ICON />";
|
|
16
|
-
readonly export: "@tabler/icons-react";
|
|
17
|
-
};
|
|
18
|
-
readonly hugeicons: {
|
|
19
|
-
readonly name: "hugeicons";
|
|
20
|
-
readonly title: "HugeIcons";
|
|
21
|
-
readonly packages: readonly ["@hugeicons/react", "@hugeicons/core-free-icons"];
|
|
22
|
-
readonly import: "import { HugeiconsIcon } from '@hugeicons/react'\nimport { ICON } from '@hugeicons/core-free-icons';";
|
|
23
|
-
readonly usage: "<HugeiconsIcon icon={ICON} strokeWidth={2} />";
|
|
24
|
-
readonly export: "@hugeicons/core-free-icons";
|
|
25
|
-
};
|
|
26
|
-
readonly phosphor: {
|
|
27
|
-
readonly name: "phosphor";
|
|
28
|
-
readonly title: "Phosphor Icons";
|
|
29
|
-
readonly packages: readonly ["@phosphor-icons/react"];
|
|
30
|
-
readonly import: "import { ICON } from '@phosphor-icons/react'";
|
|
31
|
-
readonly usage: "<ICON strokeWidth={2} />";
|
|
32
|
-
readonly export: "@phosphor-icons/react";
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export type IconLibraries = typeof iconLibraries;
|
|
36
|
-
export type IconLibrary = IconLibraries[keyof IconLibraries];
|
|
37
|
-
export type IconLibraryName = keyof IconLibraries;
|
|
1
|
+
export declare const iconLibraries: {
|
|
2
|
+
readonly lucide: {
|
|
3
|
+
readonly name: "lucide";
|
|
4
|
+
readonly title: "Lucide";
|
|
5
|
+
readonly packages: readonly ["lucide-react"];
|
|
6
|
+
readonly import: "import { ICON } from 'lucide-react'";
|
|
7
|
+
readonly usage: "<ICON />";
|
|
8
|
+
readonly export: "lucide-react";
|
|
9
|
+
};
|
|
10
|
+
readonly tabler: {
|
|
11
|
+
readonly name: "tabler";
|
|
12
|
+
readonly title: "Tabler Icons";
|
|
13
|
+
readonly packages: readonly ["@tabler/icons-react"];
|
|
14
|
+
readonly import: "import { ICON } from '@tabler/icons-react'";
|
|
15
|
+
readonly usage: "<ICON />";
|
|
16
|
+
readonly export: "@tabler/icons-react";
|
|
17
|
+
};
|
|
18
|
+
readonly hugeicons: {
|
|
19
|
+
readonly name: "hugeicons";
|
|
20
|
+
readonly title: "HugeIcons";
|
|
21
|
+
readonly packages: readonly ["@hugeicons/react", "@hugeicons/core-free-icons"];
|
|
22
|
+
readonly import: "import { HugeiconsIcon } from '@hugeicons/react'\nimport { ICON } from '@hugeicons/core-free-icons';";
|
|
23
|
+
readonly usage: "<HugeiconsIcon icon={ICON} strokeWidth={2} />";
|
|
24
|
+
readonly export: "@hugeicons/core-free-icons";
|
|
25
|
+
};
|
|
26
|
+
readonly phosphor: {
|
|
27
|
+
readonly name: "phosphor";
|
|
28
|
+
readonly title: "Phosphor Icons";
|
|
29
|
+
readonly packages: readonly ["@phosphor-icons/react"];
|
|
30
|
+
readonly import: "import { ICON } from '@phosphor-icons/react'";
|
|
31
|
+
readonly usage: "<ICON strokeWidth={2} />";
|
|
32
|
+
readonly export: "@phosphor-icons/react";
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type IconLibraries = typeof iconLibraries;
|
|
36
|
+
export type IconLibrary = IconLibraries[keyof IconLibraries];
|
|
37
|
+
export type IconLibraryName = keyof IconLibraries;
|
package/dist/icons/libraries.js
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export const iconLibraries = {
|
|
2
|
-
lucide: {
|
|
3
|
-
name: "lucide",
|
|
4
|
-
title: "Lucide",
|
|
5
|
-
packages: ["lucide-react"],
|
|
6
|
-
import: "import { ICON } from 'lucide-react'",
|
|
7
|
-
usage: "<ICON />",
|
|
8
|
-
export: "lucide-react"
|
|
9
|
-
},
|
|
10
|
-
tabler: {
|
|
11
|
-
name: "tabler",
|
|
12
|
-
title: "Tabler Icons",
|
|
13
|
-
packages: ["@tabler/icons-react"],
|
|
14
|
-
import: "import { ICON } from '@tabler/icons-react'",
|
|
15
|
-
usage: "<ICON />",
|
|
16
|
-
export: "@tabler/icons-react"
|
|
17
|
-
},
|
|
18
|
-
hugeicons: {
|
|
19
|
-
name: "hugeicons",
|
|
20
|
-
title: "HugeIcons",
|
|
21
|
-
packages: ["@hugeicons/react", "@hugeicons/core-free-icons"],
|
|
22
|
-
import: "import { HugeiconsIcon } from '@hugeicons/react'\nimport { ICON } from '@hugeicons/core-free-icons';",
|
|
23
|
-
usage: "<HugeiconsIcon icon={ICON} strokeWidth={2} />",
|
|
24
|
-
export: "@hugeicons/core-free-icons"
|
|
25
|
-
},
|
|
26
|
-
phosphor: {
|
|
27
|
-
name: "phosphor",
|
|
28
|
-
title: "Phosphor Icons",
|
|
29
|
-
packages: ["@phosphor-icons/react"],
|
|
30
|
-
import: "import { ICON } from '@phosphor-icons/react'",
|
|
31
|
-
usage: "<ICON strokeWidth={2} />",
|
|
32
|
-
export: "@phosphor-icons/react"
|
|
33
|
-
}
|
|
34
|
-
};
|
|
1
|
+
export const iconLibraries = {
|
|
2
|
+
lucide: {
|
|
3
|
+
name: "lucide",
|
|
4
|
+
title: "Lucide",
|
|
5
|
+
packages: ["lucide-react"],
|
|
6
|
+
import: "import { ICON } from 'lucide-react'",
|
|
7
|
+
usage: "<ICON />",
|
|
8
|
+
export: "lucide-react"
|
|
9
|
+
},
|
|
10
|
+
tabler: {
|
|
11
|
+
name: "tabler",
|
|
12
|
+
title: "Tabler Icons",
|
|
13
|
+
packages: ["@tabler/icons-react"],
|
|
14
|
+
import: "import { ICON } from '@tabler/icons-react'",
|
|
15
|
+
usage: "<ICON />",
|
|
16
|
+
export: "@tabler/icons-react"
|
|
17
|
+
},
|
|
18
|
+
hugeicons: {
|
|
19
|
+
name: "hugeicons",
|
|
20
|
+
title: "HugeIcons",
|
|
21
|
+
packages: ["@hugeicons/react", "@hugeicons/core-free-icons"],
|
|
22
|
+
import: "import { HugeiconsIcon } from '@hugeicons/react'\nimport { ICON } from '@hugeicons/core-free-icons';",
|
|
23
|
+
usage: "<HugeiconsIcon icon={ICON} strokeWidth={2} />",
|
|
24
|
+
export: "@hugeicons/core-free-icons"
|
|
25
|
+
},
|
|
26
|
+
phosphor: {
|
|
27
|
+
name: "phosphor",
|
|
28
|
+
title: "Phosphor Icons",
|
|
29
|
+
packages: ["@phosphor-icons/react"],
|
|
30
|
+
import: "import { ICON } from '@phosphor-icons/react'",
|
|
31
|
+
usage: "<ICON strokeWidth={2} />",
|
|
32
|
+
export: "@phosphor-icons/react"
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
35
|
//# sourceMappingURL=libraries.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
process.on("
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
.
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
program.addCommand(
|
|
22
|
-
program.addCommand(
|
|
23
|
-
program.addCommand(
|
|
24
|
-
program.addCommand(
|
|
25
|
-
program.addCommand(
|
|
26
|
-
|
|
27
|
-
program.addCommand(
|
|
28
|
-
program.addCommand(
|
|
29
|
-
program.
|
|
30
|
-
program.parse();
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { addCommand } from "./commands/add.js";
|
|
4
|
+
import { addCompositeCommand } from "./commands/add-composite.js";
|
|
5
|
+
// import { addSectionCommand } from "./commands/add-section.js"
|
|
6
|
+
import { addWrapperCommand } from "./commands/add-wrapper.js";
|
|
7
|
+
import { buildCommand } from "./commands/build.js";
|
|
8
|
+
import { doctorCommand } from "./commands/doctor.js";
|
|
9
|
+
import { initCommand } from "./commands/init.js";
|
|
10
|
+
import { listCommand } from "./commands/list.js";
|
|
11
|
+
import { removeCommand } from "./commands/remove.js";
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const packageJson = require("../package.json");
|
|
14
|
+
process.on("SIGINT", () => process.exit(0));
|
|
15
|
+
process.on("SIGTERM", () => process.exit(0));
|
|
16
|
+
const program = new Command()
|
|
17
|
+
.name("ui")
|
|
18
|
+
.description("Trix UI registry CLI")
|
|
19
|
+
.version(packageJson.version ?? "0.0.0", "-v, --version", "display version");
|
|
20
|
+
program.addCommand(initCommand);
|
|
21
|
+
program.addCommand(addCommand);
|
|
22
|
+
program.addCommand(addCompositeCommand);
|
|
23
|
+
// program.addCommand(addSectionCommand)
|
|
24
|
+
program.addCommand(addWrapperCommand);
|
|
25
|
+
program.addCommand(buildCommand);
|
|
26
|
+
program.addCommand(removeCommand);
|
|
27
|
+
program.addCommand(listCommand);
|
|
28
|
+
program.addCommand(doctorCommand);
|
|
29
|
+
program.parse();
|
|
31
30
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,gEAAgE;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC9C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAyB,CAAA;AAEtE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;AAE5C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,IAAI,CAAC;KACV,WAAW,CAAC,sBAAsB,CAAC;KACnC,OAAO,CAAC,WAAW,CAAC,OAAO,IAAI,OAAO,EAAE,eAAe,EAAE,iBAAiB,CAAC,CAAA;AAE9E,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;AAC/B,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAA;AAC9B,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAA;AACvC,wCAAwC;AACxC,OAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;AACrC,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,CAAA;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AACjC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAA;AAC/B,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAA;AAEjC,OAAO,CAAC,KAAK,EAAE,CAAA"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
export type RegistryConfig = {
|
|
2
|
-
type: "bundled";
|
|
3
|
-
} | {
|
|
4
|
-
type: "local";
|
|
5
|
-
path: string;
|
|
6
|
-
templates?: string;
|
|
7
|
-
};
|
|
8
|
-
export type RegistryConfigInput = RegistryConfig | string;
|
|
9
|
-
export interface TrixUIConfig {
|
|
10
|
-
$schema?: string;
|
|
11
|
-
typescript: boolean;
|
|
12
|
-
tailwind: boolean;
|
|
13
|
-
framework: "next" | "react" | "vite" | "unknown";
|
|
14
|
-
barrel: boolean;
|
|
15
|
-
paths: {
|
|
16
|
-
components: string;
|
|
17
|
-
sections: string;
|
|
18
|
-
wrappers: string;
|
|
19
|
-
composites: string;
|
|
20
|
-
utils: string;
|
|
21
|
-
styles: string;
|
|
22
|
-
};
|
|
23
|
-
registry?: RegistryConfigInput;
|
|
24
|
-
}
|
|
25
|
-
export declare const DEFAULT_CONFIG: TrixUIConfig;
|
|
26
|
-
/**
|
|
27
|
-
* Get the config file path
|
|
28
|
-
*/
|
|
29
|
-
export declare function getConfigPath(cwd: string): string;
|
|
30
|
-
/**
|
|
31
|
-
* Check if config file exists
|
|
32
|
-
*/
|
|
33
|
-
export declare function configExists(cwd: string): Promise<boolean>;
|
|
34
|
-
/**
|
|
35
|
-
* Load config from file
|
|
36
|
-
*/
|
|
37
|
-
export declare function loadConfig(cwd: string): Promise<TrixUIConfig>;
|
|
38
|
-
/**
|
|
39
|
-
* Write config to file
|
|
40
|
-
*/
|
|
41
|
-
export declare function writeConfig(cwd: string, config: TrixUIConfig, force?: boolean): Promise<void>;
|
|
42
|
-
/**
|
|
43
|
-
* Update specific config fields
|
|
44
|
-
*/
|
|
45
|
-
export declare function updateConfig(cwd: string, updates: Partial<TrixUIConfig>): Promise<void>;
|
|
1
|
+
export type RegistryConfig = {
|
|
2
|
+
type: "bundled";
|
|
3
|
+
} | {
|
|
4
|
+
type: "local";
|
|
5
|
+
path: string;
|
|
6
|
+
templates?: string;
|
|
7
|
+
};
|
|
8
|
+
export type RegistryConfigInput = RegistryConfig | string;
|
|
9
|
+
export interface TrixUIConfig {
|
|
10
|
+
$schema?: string;
|
|
11
|
+
typescript: boolean;
|
|
12
|
+
tailwind: boolean;
|
|
13
|
+
framework: "next" | "react" | "vite" | "unknown";
|
|
14
|
+
barrel: boolean;
|
|
15
|
+
paths: {
|
|
16
|
+
components: string;
|
|
17
|
+
sections: string;
|
|
18
|
+
wrappers: string;
|
|
19
|
+
composites: string;
|
|
20
|
+
utils: string;
|
|
21
|
+
styles: string;
|
|
22
|
+
};
|
|
23
|
+
registry?: RegistryConfigInput;
|
|
24
|
+
}
|
|
25
|
+
export declare const DEFAULT_CONFIG: TrixUIConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Get the config file path
|
|
28
|
+
*/
|
|
29
|
+
export declare function getConfigPath(cwd: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Check if config file exists
|
|
32
|
+
*/
|
|
33
|
+
export declare function configExists(cwd: string): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Load config from file
|
|
36
|
+
*/
|
|
37
|
+
export declare function loadConfig(cwd: string): Promise<TrixUIConfig>;
|
|
38
|
+
/**
|
|
39
|
+
* Write config to file
|
|
40
|
+
*/
|
|
41
|
+
export declare function writeConfig(cwd: string, config: TrixUIConfig, force?: boolean): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Update specific config fields
|
|
44
|
+
*/
|
|
45
|
+
export declare function updateConfig(cwd: string, updates: Partial<TrixUIConfig>): Promise<void>;
|
package/dist/lib/config.js
CHANGED
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { fileExists, readJsonFile, writeJsonFile } from "./fs.js";
|
|
3
|
-
export const DEFAULT_CONFIG = {
|
|
4
|
-
typescript: true,
|
|
5
|
-
tailwind: true,
|
|
6
|
-
framework: "react",
|
|
7
|
-
barrel: false,
|
|
8
|
-
registry: {
|
|
9
|
-
type: "bundled"
|
|
10
|
-
},
|
|
11
|
-
paths: {
|
|
12
|
-
components: "components/ui",
|
|
13
|
-
sections: "components/sections",
|
|
14
|
-
wrappers: "components/wrappers",
|
|
15
|
-
composites: "components/composites",
|
|
16
|
-
utils: "lib/utils.ts",
|
|
17
|
-
styles: "globals.css",
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
const CONFIG_FILENAME = "trix-ui.json";
|
|
21
|
-
/**
|
|
22
|
-
* Get the config file path
|
|
23
|
-
*/
|
|
24
|
-
export function getConfigPath(cwd) {
|
|
25
|
-
return path.join(cwd, CONFIG_FILENAME);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Check if config file exists
|
|
29
|
-
*/
|
|
30
|
-
export async function configExists(cwd) {
|
|
31
|
-
return fileExists(getConfigPath(cwd));
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Load config from file
|
|
35
|
-
*/
|
|
36
|
-
export async function loadConfig(cwd) {
|
|
37
|
-
const configPath = getConfigPath(cwd);
|
|
38
|
-
if (!(await fileExists(configPath))) {
|
|
39
|
-
throw new Error(`Config file not found: ${CONFIG_FILENAME}\n` +
|
|
40
|
-
`Run 'trix-ui init' to initialize your project.`);
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
const config = await readJsonFile(configPath);
|
|
44
|
-
// Validate required fields
|
|
45
|
-
if (!config.paths) {
|
|
46
|
-
throw new Error("Invalid config: missing 'paths' field");
|
|
47
|
-
}
|
|
48
|
-
if (!config.paths.components) {
|
|
49
|
-
throw new Error("Invalid config: missing 'paths.components' field");
|
|
50
|
-
}
|
|
51
|
-
// Merge with defaults to ensure all fields exist
|
|
52
|
-
return {
|
|
53
|
-
...DEFAULT_CONFIG,
|
|
54
|
-
...config,
|
|
55
|
-
paths: {
|
|
56
|
-
...DEFAULT_CONFIG.paths,
|
|
57
|
-
...config.paths,
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
catch (error) {
|
|
62
|
-
throw new Error(`Failed to load config: ${error.message}\n` +
|
|
63
|
-
`Please check your ${CONFIG_FILENAME} file for syntax errors.`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Write config to file
|
|
68
|
-
*/
|
|
69
|
-
export async function writeConfig(cwd, config, force = false) {
|
|
70
|
-
const configPath = getConfigPath(cwd);
|
|
71
|
-
// Add schema for IDE support
|
|
72
|
-
const configWithSchema = {
|
|
73
|
-
$schema: "https://trix-ui.com/schema.json",
|
|
74
|
-
...config,
|
|
75
|
-
};
|
|
76
|
-
try {
|
|
77
|
-
await writeJsonFile(configPath, configWithSchema, force);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
throw new Error(`Failed to write config: ${error.message}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Update specific config fields
|
|
85
|
-
*/
|
|
86
|
-
export async function updateConfig(cwd, updates) {
|
|
87
|
-
const config = await loadConfig(cwd);
|
|
88
|
-
const updatedConfig = {
|
|
89
|
-
...config,
|
|
90
|
-
...updates,
|
|
91
|
-
paths: {
|
|
92
|
-
...config.paths,
|
|
93
|
-
...(updates.paths || {}),
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
await writeConfig(cwd, updatedConfig, true);
|
|
97
|
-
}
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { fileExists, readJsonFile, writeJsonFile } from "./fs.js";
|
|
3
|
+
export const DEFAULT_CONFIG = {
|
|
4
|
+
typescript: true,
|
|
5
|
+
tailwind: true,
|
|
6
|
+
framework: "react",
|
|
7
|
+
barrel: false,
|
|
8
|
+
registry: {
|
|
9
|
+
type: "bundled"
|
|
10
|
+
},
|
|
11
|
+
paths: {
|
|
12
|
+
components: "components/ui",
|
|
13
|
+
sections: "components/sections",
|
|
14
|
+
wrappers: "components/wrappers",
|
|
15
|
+
composites: "components/composites",
|
|
16
|
+
utils: "lib/utils.ts",
|
|
17
|
+
styles: "globals.css",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
const CONFIG_FILENAME = "trix-ui.json";
|
|
21
|
+
/**
|
|
22
|
+
* Get the config file path
|
|
23
|
+
*/
|
|
24
|
+
export function getConfigPath(cwd) {
|
|
25
|
+
return path.join(cwd, CONFIG_FILENAME);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Check if config file exists
|
|
29
|
+
*/
|
|
30
|
+
export async function configExists(cwd) {
|
|
31
|
+
return fileExists(getConfigPath(cwd));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Load config from file
|
|
35
|
+
*/
|
|
36
|
+
export async function loadConfig(cwd) {
|
|
37
|
+
const configPath = getConfigPath(cwd);
|
|
38
|
+
if (!(await fileExists(configPath))) {
|
|
39
|
+
throw new Error(`Config file not found: ${CONFIG_FILENAME}\n` +
|
|
40
|
+
`Run 'trix-ui init' to initialize your project.`);
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const config = await readJsonFile(configPath);
|
|
44
|
+
// Validate required fields
|
|
45
|
+
if (!config.paths) {
|
|
46
|
+
throw new Error("Invalid config: missing 'paths' field");
|
|
47
|
+
}
|
|
48
|
+
if (!config.paths.components) {
|
|
49
|
+
throw new Error("Invalid config: missing 'paths.components' field");
|
|
50
|
+
}
|
|
51
|
+
// Merge with defaults to ensure all fields exist
|
|
52
|
+
return {
|
|
53
|
+
...DEFAULT_CONFIG,
|
|
54
|
+
...config,
|
|
55
|
+
paths: {
|
|
56
|
+
...DEFAULT_CONFIG.paths,
|
|
57
|
+
...config.paths,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
throw new Error(`Failed to load config: ${error.message}\n` +
|
|
63
|
+
`Please check your ${CONFIG_FILENAME} file for syntax errors.`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Write config to file
|
|
68
|
+
*/
|
|
69
|
+
export async function writeConfig(cwd, config, force = false) {
|
|
70
|
+
const configPath = getConfigPath(cwd);
|
|
71
|
+
// Add schema for IDE support
|
|
72
|
+
const configWithSchema = {
|
|
73
|
+
$schema: "https://trix-ui.com/schema.json",
|
|
74
|
+
...config,
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
await writeJsonFile(configPath, configWithSchema, force);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw new Error(`Failed to write config: ${error.message}`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Update specific config fields
|
|
85
|
+
*/
|
|
86
|
+
export async function updateConfig(cwd, updates) {
|
|
87
|
+
const config = await loadConfig(cwd);
|
|
88
|
+
const updatedConfig = {
|
|
89
|
+
...config,
|
|
90
|
+
...updates,
|
|
91
|
+
paths: {
|
|
92
|
+
...config.paths,
|
|
93
|
+
...(updates.paths || {}),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
await writeConfig(cwd, updatedConfig, true);
|
|
97
|
+
}
|
|
98
98
|
//# sourceMappingURL=config.js.map
|