create-kimesh 0.2.1 → 0.2.2
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.js +1 -1
- package/dist/{main-DgdkY0zh.js → main-B1WNBwTB.js} +24 -7
- package/dist/main.js +1 -1
- package/dist/run.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { AVAILABLE_MODULES, getModule, getModuleDisplayHint, getModuleIds, hasUnmetDependencies, isValidModuleId, main, parseModulesArg, promptDirectoryConflict, promptModuleSelection, promptNewDirectoryName, promptProjectName, resolveModules, scaffoldProject, validateProjectName } from "./main-
|
|
1
|
+
import { AVAILABLE_MODULES, getModule, getModuleDisplayHint, getModuleIds, hasUnmetDependencies, isValidModuleId, main, parseModulesArg, promptDirectoryConflict, promptModuleSelection, promptNewDirectoryName, promptProjectName, resolveModules, scaffoldProject, validateProjectName } from "./main-B1WNBwTB.js";
|
|
2
2
|
|
|
3
3
|
export { AVAILABLE_MODULES, getModule, getModuleDisplayHint, getModuleIds, hasUnmetDependencies, isValidModuleId, main, parseModulesArg, promptDirectoryConflict, promptModuleSelection, promptNewDirectoryName, promptProjectName, resolveModules, scaffoldProject, validateProjectName };
|
|
@@ -1,12 +1,28 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
2
|
-
import { join, resolve } from "node:path";
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import consola from "consola";
|
|
5
5
|
import pc from "picocolors";
|
|
6
6
|
import { mkdir, rm, writeFile } from "node:fs/promises";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
7
8
|
|
|
8
9
|
//#region src/scaffold/index.ts
|
|
9
10
|
/**
|
|
11
|
+
* Get the kimesh version from package.json.
|
|
12
|
+
* Reads from the create-kimesh package.json which shares the same version.
|
|
13
|
+
*/
|
|
14
|
+
function getKimeshVersion() {
|
|
15
|
+
try {
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = dirname(__filename);
|
|
18
|
+
const packageJsonPath = join(__dirname, "..", "package.json");
|
|
19
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
20
|
+
return `^${packageJson.version}`;
|
|
21
|
+
} catch {
|
|
22
|
+
return "^0.2.0";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
10
26
|
* Scaffold a new Kimesh project with the given options
|
|
11
27
|
*/
|
|
12
28
|
async function scaffoldProject(options) {
|
|
@@ -45,12 +61,13 @@ async function scaffoldProject(options) {
|
|
|
45
61
|
}
|
|
46
62
|
}
|
|
47
63
|
function generatePackageJson(projectName, modules) {
|
|
64
|
+
const kimeshVersion = getKimeshVersion();
|
|
48
65
|
const dependencies = {
|
|
49
66
|
vue: "^3.5.0",
|
|
50
67
|
"vue-router": "^4.4.0"
|
|
51
68
|
};
|
|
52
69
|
const devDependencies = {
|
|
53
|
-
kimesh:
|
|
70
|
+
kimesh: kimeshVersion,
|
|
54
71
|
typescript: "^5.7.0",
|
|
55
72
|
vite: "^6.0.0",
|
|
56
73
|
"@types/node": "^22.0.0"
|
|
@@ -59,11 +76,11 @@ function generatePackageJson(projectName, modules) {
|
|
|
59
76
|
if (module.id === "tailwindcss") {
|
|
60
77
|
devDependencies["tailwindcss"] = "^4.0.0";
|
|
61
78
|
devDependencies["@tailwindcss/vite"] = "^4.0.0";
|
|
62
|
-
devDependencies["@kimesh/tailwindcss"] =
|
|
79
|
+
devDependencies["@kimesh/tailwindcss"] = kimeshVersion;
|
|
63
80
|
}
|
|
64
81
|
if (module.id === "pinia") {
|
|
65
82
|
dependencies["pinia"] = "^3.0.0";
|
|
66
|
-
devDependencies["@kimesh/pinia"] =
|
|
83
|
+
devDependencies["@kimesh/pinia"] = kimeshVersion;
|
|
67
84
|
}
|
|
68
85
|
}
|
|
69
86
|
return {
|
|
@@ -540,8 +557,8 @@ const CONFLICT_OPTIONS = [
|
|
|
540
557
|
* @param dirname - The name of the existing directory
|
|
541
558
|
* @returns The chosen action: 'override', 'different', or 'abort'
|
|
542
559
|
*/
|
|
543
|
-
async function promptDirectoryConflict(dirname) {
|
|
544
|
-
const result = await consola.prompt(`Directory "${dirname}" already exists. What would you like to do?`, {
|
|
560
|
+
async function promptDirectoryConflict(dirname$1) {
|
|
561
|
+
const result = await consola.prompt(`Directory "${dirname$1}" already exists. What would you like to do?`, {
|
|
545
562
|
type: "select",
|
|
546
563
|
options: CONFLICT_OPTIONS
|
|
547
564
|
});
|
package/dist/main.js
CHANGED
package/dist/run.js
CHANGED