create-rstack 2.1.0 → 2.1.1
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 +10 -1
- package/dist/index.js +19 -1
- package/package.json +2 -2
- package/template-rslint/{package.json → react-js/package.json} +2 -2
- package/template-rslint/react-js/rslint.config.ts +7 -0
- package/template-rslint/react-ts/package.json +11 -0
- package/template-rslint/react-ts/rslint.config.ts +14 -0
- package/template-rslint/vanilla-js/package.json +11 -0
- package/template-rslint/vanilla-js/rslint.config.ts +3 -0
- package/template-rslint/vanilla-ts/package.json +11 -0
- package/template-rslint/vanilla-ts/rslint.config.ts +3 -0
- package/template-rslint/rslint.config.ts +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -91,7 +91,7 @@ export declare function copyFolder({ from, to, version, packageName, templatePar
|
|
|
91
91
|
skipFiles?: string[];
|
|
92
92
|
}): void;
|
|
93
93
|
|
|
94
|
-
export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv, }: {
|
|
94
|
+
export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, mapRslintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv, }: {
|
|
95
95
|
name: string;
|
|
96
96
|
root: string;
|
|
97
97
|
skipFiles?: string[];
|
|
@@ -104,6 +104,13 @@ export declare function create({ name, root, templates, skipFiles, getTemplateNa
|
|
|
104
104
|
mapESLintTemplate?: (templateName: string, context: {
|
|
105
105
|
distFolder: string;
|
|
106
106
|
}) => ESLintTemplateName | null;
|
|
107
|
+
/**
|
|
108
|
+
* Map the template name to the Rslint template name.
|
|
109
|
+
* If not provided, reuses mapESLintTemplate and falls back to 'vanilla-ts'.
|
|
110
|
+
*/
|
|
111
|
+
mapRslintTemplate?: (templateName: string, context: {
|
|
112
|
+
distFolder: string;
|
|
113
|
+
}) => RslintTemplateName | null;
|
|
107
114
|
version?: Record<string, string> | string;
|
|
108
115
|
noteInformation?: string[];
|
|
109
116
|
/**
|
|
@@ -280,6 +287,8 @@ export declare function resolveNpmTemplate(packageName: string, version?: string
|
|
|
280
287
|
cacheDir?: string;
|
|
281
288
|
}): string;
|
|
282
289
|
|
|
290
|
+
export declare type RslintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts';
|
|
291
|
+
|
|
283
292
|
/**
|
|
284
293
|
* Sanitize package name and version to create a valid cache key
|
|
285
294
|
*/
|
package/dist/index.js
CHANGED
|
@@ -3289,7 +3289,7 @@ function logNextStepsAndOutro(noteInformation, targetDir, packageManager) {
|
|
|
3289
3289
|
if (nextSteps.length) wt(nextSteps.map((step)=>color.reset(step)).join('\n'), 'Next steps');
|
|
3290
3290
|
gt('All set, happy coding!');
|
|
3291
3291
|
}
|
|
3292
|
-
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
|
|
3292
|
+
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, mapRslintTemplate, version, noteInformation, extraTools, extraSkills, argv: processArgv = process.argv }) {
|
|
3293
3293
|
src_logger.greet(`\n◆ Create ${upperFirst(name)} Project`);
|
|
3294
3294
|
const { isAgent } = await (0, dist_0.determineAgent)();
|
|
3295
3295
|
if (isAgent) {
|
|
@@ -3423,6 +3423,24 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
3423
3423
|
agentsMdSearchDirs.push(subFolder);
|
|
3424
3424
|
continue;
|
|
3425
3425
|
}
|
|
3426
|
+
if ('rslint' === tool) {
|
|
3427
|
+
const rslintTemplateName = mapRslintTemplate ? mapRslintTemplate(templateName, {
|
|
3428
|
+
distFolder
|
|
3429
|
+
}) : 'vanilla-ts';
|
|
3430
|
+
if (!rslintTemplateName) continue;
|
|
3431
|
+
const subFolder = node_path.join(toolFolder, rslintTemplateName);
|
|
3432
|
+
copyFolder({
|
|
3433
|
+
from: subFolder,
|
|
3434
|
+
to: distFolder,
|
|
3435
|
+
version,
|
|
3436
|
+
skipFiles,
|
|
3437
|
+
templateParameters,
|
|
3438
|
+
isMergePackageJson: true
|
|
3439
|
+
});
|
|
3440
|
+
agentsMdSearchDirs.push(toolFolder);
|
|
3441
|
+
agentsMdSearchDirs.push(subFolder);
|
|
3442
|
+
continue;
|
|
3443
|
+
}
|
|
3426
3444
|
copyFolder({
|
|
3427
3445
|
from: toolFolder,
|
|
3428
3446
|
to: distFolder,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rstack",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Create a new Rstack project",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@clack/prompts": "^1.2.0",
|
|
46
46
|
"@microsoft/api-extractor": "^7.58.7",
|
|
47
47
|
"@rslib/core": "0.21.3",
|
|
48
|
-
"@rslint/core": "^0.5.
|
|
48
|
+
"@rslint/core": "^0.5.1",
|
|
49
49
|
"@rstest/core": "0.9.9",
|
|
50
50
|
"@types/fs-extra": "^11.0.4",
|
|
51
51
|
"@types/minimist": "^1.2.5",
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineConfig,
|
|
3
|
+
js,
|
|
4
|
+
ts,
|
|
5
|
+
reactPlugin,
|
|
6
|
+
reactHooksPlugin,
|
|
7
|
+
} from '@rslint/core';
|
|
8
|
+
|
|
9
|
+
export default defineConfig([
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
ts.configs.recommended,
|
|
12
|
+
reactPlugin.configs.recommended,
|
|
13
|
+
reactHooksPlugin.configs.recommended,
|
|
14
|
+
]);
|