create-rslib 0.6.4 → 0.6.6
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 +12 -12
- package/package.json +2 -2
- package/template-[node-dual]-[vitest]-js/package.json +1 -1
- package/template-[node-dual]-[vitest]-ts/package.json +1 -1
- package/template-[node-esm]-[vitest]-js/package.json +1 -1
- package/template-[node-esm]-[vitest]-ts/package.json +1 -1
- package/template-[react]-[storybook,vitest]-js/package.json +2 -2
- package/template-[react]-[storybook,vitest]-ts/package.json +2 -2
- package/template-[react]-[storybook]-js/package.json +1 -1
- package/template-[react]-[storybook]-ts/package.json +1 -1
- package/template-[react]-[vitest]-js/package.json +1 -1
- package/template-[react]-[vitest]-ts/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import default_0 from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { checkCancel, create, multiselect, select as select_0 } from "create-rstack";
|
|
5
5
|
import "node:fs";
|
|
6
|
-
const helpers_filename =
|
|
7
|
-
const helpers_dirname =
|
|
8
|
-
|
|
6
|
+
const helpers_filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const helpers_dirname = default_0.dirname(helpers_filename);
|
|
8
|
+
default_0.resolve(helpers_dirname, '../fragments');
|
|
9
9
|
const composeTemplateName = ({ template, tools, lang })=>`[${template}]-[${(tools ? Object.keys(tools) : []).sort()}]-${lang}`;
|
|
10
10
|
const TEMPLATES = [
|
|
11
11
|
{
|
|
@@ -105,7 +105,7 @@ const TEMPLATES = [
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
];
|
|
108
|
-
const src_dirname =
|
|
108
|
+
const src_dirname = default_0.dirname(fileURLToPath(import.meta.url));
|
|
109
109
|
async function getTemplateName({ template }) {
|
|
110
110
|
if ('string' == typeof template) {
|
|
111
111
|
const pair = template.split('-');
|
|
@@ -116,7 +116,7 @@ async function getTemplateName({ template }) {
|
|
|
116
116
|
].includes(lang)) return template;
|
|
117
117
|
return `${template}-ts`;
|
|
118
118
|
}
|
|
119
|
-
const templateName =
|
|
119
|
+
const templateName = checkCancel(await select_0({
|
|
120
120
|
message: 'Select template',
|
|
121
121
|
options: [
|
|
122
122
|
{
|
|
@@ -133,7 +133,7 @@ async function getTemplateName({ template }) {
|
|
|
133
133
|
}
|
|
134
134
|
]
|
|
135
135
|
}));
|
|
136
|
-
const language =
|
|
136
|
+
const language = checkCancel(await select_0({
|
|
137
137
|
message: 'Select language',
|
|
138
138
|
options: [
|
|
139
139
|
{
|
|
@@ -147,7 +147,7 @@ async function getTemplateName({ template }) {
|
|
|
147
147
|
]
|
|
148
148
|
}));
|
|
149
149
|
const supportStorybook = 'react' === templateName;
|
|
150
|
-
const tools =
|
|
150
|
+
const tools = checkCancel(await multiselect({
|
|
151
151
|
message: 'Select development tools (Use <space> to select, <enter> to continue)',
|
|
152
152
|
required: false,
|
|
153
153
|
options: [
|
|
@@ -174,8 +174,8 @@ function mapESLintTemplate(templateName) {
|
|
|
174
174
|
const language = templateName.split('-').pop();
|
|
175
175
|
return `vanilla-${language}`;
|
|
176
176
|
}
|
|
177
|
-
|
|
178
|
-
root:
|
|
177
|
+
create({
|
|
178
|
+
root: default_0.resolve(src_dirname, '..'),
|
|
179
179
|
name: 'rslib',
|
|
180
180
|
templates: TEMPLATES.map(({ template, tools, lang })=>composeTemplateName({
|
|
181
181
|
template,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rslib",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"description": "Create a new Rslib project",
|
|
5
5
|
"homepage": "https://lib.rsbuild.dev",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"@types/node": "^22.8.1",
|
|
30
30
|
"fs-extra": "^11.3.0",
|
|
31
31
|
"rsbuild-plugin-publint": "^0.3.0",
|
|
32
|
-
"rslib": "npm:@rslib/core@0.6.
|
|
32
|
+
"rslib": "npm:@rslib/core@0.6.5",
|
|
33
33
|
"tsx": "^4.19.3",
|
|
34
34
|
"typescript": "^5.8.3",
|
|
35
35
|
"@rslib/tsconfig": "0.0.1"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"test": "vitest run"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@rsbuild/core": "1.3.
|
|
22
|
+
"@rsbuild/core": "1.3.9",
|
|
23
23
|
"@rsbuild/plugin-react": "^1.2.0",
|
|
24
24
|
"@rslib/core": "workspace:*",
|
|
25
25
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"storybook": "^8.6.12",
|
|
37
37
|
"storybook-addon-rslib": "^1.0.1",
|
|
38
38
|
"storybook-react-rsbuild": "^1.0.1",
|
|
39
|
-
"vitest": "^3.1.
|
|
39
|
+
"vitest": "^3.1.2"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": ">=16.9.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"test": "vitest run"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@rsbuild/core": "1.3.
|
|
24
|
+
"@rsbuild/core": "1.3.9",
|
|
25
25
|
"@rsbuild/plugin-react": "^1.2.0",
|
|
26
26
|
"@rslib/core": "workspace:*",
|
|
27
27
|
"@storybook/addon-essentials": "^8.6.12",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"storybook-addon-rslib": "^1.0.1",
|
|
41
41
|
"storybook-react-rsbuild": "^1.0.1",
|
|
42
42
|
"typescript": "^5.8.3",
|
|
43
|
-
"vitest": "^3.1.
|
|
43
|
+
"vitest": "^3.1.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.9.0",
|