trix-ui 0.2.8 → 0.2.10
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/__tests__/contracts/registry.test.d.ts +1 -0
- package/dist/__tests__/contracts/registry.test.js +42 -0
- package/dist/__tests__/contracts/registry.test.js.map +1 -0
- package/dist/__tests__/e2e/cli.test.d.ts +1 -0
- package/dist/__tests__/e2e/cli.test.js +67 -0
- package/dist/__tests__/e2e/cli.test.js.map +1 -0
- package/dist/__tests__/helpers/fs.d.ts +5 -0
- package/dist/__tests__/helpers/fs.js +26 -0
- package/dist/__tests__/helpers/fs.js.map +1 -0
- package/dist/__tests__/integration/commands.integration.test.d.ts +1 -0
- package/dist/__tests__/integration/commands.integration.test.js +184 -0
- package/dist/__tests__/integration/commands.integration.test.js.map +1 -0
- package/dist/commands/__tests__/add-composite.test.d.ts +2 -0
- package/dist/commands/__tests__/add-composite.test.js +171 -0
- package/dist/commands/__tests__/add-composite.test.js.map +1 -0
- package/dist/commands/__tests__/add-entry.mocks.d.ts +23 -0
- package/dist/commands/__tests__/add-entry.mocks.js +64 -0
- package/dist/commands/__tests__/add-entry.mocks.js.map +1 -0
- package/dist/commands/__tests__/add-section.test.d.ts +2 -0
- package/dist/commands/__tests__/add-section.test.js +191 -0
- package/dist/commands/__tests__/add-section.test.js.map +1 -0
- package/dist/commands/__tests__/add-wrapper.test.d.ts +2 -0
- package/dist/commands/__tests__/add-wrapper.test.js +171 -0
- package/dist/commands/__tests__/add-wrapper.test.js.map +1 -0
- package/dist/commands/__tests__/cli-mocks.d.ts +1 -0
- package/dist/commands/__tests__/cli-mocks.js +24 -0
- package/dist/commands/__tests__/cli-mocks.js.map +1 -0
- package/dist/commands/__tests__/doctor.mocks.d.ts +6 -0
- package/dist/commands/__tests__/doctor.mocks.js +20 -0
- package/dist/commands/__tests__/doctor.mocks.js.map +1 -0
- package/dist/commands/__tests__/doctor.test.d.ts +2 -0
- package/dist/commands/__tests__/doctor.test.js +80 -0
- package/dist/commands/__tests__/doctor.test.js.map +1 -0
- package/dist/commands/__tests__/list.mocks.d.ts +8 -0
- package/dist/commands/__tests__/list.mocks.js +20 -0
- package/dist/commands/__tests__/list.mocks.js.map +1 -0
- package/dist/commands/__tests__/list.test.d.ts +2 -0
- package/dist/commands/__tests__/list.test.js +60 -0
- package/dist/commands/__tests__/list.test.js.map +1 -0
- package/dist/commands/__tests__/remove.mocks.d.ts +9 -0
- package/dist/commands/__tests__/remove.mocks.js +26 -0
- package/dist/commands/__tests__/remove.mocks.js.map +1 -0
- package/dist/commands/__tests__/remove.test.d.ts +2 -0
- package/dist/commands/__tests__/remove.test.js +116 -0
- package/dist/commands/__tests__/remove.test.js.map +1 -0
- package/dist/commands/add/__tests__/add.mocks.d.ts +19 -19
- package/dist/commands/add/__tests__/add.mocks.js +59 -59
- package/dist/commands/add/__tests__/add.test.d.ts +2 -2
- package/dist/commands/add/__tests__/add.test.js +140 -140
- 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 +202 -202
- 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 +201 -201
- package/dist/commands/add-section.d.ts +2 -2
- package/dist/commands/add-section.js +201 -201
- package/dist/commands/add-wrapper.d.ts +2 -2
- package/dist/commands/add-wrapper.js +201 -201
- 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/doctor.d.ts +2 -2
- package/dist/commands/doctor.js +67 -67
- package/dist/commands/init/__tests__/init.mocks.d.ts +24 -0
- package/dist/commands/init/__tests__/init.mocks.js +84 -0
- package/dist/commands/init/__tests__/init.mocks.js.map +1 -0
- package/dist/commands/init/__tests__/init.test.d.ts +2 -0
- package/dist/commands/init/__tests__/init.test.js +283 -0
- package/dist/commands/init/__tests__/init.test.js.map +1 -0
- package/dist/commands/init/__tests__/tailwind.test.d.ts +1 -0
- package/dist/commands/init/__tests__/tailwind.test.js +56 -0
- package/dist/commands/init/__tests__/tailwind.test.js.map +1 -0
- package/dist/commands/init/__tests__/tsconfig.test.d.ts +1 -0
- package/dist/commands/init/__tests__/tsconfig.test.js +108 -0
- package/dist/commands/init/__tests__/tsconfig.test.js.map +1 -0
- package/dist/commands/init/__tests__/vite.test.d.ts +1 -0
- package/dist/commands/init/__tests__/vite.test.js +66 -0
- package/dist/commands/init/__tests__/vite.test.js.map +1 -0
- package/dist/commands/init/command.d.ts +2 -2
- package/dist/commands/init/command.js +114 -114
- package/dist/commands/init/config.d.ts +2 -2
- package/dist/commands/init/config.js +25 -25
- package/dist/commands/init/constants.d.ts +3 -3
- package/dist/commands/init/constants.js +105 -105
- package/dist/commands/init/dependencies.d.ts +5 -5
- package/dist/commands/init/dependencies.js +52 -52
- package/dist/commands/init/filesystem.d.ts +1 -1
- package/dist/commands/init/filesystem.js +10 -10
- 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 +6 -6
- package/dist/commands/init/package-json.js +18 -18
- package/dist/commands/init/project-files.d.ts +8 -0
- package/dist/commands/init/project-files.js +37 -0
- package/dist/commands/init/project-files.js.map +1 -0
- package/dist/commands/init/project.d.ts +3 -3
- package/dist/commands/init/project.js +97 -97
- package/dist/commands/init/style-imports.d.ts +9 -0
- package/dist/commands/init/style-imports.js +218 -0
- package/dist/commands/init/style-imports.js.map +1 -0
- package/dist/commands/init/tailwind.d.ts +3 -3
- package/dist/commands/init/tailwind.js +34 -34
- package/dist/commands/init/templates.d.ts +3 -3
- package/dist/commands/init/templates.js +15 -15
- package/dist/commands/init/tsconfig.d.ts +2 -2
- package/dist/commands/init/tsconfig.js +273 -273
- package/dist/commands/init/types.d.ts +33 -33
- package/dist/commands/init/types.js +1 -1
- package/dist/commands/init/ui.d.ts +3 -3
- package/dist/commands/init/ui.js +33 -33
- package/dist/commands/init/vite.d.ts +23 -0
- package/dist/commands/init/vite.js +347 -0
- package/dist/commands/init/vite.js.map +1 -0
- 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 +62 -62
- package/dist/commands/remove.d.ts +2 -2
- package/dist/commands/remove.js +93 -93
- 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 +2 -2
- package/dist/index.js +30 -30
- package/dist/lib/__tests__/config.test.d.ts +1 -0
- package/dist/lib/__tests__/config.test.js +49 -0
- package/dist/lib/__tests__/config.test.js.map +1 -0
- package/dist/lib/__tests__/install.test.d.ts +1 -0
- package/dist/lib/__tests__/install.test.js +149 -0
- package/dist/lib/__tests__/install.test.js.map +1 -0
- package/dist/lib/__tests__/lockfile.test.d.ts +1 -0
- package/dist/lib/__tests__/lockfile.test.js +89 -0
- package/dist/lib/__tests__/lockfile.test.js.map +1 -0
- package/dist/lib/__tests__/paths.test.d.ts +1 -0
- package/dist/lib/__tests__/paths.test.js +39 -0
- package/dist/lib/__tests__/paths.test.js.map +1 -0
- package/dist/lib/__tests__/registry.test.d.ts +1 -0
- package/dist/lib/__tests__/registry.test.js +76 -0
- package/dist/lib/__tests__/registry.test.js.map +1 -0
- package/dist/lib/config.d.ts +45 -45
- package/dist/lib/config.js +97 -97
- package/dist/lib/fs.d.ts +76 -76
- package/dist/lib/fs.js +302 -302
- 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 +55 -55
- package/dist/lib/lockfile.d.ts +63 -63
- package/dist/lib/lockfile.js +173 -173
- package/dist/lib/logger.d.ts +8 -8
- package/dist/lib/logger.js +41 -41
- package/dist/lib/paths.d.ts +14 -14
- package/dist/lib/paths.js +31 -31
- 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 +238 -238
- 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 +1 -1
|
@@ -1,115 +1,115 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { Command } from "commander";
|
|
3
|
-
import ora from "ora";
|
|
4
|
-
import prompts from "prompts";
|
|
5
|
-
import { getConfigPath, writeConfig } from "../../lib/config.js";
|
|
6
|
-
import { fileExists } from "../../lib/fs.js";
|
|
7
|
-
import { logger } from "../../lib/logger.js";
|
|
8
|
-
import { createConfig } from "./config.js";
|
|
9
|
-
import { checkDependencies, confirmInstallation, installDependencies, } from "./dependencies.js";
|
|
10
|
-
import { directoryExists } from "./filesystem.js";
|
|
11
|
-
import { detectProject, validateProject } from "./project.js";
|
|
12
|
-
import { setupGlobalStyles, setupTailwind } from "./tailwind.js";
|
|
13
|
-
import { setupTypeScriptPaths } from "./tsconfig.js";
|
|
14
|
-
import { displayProjectInfo, displaySuccessMessage } from "./ui.js";
|
|
15
|
-
export const initCommand = new Command("init")
|
|
16
|
-
.description("Initialize a project for trix-ui artifacts")
|
|
17
|
-
.option("-f, --force", "overwrite existing files", false)
|
|
18
|
-
.option("-b, --barrel", "create components/ui/index.ts barrel file", false)
|
|
19
|
-
.option("-c, --cwd <path>", "working directory to init project")
|
|
20
|
-
.option("-y, --yes", "skip confirmation prompts", false)
|
|
21
|
-
.option("-s, --silent", "suppress output messages", false)
|
|
22
|
-
.action(async (options) => {
|
|
23
|
-
const spinner = options.silent ? null : ora({ color: "blue" });
|
|
24
|
-
const shouldLog = !options.silent;
|
|
25
|
-
const forceOverwrite = Boolean(options.force);
|
|
26
|
-
try {
|
|
27
|
-
const cwd = path.resolve(options.cwd || process.cwd());
|
|
28
|
-
if (shouldLog) {
|
|
29
|
-
logger.info({ cwd }, "Initializing trix-ui");
|
|
30
|
-
}
|
|
31
|
-
if (!(await directoryExists(cwd))) {
|
|
32
|
-
logger.error(`Directory does not exist: ${cwd}`);
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
spinner?.start("Detecting project configuration...");
|
|
36
|
-
const projectInfo = await detectProject(cwd);
|
|
37
|
-
spinner?.succeed("Project detected");
|
|
38
|
-
spinner?.start("Validating project setup...");
|
|
39
|
-
const validation = await validateProject(cwd, projectInfo);
|
|
40
|
-
spinner?.stop();
|
|
41
|
-
if (!validation.valid) {
|
|
42
|
-
logger.error({ errors: validation.errors }, "Project does not meet init requirements");
|
|
43
|
-
process.exit(1);
|
|
44
|
-
}
|
|
45
|
-
if (validation.warnings.length > 0 && shouldLog) {
|
|
46
|
-
logger.warn({ warnings: validation.warnings }, "Validation warnings");
|
|
47
|
-
}
|
|
48
|
-
if (!options.silent) {
|
|
49
|
-
displayProjectInfo(projectInfo);
|
|
50
|
-
}
|
|
51
|
-
const configPath = getConfigPath(cwd);
|
|
52
|
-
const configExists = await fileExists(configPath);
|
|
53
|
-
let shouldOverwriteConfig = forceOverwrite;
|
|
54
|
-
if (configExists && !options.force) {
|
|
55
|
-
const { overwrite } = await prompts({
|
|
56
|
-
type: "confirm",
|
|
57
|
-
name: "overwrite",
|
|
58
|
-
message: "Configuration already exists. Do you want to overwrite it?",
|
|
59
|
-
initial: false,
|
|
60
|
-
});
|
|
61
|
-
if (!overwrite) {
|
|
62
|
-
logger.info("Initialization cancelled");
|
|
63
|
-
process.exit(0);
|
|
64
|
-
}
|
|
65
|
-
shouldOverwriteConfig = true;
|
|
66
|
-
}
|
|
67
|
-
spinner?.start("Checking dependencies...");
|
|
68
|
-
const dependencies = await checkDependencies(cwd, projectInfo);
|
|
69
|
-
spinner?.stop();
|
|
70
|
-
if (dependencies.missing.length > 0) {
|
|
71
|
-
if (shouldLog) {
|
|
72
|
-
logger.warn({ missing: dependencies.missing }, "Missing required dependencies detected");
|
|
73
|
-
}
|
|
74
|
-
const shouldInstall = options.yes
|
|
75
|
-
? true
|
|
76
|
-
: await confirmInstallation(dependencies);
|
|
77
|
-
if (shouldInstall) {
|
|
78
|
-
await installDependencies(cwd, projectInfo, dependencies, spinner);
|
|
79
|
-
}
|
|
80
|
-
else if (shouldLog) {
|
|
81
|
-
logger.warn({ missing: dependencies.missing }, "Skipping dependency installation. Some features may not work properly.");
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (!projectInfo.tailwind) {
|
|
85
|
-
spinner?.start("Setting up Tailwind CSS...");
|
|
86
|
-
await setupTailwind(cwd, projectInfo, options);
|
|
87
|
-
spinner?.succeed("Tailwind CSS configured");
|
|
88
|
-
projectInfo.tailwind = true;
|
|
89
|
-
}
|
|
90
|
-
spinner?.start("Creating configuration...");
|
|
91
|
-
const config = createConfig(projectInfo, options);
|
|
92
|
-
await writeConfig(cwd, config, shouldOverwriteConfig);
|
|
93
|
-
spinner?.succeed("Configuration created");
|
|
94
|
-
spinner?.start("Setting up CSS variables...");
|
|
95
|
-
await setupGlobalStyles(cwd, config, options);
|
|
96
|
-
spinner?.succeed("CSS variables configured");
|
|
97
|
-
if (projectInfo.typescript) {
|
|
98
|
-
spinner?.start("Configuring TypeScript path aliases...");
|
|
99
|
-
await setupTypeScriptPaths(cwd, projectInfo);
|
|
100
|
-
spinner?.succeed("TypeScript path aliases configured");
|
|
101
|
-
}
|
|
102
|
-
if (!options.silent) {
|
|
103
|
-
displaySuccessMessage(projectInfo, config);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
spinner?.fail("Initialization failed");
|
|
108
|
-
logger.error(error.message);
|
|
109
|
-
if (process.env.DEBUG) {
|
|
110
|
-
console.error(error);
|
|
111
|
-
}
|
|
112
|
-
process.exit(1);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import ora from "ora";
|
|
4
|
+
import prompts from "prompts";
|
|
5
|
+
import { getConfigPath, writeConfig } from "../../lib/config.js";
|
|
6
|
+
import { fileExists } from "../../lib/fs.js";
|
|
7
|
+
import { logger } from "../../lib/logger.js";
|
|
8
|
+
import { createConfig } from "./config.js";
|
|
9
|
+
import { checkDependencies, confirmInstallation, installDependencies, } from "./dependencies.js";
|
|
10
|
+
import { directoryExists } from "./filesystem.js";
|
|
11
|
+
import { detectProject, validateProject } from "./project.js";
|
|
12
|
+
import { setupGlobalStyles, setupTailwind } from "./tailwind.js";
|
|
13
|
+
import { setupTypeScriptPaths } from "./tsconfig.js";
|
|
14
|
+
import { displayProjectInfo, displaySuccessMessage } from "./ui.js";
|
|
15
|
+
export const initCommand = new Command("init")
|
|
16
|
+
.description("Initialize a project for trix-ui artifacts")
|
|
17
|
+
.option("-f, --force", "overwrite existing files", false)
|
|
18
|
+
.option("-b, --barrel", "create components/ui/index.ts barrel file", false)
|
|
19
|
+
.option("-c, --cwd <path>", "working directory to init project")
|
|
20
|
+
.option("-y, --yes", "skip confirmation prompts", false)
|
|
21
|
+
.option("-s, --silent", "suppress output messages", false)
|
|
22
|
+
.action(async (options) => {
|
|
23
|
+
const spinner = options.silent ? null : ora({ color: "blue" });
|
|
24
|
+
const shouldLog = !options.silent;
|
|
25
|
+
const forceOverwrite = Boolean(options.force);
|
|
26
|
+
try {
|
|
27
|
+
const cwd = path.resolve(options.cwd || process.cwd());
|
|
28
|
+
if (shouldLog) {
|
|
29
|
+
logger.info({ cwd }, "Initializing trix-ui");
|
|
30
|
+
}
|
|
31
|
+
if (!(await directoryExists(cwd))) {
|
|
32
|
+
logger.error(`Directory does not exist: ${cwd}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
spinner?.start("Detecting project configuration...");
|
|
36
|
+
const projectInfo = await detectProject(cwd);
|
|
37
|
+
spinner?.succeed("Project detected");
|
|
38
|
+
spinner?.start("Validating project setup...");
|
|
39
|
+
const validation = await validateProject(cwd, projectInfo);
|
|
40
|
+
spinner?.stop();
|
|
41
|
+
if (!validation.valid) {
|
|
42
|
+
logger.error({ errors: validation.errors }, "Project does not meet init requirements");
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
if (validation.warnings.length > 0 && shouldLog) {
|
|
46
|
+
logger.warn({ warnings: validation.warnings }, "Validation warnings");
|
|
47
|
+
}
|
|
48
|
+
if (!options.silent) {
|
|
49
|
+
displayProjectInfo(projectInfo);
|
|
50
|
+
}
|
|
51
|
+
const configPath = getConfigPath(cwd);
|
|
52
|
+
const configExists = await fileExists(configPath);
|
|
53
|
+
let shouldOverwriteConfig = forceOverwrite;
|
|
54
|
+
if (configExists && !options.force) {
|
|
55
|
+
const { overwrite } = await prompts({
|
|
56
|
+
type: "confirm",
|
|
57
|
+
name: "overwrite",
|
|
58
|
+
message: "Configuration already exists. Do you want to overwrite it?",
|
|
59
|
+
initial: false,
|
|
60
|
+
});
|
|
61
|
+
if (!overwrite) {
|
|
62
|
+
logger.info("Initialization cancelled");
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
shouldOverwriteConfig = true;
|
|
66
|
+
}
|
|
67
|
+
spinner?.start("Checking dependencies...");
|
|
68
|
+
const dependencies = await checkDependencies(cwd, projectInfo);
|
|
69
|
+
spinner?.stop();
|
|
70
|
+
if (dependencies.missing.length > 0) {
|
|
71
|
+
if (shouldLog) {
|
|
72
|
+
logger.warn({ missing: dependencies.missing }, "Missing required dependencies detected");
|
|
73
|
+
}
|
|
74
|
+
const shouldInstall = options.yes
|
|
75
|
+
? true
|
|
76
|
+
: await confirmInstallation(dependencies);
|
|
77
|
+
if (shouldInstall) {
|
|
78
|
+
await installDependencies(cwd, projectInfo, dependencies, spinner);
|
|
79
|
+
}
|
|
80
|
+
else if (shouldLog) {
|
|
81
|
+
logger.warn({ missing: dependencies.missing }, "Skipping dependency installation. Some features may not work properly.");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!projectInfo.tailwind) {
|
|
85
|
+
spinner?.start("Setting up Tailwind CSS...");
|
|
86
|
+
await setupTailwind(cwd, projectInfo, options);
|
|
87
|
+
spinner?.succeed("Tailwind CSS configured");
|
|
88
|
+
projectInfo.tailwind = true;
|
|
89
|
+
}
|
|
90
|
+
spinner?.start("Creating configuration...");
|
|
91
|
+
const config = createConfig(projectInfo, options);
|
|
92
|
+
await writeConfig(cwd, config, shouldOverwriteConfig);
|
|
93
|
+
spinner?.succeed("Configuration created");
|
|
94
|
+
spinner?.start("Setting up CSS variables...");
|
|
95
|
+
await setupGlobalStyles(cwd, config, options);
|
|
96
|
+
spinner?.succeed("CSS variables configured");
|
|
97
|
+
if (projectInfo.typescript) {
|
|
98
|
+
spinner?.start("Configuring TypeScript path aliases...");
|
|
99
|
+
await setupTypeScriptPaths(cwd, projectInfo);
|
|
100
|
+
spinner?.succeed("TypeScript path aliases configured");
|
|
101
|
+
}
|
|
102
|
+
if (!options.silent) {
|
|
103
|
+
displaySuccessMessage(projectInfo, config);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
spinner?.fail("Initialization failed");
|
|
108
|
+
logger.error(error.message);
|
|
109
|
+
if (process.env.DEBUG) {
|
|
110
|
+
console.error(error);
|
|
111
|
+
}
|
|
112
|
+
process.exit(1);
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
115
|
//# sourceMappingURL=command.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { InitConfig, InitOptions, ProjectInfo } from "./types.js";
|
|
2
|
-
export declare function createConfig(projectInfo: ProjectInfo, options: InitOptions): InitConfig;
|
|
1
|
+
import type { InitConfig, InitOptions, ProjectInfo } from "./types.js";
|
|
2
|
+
export declare function createConfig(projectInfo: ProjectInfo, options: InitOptions): InitConfig;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { DEFAULT_CONFIG } from "../../lib/config.js";
|
|
3
|
-
export function createConfig(projectInfo, options) {
|
|
4
|
-
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
5
|
-
const ext = projectInfo.typescript ? "ts" : "js";
|
|
6
|
-
const stylesPath = projectInfo.framework === "next"
|
|
7
|
-
? "globals.css"
|
|
8
|
-
: projectInfo.srcDir
|
|
9
|
-
? path.join("src", "globals.css")
|
|
10
|
-
: "globals.css";
|
|
11
|
-
return {
|
|
12
|
-
...DEFAULT_CONFIG,
|
|
13
|
-
barrel: Boolean(options.barrel),
|
|
14
|
-
typescript: projectInfo.typescript,
|
|
15
|
-
framework: projectInfo.framework,
|
|
16
|
-
paths: {
|
|
17
|
-
components: path.join(baseDir, "components/ui"),
|
|
18
|
-
sections: path.join(baseDir, "components/sections"),
|
|
19
|
-
wrappers: path.join(baseDir, "components/wrappers"),
|
|
20
|
-
composites: path.join(baseDir, "components/composites"),
|
|
21
|
-
utils: path.join(baseDir, "lib", `utils.${ext}`),
|
|
22
|
-
styles: stylesPath
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { DEFAULT_CONFIG } from "../../lib/config.js";
|
|
3
|
+
export function createConfig(projectInfo, options) {
|
|
4
|
+
const baseDir = projectInfo.srcDir ? "src" : ".";
|
|
5
|
+
const ext = projectInfo.typescript ? "ts" : "js";
|
|
6
|
+
const stylesPath = projectInfo.framework === "next"
|
|
7
|
+
? "globals.css"
|
|
8
|
+
: projectInfo.srcDir
|
|
9
|
+
? path.join("src", "globals.css")
|
|
10
|
+
: "globals.css";
|
|
11
|
+
return {
|
|
12
|
+
...DEFAULT_CONFIG,
|
|
13
|
+
barrel: Boolean(options.barrel),
|
|
14
|
+
typescript: projectInfo.typescript,
|
|
15
|
+
framework: projectInfo.framework,
|
|
16
|
+
paths: {
|
|
17
|
+
components: path.join(baseDir, "components/ui"),
|
|
18
|
+
sections: path.join(baseDir, "components/sections"),
|
|
19
|
+
wrappers: path.join(baseDir, "components/wrappers"),
|
|
20
|
+
composites: path.join(baseDir, "components/composites"),
|
|
21
|
+
utils: path.join(baseDir, "lib", `utils.${ext}`),
|
|
22
|
+
styles: stylesPath
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
26
|
//# sourceMappingURL=config.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Framework } from "./types.js";
|
|
2
|
-
export declare const TAILWIND_CONTENT_PATHS: Record<Framework, string[]>;
|
|
3
|
-
export declare const BASE_CSS_VARS = "@import \"tailwindcss\";\n\n@custom-variant dark (&:is(.dark *));\n\n@theme inline {\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --font-sans: var(--font-geist-sans);\n --font-mono: var(--font-geist-mono);\n --color-sidebar-ring: var(--sidebar-ring);\n --color-sidebar-border: var(--sidebar-border);\n --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);\n --color-sidebar-accent: var(--sidebar-accent);\n --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);\n --color-sidebar-primary: var(--sidebar-primary);\n --color-sidebar-foreground: var(--sidebar-foreground);\n --color-sidebar: var(--sidebar);\n --color-ring: var(--ring);\n --color-input: var(--input);\n --color-border: var(--border);\n --color-destructive: var(--destructive);\n --color-accent-foreground: var(--accent-foreground);\n --color-accent: var(--accent);\n --color-muted-foreground: var(--muted-foreground);\n --color-muted: var(--muted);\n --color-secondary-foreground: var(--secondary-foreground);\n --color-secondary: var(--secondary);\n --color-primary-foreground: var(--primary-foreground);\n --color-primary: var(--primary);\n --color-popover-foreground: var(--popover-foreground);\n --color-popover: var(--popover);\n --color-card-foreground: var(--card-foreground);\n --color-card: var(--card);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n --radius-2xl: calc(var(--radius) + 8px);\n --radius-3xl: calc(var(--radius) + 12px);\n --radius-4xl: calc(var(--radius) + 16px);\n}\n\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(54.61% 0.215 262.88);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(54.61% 0.215 262.88);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n}\n\n@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n";
|
|
1
|
+
import type { Framework } from "./types.js";
|
|
2
|
+
export declare const TAILWIND_CONTENT_PATHS: Record<Framework, string[]>;
|
|
3
|
+
export declare const BASE_CSS_VARS = "@import \"tailwindcss\";\n\n@custom-variant dark (&:is(.dark *));\n\n@theme inline {\n --color-background: var(--background);\n --color-foreground: var(--foreground);\n --font-sans: var(--font-geist-sans);\n --font-mono: var(--font-geist-mono);\n --color-sidebar-ring: var(--sidebar-ring);\n --color-sidebar-border: var(--sidebar-border);\n --color-sidebar-accent-foreground: var(--sidebar-accent-foreground);\n --color-sidebar-accent: var(--sidebar-accent);\n --color-sidebar-primary-foreground: var(--sidebar-primary-foreground);\n --color-sidebar-primary: var(--sidebar-primary);\n --color-sidebar-foreground: var(--sidebar-foreground);\n --color-sidebar: var(--sidebar);\n --color-ring: var(--ring);\n --color-input: var(--input);\n --color-border: var(--border);\n --color-destructive: var(--destructive);\n --color-accent-foreground: var(--accent-foreground);\n --color-accent: var(--accent);\n --color-muted-foreground: var(--muted-foreground);\n --color-muted: var(--muted);\n --color-secondary-foreground: var(--secondary-foreground);\n --color-secondary: var(--secondary);\n --color-primary-foreground: var(--primary-foreground);\n --color-primary: var(--primary);\n --color-popover-foreground: var(--popover-foreground);\n --color-popover: var(--popover);\n --color-card-foreground: var(--card-foreground);\n --color-card: var(--card);\n --radius-sm: calc(var(--radius) - 4px);\n --radius-md: calc(var(--radius) - 2px);\n --radius-lg: var(--radius);\n --radius-xl: calc(var(--radius) + 4px);\n --radius-2xl: calc(var(--radius) + 8px);\n --radius-3xl: calc(var(--radius) + 12px);\n --radius-4xl: calc(var(--radius) + 16px);\n}\n\n:root {\n --radius: 0.625rem;\n --background: oklch(1 0 0);\n --foreground: oklch(0.145 0 0);\n --card: oklch(1 0 0);\n --card-foreground: oklch(0.145 0 0);\n --popover: oklch(1 0 0);\n --popover-foreground: oklch(0.145 0 0);\n --primary: oklch(54.61% 0.215 262.88);\n --primary-foreground: oklch(0.985 0 0);\n --secondary: oklch(0.97 0 0);\n --secondary-foreground: oklch(0.205 0 0);\n --muted: oklch(0.97 0 0);\n --muted-foreground: oklch(0.556 0 0);\n --accent: oklch(0.97 0 0);\n --accent-foreground: oklch(0.205 0 0);\n --destructive: oklch(0.577 0.245 27.325);\n --border: oklch(0.922 0 0);\n --input: oklch(0.922 0 0);\n --ring: oklch(0.708 0 0);\n}\n\n.dark {\n --background: oklch(0.145 0 0);\n --foreground: oklch(0.985 0 0);\n --card: oklch(0.205 0 0);\n --card-foreground: oklch(0.985 0 0);\n --popover: oklch(0.205 0 0);\n --popover-foreground: oklch(0.985 0 0);\n --primary: oklch(54.61% 0.215 262.88);\n --primary-foreground: oklch(0.205 0 0);\n --secondary: oklch(0.269 0 0);\n --secondary-foreground: oklch(0.985 0 0);\n --muted: oklch(0.269 0 0);\n --muted-foreground: oklch(0.708 0 0);\n --accent: oklch(0.269 0 0);\n --accent-foreground: oklch(0.985 0 0);\n --destructive: oklch(0.704 0.191 22.216);\n --border: oklch(1 0 0 / 10%);\n --input: oklch(1 0 0 / 15%);\n --ring: oklch(0.556 0 0);\n}\n\n@layer base {\n * {\n @apply border-border outline-ring/50;\n }\n body {\n @apply bg-background text-foreground;\n }\n}\n";
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
export const TAILWIND_CONTENT_PATHS = {
|
|
2
|
-
next: [
|
|
3
|
-
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
4
|
-
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
5
|
-
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
6
|
-
"./src/**/*.{js,ts,jsx,tsx,mdx}"
|
|
7
|
-
],
|
|
8
|
-
react: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"],
|
|
9
|
-
vite: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"],
|
|
10
|
-
unknown: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"]
|
|
11
|
-
};
|
|
12
|
-
export const BASE_CSS_VARS = `@import "tailwindcss";
|
|
13
|
-
|
|
14
|
-
@custom-variant dark (&:is(.dark *));
|
|
15
|
-
|
|
16
|
-
@theme inline {
|
|
17
|
-
--color-background: var(--background);
|
|
18
|
-
--color-foreground: var(--foreground);
|
|
19
|
-
--font-sans: var(--font-geist-sans);
|
|
20
|
-
--font-mono: var(--font-geist-mono);
|
|
21
|
-
--color-sidebar-ring: var(--sidebar-ring);
|
|
22
|
-
--color-sidebar-border: var(--sidebar-border);
|
|
23
|
-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
24
|
-
--color-sidebar-accent: var(--sidebar-accent);
|
|
25
|
-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
26
|
-
--color-sidebar-primary: var(--sidebar-primary);
|
|
27
|
-
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
28
|
-
--color-sidebar: var(--sidebar);
|
|
29
|
-
--color-ring: var(--ring);
|
|
30
|
-
--color-input: var(--input);
|
|
31
|
-
--color-border: var(--border);
|
|
32
|
-
--color-destructive: var(--destructive);
|
|
33
|
-
--color-accent-foreground: var(--accent-foreground);
|
|
34
|
-
--color-accent: var(--accent);
|
|
35
|
-
--color-muted-foreground: var(--muted-foreground);
|
|
36
|
-
--color-muted: var(--muted);
|
|
37
|
-
--color-secondary-foreground: var(--secondary-foreground);
|
|
38
|
-
--color-secondary: var(--secondary);
|
|
39
|
-
--color-primary-foreground: var(--primary-foreground);
|
|
40
|
-
--color-primary: var(--primary);
|
|
41
|
-
--color-popover-foreground: var(--popover-foreground);
|
|
42
|
-
--color-popover: var(--popover);
|
|
43
|
-
--color-card-foreground: var(--card-foreground);
|
|
44
|
-
--color-card: var(--card);
|
|
45
|
-
--radius-sm: calc(var(--radius) - 4px);
|
|
46
|
-
--radius-md: calc(var(--radius) - 2px);
|
|
47
|
-
--radius-lg: var(--radius);
|
|
48
|
-
--radius-xl: calc(var(--radius) + 4px);
|
|
49
|
-
--radius-2xl: calc(var(--radius) + 8px);
|
|
50
|
-
--radius-3xl: calc(var(--radius) + 12px);
|
|
51
|
-
--radius-4xl: calc(var(--radius) + 16px);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
:root {
|
|
55
|
-
--radius: 0.625rem;
|
|
56
|
-
--background: oklch(1 0 0);
|
|
57
|
-
--foreground: oklch(0.145 0 0);
|
|
58
|
-
--card: oklch(1 0 0);
|
|
59
|
-
--card-foreground: oklch(0.145 0 0);
|
|
60
|
-
--popover: oklch(1 0 0);
|
|
61
|
-
--popover-foreground: oklch(0.145 0 0);
|
|
62
|
-
--primary: oklch(54.61% 0.215 262.88);
|
|
63
|
-
--primary-foreground: oklch(0.985 0 0);
|
|
64
|
-
--secondary: oklch(0.97 0 0);
|
|
65
|
-
--secondary-foreground: oklch(0.205 0 0);
|
|
66
|
-
--muted: oklch(0.97 0 0);
|
|
67
|
-
--muted-foreground: oklch(0.556 0 0);
|
|
68
|
-
--accent: oklch(0.97 0 0);
|
|
69
|
-
--accent-foreground: oklch(0.205 0 0);
|
|
70
|
-
--destructive: oklch(0.577 0.245 27.325);
|
|
71
|
-
--border: oklch(0.922 0 0);
|
|
72
|
-
--input: oklch(0.922 0 0);
|
|
73
|
-
--ring: oklch(0.708 0 0);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.dark {
|
|
77
|
-
--background: oklch(0.145 0 0);
|
|
78
|
-
--foreground: oklch(0.985 0 0);
|
|
79
|
-
--card: oklch(0.205 0 0);
|
|
80
|
-
--card-foreground: oklch(0.985 0 0);
|
|
81
|
-
--popover: oklch(0.205 0 0);
|
|
82
|
-
--popover-foreground: oklch(0.985 0 0);
|
|
83
|
-
--primary: oklch(54.61% 0.215 262.88);
|
|
84
|
-
--primary-foreground: oklch(0.205 0 0);
|
|
85
|
-
--secondary: oklch(0.269 0 0);
|
|
86
|
-
--secondary-foreground: oklch(0.985 0 0);
|
|
87
|
-
--muted: oklch(0.269 0 0);
|
|
88
|
-
--muted-foreground: oklch(0.708 0 0);
|
|
89
|
-
--accent: oklch(0.269 0 0);
|
|
90
|
-
--accent-foreground: oklch(0.985 0 0);
|
|
91
|
-
--destructive: oklch(0.704 0.191 22.216);
|
|
92
|
-
--border: oklch(1 0 0 / 10%);
|
|
93
|
-
--input: oklch(1 0 0 / 15%);
|
|
94
|
-
--ring: oklch(0.556 0 0);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@layer base {
|
|
98
|
-
* {
|
|
99
|
-
@apply border-border outline-ring/50;
|
|
100
|
-
}
|
|
101
|
-
body {
|
|
102
|
-
@apply bg-background text-foreground;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
`;
|
|
1
|
+
export const TAILWIND_CONTENT_PATHS = {
|
|
2
|
+
next: [
|
|
3
|
+
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
|
4
|
+
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
|
5
|
+
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
|
6
|
+
"./src/**/*.{js,ts,jsx,tsx,mdx}"
|
|
7
|
+
],
|
|
8
|
+
react: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"],
|
|
9
|
+
vite: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"],
|
|
10
|
+
unknown: ["./src/**/*.{js,ts,jsx,tsx}", "./index.html"]
|
|
11
|
+
};
|
|
12
|
+
export const BASE_CSS_VARS = `@import "tailwindcss";
|
|
13
|
+
|
|
14
|
+
@custom-variant dark (&:is(.dark *));
|
|
15
|
+
|
|
16
|
+
@theme inline {
|
|
17
|
+
--color-background: var(--background);
|
|
18
|
+
--color-foreground: var(--foreground);
|
|
19
|
+
--font-sans: var(--font-geist-sans);
|
|
20
|
+
--font-mono: var(--font-geist-mono);
|
|
21
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
22
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
23
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
24
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
25
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
26
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
27
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
28
|
+
--color-sidebar: var(--sidebar);
|
|
29
|
+
--color-ring: var(--ring);
|
|
30
|
+
--color-input: var(--input);
|
|
31
|
+
--color-border: var(--border);
|
|
32
|
+
--color-destructive: var(--destructive);
|
|
33
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
34
|
+
--color-accent: var(--accent);
|
|
35
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
36
|
+
--color-muted: var(--muted);
|
|
37
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
38
|
+
--color-secondary: var(--secondary);
|
|
39
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
40
|
+
--color-primary: var(--primary);
|
|
41
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
42
|
+
--color-popover: var(--popover);
|
|
43
|
+
--color-card-foreground: var(--card-foreground);
|
|
44
|
+
--color-card: var(--card);
|
|
45
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
46
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
47
|
+
--radius-lg: var(--radius);
|
|
48
|
+
--radius-xl: calc(var(--radius) + 4px);
|
|
49
|
+
--radius-2xl: calc(var(--radius) + 8px);
|
|
50
|
+
--radius-3xl: calc(var(--radius) + 12px);
|
|
51
|
+
--radius-4xl: calc(var(--radius) + 16px);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:root {
|
|
55
|
+
--radius: 0.625rem;
|
|
56
|
+
--background: oklch(1 0 0);
|
|
57
|
+
--foreground: oklch(0.145 0 0);
|
|
58
|
+
--card: oklch(1 0 0);
|
|
59
|
+
--card-foreground: oklch(0.145 0 0);
|
|
60
|
+
--popover: oklch(1 0 0);
|
|
61
|
+
--popover-foreground: oklch(0.145 0 0);
|
|
62
|
+
--primary: oklch(54.61% 0.215 262.88);
|
|
63
|
+
--primary-foreground: oklch(0.985 0 0);
|
|
64
|
+
--secondary: oklch(0.97 0 0);
|
|
65
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
66
|
+
--muted: oklch(0.97 0 0);
|
|
67
|
+
--muted-foreground: oklch(0.556 0 0);
|
|
68
|
+
--accent: oklch(0.97 0 0);
|
|
69
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
70
|
+
--destructive: oklch(0.577 0.245 27.325);
|
|
71
|
+
--border: oklch(0.922 0 0);
|
|
72
|
+
--input: oklch(0.922 0 0);
|
|
73
|
+
--ring: oklch(0.708 0 0);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dark {
|
|
77
|
+
--background: oklch(0.145 0 0);
|
|
78
|
+
--foreground: oklch(0.985 0 0);
|
|
79
|
+
--card: oklch(0.205 0 0);
|
|
80
|
+
--card-foreground: oklch(0.985 0 0);
|
|
81
|
+
--popover: oklch(0.205 0 0);
|
|
82
|
+
--popover-foreground: oklch(0.985 0 0);
|
|
83
|
+
--primary: oklch(54.61% 0.215 262.88);
|
|
84
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
85
|
+
--secondary: oklch(0.269 0 0);
|
|
86
|
+
--secondary-foreground: oklch(0.985 0 0);
|
|
87
|
+
--muted: oklch(0.269 0 0);
|
|
88
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
89
|
+
--accent: oklch(0.269 0 0);
|
|
90
|
+
--accent-foreground: oklch(0.985 0 0);
|
|
91
|
+
--destructive: oklch(0.704 0.191 22.216);
|
|
92
|
+
--border: oklch(1 0 0 / 10%);
|
|
93
|
+
--input: oklch(1 0 0 / 15%);
|
|
94
|
+
--ring: oklch(0.556 0 0);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@layer base {
|
|
98
|
+
* {
|
|
99
|
+
@apply border-border outline-ring/50;
|
|
100
|
+
}
|
|
101
|
+
body {
|
|
102
|
+
@apply bg-background text-foreground;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
106
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Ora } from "ora";
|
|
2
|
-
import type { DependencyInstallation, ProjectInfo } from "./types.js";
|
|
3
|
-
export declare function checkDependencies(cwd: string, projectInfo: ProjectInfo): Promise<DependencyInstallation>;
|
|
4
|
-
export declare function confirmInstallation(dependencies: DependencyInstallation): Promise<boolean>;
|
|
5
|
-
export declare function installDependencies(cwd: string, projectInfo: ProjectInfo, dependencies: DependencyInstallation, spinner: Ora | null): Promise<void>;
|
|
1
|
+
import type { Ora } from "ora";
|
|
2
|
+
import type { DependencyInstallation, ProjectInfo } from "./types.js";
|
|
3
|
+
export declare function checkDependencies(cwd: string, projectInfo: ProjectInfo): Promise<DependencyInstallation>;
|
|
4
|
+
export declare function confirmInstallation(dependencies: DependencyInstallation): Promise<boolean>;
|
|
5
|
+
export declare function installDependencies(cwd: string, projectInfo: ProjectInfo, dependencies: DependencyInstallation, spinner: Ora | null): Promise<void>;
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { execa } from "execa";
|
|
2
|
-
import prompts from "prompts";
|
|
3
|
-
import { collectDependencies, readPackageJson } from "./package-json.js";
|
|
4
|
-
export async function checkDependencies(cwd, projectInfo) {
|
|
5
|
-
const packageJson = await readPackageJson(cwd);
|
|
6
|
-
const allDeps = collectDependencies(packageJson);
|
|
7
|
-
const required = [];
|
|
8
|
-
const devDependencies = projectInfo.tailwind
|
|
9
|
-
? []
|
|
10
|
-
: ["tailwindcss", "@tailwindcss/postcss"];
|
|
11
|
-
const missing = [
|
|
12
|
-
...required.filter((dep) => !allDeps[dep]),
|
|
13
|
-
...devDependencies.filter((dep) => !allDeps[dep])
|
|
14
|
-
];
|
|
15
|
-
return {
|
|
16
|
-
required,
|
|
17
|
-
devDependencies,
|
|
18
|
-
missing
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
export async function confirmInstallation(dependencies) {
|
|
22
|
-
const { shouldInstall } = await prompts({
|
|
23
|
-
type: "confirm",
|
|
24
|
-
name: "shouldInstall",
|
|
25
|
-
message: `Install missing dependencies? (${dependencies.missing.join(", ")})`,
|
|
26
|
-
initial: true
|
|
27
|
-
});
|
|
28
|
-
return shouldInstall;
|
|
29
|
-
}
|
|
30
|
-
export async function installDependencies(cwd, projectInfo, dependencies, spinner) {
|
|
31
|
-
const requiredMissing = dependencies.missing.filter((dep) => dependencies.required.includes(dep));
|
|
32
|
-
const devMissing = dependencies.missing.filter((dep) => dependencies.devDependencies.includes(dep));
|
|
33
|
-
const pm = projectInfo.packageManager;
|
|
34
|
-
const installCmd = pm === "npm" ? "install" : "add";
|
|
35
|
-
try {
|
|
36
|
-
if (requiredMissing.length > 0) {
|
|
37
|
-
spinner?.start(`Installing dependencies with ${pm}...`);
|
|
38
|
-
await execa(pm, [installCmd, ...requiredMissing], { cwd });
|
|
39
|
-
spinner?.succeed("Dependencies installed");
|
|
40
|
-
}
|
|
41
|
-
if (devMissing.length > 0) {
|
|
42
|
-
spinner?.start(`Installing dev dependencies with ${pm}...`);
|
|
43
|
-
const devFlag = pm === "npm" ? "--save-dev" : "-D";
|
|
44
|
-
await execa(pm, [installCmd, devFlag, ...devMissing], { cwd });
|
|
45
|
-
spinner?.succeed("Dev dependencies installed");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (error) {
|
|
49
|
-
spinner?.fail("Failed to install dependencies");
|
|
50
|
-
throw new Error(`Failed to install dependencies: ${error.message}`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
1
|
+
import { execa } from "execa";
|
|
2
|
+
import prompts from "prompts";
|
|
3
|
+
import { collectDependencies, readPackageJson } from "./package-json.js";
|
|
4
|
+
export async function checkDependencies(cwd, projectInfo) {
|
|
5
|
+
const packageJson = await readPackageJson(cwd);
|
|
6
|
+
const allDeps = collectDependencies(packageJson);
|
|
7
|
+
const required = [];
|
|
8
|
+
const devDependencies = projectInfo.tailwind
|
|
9
|
+
? []
|
|
10
|
+
: ["tailwindcss", "@tailwindcss/postcss"];
|
|
11
|
+
const missing = [
|
|
12
|
+
...required.filter((dep) => !allDeps[dep]),
|
|
13
|
+
...devDependencies.filter((dep) => !allDeps[dep])
|
|
14
|
+
];
|
|
15
|
+
return {
|
|
16
|
+
required,
|
|
17
|
+
devDependencies,
|
|
18
|
+
missing
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export async function confirmInstallation(dependencies) {
|
|
22
|
+
const { shouldInstall } = await prompts({
|
|
23
|
+
type: "confirm",
|
|
24
|
+
name: "shouldInstall",
|
|
25
|
+
message: `Install missing dependencies? (${dependencies.missing.join(", ")})`,
|
|
26
|
+
initial: true
|
|
27
|
+
});
|
|
28
|
+
return shouldInstall;
|
|
29
|
+
}
|
|
30
|
+
export async function installDependencies(cwd, projectInfo, dependencies, spinner) {
|
|
31
|
+
const requiredMissing = dependencies.missing.filter((dep) => dependencies.required.includes(dep));
|
|
32
|
+
const devMissing = dependencies.missing.filter((dep) => dependencies.devDependencies.includes(dep));
|
|
33
|
+
const pm = projectInfo.packageManager;
|
|
34
|
+
const installCmd = pm === "npm" ? "install" : "add";
|
|
35
|
+
try {
|
|
36
|
+
if (requiredMissing.length > 0) {
|
|
37
|
+
spinner?.start(`Installing dependencies with ${pm}...`);
|
|
38
|
+
await execa(pm, [installCmd, ...requiredMissing], { cwd });
|
|
39
|
+
spinner?.succeed("Dependencies installed");
|
|
40
|
+
}
|
|
41
|
+
if (devMissing.length > 0) {
|
|
42
|
+
spinner?.start(`Installing dev dependencies with ${pm}...`);
|
|
43
|
+
const devFlag = pm === "npm" ? "--save-dev" : "-D";
|
|
44
|
+
await execa(pm, [installCmd, devFlag, ...devMissing], { cwd });
|
|
45
|
+
spinner?.succeed("Dev dependencies installed");
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
spinner?.fail("Failed to install dependencies");
|
|
50
|
+
throw new Error(`Failed to install dependencies: ${error.message}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
53
|
//# sourceMappingURL=dependencies.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function directoryExists(dir: string): Promise<boolean>;
|
|
1
|
+
export declare function directoryExists(dir: string): Promise<boolean>;
|