create-rstack 1.0.8 → 1.1.0

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/README.md CHANGED
@@ -17,13 +17,15 @@ A shared package for create-rspack, create-rsbuild, create-rspress and create-rs
17
17
  npm add create-rstack -D
18
18
  ```
19
19
 
20
- ## Example
20
+ ## Examples
21
21
 
22
- See: [create-rsbuild](https://github.com/web-infra-dev/rsbuild/tree/main/packages/create-rsbuild).
22
+ | Project | Link |
23
+ | ------- | -------------------------------------------------------------------------------------------- |
24
+ | Rsbuild | [create-rsbuild](https://github.com/web-infra-dev/rsbuild/tree/main/packages/create-rsbuild) |
25
+ | Rslib | [create-rslib](https://github.com/web-infra-dev/rslib/tree/main/packages/create-rslib) |
23
26
 
24
27
  ![image](https://github.com/user-attachments/assets/2dda3501-720c-4151-bd3e-5e038dca9e68)
25
28
 
26
-
27
29
  ## License
28
30
 
29
31
  [MIT](./LICENSE).
package/dist/index.d.ts CHANGED
@@ -12,27 +12,28 @@ export declare function checkCancel<T>(value: unknown): T;
12
12
  * Copy files from one folder to another.
13
13
  * @param from Source folder
14
14
  * @param to Destination folder
15
- * @param version Version to update in package.json
16
- * @param packageName Name to update in package.json
15
+ * @param version - Optional. The version to update in the package.json. If not provided, version will not be updated.
16
+ * @param name - Optional. The name to update in the package.json. If not provided, name will not be updated.
17
17
  * @param isMergePackageJson Merge package.json files
18
18
  * @param skipFiles Files to skip
19
19
  */
20
20
  export declare function copyFolder({ from, to, version, packageName, isMergePackageJson, skipFiles, }: {
21
21
  from: string;
22
22
  to: string;
23
- version: string;
23
+ version?: string | Record<string, string>;
24
24
  packageName?: string;
25
25
  isMergePackageJson?: boolean;
26
26
  skipFiles?: string[];
27
27
  }): void;
28
28
 
29
- export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, }: {
29
+ export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, version, }: {
30
30
  name: string;
31
31
  root: string;
32
32
  skipFiles?: string[];
33
33
  templates: string[];
34
34
  getTemplateName: (argv: Argv) => Promise<string>;
35
35
  mapESLintTemplate: (templateName: string) => ESLintTemplateName | null;
36
+ version?: Record<string, string> | string;
36
37
  }): Promise<void>;
37
38
 
38
39
  export declare type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts' | 'vue-ts' | 'vue-js' | 'svelte-js' | 'svelte-ts';
@@ -44,12 +45,13 @@ export declare type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js
44
45
  */
45
46
  export declare function mergePackageJson(targetPackage: string, extraPackage: string): void;
46
47
 
47
- export declare const multiselect: <Options extends Option_2<Value>[], Value>(opts: MultiSelectOptions<Options, Value>) => Promise<symbol | Value[]>;
48
+ export declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<symbol | Value[]>;
48
49
 
49
- declare interface MultiSelectOptions<Options extends Option_2<Value>[], Value> {
50
+ declare interface MultiSelectOptions<Value> {
50
51
  message: string;
51
- options: Options;
52
+ options: Option_2<Value>[];
52
53
  initialValues?: Value[];
54
+ maxItems?: number;
53
55
  required?: boolean;
54
56
  cursorAt?: Value;
55
57
  }
@@ -66,11 +68,11 @@ declare type Option_2<Value> = Value extends Primitive ? {
66
68
 
67
69
  declare type Primitive = Readonly<string | boolean | number>;
68
70
 
69
- export declare const select: <Options extends Option_2<Value>[], Value>(opts: SelectOptions<Options, Value>) => Promise<symbol | Value>;
71
+ export declare const select: <Value>(opts: SelectOptions<Value>) => Promise<symbol | Value>;
70
72
 
71
- declare interface SelectOptions<Options extends Option_2<Value>[], Value> {
73
+ declare interface SelectOptions<Value> {
72
74
  message: string;
73
- options: Options;
75
+ options: Option_2<Value>[];
74
76
  initialValue?: Value;
75
77
  maxItems?: number;
76
78
  }