centoui-cli 1.0.0-alpha.28 → 1.0.0-alpha.29
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/index.mjs +9 -13
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -4,11 +4,11 @@ import { cancel, confirm, group, intro, isCancel, log, note, outro, tasks, text
|
|
|
4
4
|
import { dirname, join } from "pathe";
|
|
5
5
|
import fsExtra from "fs-extra";
|
|
6
6
|
import { addDependency, removeDependency } from "nypm";
|
|
7
|
-
import {
|
|
7
|
+
import { loadConfig } from "c12";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/constants.ts
|
|
10
10
|
/** CentoUI current package version, sourced directly from package.json. */
|
|
11
|
-
const VERSION = "1.0.0-alpha.
|
|
11
|
+
const VERSION = "1.0.0-alpha.29";
|
|
12
12
|
/** File name for the user-side CentoUI config (created by `centoui init`). */
|
|
13
13
|
const CONFIG_FILE_NAME = "centoui.config.ts";
|
|
14
14
|
/**
|
|
@@ -190,10 +190,7 @@ async function confirmOverwriteIfExists(label, path) {
|
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region src/utils/config-utils.ts
|
|
192
192
|
/**
|
|
193
|
-
* Loads and returns the user's CentoUI configuration from `centoui.config.ts
|
|
194
|
-
*
|
|
195
|
-
* Uses a dynamic `import()` via a `file://` URL so that TypeScript config files
|
|
196
|
-
* compiled by the user's build tooling are resolved correctly at runtime.
|
|
193
|
+
* Loads and returns the user's CentoUI configuration from `centoui.config.ts` using c12.
|
|
197
194
|
*
|
|
198
195
|
* @param cwd - Absolute path to the project root.
|
|
199
196
|
* @returns The default export of `centoui.config.ts` cast as {@link CentoUIConfig}.
|
|
@@ -201,13 +198,12 @@ async function confirmOverwriteIfExists(label, path) {
|
|
|
201
198
|
* @throws If the file exists but cannot be imported or does not export a default value.
|
|
202
199
|
*/
|
|
203
200
|
async function loadCentoUIConfig(cwd) {
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
201
|
+
const { config, configFile } = await loadConfig({
|
|
202
|
+
name: "centoui",
|
|
203
|
+
cwd
|
|
204
|
+
});
|
|
205
|
+
if (!configFile) throw new Error(`[loadCentoUIConfig] "${CONFIG_FILE_NAME}" not found in "${cwd}". Run \`centoui init\` first.`);
|
|
206
|
+
return config;
|
|
211
207
|
}
|
|
212
208
|
/**
|
|
213
209
|
* Fetches the raw content of the default CentoUI config file from GitHub.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "centoui-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.0-alpha.
|
|
4
|
+
"version": "1.0.0-alpha.29",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Official CLI for CentoUI.",
|
|
7
7
|
"author": "Favour Emeka <favorodera@gmail.com>",
|
|
@@ -30,20 +30,22 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/fs-extra": "^11.0.4",
|
|
33
|
+
"@vitest/ui": "^4.1.5",
|
|
33
34
|
"tsdown": "^0.21.7",
|
|
34
35
|
"type-fest": "^5.6.0",
|
|
35
|
-
"@vitest/ui": "^4.1.5",
|
|
36
36
|
"vitest": "^4.1.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@clack/prompts": "^1.2.0",
|
|
40
|
+
"c12": "4.0.0-beta.5",
|
|
40
41
|
"citty": "^0.2.2",
|
|
41
42
|
"fs-extra": "^11.3.4",
|
|
42
43
|
"nypm": "^0.6.6",
|
|
43
44
|
"pathe": "^2.0.3"
|
|
44
45
|
},
|
|
45
46
|
"engines": {
|
|
46
|
-
"node": ">=22.0.0"
|
|
47
|
+
"node": ">=22.0.0",
|
|
48
|
+
"pnpm": ">=11.0.0"
|
|
47
49
|
},
|
|
48
50
|
"scripts": {
|
|
49
51
|
"build": "tsdown",
|