create-rstack 1.0.7 → 1.0.8
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 +25 -0
- package/dist/index.js +15 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,24 @@ export declare type Argv = {
|
|
|
8
8
|
|
|
9
9
|
export declare function checkCancel<T>(value: unknown): T;
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Copy files from one folder to another.
|
|
13
|
+
* @param from Source folder
|
|
14
|
+
* @param to Destination folder
|
|
15
|
+
* @param version Version to update in package.json
|
|
16
|
+
* @param packageName Name to update in package.json
|
|
17
|
+
* @param isMergePackageJson Merge package.json files
|
|
18
|
+
* @param skipFiles Files to skip
|
|
19
|
+
*/
|
|
20
|
+
export declare function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFiles, }: {
|
|
21
|
+
from: string;
|
|
22
|
+
to: string;
|
|
23
|
+
version: string;
|
|
24
|
+
packageName?: string;
|
|
25
|
+
isMergePackageJson?: boolean;
|
|
26
|
+
skipFiles?: string[];
|
|
27
|
+
}): void;
|
|
28
|
+
|
|
11
29
|
export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, }: {
|
|
12
30
|
name: string;
|
|
13
31
|
root: string;
|
|
@@ -19,6 +37,13 @@ export declare function create({ name, root, templates, skipFiles, getTemplateNa
|
|
|
19
37
|
|
|
20
38
|
export declare type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts' | 'vue-ts' | 'vue-js' | 'svelte-js' | 'svelte-ts';
|
|
21
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Merge two package.json files and keep the order of keys.
|
|
42
|
+
* @param targetPackage Path to the base package.json file
|
|
43
|
+
* @param extraPackage Path to the extra package.json file to merge
|
|
44
|
+
*/
|
|
45
|
+
export declare function mergePackageJson(targetPackage: string, extraPackage: string): void;
|
|
46
|
+
|
|
22
47
|
export declare const multiselect: <Options extends Option_2<Value>[], Value>(opts: MultiSelectOptions<Options, Value>) => Promise<symbol | Value[]>;
|
|
23
48
|
|
|
24
49
|
declare interface MultiSelectOptions<Options extends Option_2<Value>[], Value> {
|
package/dist/index.js
CHANGED
|
@@ -1693,7 +1693,11 @@ function sortObjectKeys(obj) {
|
|
|
1693
1693
|
for (const key of sortedKeys)sortedObj[key] = obj[key];
|
|
1694
1694
|
return sortedObj;
|
|
1695
1695
|
}
|
|
1696
|
-
|
|
1696
|
+
/**
|
|
1697
|
+
* Merge two package.json files and keep the order of keys.
|
|
1698
|
+
* @param targetPackage Path to the base package.json file
|
|
1699
|
+
* @param extraPackage Path to the extra package.json file to merge
|
|
1700
|
+
*/ function mergePackageJson(targetPackage, extraPackage) {
|
|
1697
1701
|
if (!__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].existsSync(targetPackage)) return;
|
|
1698
1702
|
const targetJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(targetPackage, 'utf-8'));
|
|
1699
1703
|
const extraJson = JSON.parse(__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].readFileSync(extraPackage, 'utf-8'));
|
|
@@ -1708,7 +1712,15 @@ function mergePackageJson(targetPackage, extraPackage) {
|
|
|
1708
1712
|
}
|
|
1709
1713
|
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].writeFileSync(targetPackage, `${JSON.stringify(mergedJson, null, 2)}\n`);
|
|
1710
1714
|
}
|
|
1711
|
-
|
|
1715
|
+
/**
|
|
1716
|
+
* Copy files from one folder to another.
|
|
1717
|
+
* @param from Source folder
|
|
1718
|
+
* @param to Destination folder
|
|
1719
|
+
* @param version Version to update in package.json
|
|
1720
|
+
* @param packageName Name to update in package.json
|
|
1721
|
+
* @param isMergePackageJson Merge package.json files
|
|
1722
|
+
* @param skipFiles Files to skip
|
|
1723
|
+
*/ function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFiles = [] }) {
|
|
1712
1724
|
const renameFiles = {
|
|
1713
1725
|
gitignore: '.gitignore'
|
|
1714
1726
|
};
|
|
@@ -1758,4 +1770,4 @@ const updatePackageJson = (pkgJsonPath, version, name)=>{
|
|
|
1758
1770
|
if (name && '.' !== name) pkg.name = name;
|
|
1759
1771
|
__WEBPACK_EXTERNAL_MODULE_node_fs__["default"].writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2));
|
|
1760
1772
|
};
|
|
1761
|
-
export { checkCancel, create, ae as multiselect, ie as select, te as text };
|
|
1773
|
+
export { checkCancel, copyFolder, create, mergePackageJson, ae as multiselect, ie as select, te as text };
|