create-rstack 2.1.3 → 3.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/LICENSE +1 -1
- package/README.md +43 -73
- package/bin.js +2 -0
- package/dist/index.js +195 -3312
- package/package.json +23 -41
- package/template-app-lit/package.json +23 -0
- package/template-app-lit/rstack.config.js +28 -0
- package/template-app-lit/src/index.css +6 -0
- package/template-app-lit/src/index.html +7 -0
- package/template-app-lit/src/index.js +4 -0
- package/template-app-lit/src/my-element.js +34 -0
- package/template-app-lit/tests/index.test.js +12 -0
- package/template-app-lit-ts/package.json +25 -0
- package/template-app-lit-ts/rstack.config.ts +27 -0
- package/template-app-lit-ts/src/index.css +6 -0
- package/template-app-lit-ts/src/index.html +7 -0
- package/template-app-lit-ts/src/index.ts +4 -0
- package/template-app-lit-ts/src/my-element.ts +34 -0
- package/template-app-lit-ts/tests/index.test.ts +12 -0
- package/template-app-lit-ts/tsconfig.json +23 -0
- package/template-app-preact/package.json +26 -0
- package/template-app-preact/rstack.config.js +29 -0
- package/template-app-preact/src/App.css +26 -0
- package/template-app-preact/src/App.jsx +12 -0
- package/template-app-preact/src/index.jsx +4 -0
- package/template-app-preact/tests/index.test.jsx +8 -0
- package/template-app-preact/tests/rstest.setup.js +4 -0
- package/template-app-preact-ts/package.json +28 -0
- package/template-app-preact-ts/rstack.config.ts +29 -0
- package/template-app-preact-ts/src/App.css +26 -0
- package/template-app-preact-ts/src/App.tsx +12 -0
- package/template-app-preact-ts/src/index.tsx +7 -0
- package/template-app-preact-ts/tests/index.test.tsx +8 -0
- package/template-app-preact-ts/tests/rstest.setup.ts +4 -0
- package/template-app-preact-ts/tests/tsconfig.json +7 -0
- package/template-app-preact-ts/tsconfig.json +28 -0
- package/template-app-react/package.json +28 -0
- package/template-app-react/rstack.config.js +29 -0
- package/template-app-react/src/App.css +26 -0
- package/template-app-react/src/App.jsx +12 -0
- package/template-app-react/src/index.jsx +10 -0
- package/template-app-react/tests/index.test.jsx +8 -0
- package/template-app-react/tests/rstest.setup.js +4 -0
- package/template-app-react-ts/package.json +32 -0
- package/template-app-react-ts/rstack.config.ts +29 -0
- package/template-app-react-ts/src/App.css +26 -0
- package/template-app-react-ts/src/App.tsx +12 -0
- package/template-app-react-ts/src/env.d.ts +9 -0
- package/template-app-react-ts/src/index.tsx +13 -0
- package/template-app-react-ts/tests/index.test.tsx +8 -0
- package/template-app-react-ts/tests/rstest.setup.ts +4 -0
- package/template-app-react-ts/tests/tsconfig.json +7 -0
- package/template-app-react-ts/tsconfig.json +23 -0
- package/template-app-solid/package.json +27 -0
- package/template-app-solid/rstack.config.js +31 -0
- package/template-app-solid/src/App.css +26 -0
- package/template-app-solid/src/App.jsx +12 -0
- package/template-app-solid/src/index.jsx +4 -0
- package/template-app-solid/tests/index.test.jsx +8 -0
- package/template-app-solid/tests/rstest.setup.js +4 -0
- package/template-app-solid-ts/package.json +29 -0
- package/template-app-solid-ts/rstack.config.ts +30 -0
- package/template-app-solid-ts/src/App.css +26 -0
- package/template-app-solid-ts/src/App.tsx +12 -0
- package/template-app-solid-ts/src/index.tsx +7 -0
- package/template-app-solid-ts/tests/index.test.tsx +8 -0
- package/template-app-solid-ts/tests/rstest.setup.ts +4 -0
- package/template-app-solid-ts/tests/tsconfig.json +7 -0
- package/template-app-solid-ts/tsconfig.json +24 -0
- package/template-app-svelte/package.json +27 -0
- package/template-app-svelte/pnpm-workspace.yaml +2 -0
- package/template-app-svelte/rstack.config.js +26 -0
- package/template-app-svelte/src/App.svelte +28 -0
- package/template-app-svelte/src/index.css +6 -0
- package/template-app-svelte/src/index.js +8 -0
- package/template-app-svelte/tests/index.test.js +8 -0
- package/template-app-svelte/tests/rstest.setup.js +4 -0
- package/template-app-svelte-ts/package.json +30 -0
- package/template-app-svelte-ts/pnpm-workspace.yaml +2 -0
- package/template-app-svelte-ts/rstack.config.ts +25 -0
- package/template-app-svelte-ts/src/App.svelte +37 -0
- package/template-app-svelte-ts/src/index.css +6 -0
- package/template-app-svelte-ts/src/index.ts +14 -0
- package/template-app-svelte-ts/tests/index.test.ts +11 -0
- package/template-app-svelte-ts/tests/rstest.setup.ts +4 -0
- package/template-app-svelte-ts/tests/tsconfig.json +7 -0
- package/template-app-svelte-ts/tsconfig.json +22 -0
- package/template-app-vanilla/package.json +22 -0
- package/template-app-vanilla/rstack.config.js +21 -0
- package/template-app-vanilla/src/index.css +26 -0
- package/template-app-vanilla/src/index.js +12 -0
- package/template-app-vanilla/tests/dom.test.js +12 -0
- package/template-app-vanilla/tests/rstest.setup.js +4 -0
- package/template-app-vanilla-ts/package.json +24 -0
- package/template-app-vanilla-ts/rstack.config.ts +20 -0
- package/template-app-vanilla-ts/src/index.css +26 -0
- package/template-app-vanilla-ts/src/index.ts +12 -0
- package/template-app-vanilla-ts/tests/dom.test.ts +12 -0
- package/template-app-vanilla-ts/tests/rstest.setup.ts +4 -0
- package/template-app-vanilla-ts/tests/tsconfig.json +7 -0
- package/template-app-vanilla-ts/tsconfig.json +22 -0
- package/template-app-vue/package.json +26 -0
- package/template-app-vue/rstack.config.js +25 -0
- package/template-app-vue/src/App.vue +28 -0
- package/template-app-vue/src/index.css +6 -0
- package/template-app-vue/src/index.js +5 -0
- package/template-app-vue/tests/index.test.js +8 -0
- package/template-app-vue/tests/rstest.setup.js +6 -0
- package/template-app-vue-ts/package.json +29 -0
- package/template-app-vue-ts/rstack.config.ts +24 -0
- package/template-app-vue-ts/src/App.vue +28 -0
- package/template-app-vue-ts/src/index.css +6 -0
- package/template-app-vue-ts/src/index.ts +5 -0
- package/template-app-vue-ts/tests/index.test.ts +8 -0
- package/template-app-vue-ts/tests/rstest.setup.ts +6 -0
- package/template-app-vue-ts/tests/tsconfig.json +7 -0
- package/template-app-vue-ts/tsconfig.json +24 -0
- package/template-common/AGENTS.md +7 -0
- package/template-common/README.md +25 -0
- package/template-common/gitignore +13 -0
- package/template-doc/README.md +23 -0
- package/template-doc/docs/_nav.json +16 -0
- package/template-doc/docs/api/_meta.json +1 -0
- package/template-doc/docs/api/commands.mdx +25 -0
- package/template-doc/docs/api/index.mdx +6 -0
- package/template-doc/docs/guide/_meta.json +7 -0
- package/template-doc/docs/guide/start/_meta.json +1 -0
- package/template-doc/docs/guide/start/introduction.md +5 -0
- package/template-doc/docs/index.md +39 -0
- package/template-doc/gitignore +14 -0
- package/template-doc/package.json +24 -0
- package/template-doc/rstack.config.ts +23 -0
- package/template-doc/tsconfig.json +26 -0
- package/template-doc-i18n/README.md +23 -0
- package/template-doc-i18n/docs/en/_nav.json +16 -0
- package/template-doc-i18n/docs/en/api/_meta.json +1 -0
- package/template-doc-i18n/docs/en/api/commands.mdx +25 -0
- package/template-doc-i18n/docs/en/api/index.mdx +6 -0
- package/template-doc-i18n/docs/en/guide/_meta.json +7 -0
- package/template-doc-i18n/docs/en/guide/start/_meta.json +1 -0
- package/template-doc-i18n/docs/en/guide/start/introduction.md +5 -0
- package/template-doc-i18n/docs/en/index.md +39 -0
- package/template-doc-i18n/docs/zh/_nav.json +16 -0
- package/template-doc-i18n/docs/zh/api/_meta.json +12 -0
- package/template-doc-i18n/docs/zh/api/commands.mdx +25 -0
- package/template-doc-i18n/docs/zh/api/index.mdx +6 -0
- package/template-doc-i18n/docs/zh/guide/_meta.json +7 -0
- package/template-doc-i18n/docs/zh/guide/start/_meta.json +7 -0
- package/template-doc-i18n/docs/zh/guide/start/introduction.md +5 -0
- package/template-doc-i18n/docs/zh/index.md +39 -0
- package/template-doc-i18n/gitignore +14 -0
- package/template-doc-i18n/package.json +24 -0
- package/template-doc-i18n/rstack.config.ts +39 -0
- package/template-doc-i18n/tsconfig.json +26 -0
- package/template-lib-node/README.md +24 -0
- package/template-lib-node/package.json +33 -0
- package/template-lib-node/rstack.config.js +21 -0
- package/template-lib-node/src/index.js +1 -0
- package/template-lib-node/tests/index.test.js +7 -0
- package/template-lib-node-ts/README.md +24 -0
- package/template-lib-node-ts/package.json +37 -0
- package/template-lib-node-ts/rstack.config.ts +21 -0
- package/template-lib-node-ts/src/index.ts +1 -0
- package/template-lib-node-ts/tests/index.test.ts +7 -0
- package/template-lib-node-ts/tsconfig.json +23 -0
- package/template-lib-react/README.md +24 -0
- package/template-lib-react/package.json +41 -0
- package/template-lib-react/rstack.config.js +38 -0
- package/template-lib-react/src/Button.jsx +21 -0
- package/template-lib-react/src/button.css +34 -0
- package/template-lib-react/src/index.jsx +1 -0
- package/template-lib-react/tests/index.test.jsx +11 -0
- package/template-lib-react/tests/rstest.setup.js +4 -0
- package/template-lib-react-ts/README.md +24 -0
- package/template-lib-react-ts/package.json +46 -0
- package/template-lib-react-ts/rstack.config.ts +39 -0
- package/template-lib-react-ts/src/Button.tsx +46 -0
- package/template-lib-react-ts/src/button.css +34 -0
- package/template-lib-react-ts/src/index.tsx +1 -0
- package/template-lib-react-ts/tests/index.test.tsx +11 -0
- package/template-lib-react-ts/tests/rstest.setup.ts +4 -0
- package/template-lib-react-ts/tests/tsconfig.json +8 -0
- package/template-lib-react-ts/tsconfig.json +24 -0
- package/template-lib-solid/README.md +24 -0
- package/template-lib-solid/package.json +39 -0
- package/template-lib-solid/rstack.config.js +86 -0
- package/template-lib-solid/src/Button.jsx +18 -0
- package/template-lib-solid/src/button.css +34 -0
- package/template-lib-solid/src/index.jsx +1 -0
- package/template-lib-solid/tests/index.test.jsx +11 -0
- package/template-lib-solid/tests/rstest.setup.js +4 -0
- package/template-lib-solid-ts/README.md +24 -0
- package/template-lib-solid-ts/package.json +43 -0
- package/template-lib-solid-ts/rstack.config.ts +86 -0
- package/template-lib-solid-ts/src/Button.tsx +43 -0
- package/template-lib-solid-ts/src/button.css +34 -0
- package/template-lib-solid-ts/src/index.tsx +2 -0
- package/template-lib-solid-ts/tests/index.test.tsx +11 -0
- package/template-lib-solid-ts/tests/rstest.setup.ts +4 -0
- package/template-lib-solid-ts/tests/tsconfig.json +8 -0
- package/template-lib-solid-ts/tsconfig.json +25 -0
- package/template-lib-svelte/README.md +24 -0
- package/template-lib-svelte/package.json +36 -0
- package/template-lib-svelte/pnpm-workspace.yaml +2 -0
- package/template-lib-svelte/rstack.config.js +35 -0
- package/template-lib-svelte/src/Button.svelte +24 -0
- package/template-lib-svelte/src/button.css +34 -0
- package/template-lib-svelte/src/index.js +1 -0
- package/template-lib-svelte/tests/index.test.js +19 -0
- package/template-lib-svelte-ts/README.md +24 -0
- package/template-lib-svelte-ts/package.json +42 -0
- package/template-lib-svelte-ts/pnpm-workspace.yaml +2 -0
- package/template-lib-svelte-ts/rstack.config.ts +35 -0
- package/template-lib-svelte-ts/scripts/rslib-plugin-svelte-dts.ts +59 -0
- package/template-lib-svelte-ts/src/Button.svelte +34 -0
- package/template-lib-svelte-ts/src/button.css +34 -0
- package/template-lib-svelte-ts/src/index.ts +1 -0
- package/template-lib-svelte-ts/tests/index.test.ts +19 -0
- package/template-lib-svelte-ts/tests/tsconfig.json +7 -0
- package/template-lib-svelte-ts/tsconfig.json +25 -0
- package/template-lib-vue/README.md +24 -0
- package/template-lib-vue/package.json +37 -0
- package/template-lib-vue/rstack.config.js +34 -0
- package/template-lib-vue/src/Button.vue +43 -0
- package/template-lib-vue/src/button.css +34 -0
- package/template-lib-vue/src/index.js +1 -0
- package/template-lib-vue/tests/index.test.js +17 -0
- package/template-lib-vue/tests/rstest.setup.js +6 -0
- package/template-lib-vue-ts/README.md +24 -0
- package/template-lib-vue-ts/package.json +42 -0
- package/template-lib-vue-ts/rstack.config.ts +33 -0
- package/template-lib-vue-ts/src/Button.vue +35 -0
- package/template-lib-vue-ts/src/button.css +34 -0
- package/template-lib-vue-ts/src/index.ts +1 -0
- package/template-lib-vue-ts/tests/index.test.ts +17 -0
- package/template-lib-vue-ts/tests/rstest.setup.ts +6 -0
- package/template-lib-vue-ts/tests/tsconfig.json +8 -0
- package/template-lib-vue-ts/tsconfig.json +27 -0
- package/dist/index.d.ts +0 -356
- package/template-biome/AGENTS.md +0 -6
- package/template-biome/biome.json.template +0 -34
- package/template-biome/package.json +0 -12
- package/template-eslint/AGENTS.md +0 -5
- package/template-eslint/react-js/eslint.config.mjs +0 -23
- package/template-eslint/react-js/package.json +0 -15
- package/template-eslint/react-ts/eslint.config.mjs +0 -22
- package/template-eslint/react-ts/package.json +0 -16
- 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 -15
- package/template-eslint/vue-js/package.json +0 -14
- package/template-eslint/vue-ts/eslint.config.mjs +0 -23
- package/template-eslint/vue-ts/package.json +0 -15
- package/template-prettier/.prettierignore +0 -4
- package/template-prettier/.prettierrc +0 -3
- package/template-prettier/AGENTS.md +0 -5
- package/template-prettier/package.json +0 -11
- package/template-rslint/AGENTS.md +0 -9
- package/template-rslint/react-js/package.json +0 -11
- package/template-rslint/react-js/rslint.config.ts +0 -7
- package/template-rslint/react-ts/package.json +0 -11
- package/template-rslint/react-ts/rslint.config.ts +0 -14
- package/template-rslint/vanilla-js/package.json +0 -11
- package/template-rslint/vanilla-js/rslint.config.ts +0 -3
- package/template-rslint/vanilla-ts/package.json +0 -11
- package/template-rslint/vanilla-ts/rslint.config.ts +0 -3
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,90 +1,60 @@
|
|
|
1
1
|
# create-rstack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Create a new Rstack project.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
<a href="https://npmjs.com/package/create-rstack">
|
|
9
|
-
<img src="https://img.shields.io/npm/v/create-rstack?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
|
|
10
|
-
</a>
|
|
11
|
-
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
## Install
|
|
7
|
+
Using `npm create`:
|
|
15
8
|
|
|
16
9
|
```bash
|
|
17
|
-
npm
|
|
10
|
+
npm create rstack@latest
|
|
18
11
|
```
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### NPM Template Support
|
|
23
|
-
|
|
24
|
-
`create-rstack` supports using npm packages as templates, allowing users to create projects from custom templates published to npm.
|
|
25
|
-
|
|
26
|
-
#### Usage
|
|
13
|
+
Using CLI flags:
|
|
27
14
|
|
|
28
15
|
```bash
|
|
29
|
-
|
|
30
|
-
npm create rsbuild@latest my-project -- --template my-template-package
|
|
31
|
-
|
|
32
|
-
# Using scoped package
|
|
33
|
-
npm create rsbuild@latest my-project -- --template @scope/template-package
|
|
34
|
-
|
|
35
|
-
# Using explicit npm: prefix
|
|
36
|
-
npm create rsbuild@latest my-project -- --template npm:my-template-package
|
|
37
|
-
|
|
38
|
-
# With specific version
|
|
39
|
-
npm create rsbuild@latest my-project -- --template my-template-package --template-version 1.2.3
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
#### Template Package Structure
|
|
16
|
+
npx create-rstack --dir my-project --template app-vanilla-ts
|
|
43
17
|
|
|
44
|
-
|
|
18
|
+
# Using abbreviations
|
|
19
|
+
npx create-rstack -d my-project -t app-vanilla-ts
|
|
45
20
|
|
|
21
|
+
# Skip Git initialization
|
|
22
|
+
npx create-rstack --dir my-project --template app-vanilla-ts --no-git
|
|
46
23
|
```
|
|
47
|
-
my-template-package/
|
|
48
|
-
├── template/ # Preferred
|
|
49
|
-
│ ├── package.json
|
|
50
|
-
│ └── src/
|
|
51
|
-
├── templates/
|
|
52
|
-
│ └── app/ # Alternative
|
|
53
|
-
└── (root) # Fallback
|
|
54
|
-
├── package.json
|
|
55
|
-
└── src/
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
#### Caching Strategy
|
|
59
|
-
|
|
60
|
-
- Templates with `latest` version are always re-installed to ensure the latest version
|
|
61
|
-
- Specific versions are cached in `.temp-templates/` for faster reuse
|
|
62
|
-
|
|
63
|
-
#### API
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
import {
|
|
67
|
-
isNpmTemplate,
|
|
68
|
-
resolveCustomTemplate,
|
|
69
|
-
resolveNpmTemplate,
|
|
70
|
-
} from 'create-rstack';
|
|
71
|
-
|
|
72
|
-
// Check if template input is an npm package
|
|
73
|
-
if (isNpmTemplate(templateInput)) {
|
|
74
|
-
// Resolve npm template to local path
|
|
75
|
-
const templatePath = resolveCustomTemplate(templateInput, version);
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Examples
|
|
80
|
-
|
|
81
|
-
| Project | Link |
|
|
82
|
-
| ------- | -------------------------------------------------------------------------------------------- |
|
|
83
|
-
| Rsbuild | [create-rsbuild](https://github.com/web-infra-dev/rsbuild/tree/main/packages/create-rsbuild) |
|
|
84
|
-
| Rslib | [create-rslib](https://github.com/web-infra-dev/rslib/tree/main/packages/create-rslib) |
|
|
85
24
|
|
|
86
|
-
|
|
25
|
+
## Templates
|
|
26
|
+
|
|
27
|
+
- `app-vanilla` - JavaScript Vanilla application
|
|
28
|
+
- `app-vanilla-ts` - TypeScript Vanilla application
|
|
29
|
+
- `app-react` - JavaScript React application
|
|
30
|
+
- `app-react-ts` - TypeScript React application
|
|
31
|
+
- `app-preact` - JavaScript Preact application
|
|
32
|
+
- `app-preact-ts` - TypeScript Preact application
|
|
33
|
+
- `app-vue` - JavaScript Vue application
|
|
34
|
+
- `app-vue-ts` - TypeScript Vue application
|
|
35
|
+
- `app-lit` - JavaScript Lit application
|
|
36
|
+
- `app-lit-ts` - TypeScript Lit application
|
|
37
|
+
- `app-svelte` - JavaScript Svelte application
|
|
38
|
+
- `app-svelte-ts` - TypeScript Svelte application
|
|
39
|
+
- `app-solid` - JavaScript Solid application
|
|
40
|
+
- `app-solid-ts` - TypeScript Solid application
|
|
41
|
+
- `lib-node` - JavaScript Node.js library
|
|
42
|
+
- `lib-node-ts` - TypeScript Node.js library
|
|
43
|
+
- `lib-react` - JavaScript React library
|
|
44
|
+
- `lib-react-ts` - TypeScript React library
|
|
45
|
+
- `lib-vue` - JavaScript Vue library
|
|
46
|
+
- `lib-vue-ts` - TypeScript Vue library
|
|
47
|
+
- `lib-svelte` - JavaScript Svelte library
|
|
48
|
+
- `lib-svelte-ts` - TypeScript Svelte library
|
|
49
|
+
- `lib-solid` - JavaScript Solid library
|
|
50
|
+
- `lib-solid-ts` - TypeScript Solid library
|
|
51
|
+
- `doc` - Basic documentation site
|
|
52
|
+
- `doc-i18n` - Multilingual documentation site
|
|
53
|
+
|
|
54
|
+
## Documentation
|
|
55
|
+
|
|
56
|
+
See the [Rstack documentation](https://rstack.rs).
|
|
87
57
|
|
|
88
58
|
## License
|
|
89
59
|
|
|
90
|
-
[MIT](
|
|
60
|
+
[MIT](https://github.com/rstackjs/rstack-cli/blob/main/LICENSE).
|
package/bin.js
ADDED