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 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 (linting & formatting)'
2147
+ label: 'Biome - linting & formatting'
2148
2148
  },
2149
2149
  {
2150
2150
  value: 'eslint',
2151
- label: 'ESLint (linting)'
2151
+ label: 'ESLint - linting'
2152
2152
  },
2153
2153
  {
2154
2154
  value: 'prettier',
2155
- label: 'Prettier (formatting)'
2155
+ label: 'Prettier - formatting'
2156
2156
  }
2157
2157
  ];
2158
- if (extraTools) options.push(...extraTools.map((tool)=>({
2159
- value: tool.value,
2160
- label: tool.label,
2161
- hint: tool.command
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(/^npm create /, replacement).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(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rstack",
3
- "version": "1.7.18",
3
+ "version": "1.7.19",
4
4
  "description": "Create a new Rstack project",
5
5
  "repository": {
6
6
  "type": "git",