create-alistt69-kit 0.1.2 โ 0.1.4
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/README.md
CHANGED
|
@@ -65,7 +65,7 @@ npm create alistt69-kit@latest
|
|
|
65
65
|
Follow the prompts โ or skip them entirely:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npm create alistt69-kit@latest my-app --
|
|
68
|
+
npm create alistt69-kit@latest my-app -- --defaults
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
## ๐ ๏ธ Usage examples
|
|
@@ -75,34 +75,34 @@ npm create alistt69-kit@latest my-app --yes
|
|
|
75
75
|
npm create alistt69-kit@latest my-app
|
|
76
76
|
|
|
77
77
|
# All defaults, no prompts
|
|
78
|
-
npm create alistt69-kit@latest my-app --
|
|
78
|
+
npm create alistt69-kit@latest my-app -- --defaults
|
|
79
79
|
|
|
80
80
|
# Skip dependency installation
|
|
81
|
-
npm create alistt69-kit@latest my-app --no-install
|
|
81
|
+
npm create alistt69-kit@latest my-app -- --no-install
|
|
82
82
|
|
|
83
83
|
# Enable only selected features
|
|
84
|
-
npm create alistt69-kit@latest my-app --features=eslint,react-router
|
|
84
|
+
npm create alistt69-kit@latest my-app -- --features=eslint,react-router
|
|
85
85
|
|
|
86
86
|
# Enable all optional features
|
|
87
|
-
npm create alistt69-kit@latest my-app --features=all
|
|
87
|
+
npm create alistt69-kit@latest my-app -- --features=all
|
|
88
88
|
|
|
89
89
|
# Use pnpm as package manager
|
|
90
|
-
npm create alistt69-kit@latest my-app --pm pnpm
|
|
90
|
+
npm create alistt69-kit@latest my-app -- --pm pnpm
|
|
91
91
|
|
|
92
92
|
# Overwrite existing directory
|
|
93
|
-
npm create alistt69-kit@latest my-app --
|
|
93
|
+
npm create alistt69-kit@latest my-app -- --defaults --overwrite
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## โ๏ธ CLI options
|
|
97
97
|
|
|
98
|
-
| Option | Alias
|
|
99
|
-
|
|
100
|
-
| `--
|
|
101
|
-
| `--overwrite` | โ
|
|
102
|
-
| `--no-install` | โ
|
|
103
|
-
| `--features <list>` | โ
|
|
104
|
-
| `--pm <name>` | โ
|
|
105
|
-
| `--help` | `-h`
|
|
98
|
+
| Option | Alias | Description |
|
|
99
|
+
|--------|--------|-------------|
|
|
100
|
+
| `--defaults` | `-def` | Skip prompts, use defaults |
|
|
101
|
+
| `--overwrite` | โ | Overwrite target directory if it exists |
|
|
102
|
+
| `--no-install` | โ | Skip dependency installation |
|
|
103
|
+
| `--features <list>` | โ | Enable specific features (`eslint`, `react-router`, `all`) |
|
|
104
|
+
| `--pm <name>` | โ | Choose package manager (`npm`, `pnpm`, `yarn`) |
|
|
105
|
+
| `--help` | `-h` | Show help |
|
|
106
106
|
|
|
107
107
|
## ๐งช Default behavior
|
|
108
108
|
|
package/package.json
CHANGED
|
@@ -94,8 +94,8 @@ export async function collectProjectInfo(cliArgs = {}) {
|
|
|
94
94
|
let shouldInstallDependencies = cliArgs.shouldInstallDependencies;
|
|
95
95
|
let packageManager = cliArgs.packageManager;
|
|
96
96
|
|
|
97
|
-
if (cliArgs.
|
|
98
|
-
throw new Error('Project name is required when using --
|
|
97
|
+
if (cliArgs.defaults && !projectName) {
|
|
98
|
+
throw new Error('Project name is required when using --defaults');
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
if (!projectName) {
|
|
@@ -113,7 +113,7 @@ export async function collectProjectInfo(cliArgs = {}) {
|
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
if (selectedFeatureIds === undefined) {
|
|
116
|
-
if (cliArgs.
|
|
116
|
+
if (cliArgs.defaults) {
|
|
117
117
|
selectedFeatureIds = defaultFeatureIds;
|
|
118
118
|
} else {
|
|
119
119
|
note(
|
|
@@ -140,7 +140,7 @@ export async function collectProjectInfo(cliArgs = {}) {
|
|
|
140
140
|
selectedFeatureIds = normalizeFeatureIds(selectedFeatureIds);
|
|
141
141
|
|
|
142
142
|
if (!packageManager) {
|
|
143
|
-
if (cliArgs.
|
|
143
|
+
if (cliArgs.defaults) {
|
|
144
144
|
packageManager = defaultPackageManager;
|
|
145
145
|
} else {
|
|
146
146
|
packageManager = handleCancel(await select({
|
|
@@ -155,7 +155,7 @@ export async function collectProjectInfo(cliArgs = {}) {
|
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
if (shouldInstallDependencies === undefined) {
|
|
158
|
-
if (cliArgs.
|
|
158
|
+
if (cliArgs.defaults) {
|
|
159
159
|
shouldInstallDependencies = true;
|
|
160
160
|
} else {
|
|
161
161
|
shouldInstallDependencies = handleCancel(await confirm({
|
|
@@ -174,7 +174,7 @@ export async function collectProjectInfo(cliArgs = {}) {
|
|
|
174
174
|
|
|
175
175
|
note(summaryLines.join('\n'), format.sectionTitle('Summary'));
|
|
176
176
|
|
|
177
|
-
if (!cliArgs.
|
|
177
|
+
if (!cliArgs.defaults) {
|
|
178
178
|
const shouldContinue = handleCancel(await confirm({
|
|
179
179
|
message: 'Continue?',
|
|
180
180
|
initialValue: true,
|
|
@@ -28,8 +28,8 @@ export function formatHelpMessage() {
|
|
|
28
28
|
' create-alistt69-kit <project-name> [options]',
|
|
29
29
|
'',
|
|
30
30
|
'Options:',
|
|
31
|
-
' -
|
|
32
|
-
' --overwrite
|
|
31
|
+
' -def, --defaults Skip prompts and use defaults',
|
|
32
|
+
' --overwrite Overwrite target directory if it exists',
|
|
33
33
|
' --no-install Do not install dependencies',
|
|
34
34
|
' --features <comma-list> Example: eslint,stylelint,react-router',
|
|
35
35
|
' --features all Enable all features',
|
|
@@ -45,8 +45,8 @@ export function formatHelpMessage() {
|
|
|
45
45
|
' create-alistt69-kit my-app',
|
|
46
46
|
' create-alistt69-kit my-app --features=all',
|
|
47
47
|
' create-alistt69-kit my-app --pm pnpm --no-install',
|
|
48
|
-
' create-alistt69-kit my-app --
|
|
49
|
-
' create-alistt69-kit my-app --
|
|
48
|
+
' create-alistt69-kit my-app --defaults',
|
|
49
|
+
' create-alistt69-kit my-app --defaults --overwrite',
|
|
50
50
|
].join('\n');
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -56,7 +56,7 @@ export function parseCliArgs(argv) {
|
|
|
56
56
|
selectedFeatureIds: undefined,
|
|
57
57
|
shouldInstallDependencies: undefined,
|
|
58
58
|
packageManager: undefined,
|
|
59
|
-
|
|
59
|
+
defaults: false,
|
|
60
60
|
overwrite: false,
|
|
61
61
|
showHelp: false,
|
|
62
62
|
};
|
|
@@ -69,8 +69,8 @@ export function parseCliArgs(argv) {
|
|
|
69
69
|
continue;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
if (arg === '-
|
|
73
|
-
result.
|
|
72
|
+
if (arg === '-def' || arg === '--defaults') {
|
|
73
|
+
result.defaults = true;
|
|
74
74
|
continue;
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -15,7 +15,7 @@ async function pathExists(targetDirPath) {
|
|
|
15
15
|
export async function prepareTargetDirectory({
|
|
16
16
|
projectName,
|
|
17
17
|
overwrite = false,
|
|
18
|
-
|
|
18
|
+
defaults = false,
|
|
19
19
|
}) {
|
|
20
20
|
const targetDirPath = resolve(process.cwd(), projectName);
|
|
21
21
|
const exists = await pathExists(targetDirPath);
|
|
@@ -46,7 +46,7 @@ export async function prepareTargetDirectory({
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
if (
|
|
49
|
+
if (defaults) {
|
|
50
50
|
throw new Error(
|
|
51
51
|
`Directory already exists and is not empty: ${targetDirPath}. Use --overwrite to overwrite it.`,
|
|
52
52
|
);
|