create-rstack 1.9.2 → 2.0.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 +12 -2
- package/dist/index.js +34 -17
- package/package.json +13 -10
- package/template-biome/package.json +2 -2
- package/template-eslint/react-js/eslint.config.mjs +0 -6
- package/template-eslint/react-js/package.json +4 -4
- package/template-eslint/react-ts/eslint.config.mjs +0 -1
- package/template-eslint/react-ts/package.json +5 -5
- package/template-eslint/svelte-js/package.json +3 -3
- package/template-eslint/svelte-ts/package.json +4 -4
- package/template-eslint/vanilla-js/package.json +3 -3
- package/template-eslint/vanilla-ts/package.json +4 -4
- package/template-eslint/vue-js/package.json +3 -3
- package/template-eslint/vue-ts/package.json +3 -3
- package/template-prettier/package.json +2 -2
- package/template-rslint/AGENTS.md +5 -0
- package/template-rslint/package.json +11 -0
- package/template-rslint/rslint.config.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -122,7 +122,15 @@ declare type ExtraSkill = {
|
|
|
122
122
|
label: string;
|
|
123
123
|
source: string;
|
|
124
124
|
skill?: string;
|
|
125
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Controls whether the skill is shown in the interactive prompt for the
|
|
127
|
+
* selected template/tools. Explicit `--skill` values and `--help` remain
|
|
128
|
+
* unfiltered so CLI input stays authoritative and help stays discoverable.
|
|
129
|
+
*/
|
|
130
|
+
when?: (context: {
|
|
131
|
+
templateName: string;
|
|
132
|
+
tools: string[];
|
|
133
|
+
}) => boolean;
|
|
126
134
|
order?: 'pre' | 'post';
|
|
127
135
|
};
|
|
128
136
|
|
|
@@ -157,7 +165,9 @@ declare type ExtraTool = {
|
|
|
157
165
|
* If returns false, the tool will not be shown in the selection.
|
|
158
166
|
* @default () => true
|
|
159
167
|
*/
|
|
160
|
-
when?: (
|
|
168
|
+
when?: (context: {
|
|
169
|
+
templateName: string;
|
|
170
|
+
}) => boolean;
|
|
161
171
|
};
|
|
162
172
|
|
|
163
173
|
export declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ __webpack_require__.m = __webpack_modules__;
|
|
|
51
51
|
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
52
52
|
})();
|
|
53
53
|
__webpack_require__.add({
|
|
54
|
-
"./node_modules/.pnpm/@vercel+detect-agent@1.2.
|
|
54
|
+
"./node_modules/.pnpm/@vercel+detect-agent@1.2.3/node_modules/@vercel/detect-agent/dist/index.js" (module, __unused_rspack_exports, __webpack_require__) {
|
|
55
55
|
var __defProp = Object.defineProperty;
|
|
56
56
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
57
57
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -96,6 +96,7 @@ __webpack_require__.add({
|
|
|
96
96
|
const OPENCODE = "opencode";
|
|
97
97
|
const GITHUB_COPILOT = "github-copilot";
|
|
98
98
|
const GITHUB_COPILOT_CLI = "github-copilot-cli";
|
|
99
|
+
const V0 = "v0";
|
|
99
100
|
const KNOWN_AGENTS = {
|
|
100
101
|
CURSOR,
|
|
101
102
|
CURSOR_CLI,
|
|
@@ -108,7 +109,8 @@ __webpack_require__.add({
|
|
|
108
109
|
ANTIGRAVITY,
|
|
109
110
|
AUGMENT_CLI,
|
|
110
111
|
OPENCODE,
|
|
111
|
-
GITHUB_COPILOT
|
|
112
|
+
GITHUB_COPILOT,
|
|
113
|
+
V0
|
|
112
114
|
};
|
|
113
115
|
async function determineAgent() {
|
|
114
116
|
if (process.env.AI_AGENT) {
|
|
@@ -120,6 +122,12 @@ __webpack_require__.add({
|
|
|
120
122
|
name: GITHUB_COPILOT
|
|
121
123
|
}
|
|
122
124
|
};
|
|
125
|
+
if (name === V0) return {
|
|
126
|
+
isAgent: true,
|
|
127
|
+
agent: {
|
|
128
|
+
name: V0
|
|
129
|
+
}
|
|
130
|
+
};
|
|
123
131
|
return {
|
|
124
132
|
isAgent: true,
|
|
125
133
|
agent: {
|
|
@@ -2932,7 +2940,7 @@ const main_U = (e, t, n)=>{
|
|
|
2932
2940
|
return r;
|
|
2933
2941
|
};
|
|
2934
2942
|
const main_W = main_U;
|
|
2935
|
-
const dist_0 = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.2.
|
|
2943
|
+
const dist_0 = __webpack_require__("./node_modules/.pnpm/@vercel+detect-agent@1.2.3/node_modules/@vercel/detect-agent/dist/index.js");
|
|
2936
2944
|
const cjs = __webpack_require__("./node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js");
|
|
2937
2945
|
var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
2938
2946
|
const minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
@@ -2982,8 +2990,9 @@ function parseSkillsOption(skills) {
|
|
|
2982
2990
|
return skillsArr.flatMap((skill)=>skill.split(',')).map((skill)=>skill.trim()).filter(Boolean);
|
|
2983
2991
|
}
|
|
2984
2992
|
const BUILTIN_TOOLS = [
|
|
2985
|
-
'biome',
|
|
2986
2993
|
'eslint',
|
|
2994
|
+
'rslint',
|
|
2995
|
+
'biome',
|
|
2987
2996
|
'prettier'
|
|
2988
2997
|
];
|
|
2989
2998
|
function logHelpMessage(name, templates, extraTools, extraSkills) {
|
|
@@ -3023,7 +3032,9 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
3023
3032
|
const parsedTools = parseToolsOption(tools);
|
|
3024
3033
|
const filteredExtraTools = extraTools?.filter((tool)=>{
|
|
3025
3034
|
const when = tool.when ?? (()=>true);
|
|
3026
|
-
return templateName ? when(
|
|
3035
|
+
return templateName ? when({
|
|
3036
|
+
templateName
|
|
3037
|
+
}) : true;
|
|
3027
3038
|
});
|
|
3028
3039
|
if (null !== parsedTools) {
|
|
3029
3040
|
const toolsArr = parsedTools.filter((tool)=>BUILTIN_TOOLS.includes(tool) || filteredExtraTools?.some((extraTool)=>extraTool.value === tool));
|
|
@@ -3031,17 +3042,21 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
3031
3042
|
}
|
|
3032
3043
|
if (dir && template) return [];
|
|
3033
3044
|
const options = [
|
|
3034
|
-
{
|
|
3035
|
-
value: 'biome',
|
|
3036
|
-
label: 'Biome - linting & formatting'
|
|
3037
|
-
},
|
|
3038
3045
|
{
|
|
3039
3046
|
value: 'eslint',
|
|
3040
3047
|
label: 'ESLint - linting'
|
|
3041
3048
|
},
|
|
3049
|
+
{
|
|
3050
|
+
value: 'rslint',
|
|
3051
|
+
label: 'Rslint - linting (experimental)'
|
|
3052
|
+
},
|
|
3042
3053
|
{
|
|
3043
3054
|
value: 'prettier',
|
|
3044
3055
|
label: 'Prettier - formatting'
|
|
3056
|
+
},
|
|
3057
|
+
{
|
|
3058
|
+
value: 'biome',
|
|
3059
|
+
label: 'Biome - linting & formatting'
|
|
3045
3060
|
}
|
|
3046
3061
|
];
|
|
3047
3062
|
if (filteredExtraTools) {
|
|
@@ -3059,10 +3074,13 @@ async function getTools({ tools, dir, template }, extraTools, templateName) {
|
|
|
3059
3074
|
required: false
|
|
3060
3075
|
}));
|
|
3061
3076
|
}
|
|
3062
|
-
function filterExtraSkills(extraSkills, templateName) {
|
|
3077
|
+
function filterExtraSkills(extraSkills, templateName, tools = []) {
|
|
3063
3078
|
return extraSkills?.filter((extraSkill)=>{
|
|
3064
3079
|
const when = extraSkill.when ?? (()=>true);
|
|
3065
|
-
return templateName ? when(
|
|
3080
|
+
return templateName ? when({
|
|
3081
|
+
templateName,
|
|
3082
|
+
tools
|
|
3083
|
+
}) : true;
|
|
3066
3084
|
});
|
|
3067
3085
|
}
|
|
3068
3086
|
function orderExtraSkills(extraSkills) {
|
|
@@ -3073,10 +3091,10 @@ function orderExtraSkills(extraSkills) {
|
|
|
3073
3091
|
...extraSkills.filter((extraSkill)=>'post' === extraSkill.order)
|
|
3074
3092
|
];
|
|
3075
3093
|
}
|
|
3076
|
-
async function getSkills({ skill, dir, template }, extraSkills, templateName, promptMultiselect = yt) {
|
|
3094
|
+
async function getSkills({ skill, dir, template }, extraSkills, templateName, tools = [], promptMultiselect = yt) {
|
|
3077
3095
|
const parsedSkills = parseSkillsOption(skill);
|
|
3078
|
-
const filteredExtraSkills = filterExtraSkills(extraSkills, templateName);
|
|
3079
|
-
if (null !== parsedSkills) return parsedSkills.filter((value)=>
|
|
3096
|
+
const filteredExtraSkills = filterExtraSkills(extraSkills, templateName, tools);
|
|
3097
|
+
if (null !== parsedSkills) return parsedSkills.filter((value)=>extraSkills?.some((extraSkill)=>extraSkill.value === value));
|
|
3080
3098
|
if (dir && template) return [];
|
|
3081
3099
|
if (!filteredExtraSkills?.length) return [];
|
|
3082
3100
|
const orderedExtraSkills = orderExtraSkills(filteredExtraSkills);
|
|
@@ -3220,8 +3238,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
3220
3238
|
}
|
|
3221
3239
|
const templateName = await getTemplateName(argv);
|
|
3222
3240
|
const tools = await getTools(argv, extraTools, templateName);
|
|
3223
|
-
const
|
|
3224
|
-
const skills = await getSkills(argv, filteredExtraSkills, templateName, yt);
|
|
3241
|
+
const skills = await getSkills(argv, extraSkills, templateName, tools, yt);
|
|
3225
3242
|
const srcFolder = node_path.join(root, `template-${templateName}`);
|
|
3226
3243
|
const commonFolder = node_path.join(root, 'template-common');
|
|
3227
3244
|
if (!node_fs.existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
|
|
@@ -3240,7 +3257,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
3240
3257
|
templateParameters,
|
|
3241
3258
|
skipFiles
|
|
3242
3259
|
});
|
|
3243
|
-
const skillsByValue = new Map((
|
|
3260
|
+
const skillsByValue = new Map((extraSkills ?? []).map((extraSkill)=>[
|
|
3244
3261
|
extraSkill.value,
|
|
3245
3262
|
extraSkill
|
|
3246
3263
|
]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rstack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Create a new Rstack project",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -19,13 +19,15 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"template-biome",
|
|
21
21
|
"template-eslint",
|
|
22
|
+
"template-rslint",
|
|
22
23
|
"template-prettier",
|
|
23
24
|
"dist"
|
|
24
25
|
],
|
|
25
26
|
"scripts": {
|
|
26
27
|
"build": "rslib",
|
|
27
28
|
"dev": "rslib --watch",
|
|
28
|
-
"lint": "rslint",
|
|
29
|
+
"lint": "rslint && prettier . --check",
|
|
30
|
+
"lint:fix": "rslint --fix && prettier . --write",
|
|
29
31
|
"prepare": "simple-git-hooks && rslib",
|
|
30
32
|
"test": "rstest",
|
|
31
33
|
"bump": "npx bumpp"
|
|
@@ -35,28 +37,29 @@
|
|
|
35
37
|
},
|
|
36
38
|
"nano-staged": {
|
|
37
39
|
"*.{js,jsx,ts,tsx,mjs,cjs}": [
|
|
38
|
-
"rslint
|
|
40
|
+
"rslint",
|
|
41
|
+
"prettier --write"
|
|
39
42
|
]
|
|
40
43
|
},
|
|
41
44
|
"devDependencies": {
|
|
42
45
|
"@clack/prompts": "^1.2.0",
|
|
43
|
-
"@microsoft/api-extractor": "^7.58.
|
|
44
|
-
"@rslib/core": "0.21.
|
|
45
|
-
"@rslint/core": "^0.4.
|
|
46
|
-
"@rstest/core": "0.9.
|
|
46
|
+
"@microsoft/api-extractor": "^7.58.5",
|
|
47
|
+
"@rslib/core": "0.21.2",
|
|
48
|
+
"@rslint/core": "^0.4.2",
|
|
49
|
+
"@rstest/core": "0.9.8",
|
|
47
50
|
"@types/fs-extra": "^11.0.4",
|
|
48
51
|
"@types/minimist": "^1.2.5",
|
|
49
52
|
"@types/node": "24.12.2",
|
|
50
|
-
"@vercel/detect-agent": "^1.2.
|
|
53
|
+
"@vercel/detect-agent": "^1.2.3",
|
|
51
54
|
"deepmerge": "^4.3.1",
|
|
52
55
|
"fs-extra": "^11.3.4",
|
|
53
56
|
"minimist": "^1.2.8",
|
|
54
|
-
"prettier": "^3.8.
|
|
57
|
+
"prettier": "^3.8.3",
|
|
55
58
|
"rimraf": "^6.1.3",
|
|
56
59
|
"rslog": "^2.1.1",
|
|
57
60
|
"simple-git-hooks": "^2.13.1",
|
|
58
61
|
"tinyexec": "^1.1.1",
|
|
59
|
-
"typescript": "^6.0.
|
|
62
|
+
"typescript": "^6.0.3"
|
|
60
63
|
},
|
|
61
64
|
"engines": {
|
|
62
65
|
"node": "^20.19.0 || >=22.12.0"
|
|
@@ -14,16 +14,10 @@ export default defineConfig([
|
|
|
14
14
|
reactRefresh.configs.recommended,
|
|
15
15
|
],
|
|
16
16
|
languageOptions: {
|
|
17
|
-
ecmaVersion: 2020,
|
|
18
17
|
globals: globals.browser,
|
|
19
18
|
parserOptions: {
|
|
20
|
-
ecmaVersion: 'latest',
|
|
21
19
|
ecmaFeatures: { jsx: true },
|
|
22
|
-
sourceType: 'module',
|
|
23
20
|
},
|
|
24
21
|
},
|
|
25
|
-
rules: {
|
|
26
|
-
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
|
|
27
|
-
},
|
|
28
22
|
},
|
|
29
23
|
]);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-react-js",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
11
|
-
"eslint-plugin-react-hooks": "^7.
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
12
12
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
13
13
|
"globals": "^17.5.0"
|
|
14
14
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-react-ts",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
11
|
-
"eslint-plugin-react-hooks": "^7.
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
12
12
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
13
13
|
"globals": "^17.5.0",
|
|
14
|
-
"typescript-eslint": "^8.58.
|
|
14
|
+
"typescript-eslint": "^8.58.2"
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-svelte-js",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"eslint-plugin-svelte": "^3.17.0",
|
|
12
12
|
"globals": "^17.5.0"
|
|
13
13
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-svelte-ts",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"eslint-plugin-svelte": "^3.17.0",
|
|
12
12
|
"globals": "^17.5.0",
|
|
13
|
-
"typescript-eslint": "^8.58.
|
|
13
|
+
"typescript-eslint": "^8.58.2"
|
|
14
14
|
},
|
|
15
15
|
"type": "module"
|
|
16
16
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-common-js",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"globals": "^17.5.0"
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-common-ts",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"globals": "^17.5.0",
|
|
12
|
-
"typescript-eslint": "^8.58.
|
|
12
|
+
"typescript-eslint": "^8.58.2"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-vue-js",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint ."
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^
|
|
10
|
-
"eslint": "^
|
|
9
|
+
"@eslint/js": "^10.0.1",
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"eslint-plugin-vue": "^10.8.0",
|
|
12
12
|
"globals": "^17.5.0"
|
|
13
13
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "eslint-vue-ts",
|
|
3
3
|
"private": true,
|
|
4
4
|
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
9
|
"@vue/eslint-config-typescript": "^14.7.0",
|
|
10
|
-
"eslint": "^
|
|
10
|
+
"eslint": "^10.2.1",
|
|
11
11
|
"eslint-plugin-vue": "^10.8.0",
|
|
12
12
|
"globals": "^17.5.0",
|
|
13
|
-
"typescript-eslint": "^8.58.
|
|
13
|
+
"typescript-eslint": "^8.58.2"
|
|
14
14
|
}
|
|
15
15
|
}
|