create-rstack 1.0.5 → 1.0.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.d.ts CHANGED
@@ -1,19 +1,63 @@
1
- import { multiselect, select, text } from '@clack/prompts';
2
- export { select, multiselect, text };
3
- export declare function checkCancel<T>(value: unknown): T;
4
- export type Argv = {
5
- help?: boolean;
6
- dir?: string;
7
- template?: string;
8
- override?: boolean;
9
- tools?: string | string[];
10
- };
11
- export type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts' | 'vue-ts' | 'vue-js' | 'svelte-js' | 'svelte-ts';
12
- export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, }: {
13
- name: string;
14
- root: string;
15
- skipFiles?: string[];
16
- templates: string[];
17
- getTemplateName: (argv: Argv) => Promise<string>;
18
- mapESLintTemplate: (templateName: string) => ESLintTemplateName | null;
19
- }): Promise<void>;
1
+ export declare type Argv = {
2
+ help?: boolean;
3
+ dir?: string;
4
+ template?: string;
5
+ override?: boolean;
6
+ tools?: string | string[];
7
+ };
8
+
9
+ export declare function checkCancel<T>(value: unknown): T;
10
+
11
+ export declare function create({ name, root, templates, skipFiles, getTemplateName, mapESLintTemplate, }: {
12
+ name: string;
13
+ root: string;
14
+ skipFiles?: string[];
15
+ templates: string[];
16
+ getTemplateName: (argv: Argv) => Promise<string>;
17
+ mapESLintTemplate: (templateName: string) => ESLintTemplateName | null;
18
+ }): Promise<void>;
19
+
20
+ export declare type ESLintTemplateName = 'vanilla-js' | 'vanilla-ts' | 'react-js' | 'react-ts' | 'vue-ts' | 'vue-js' | 'svelte-js' | 'svelte-ts';
21
+
22
+ export declare const multiselect: <Options extends Option_2<Value>[], Value>(opts: MultiSelectOptions<Options, Value>) => Promise<symbol | Value[]>;
23
+
24
+ declare interface MultiSelectOptions<Options extends Option_2<Value>[], Value> {
25
+ message: string;
26
+ options: Options;
27
+ initialValues?: Value[];
28
+ required?: boolean;
29
+ cursorAt?: Value;
30
+ }
31
+
32
+ declare type Option_2<Value> = Value extends Primitive ? {
33
+ value: Value;
34
+ label?: string;
35
+ hint?: string;
36
+ } : {
37
+ value: Value;
38
+ label: string;
39
+ hint?: string;
40
+ };
41
+
42
+ declare type Primitive = Readonly<string | boolean | number>;
43
+
44
+ export declare const select: <Options extends Option_2<Value>[], Value>(opts: SelectOptions<Options, Value>) => Promise<symbol | Value>;
45
+
46
+ declare interface SelectOptions<Options extends Option_2<Value>[], Value> {
47
+ message: string;
48
+ options: Options;
49
+ initialValue?: Value;
50
+ maxItems?: number;
51
+ }
52
+
53
+ export declare const text: (opts: TextOptions) => Promise<string | symbol>;
54
+
55
+ declare interface TextOptions {
56
+ message: string;
57
+ placeholder?: string;
58
+ defaultValue?: string;
59
+ initialValue?: string;
60
+ validate?: (value: string) => string | void;
61
+ }
62
+
63
+ export { }
package/dist/index.js CHANGED
@@ -1,8 +1,10 @@
1
- import { fileURLToPath as __webpack_fileURLToPath__ } from "url";
2
- import { dirname as __webpack_dirname__ } from "path";
1
+ // Rslib ESM shims
2
+ import __rslib_shim_module__ from 'module';
3
+ const require = /*#__PURE__*/ __rslib_shim_module__.createRequire(import.meta.url);
3
4
  import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
4
5
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs__ from "node:fs";
5
6
  import * as __WEBPACK_EXTERNAL_MODULE_node_path__ from "node:path";
7
+ import * as __WEBPACK_EXTERNAL_MODULE_node_url__ from "node:url";
6
8
  import * as __WEBPACK_EXTERNAL_MODULE_node_process__ from "node:process";
7
9
  import * as __WEBPACK_EXTERNAL_MODULE_node_readline__ from "node:readline";
8
10
  import * as __WEBPACK_EXTERNAL_MODULE_node_tty__ from "node:tty";
@@ -1502,7 +1504,8 @@ ${gray(rest.join("\n"))}`;
1502
1504
  };
1503
1505
  // src/index.ts
1504
1506
  var logger = createLogger();
1505
- var src_dirname = __webpack_dirname__(__webpack_fileURLToPath__(import.meta.url));
1507
+ const src_filename = (0, __WEBPACK_EXTERNAL_MODULE_node_url__.fileURLToPath)(import.meta.url);
1508
+ const src_dirname = (0, __WEBPACK_EXTERNAL_MODULE_node_path__.dirname)(src_filename);
1506
1509
  function cancelAndExit() {
1507
1510
  ue('Operation cancelled.');
1508
1511
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rstack",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Create a new Rstack project",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,7 +28,7 @@
28
28
  "lint": "biome check .",
29
29
  "lint:write": "biome check . --write",
30
30
  "prepare": "simple-git-hooks && npm run build",
31
- "test": "playwright test",
31
+ "test": "node test/index.js",
32
32
  "bump": "npx bumpp"
33
33
  },
34
34
  "simple-git-hooks": {
@@ -42,7 +42,8 @@
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "^1.9.3",
44
44
  "@clack/prompts": "^0.7.0",
45
- "@rslib/core": "0.0.11",
45
+ "@microsoft/api-extractor": "^7.47.10",
46
+ "@rslib/core": "0.0.12",
46
47
  "@types/minimist": "^1.2.5",
47
48
  "@types/node": "18.19.55",
48
49
  "deepmerge": "^4.3.1",