create-rslib 0.6.6 → 0.6.7
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 +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 * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__ from "node:url";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__ from "create-rstack";
|
|
5
5
|
import "node:fs";
|
|
6
|
-
const helpers_filename = fileURLToPath(import.meta.url);
|
|
7
|
-
const helpers_dirname =
|
|
8
|
-
|
|
6
|
+
const helpers_filename = (0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.fileURLToPath)(import.meta.url);
|
|
7
|
+
const helpers_dirname = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname(helpers_filename);
|
|
8
|
+
__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].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 = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].dirname((0, __WEBPACK_EXTERNAL_MODULE_node_url_e96de089__.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 = checkCancel(await
|
|
119
|
+
const templateName = (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.checkCancel)(await (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.select)({
|
|
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 = checkCancel(await
|
|
136
|
+
const language = (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.checkCancel)(await (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.select)({
|
|
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 = checkCancel(await multiselect({
|
|
150
|
+
const tools = (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.checkCancel)(await (0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.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
|
-
create({
|
|
178
|
-
root:
|
|
177
|
+
(0, __WEBPACK_EXTERNAL_MODULE_create_rstack_aeeb76b8__.create)({
|
|
178
|
+
root: __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].resolve(src_dirname, '..'),
|
|
179
179
|
name: 'rslib',
|
|
180
180
|
templates: TEMPLATES.map(({ template, tools, lang })=>composeTemplateName({
|
|
181
181
|
template,
|