create-rstack 1.0.3 → 1.0.4
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 +37 -55
- package/package.json +16 -13
- package/template-biome/biome.json +0 -30
- package/template-biome/package.json +0 -12
- package/template-eslint/react-js/eslint.config.mjs +0 -29
- package/template-eslint/react-js/package.json +0 -16
- package/template-eslint/react-ts/eslint.config.mjs +0 -31
- package/template-eslint/react-ts/package.json +0 -17
- package/template-eslint/svelte-js/eslint.config.mjs +0 -20
- package/template-eslint/svelte-js/package.json +0 -14
- package/template-eslint/svelte-ts/eslint.config.mjs +0 -28
- package/template-eslint/svelte-ts/package.json +0 -16
- package/template-eslint/vanilla-js/eslint.config.mjs +0 -8
- package/template-eslint/vanilla-js/package.json +0 -13
- package/template-eslint/vanilla-ts/eslint.config.mjs +0 -10
- package/template-eslint/vanilla-ts/package.json +0 -14
- package/template-eslint/vue-js/eslint.config.mjs +0 -10
- package/template-eslint/vue-js/package.json +0 -14
- package/template-eslint/vue-ts/eslint.config.mjs +0 -12
- package/template-eslint/vue-ts/package.json +0 -15
- package/template-prettier/.prettierignore +0 -4
- package/template-prettier/.prettierrc +0 -3
- package/template-prettier/package.json +0 -11
package/dist/index.js
CHANGED
|
@@ -287,7 +287,7 @@ var __webpack_modules__ = {
|
|
|
287
287
|
},
|
|
288
288
|
"./node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
289
289
|
let argv = process.argv || [], env = process.env;
|
|
290
|
-
let isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || "win32" === process.platform || null !=
|
|
290
|
+
let isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || "win32" === process.platform || null != require && __webpack_require__("tty")/* .isatty */ .isatty(1) && "dumb" !== env.TERM || "CI" in env);
|
|
291
291
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
292
292
|
let string = "" + input;
|
|
293
293
|
let index = string.indexOf(close, open.length);
|
|
@@ -337,17 +337,6 @@ var __webpack_modules__ = {
|
|
|
337
337
|
module.exports = createColors();
|
|
338
338
|
module.exports.createColors = createColors;
|
|
339
339
|
},
|
|
340
|
-
"./node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors sync recursive": function(module) {
|
|
341
|
-
function webpackEmptyContext(req) {
|
|
342
|
-
var e = new Error("Cannot find module '" + req + "'");
|
|
343
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
344
|
-
throw e;
|
|
345
|
-
}
|
|
346
|
-
webpackEmptyContext.keys = ()=>[];
|
|
347
|
-
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
348
|
-
webpackEmptyContext.id = "./node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors sync recursive";
|
|
349
|
-
module.exports = webpackEmptyContext;
|
|
350
|
-
},
|
|
351
340
|
"./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js": function(module) {
|
|
352
341
|
const ESC = '\x1B';
|
|
353
342
|
const CSI = `${ESC}[`;
|
|
@@ -452,13 +441,8 @@ function __webpack_require__(moduleId) {
|
|
|
452
441
|
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
453
442
|
};
|
|
454
443
|
})(); /************************************************************************/
|
|
455
|
-
var external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_fs__;
|
|
456
|
-
var external_node_path_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_path__;
|
|
457
444
|
// EXTERNAL MODULE: ./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js
|
|
458
445
|
var src = __webpack_require__("./node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js");
|
|
459
|
-
var external_node_process_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_process__;
|
|
460
|
-
var external_node_readline_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_readline__;
|
|
461
|
-
var external_node_tty_namespaceObject = __WEBPACK_EXTERNAL_MODULE_node_tty__;
|
|
462
446
|
// EXTERNAL MODULE: ./node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js
|
|
463
447
|
var picocolors = __webpack_require__("./node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js");
|
|
464
448
|
function q({ onlyFirst: t = !1 } = {}) {
|
|
@@ -925,20 +909,20 @@ const z = new Map([
|
|
|
925
909
|
"enter"
|
|
926
910
|
]);
|
|
927
911
|
class x {
|
|
928
|
-
constructor({ render: u, input: F =
|
|
912
|
+
constructor({ render: u, input: F = __WEBPACK_EXTERNAL_MODULE_node_process__.stdin, output: e = __WEBPACK_EXTERNAL_MODULE_node_process__.stdout, ...s }, C = !0){
|
|
929
913
|
a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", !1), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", new Map), a(this, "_prevFrame", ""), this.opts = s, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u.bind(this), this._track = C, this.input = F, this.output = e;
|
|
930
914
|
}
|
|
931
915
|
prompt() {
|
|
932
|
-
const u = new
|
|
916
|
+
const u = new __WEBPACK_EXTERNAL_MODULE_node_tty__.WriteStream(0);
|
|
933
917
|
return u._write = (F, e, s)=>{
|
|
934
918
|
this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s();
|
|
935
|
-
}, this.input.pipe(u), this.rl =
|
|
919
|
+
}, this.input.pipe(u), this.rl = __WEBPACK_EXTERNAL_MODULE_node_readline__["default"].createInterface({
|
|
936
920
|
input: this.input,
|
|
937
921
|
output: u,
|
|
938
922
|
tabSize: 2,
|
|
939
923
|
prompt: "",
|
|
940
924
|
escapeCodeTimeout: 50
|
|
941
|
-
}),
|
|
925
|
+
}), __WEBPACK_EXTERNAL_MODULE_node_readline__["default"].emitKeypressEvents(this.input, this.rl), this.rl.prompt(), void 0 !== this.opts.initialValue && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), dist_v(this.input, !0), this.output.on("resize", this.render), this.render(), new Promise((F, e)=>{
|
|
942
926
|
this.once("submit", ()=>{
|
|
943
927
|
this.output.write(src.cursor.show), this.output.off("resize", this.render), dist_v(this.input, !1), F(this.value);
|
|
944
928
|
}), this.once("cancel", ()=>{
|
|
@@ -1115,7 +1099,7 @@ class TD extends x {
|
|
|
1115
1099
|
}
|
|
1116
1100
|
globalThis.process.platform.startsWith("win");
|
|
1117
1101
|
function dist_q() {
|
|
1118
|
-
return "win32" !==
|
|
1102
|
+
return "win32" !== __WEBPACK_EXTERNAL_MODULE_node_process__["default"].platform ? "linux" !== __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERM : Boolean(__WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.CI) || Boolean(__WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.WT_SESSION) || Boolean(__WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERMINUS_SUBLIME) || "{cmd::Cmder}" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.ConEmuTask || "Terminus-Sublime" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERM_PROGRAM || "vscode" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERM_PROGRAM || "xterm-256color" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERM || "alacritty" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERM || "JetBrains-JediTerm" === __WEBPACK_EXTERNAL_MODULE_node_process__["default"].env.TERMINAL_EMULATOR;
|
|
1119
1103
|
}
|
|
1120
1104
|
const _ = dist_q(), dist_o = (r, n)=>_ ? r : n, dist_H = dist_o("\u25C6", "*"), dist_I = dist_o("\u25A0", "x"), dist_x = dist_o("\u25B2", "x"), dist_S = dist_o("\u25C7", "o"), dist_a = (dist_o("\u250C", "T"), dist_o("\u2502", "|")), d = dist_o("\u2514", "\u2014"), prompts_dist_b = dist_o("\u25CF", ">"), dist_E = dist_o("\u25CB", " "), dist_C = dist_o("\u25FB", "[\u2022]"), dist_w = dist_o("\u25FC", "[+]"), dist_M = dist_o("\u25FB", "[ ]"), dist_B = (dist_o("\u25AA", "\u2022"), dist_o("\u2500", "-")), dist_Z = dist_o("\u256E", "+"), dist_z = dist_o("\u251C", "+"), dist_X = dist_o("\u256F", "+"), dist_y = (dist_o("\u25CF", "\u2022"), dist_o("\u25C6", "*"), dist_o("\u25B2", "!"), dist_o("\u25A0", "x"), (r)=>{
|
|
1121
1105
|
switch(r){
|
|
@@ -1269,18 +1253,16 @@ var cjs_default = /*#__PURE__*/ __webpack_require__.n(cjs);
|
|
|
1269
1253
|
// EXTERNAL MODULE: ./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js
|
|
1270
1254
|
var minimist = __webpack_require__("./node_modules/.pnpm/minimist@1.2.8/node_modules/minimist/index.js");
|
|
1271
1255
|
var minimist_default = /*#__PURE__*/ __webpack_require__.n(minimist);
|
|
1272
|
-
var external_process_namespaceObject = __WEBPACK_EXTERNAL_MODULE_process__;
|
|
1273
|
-
var external_os_namespaceObject = __WEBPACK_EXTERNAL_MODULE_os__;
|
|
1274
1256
|
// EXTERNAL MODULE: external "tty"
|
|
1275
1257
|
var external_tty_ = __webpack_require__("tty");
|
|
1276
1258
|
// node_modules/.pnpm/supports-color@9.4.0/node_modules/supports-color/index.js
|
|
1277
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
1259
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : __WEBPACK_EXTERNAL_MODULE_process__["default"].argv) {
|
|
1278
1260
|
const prefix = flag.startsWith("-") ? "" : 1 === flag.length ? "-" : "--";
|
|
1279
1261
|
const position = argv.indexOf(prefix + flag);
|
|
1280
1262
|
const terminatorPosition = argv.indexOf("--");
|
|
1281
1263
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
1282
1264
|
}
|
|
1283
|
-
var { env } =
|
|
1265
|
+
var { env } = __WEBPACK_EXTERNAL_MODULE_process__["default"];
|
|
1284
1266
|
var flagForceColor;
|
|
1285
1267
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
1286
1268
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -1313,8 +1295,8 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
1313
1295
|
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
1314
1296
|
const min = forceColor || 0;
|
|
1315
1297
|
if ("dumb" === env.TERM) return min;
|
|
1316
|
-
if ("win32" ===
|
|
1317
|
-
const osRelease =
|
|
1298
|
+
if ("win32" === __WEBPACK_EXTERNAL_MODULE_process__["default"].platform) {
|
|
1299
|
+
const osRelease = __WEBPACK_EXTERNAL_MODULE_os__["default"].release().split(".");
|
|
1318
1300
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1319
1301
|
return 1;
|
|
1320
1302
|
}
|
|
@@ -1547,7 +1529,7 @@ function checkCancel(value) {
|
|
|
1547
1529
|
*/ function formatProjectName(input) {
|
|
1548
1530
|
const formatted = input.trim().replace(/\/+$/g, '');
|
|
1549
1531
|
return {
|
|
1550
|
-
packageName: formatted.startsWith('@') ? formatted :
|
|
1532
|
+
packageName: formatted.startsWith('@') ? formatted : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].basename(formatted),
|
|
1551
1533
|
targetDir: formatted
|
|
1552
1534
|
};
|
|
1553
1535
|
}
|
|
@@ -1561,7 +1543,7 @@ function pkgFromUserAgent(userAgent) {
|
|
|
1561
1543
|
};
|
|
1562
1544
|
}
|
|
1563
1545
|
function isEmptyDir(path) {
|
|
1564
|
-
const files =
|
|
1546
|
+
const files = __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readdirSync(path);
|
|
1565
1547
|
return 0 === files.length || 1 === files.length && '.git' === files[0];
|
|
1566
1548
|
}
|
|
1567
1549
|
function logHelpMessage(name, templates) {
|
|
@@ -1626,8 +1608,8 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1626
1608
|
const cwd = process.cwd();
|
|
1627
1609
|
const pkgInfo = pkgFromUserAgent(process.env.npm_config_user_agent);
|
|
1628
1610
|
const pkgManager = pkgInfo ? pkgInfo.name : 'npm';
|
|
1629
|
-
const packageJsonPath =
|
|
1630
|
-
const { version } = JSON.parse(await
|
|
1611
|
+
const packageJsonPath = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(root, 'package.json');
|
|
1612
|
+
const { version } = JSON.parse(await __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].promises.readFile(packageJsonPath, 'utf-8'));
|
|
1631
1613
|
const projectName = argv.dir ?? checkCancel(await te({
|
|
1632
1614
|
message: 'Project name or path',
|
|
1633
1615
|
placeholder: `${name}-project`,
|
|
@@ -1637,8 +1619,8 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1637
1619
|
}
|
|
1638
1620
|
}));
|
|
1639
1621
|
const { targetDir, packageName } = formatProjectName(projectName);
|
|
1640
|
-
const distFolder =
|
|
1641
|
-
if (!argv.override &&
|
|
1622
|
+
const distFolder = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].isAbsolute(targetDir) ? targetDir : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(cwd, targetDir);
|
|
1623
|
+
if (!argv.override && __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(distFolder) && !isEmptyDir(distFolder)) {
|
|
1642
1624
|
const option = checkCancel(await ie({
|
|
1643
1625
|
message: `"${targetDir}" is not empty, please choose:`,
|
|
1644
1626
|
options: [
|
|
@@ -1656,9 +1638,9 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1656
1638
|
}
|
|
1657
1639
|
const templateName = await getTemplateName(argv);
|
|
1658
1640
|
const tools = await getTools(argv);
|
|
1659
|
-
const srcFolder =
|
|
1660
|
-
const commonFolder =
|
|
1661
|
-
if (!
|
|
1641
|
+
const srcFolder = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(root, `template-${templateName}`);
|
|
1642
|
+
const commonFolder = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(root, 'template-common');
|
|
1643
|
+
if (!__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(srcFolder)) throw new Error(`Invalid input: template "${templateName}" not found.`);
|
|
1662
1644
|
copyFolder({
|
|
1663
1645
|
from: commonFolder,
|
|
1664
1646
|
to: distFolder,
|
|
@@ -1672,13 +1654,13 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1672
1654
|
packageName,
|
|
1673
1655
|
skipFiles
|
|
1674
1656
|
});
|
|
1675
|
-
const packageRoot =
|
|
1657
|
+
const packageRoot = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(src_dirname, '..');
|
|
1676
1658
|
for (const tool of tools){
|
|
1677
|
-
const toolFolder =
|
|
1659
|
+
const toolFolder = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(packageRoot, `template-${tool}`);
|
|
1678
1660
|
if ('eslint' === tool) {
|
|
1679
1661
|
const eslintTemplateName = mapESLintTemplate(templateName);
|
|
1680
1662
|
if (!eslintTemplateName) continue;
|
|
1681
|
-
const subFolder =
|
|
1663
|
+
const subFolder = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].join(toolFolder, eslintTemplateName);
|
|
1682
1664
|
copyFolder({
|
|
1683
1665
|
from: subFolder,
|
|
1684
1666
|
to: distFolder,
|
|
@@ -1709,9 +1691,9 @@ function sortObjectKeys(obj) {
|
|
|
1709
1691
|
return sortedObj;
|
|
1710
1692
|
}
|
|
1711
1693
|
function mergePackageJson(targetPackage, extraPackage) {
|
|
1712
|
-
if (!
|
|
1713
|
-
const targetJson = JSON.parse(
|
|
1714
|
-
const extraJson = JSON.parse(
|
|
1694
|
+
if (!__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(targetPackage)) return;
|
|
1695
|
+
const targetJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(targetPackage, 'utf-8'));
|
|
1696
|
+
const extraJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(extraPackage, 'utf-8'));
|
|
1715
1697
|
const mergedJson = cjs_default()(targetJson, extraJson);
|
|
1716
1698
|
mergedJson.name = targetJson.name || extraJson.name;
|
|
1717
1699
|
for (const key of [
|
|
@@ -1721,7 +1703,7 @@ function mergePackageJson(targetPackage, extraPackage) {
|
|
|
1721
1703
|
]){
|
|
1722
1704
|
if (key in mergedJson) mergedJson[key] = sortObjectKeys(mergedJson[key]);
|
|
1723
1705
|
}
|
|
1724
|
-
|
|
1706
|
+
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}\n`);
|
|
1725
1707
|
}
|
|
1726
1708
|
function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFiles = [] }) {
|
|
1727
1709
|
const renameFiles = {
|
|
@@ -1733,14 +1715,14 @@ function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFi
|
|
|
1733
1715
|
'dist',
|
|
1734
1716
|
...skipFiles
|
|
1735
1717
|
];
|
|
1736
|
-
|
|
1718
|
+
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].mkdirSync(to, {
|
|
1737
1719
|
recursive: true
|
|
1738
1720
|
});
|
|
1739
|
-
for (const file of
|
|
1721
|
+
for (const file of __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readdirSync(from)){
|
|
1740
1722
|
if (allSkipFiles.includes(file)) continue;
|
|
1741
|
-
const srcFile =
|
|
1742
|
-
const distFile = renameFiles[file] ?
|
|
1743
|
-
const stat =
|
|
1723
|
+
const srcFile = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(from, file);
|
|
1724
|
+
const distFile = renameFiles[file] ? __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(to, renameFiles[file]) : __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(to, file);
|
|
1725
|
+
const stat = __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].statSync(srcFile);
|
|
1744
1726
|
if (stat.isDirectory()) copyFolder({
|
|
1745
1727
|
from: srcFile,
|
|
1746
1728
|
to: distFile,
|
|
@@ -1748,13 +1730,13 @@ function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFi
|
|
|
1748
1730
|
skipFiles
|
|
1749
1731
|
});
|
|
1750
1732
|
else if ('package.json' === file) {
|
|
1751
|
-
const targetPackage =
|
|
1752
|
-
if (isMergePackageJson &&
|
|
1733
|
+
const targetPackage = __WEBPACK_EXTERNAL_MODULE_node_path__["default"].resolve(to, 'package.json');
|
|
1734
|
+
if (isMergePackageJson && __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(targetPackage)) mergePackageJson(targetPackage, srcFile);
|
|
1753
1735
|
else {
|
|
1754
|
-
|
|
1736
|
+
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].copyFileSync(srcFile, distFile);
|
|
1755
1737
|
updatePackageJson(distFile, version, packageName);
|
|
1756
1738
|
}
|
|
1757
|
-
} else
|
|
1739
|
+
} else __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].copyFileSync(srcFile, distFile);
|
|
1758
1740
|
}
|
|
1759
1741
|
}
|
|
1760
1742
|
const isStableVersion = (version)=>[
|
|
@@ -1765,12 +1747,12 @@ const isStableVersion = (version)=>[
|
|
|
1765
1747
|
'nightly'
|
|
1766
1748
|
].every((tag)=>!version.includes(tag));
|
|
1767
1749
|
const updatePackageJson = (pkgJsonPath, version, name)=>{
|
|
1768
|
-
let content =
|
|
1750
|
+
let content = __WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(pkgJsonPath, 'utf-8');
|
|
1769
1751
|
// Lock the version if it is not stable
|
|
1770
1752
|
const targetVersion = isStableVersion(version) ? `^${version}` : version;
|
|
1771
1753
|
content = content.replace(/workspace:\*/g, targetVersion);
|
|
1772
1754
|
const pkg = JSON.parse(content);
|
|
1773
1755
|
if (name && '.' !== name) pkg.name = name;
|
|
1774
|
-
|
|
1756
|
+
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2));
|
|
1775
1757
|
};
|
|
1776
1758
|
export { checkCancel, create, ae as multiselect, ie as select, te as text };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rstack",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Create a new Rstack project",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -20,6 +20,15 @@
|
|
|
20
20
|
"template-*",
|
|
21
21
|
"dist"
|
|
22
22
|
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "rslib build",
|
|
25
|
+
"dev": "rslib build --watch",
|
|
26
|
+
"lint": "biome check .",
|
|
27
|
+
"lint:write": "biome check . --write",
|
|
28
|
+
"prepare": "simple-git-hooks && npm run build",
|
|
29
|
+
"test": "playwright test",
|
|
30
|
+
"bump": "npx bumpp"
|
|
31
|
+
},
|
|
23
32
|
"simple-git-hooks": {
|
|
24
33
|
"pre-commit": "npx nano-staged"
|
|
25
34
|
},
|
|
@@ -29,27 +38,21 @@
|
|
|
29
38
|
]
|
|
30
39
|
},
|
|
31
40
|
"devDependencies": {
|
|
32
|
-
"@biomejs/biome": "^1.9.
|
|
41
|
+
"@biomejs/biome": "^1.9.3",
|
|
33
42
|
"@clack/prompts": "^0.7.0",
|
|
34
|
-
"@rslib/core": "0.0.
|
|
43
|
+
"@rslib/core": "0.0.11",
|
|
35
44
|
"@types/minimist": "^1.2.5",
|
|
36
|
-
"@types/node": "18.19.
|
|
45
|
+
"@types/node": "18.19.55",
|
|
37
46
|
"deepmerge": "^4.3.1",
|
|
38
47
|
"minimist": "^1.2.8",
|
|
39
48
|
"rslog": "^1.2.3",
|
|
40
49
|
"simple-git-hooks": "^2.11.1",
|
|
41
|
-
"typescript": "^5.6.
|
|
50
|
+
"typescript": "^5.6.3"
|
|
42
51
|
},
|
|
52
|
+
"packageManager": "pnpm@9.12.1",
|
|
43
53
|
"publishConfig": {
|
|
44
54
|
"access": "public",
|
|
45
55
|
"provenance": true,
|
|
46
56
|
"registry": "https://registry.npmjs.org/"
|
|
47
|
-
},
|
|
48
|
-
"scripts": {
|
|
49
|
-
"build": "rslib build",
|
|
50
|
-
"dev": "rslib build --watch",
|
|
51
|
-
"lint": "biome check .",
|
|
52
|
-
"lint:write": "biome check . --write",
|
|
53
|
-
"test": "playwright test"
|
|
54
57
|
}
|
|
55
|
-
}
|
|
58
|
+
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
|
|
3
|
-
"organizeImports": {
|
|
4
|
-
"enabled": true
|
|
5
|
-
},
|
|
6
|
-
"vcs": {
|
|
7
|
-
"enabled": true,
|
|
8
|
-
"clientKind": "git",
|
|
9
|
-
"useIgnoreFile": true
|
|
10
|
-
},
|
|
11
|
-
"formatter": {
|
|
12
|
-
"indentStyle": "space"
|
|
13
|
-
},
|
|
14
|
-
"javascript": {
|
|
15
|
-
"formatter": {
|
|
16
|
-
"quoteStyle": "single"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"css": {
|
|
20
|
-
"parser": {
|
|
21
|
-
"cssModules": true
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"linter": {
|
|
25
|
-
"enabled": true,
|
|
26
|
-
"rules": {
|
|
27
|
-
"recommended": true
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
2
|
-
import js from '@eslint/js';
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js';
|
|
5
|
-
import react from 'eslint-plugin-react/configs/recommended.js';
|
|
6
|
-
import globals from 'globals';
|
|
7
|
-
|
|
8
|
-
export default [
|
|
9
|
-
{ languageOptions: { globals: globals.browser } },
|
|
10
|
-
js.configs.recommended,
|
|
11
|
-
...fixupConfigRules([
|
|
12
|
-
{
|
|
13
|
-
...react,
|
|
14
|
-
settings: {
|
|
15
|
-
react: { version: 'detect' },
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
reactJsx,
|
|
19
|
-
]),
|
|
20
|
-
{
|
|
21
|
-
plugins: {
|
|
22
|
-
'react-hooks': reactHooks,
|
|
23
|
-
},
|
|
24
|
-
rules: {
|
|
25
|
-
...reactHooks.configs.recommended.rules,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{ ignores: ['dist/'] },
|
|
29
|
-
];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-react-js",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/compat": "^1.1.1",
|
|
10
|
-
"@eslint/js": "^9.10.0",
|
|
11
|
-
"eslint": "^9.10.0",
|
|
12
|
-
"eslint-plugin-react": "^7.35.2",
|
|
13
|
-
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
14
|
-
"globals": "^15.9.0"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { fixupConfigRules } from '@eslint/compat';
|
|
2
|
-
import js from '@eslint/js';
|
|
3
|
-
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
-
import reactJsx from 'eslint-plugin-react/configs/jsx-runtime.js';
|
|
5
|
-
import react from 'eslint-plugin-react/configs/recommended.js';
|
|
6
|
-
import globals from 'globals';
|
|
7
|
-
import ts from 'typescript-eslint';
|
|
8
|
-
|
|
9
|
-
export default [
|
|
10
|
-
{ languageOptions: { globals: globals.browser } },
|
|
11
|
-
js.configs.recommended,
|
|
12
|
-
...ts.configs.recommended,
|
|
13
|
-
...fixupConfigRules([
|
|
14
|
-
{
|
|
15
|
-
...react,
|
|
16
|
-
settings: {
|
|
17
|
-
react: { version: 'detect' },
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
reactJsx,
|
|
21
|
-
]),
|
|
22
|
-
{
|
|
23
|
-
plugins: {
|
|
24
|
-
'react-hooks': reactHooks,
|
|
25
|
-
},
|
|
26
|
-
rules: {
|
|
27
|
-
...reactHooks.configs.recommended.rules,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{ ignores: ['dist/'] },
|
|
31
|
-
];
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-react-ts",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/compat": "^1.1.1",
|
|
10
|
-
"@eslint/js": "^9.10.0",
|
|
11
|
-
"eslint": "^9.10.0",
|
|
12
|
-
"eslint-plugin-react": "^7.35.2",
|
|
13
|
-
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
14
|
-
"globals": "^15.9.0",
|
|
15
|
-
"typescript-eslint": "^8.5.0"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import svelte from 'eslint-plugin-svelte';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
|
|
5
|
-
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
6
|
-
export default [
|
|
7
|
-
js.configs.recommended,
|
|
8
|
-
...svelte.configs['flat/recommended'],
|
|
9
|
-
{
|
|
10
|
-
languageOptions: {
|
|
11
|
-
globals: {
|
|
12
|
-
...globals.browser,
|
|
13
|
-
...globals.node,
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
ignores: ['dist/'],
|
|
19
|
-
},
|
|
20
|
-
];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-svelte-js",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^9.10.0",
|
|
10
|
-
"eslint": "^9.10.0",
|
|
11
|
-
"eslint-plugin-svelte": "^2.43.0",
|
|
12
|
-
"globals": "^15.9.0"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import svelte from 'eslint-plugin-svelte';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
import ts from 'typescript-eslint';
|
|
5
|
-
|
|
6
|
-
/** @type {import('eslint').Linter.FlatConfig[]} */
|
|
7
|
-
export default [
|
|
8
|
-
js.configs.recommended,
|
|
9
|
-
...ts.configs.recommended,
|
|
10
|
-
...svelte.configs['flat/recommended'],
|
|
11
|
-
{
|
|
12
|
-
languageOptions: {
|
|
13
|
-
globals: {
|
|
14
|
-
...globals.browser,
|
|
15
|
-
...globals.node,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
files: ['**/*.svelte'],
|
|
21
|
-
languageOptions: {
|
|
22
|
-
parserOptions: {
|
|
23
|
-
parser: ts.parser,
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
{ ignores: ['dist/'] },
|
|
28
|
-
];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-svelte-ts",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^9.10.0",
|
|
10
|
-
"eslint": "^9.10.0",
|
|
11
|
-
"eslint-plugin-svelte": "^2.43.0",
|
|
12
|
-
"globals": "^15.9.0",
|
|
13
|
-
"typescript-eslint": "^8.5.0"
|
|
14
|
-
},
|
|
15
|
-
"type": "module"
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-common-ts",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^9.10.0",
|
|
10
|
-
"eslint": "^9.10.0",
|
|
11
|
-
"globals": "^15.9.0",
|
|
12
|
-
"typescript-eslint": "^8.5.0"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import vue from 'eslint-plugin-vue';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
|
|
5
|
-
export default [
|
|
6
|
-
{ languageOptions: { globals: globals.browser } },
|
|
7
|
-
js.configs.recommended,
|
|
8
|
-
...vue.configs['flat/essential'],
|
|
9
|
-
{ ignores: ['dist/'] },
|
|
10
|
-
];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-vue-js",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^9.10.0",
|
|
10
|
-
"eslint": "^9.10.0",
|
|
11
|
-
"eslint-plugin-vue": "^9.28.0",
|
|
12
|
-
"globals": "^15.9.0"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import js from '@eslint/js';
|
|
2
|
-
import vue from 'eslint-plugin-vue';
|
|
3
|
-
import globals from 'globals';
|
|
4
|
-
import ts from 'typescript-eslint';
|
|
5
|
-
|
|
6
|
-
export default [
|
|
7
|
-
{ languageOptions: { globals: globals.browser } },
|
|
8
|
-
js.configs.recommended,
|
|
9
|
-
...ts.configs.recommended,
|
|
10
|
-
...vue.configs['flat/essential'],
|
|
11
|
-
{ ignores: ['dist/'] },
|
|
12
|
-
];
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rsbuild-eslint-vue-ts",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lint": "eslint ."
|
|
7
|
-
},
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"@eslint/js": "^9.10.0",
|
|
10
|
-
"eslint": "^9.10.0",
|
|
11
|
-
"eslint-plugin-vue": "^9.28.0",
|
|
12
|
-
"globals": "^15.9.0",
|
|
13
|
-
"typescript-eslint": "^8.5.0"
|
|
14
|
-
}
|
|
15
|
-
}
|