create-commandkit 1.2.0-dev.20251019062347 → 1.2.0-dev.20251019063816
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 +3 -3
- package/dist/utils.d.ts +2 -1
- package/dist/utils.js +10 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -97,8 +97,6 @@ Examples:
|
|
|
97
97
|
console.error(colors.red(`Error: ${dirValidation.error}`));
|
|
98
98
|
process.exit(1);
|
|
99
99
|
}
|
|
100
|
-
// Determine package manager
|
|
101
|
-
const manager = resolvePackageManager(cliOptions);
|
|
102
100
|
// Get Discord token
|
|
103
101
|
let token;
|
|
104
102
|
if (cliOptions.yes) {
|
|
@@ -120,9 +118,11 @@ Examples:
|
|
|
120
118
|
initialValue: true,
|
|
121
119
|
});
|
|
122
120
|
outro(colors.cyan('Setup complete.'));
|
|
121
|
+
const example = cliOptions.example || getDefaultExample(cliOptions);
|
|
122
|
+
// Determine package manager
|
|
123
|
+
const manager = resolvePackageManager(cliOptions, example);
|
|
123
124
|
// Fetch example from GitHub
|
|
124
125
|
try {
|
|
125
|
-
const example = cliOptions.example || getDefaultExample(cliOptions);
|
|
126
126
|
await fetchExample({
|
|
127
127
|
example,
|
|
128
128
|
examplePath: cliOptions.examplePath,
|
package/dist/utils.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export declare function resolvePackageManager(cliOptions: {
|
|
|
18
18
|
useYarn?: boolean;
|
|
19
19
|
useBun?: boolean;
|
|
20
20
|
useDeno?: boolean;
|
|
21
|
-
}): PackageManager;
|
|
21
|
+
}, name: string): PackageManager;
|
|
22
22
|
export declare function getDefaultExample(cliOptions: CLIOptions): string;
|
|
23
23
|
export declare function isOfficialExample(example: string): boolean;
|
|
24
24
|
export declare function getInstallCommand(manager: PackageManager, deps: string[], dev?: boolean): string;
|
|
25
25
|
export declare function fetchAvailableExamples(): Promise<string[]>;
|
|
26
|
+
export declare function isDenoProject(example: string): boolean;
|
package/dist/utils.js
CHANGED
|
@@ -30,9 +30,9 @@ export function getPackageManagerFromCLI(options) {
|
|
|
30
30
|
return 'deno';
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
33
|
-
export function resolvePackageManager(cliOptions) {
|
|
33
|
+
export function resolvePackageManager(cliOptions, name) {
|
|
34
34
|
const cliManager = getPackageManagerFromCLI(cliOptions);
|
|
35
|
-
return cliManager || detectPackageManager();
|
|
35
|
+
return cliManager || (isDenoProject(name) ? 'deno' : detectPackageManager());
|
|
36
36
|
}
|
|
37
37
|
export function getDefaultExample(cliOptions) {
|
|
38
38
|
if (cliOptions.useDeno) {
|
|
@@ -106,3 +106,11 @@ export async function fetchAvailableExamples() {
|
|
|
106
106
|
return ['basic-ts', 'basic-js', 'deno-ts', 'without-cli'];
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
export function isDenoProject(example) {
|
|
110
|
+
const isOfficial = isOfficialExample(example);
|
|
111
|
+
// if it's not an official example, we can assume it's not a Deno project
|
|
112
|
+
// the user may use --use-deno to force a Deno project
|
|
113
|
+
if (!isOfficial)
|
|
114
|
+
return false;
|
|
115
|
+
return example.startsWith('deno-') || example.startsWith('with-deno-');
|
|
116
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-commandkit",
|
|
3
3
|
"description": "Effortlessly create a CommandKit project",
|
|
4
|
-
"version": "1.2.0-dev.
|
|
4
|
+
"version": "1.2.0-dev.20251019063816",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
7
7
|
"bin": "./dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@types/validate-npm-package-name": "^4.0.2",
|
|
44
44
|
"tsx": "^4.20.6",
|
|
45
45
|
"typescript": "^5.8.3",
|
|
46
|
-
"tsconfig": "0.0.0-dev.
|
|
46
|
+
"tsconfig": "0.0.0-dev.20251019063816"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"check-types": "tsc --noEmit",
|