create-forkly 0.4.2 → 0.6.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/index.js +19 -6
- package/package.json +2 -2
- package/template/package.json +3 -2
- package/template/tsconfig.json +5 -1
package/dist/index.js
CHANGED
|
@@ -25,8 +25,8 @@ function copyDir(src, dest, replaces) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
const cli = cac('
|
|
29
|
-
cli.command('[dir]', 'Create a new Forkly project')
|
|
28
|
+
const cli = cac('forkly');
|
|
29
|
+
cli.command('create [dir]', 'Create a new Forkly project')
|
|
30
30
|
.action(async (dir = '.') => {
|
|
31
31
|
p.intro('Forkly Project Scaffolder');
|
|
32
32
|
const projectName = await p.text({
|
|
@@ -46,6 +46,18 @@ cli.command('[dir]', 'Create a new Forkly project')
|
|
|
46
46
|
p.cancel('Cancelled');
|
|
47
47
|
process.exit(0);
|
|
48
48
|
}
|
|
49
|
+
const pm = await p.select({
|
|
50
|
+
message: 'Select package manager:',
|
|
51
|
+
options: [
|
|
52
|
+
{ value: 'pnpm', label: 'pnpm' },
|
|
53
|
+
{ value: 'npm', label: 'npm' },
|
|
54
|
+
{ value: 'yarn', label: 'yarn' },
|
|
55
|
+
],
|
|
56
|
+
});
|
|
57
|
+
if (p.isCancel(pm)) {
|
|
58
|
+
p.cancel('Cancelled');
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
49
61
|
const targetDir = resolve(process.cwd(), dir === '.' ? projectName : dir);
|
|
50
62
|
const replaces = { 'forkly-app': projectName };
|
|
51
63
|
p.log.step('Copying template files...');
|
|
@@ -61,13 +73,14 @@ cli.command('[dir]', 'Create a new Forkly project')
|
|
|
61
73
|
}
|
|
62
74
|
p.log.step('Installing dependencies...');
|
|
63
75
|
try {
|
|
64
|
-
execSync(
|
|
76
|
+
execSync(`${pm} install`, { cwd: targetDir, stdio: 'inherit' });
|
|
65
77
|
}
|
|
66
78
|
catch {
|
|
67
|
-
p.log.warn(
|
|
79
|
+
p.log.warn(`${pm} install failed. You can run it manually.`);
|
|
68
80
|
}
|
|
69
|
-
|
|
81
|
+
const devCmd = pm === 'npm' ? 'npm run dev' : `${pm} dev`;
|
|
82
|
+
p.outro(`Done! Run:\n cd ${projectName}\n ${devCmd}`);
|
|
70
83
|
});
|
|
71
84
|
cli.help();
|
|
72
|
-
cli.version('0.
|
|
85
|
+
cli.version('0.6.0');
|
|
73
86
|
cli.parse();
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-forkly",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "CLI to scaffold a new Forkly project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"
|
|
7
|
+
"forkly": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"files": ["dist/", "template/"],
|
|
10
10
|
"scripts": {
|
package/template/package.json
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "tsx watch app.ts",
|
|
7
|
-
"build": "tsc"
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"start": "node dist/app.js"
|
|
8
9
|
},
|
|
9
10
|
"dependencies": {
|
|
10
|
-
"forkly": "^0.5.
|
|
11
|
+
"forkly": "^0.5.2"
|
|
11
12
|
},
|
|
12
13
|
"devDependencies": {
|
|
13
14
|
"@types/node": "^25.9.1",
|
package/template/tsconfig.json
CHANGED
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
"rootDir": ".",
|
|
8
8
|
"strict": true,
|
|
9
9
|
"esModuleInterop": true,
|
|
10
|
-
"resolveJsonModule": true
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"sourceMap": true,
|
|
14
|
+
"types": ["node"]
|
|
11
15
|
},
|
|
12
16
|
"include": ["**/*.ts"],
|
|
13
17
|
"exclude": ["node_modules", "dist"]
|