create-rstack 1.4.1 → 1.4.3
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 +3 -1
- package/dist/index.js +6 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare type Argv = {
|
|
|
4
4
|
template?: string;
|
|
5
5
|
override?: boolean;
|
|
6
6
|
tools?: string | string[];
|
|
7
|
+
'package-name'?: string;
|
|
7
8
|
};
|
|
8
9
|
|
|
9
10
|
export declare function checkCancel<T>(value: unknown): T;
|
|
@@ -26,7 +27,7 @@ export declare function copyFolder({ from, to, version, packageName, isMergePack
|
|
|
26
27
|
skipFiles?: string[];
|
|
27
28
|
}): void;
|
|
28
29
|
|
|
29
|
-
export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, }: {
|
|
30
|
+
export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation, }: {
|
|
30
31
|
name: string;
|
|
31
32
|
root: string;
|
|
32
33
|
skipFiles?: string[];
|
|
@@ -34,6 +35,7 @@ export declare function create({ name, root, templates, skipFiles, getTemplateNa
|
|
|
34
35
|
getTemplateName: (argv: Argv) => Promise<string>;
|
|
35
36
|
mapESLintTemplate: (templateName: string) => ESLintTemplateName | null;
|
|
36
37
|
version?: Record<string, string> | string;
|
|
38
|
+
noteInformation?: string[];
|
|
37
39
|
}): Promise<void>;
|
|
38
40
|
|
|
39
41
|
export declare type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts' | 'vue-ts' | 'vue-js' | 'svelte-js' | 'svelte-ts';
|
package/dist/index.js
CHANGED
|
@@ -1561,6 +1561,7 @@ function logHelpMessage(name, templates) {
|
|
|
1561
1561
|
-t, --template specify the template to use
|
|
1562
1562
|
--tools select additional tools (biome, eslint, prettier)
|
|
1563
1563
|
--override override files in target directory
|
|
1564
|
+
--package-name specify the package name
|
|
1564
1565
|
|
|
1565
1566
|
Templates:
|
|
1566
1567
|
|
|
@@ -1597,7 +1598,7 @@ function upperFirst(str) {
|
|
|
1597
1598
|
}
|
|
1598
1599
|
const readJSON = async (path)=>JSON.parse(await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.readFile(path, 'utf-8'));
|
|
1599
1600
|
const readPackageJson = async (filePath)=>readJSON(__WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(filePath, 'package.json'));
|
|
1600
|
-
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version }) {
|
|
1601
|
+
async function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, noteInformation }) {
|
|
1601
1602
|
const argv = minimist_default()(process.argv.slice(2), {
|
|
1602
1603
|
alias: {
|
|
1603
1604
|
h: 'help',
|
|
@@ -1620,7 +1621,9 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1620
1621
|
if (0 === value.length) return 'Project name is required';
|
|
1621
1622
|
}
|
|
1622
1623
|
}));
|
|
1623
|
-
const
|
|
1624
|
+
const formatted = formatProjectName(projectName);
|
|
1625
|
+
const { targetDir } = formatted;
|
|
1626
|
+
const packageName = argv['package-name'] || formatted.packageName;
|
|
1624
1627
|
const distFolder = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].isAbsolute(targetDir) ? targetDir : __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(cwd, targetDir);
|
|
1625
1628
|
if (!argv.override && __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].existsSync(distFolder) && !isEmptyDir(distFolder)) {
|
|
1626
1629
|
const option = checkCancel(await ve({
|
|
@@ -1689,7 +1692,7 @@ async function create({ name, root, templates, skipFiles, getTemplateName, mapES
|
|
|
1689
1692
|
await __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].promises.writeFile(biomeJsonPath, `${JSON.stringify(biomeJson, null, 2)}\n`, 'utf-8');
|
|
1690
1693
|
}
|
|
1691
1694
|
}
|
|
1692
|
-
const nextSteps = [
|
|
1695
|
+
const nextSteps = noteInformation?.length ? noteInformation : [
|
|
1693
1696
|
`1. ${picocolors_default().cyan(`cd ${targetDir}`)}`,
|
|
1694
1697
|
`2. ${picocolors_default().cyan('git init')} ${picocolors_default().dim('(optional)')}`,
|
|
1695
1698
|
`3. ${picocolors_default().cyan(`${pkgManager} install`)}`,
|