create-rstack 1.7.18 → 1.7.19
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.d.ts +5 -0
- package/dist/index.js +13 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -84,6 +84,11 @@ declare type ExtraTool = {
|
|
|
84
84
|
* The custom command to run when the tool is selected.
|
|
85
85
|
*/
|
|
86
86
|
command?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Specify where to display this tool.
|
|
89
|
+
* If undefined, the tool will be displayed after built-in tools.
|
|
90
|
+
*/
|
|
91
|
+
order?: 'pre' | 'post';
|
|
87
92
|
};
|
|
88
93
|
|
|
89
94
|
/**
|
package/dist/index.js
CHANGED
|
@@ -2144,22 +2144,26 @@ async function getTools({ tools, dir, template }, extraTools) {
|
|
|
2144
2144
|
const options = [
|
|
2145
2145
|
{
|
|
2146
2146
|
value: 'biome',
|
|
2147
|
-
label: 'Biome
|
|
2147
|
+
label: 'Biome - linting & formatting'
|
|
2148
2148
|
},
|
|
2149
2149
|
{
|
|
2150
2150
|
value: 'eslint',
|
|
2151
|
-
label: 'ESLint
|
|
2151
|
+
label: 'ESLint - linting'
|
|
2152
2152
|
},
|
|
2153
2153
|
{
|
|
2154
2154
|
value: 'prettier',
|
|
2155
|
-
label: 'Prettier
|
|
2155
|
+
label: 'Prettier - formatting'
|
|
2156
2156
|
}
|
|
2157
2157
|
];
|
|
2158
|
-
if (extraTools)
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2158
|
+
if (extraTools) {
|
|
2159
|
+
const normalize = (tool)=>({
|
|
2160
|
+
value: tool.value,
|
|
2161
|
+
label: tool.label,
|
|
2162
|
+
hint: tool.command
|
|
2163
|
+
});
|
|
2164
|
+
options.unshift(...extraTools.filter((tool)=>'pre' === tool.order).map(normalize));
|
|
2165
|
+
options.push(...extraTools.filter((tool)=>'pre' !== tool.order).map(normalize));
|
|
2166
|
+
}
|
|
2163
2167
|
return checkCancel(await fe({
|
|
2164
2168
|
message: 'Select additional tools (Use <space> to select, <enter> to continue)',
|
|
2165
2169
|
options,
|
|
@@ -2192,7 +2196,7 @@ function runCommand(command, cwd, packageManager) {
|
|
|
2192
2196
|
deno: 'deno run -A npm:create-'
|
|
2193
2197
|
};
|
|
2194
2198
|
const replacement = createReplacements[packageManager];
|
|
2195
|
-
if (replacement) command = command.replace(
|
|
2199
|
+
if (replacement) command = command.replace('npm create ', replacement).replace(' -- --', ' --');
|
|
2196
2200
|
if ('yarn' === packageManager) command = command.replace('@latest', '');
|
|
2197
2201
|
}
|
|
2198
2202
|
const [bin, ...args] = command.split(' ');
|