create-rstack 2.1.3 → 3.0.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 +203 -3312
- package/package.json +23 -41
- package/template-app-lit-js/package.json +23 -0
- package/template-app-lit-js/rstack.config.js +28 -0
- package/template-app-lit-js/src/index.css +6 -0
- package/template-app-lit-js/src/index.html +7 -0
- package/template-app-lit-js/src/index.js +4 -0
- package/template-app-lit-js/src/my-element.js +34 -0
- package/template-app-lit-js/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-js/package.json +26 -0
- package/template-app-preact-js/rstack.config.js +29 -0
- package/template-app-preact-js/src/App.css +26 -0
- package/template-app-preact-js/src/App.jsx +12 -0
- package/template-app-preact-js/src/index.jsx +4 -0
- package/template-app-preact-js/tests/index.test.jsx +8 -0
- package/template-app-preact-js/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-js/package.json +28 -0
- package/template-app-react-js/rstack.config.js +29 -0
- package/template-app-react-js/src/App.css +26 -0
- package/template-app-react-js/src/App.jsx +12 -0
- package/template-app-react-js/src/index.jsx +10 -0
- package/template-app-react-js/tests/index.test.jsx +8 -0
- package/template-app-react-js/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-js/package.json +27 -0
- package/template-app-solid-js/rstack.config.js +31 -0
- package/template-app-solid-js/src/App.css +26 -0
- package/template-app-solid-js/src/App.jsx +12 -0
- package/template-app-solid-js/src/index.jsx +4 -0
- package/template-app-solid-js/tests/index.test.jsx +8 -0
- package/template-app-solid-js/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-js/package.json +27 -0
- package/template-app-svelte-js/pnpm-workspace.yaml +2 -0
- package/template-app-svelte-js/rstack.config.js +26 -0
- package/template-app-svelte-js/src/App.svelte +28 -0
- package/template-app-svelte-js/src/index.css +6 -0
- package/template-app-svelte-js/src/index.js +8 -0
- package/template-app-svelte-js/tests/index.test.js +8 -0
- package/template-app-svelte-js/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-js/package.json +22 -0
- package/template-app-vanilla-js/rstack.config.js +21 -0
- package/template-app-vanilla-js/src/index.css +26 -0
- package/template-app-vanilla-js/src/index.js +12 -0
- package/template-app-vanilla-js/tests/dom.test.js +12 -0
- package/template-app-vanilla-js/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-js/package.json +26 -0
- package/template-app-vue-js/rstack.config.js +25 -0
- package/template-app-vue-js/src/App.vue +28 -0
- package/template-app-vue-js/src/index.css +6 -0
- package/template-app-vue-js/src/index.js +5 -0
- package/template-app-vue-js/tests/index.test.js +8 -0
- package/template-app-vue-js/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 +34 -0
- package/template-common/gitignore +13 -0
- package/template-doc-basic/README.md +34 -0
- package/template-doc-basic/docs/_nav.json +16 -0
- package/template-doc-basic/docs/api/_meta.json +1 -0
- package/template-doc-basic/docs/api/commands.mdx +25 -0
- package/template-doc-basic/docs/api/index.mdx +6 -0
- package/template-doc-basic/docs/guide/_meta.json +7 -0
- package/template-doc-basic/docs/guide/start/_meta.json +1 -0
- package/template-doc-basic/docs/guide/start/introduction.md +5 -0
- package/template-doc-basic/docs/index.md +39 -0
- package/template-doc-basic/gitignore +14 -0
- package/template-doc-basic/package.json +24 -0
- package/template-doc-basic/rstack.config.ts +23 -0
- package/template-doc-basic/tsconfig.json +26 -0
- package/template-doc-i18n/README.md +34 -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-js/README.md +40 -0
- package/template-lib-node-js/package.json +33 -0
- package/template-lib-node-js/rstack.config.js +21 -0
- package/template-lib-node-js/src/index.js +1 -0
- package/template-lib-node-js/tests/index.test.js +7 -0
- package/template-lib-node-ts/README.md +40 -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-js/README.md +40 -0
- package/template-lib-react-js/package.json +41 -0
- package/template-lib-react-js/rstack.config.js +38 -0
- package/template-lib-react-js/src/Button.jsx +21 -0
- package/template-lib-react-js/src/button.css +34 -0
- package/template-lib-react-js/src/index.jsx +1 -0
- package/template-lib-react-js/tests/index.test.jsx +11 -0
- package/template-lib-react-js/tests/rstest.setup.js +4 -0
- package/template-lib-react-ts/README.md +40 -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-js/README.md +40 -0
- package/template-lib-solid-js/package.json +39 -0
- package/template-lib-solid-js/rstack.config.js +86 -0
- package/template-lib-solid-js/src/Button.jsx +18 -0
- package/template-lib-solid-js/src/button.css +34 -0
- package/template-lib-solid-js/src/index.jsx +1 -0
- package/template-lib-solid-js/tests/index.test.jsx +11 -0
- package/template-lib-solid-js/tests/rstest.setup.js +4 -0
- package/template-lib-solid-ts/README.md +40 -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-js/README.md +40 -0
- package/template-lib-svelte-js/package.json +36 -0
- package/template-lib-svelte-js/pnpm-workspace.yaml +2 -0
- package/template-lib-svelte-js/rstack.config.js +35 -0
- package/template-lib-svelte-js/src/Button.svelte +24 -0
- package/template-lib-svelte-js/src/button.css +34 -0
- package/template-lib-svelte-js/src/index.js +1 -0
- package/template-lib-svelte-js/tests/index.test.js +19 -0
- package/template-lib-svelte-ts/README.md +40 -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-js/README.md +40 -0
- package/template-lib-vue-js/package.json +37 -0
- package/template-lib-vue-js/rstack.config.js +34 -0
- package/template-lib-vue-js/src/Button.vue +43 -0
- package/template-lib-vue-js/src/button.css +34 -0
- package/template-lib-vue-js/src/index.js +1 -0
- package/template-lib-vue-js/tests/index.test.js +17 -0
- package/template-lib-vue-js/tests/rstest.setup.js +6 -0
- package/template-lib-vue-ts/README.md +40 -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/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-rstack",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Create a new Rstack project",
|
|
5
|
+
"homepage": "https://rstack.rs",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/rstackjs/rstack-cli/issues"
|
|
8
|
+
},
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
|
-
"url": "https://github.com/rstackjs/
|
|
11
|
+
"url": "git+https://github.com/rstackjs/rstack-cli.git",
|
|
12
|
+
"directory": "packages/create-rstack"
|
|
8
13
|
},
|
|
9
14
|
"license": "MIT",
|
|
10
15
|
"type": "module",
|
|
@@ -14,57 +19,34 @@
|
|
|
14
19
|
"default": "./dist/index.js"
|
|
15
20
|
}
|
|
16
21
|
},
|
|
17
|
-
"main": "./dist/index.js",
|
|
18
22
|
"types": "./dist/index.d.ts",
|
|
23
|
+
"bin": {
|
|
24
|
+
"create-rstack": "./bin.js"
|
|
25
|
+
},
|
|
19
26
|
"files": [
|
|
20
|
-
"template
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"template-prettier",
|
|
24
|
-
"dist"
|
|
27
|
+
"template-*/**",
|
|
28
|
+
"dist",
|
|
29
|
+
"bin.js"
|
|
25
30
|
],
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
},
|
|
29
|
-
"nano-staged": {
|
|
30
|
-
"*.{js,jsx,ts,tsx,mjs,cjs}": [
|
|
31
|
-
"rslint",
|
|
32
|
-
"prettier --write"
|
|
33
|
-
]
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@rstackjs/create-toolkit": "2.2.2"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"@rslint/core": "^0.5.3",
|
|
40
|
-
"@rstest/core": "0.10.2",
|
|
41
|
-
"@types/fs-extra": "^11.0.4",
|
|
42
|
-
"@types/minimist": "^1.2.5",
|
|
43
|
-
"@types/node": "24.12.4",
|
|
44
|
-
"@vercel/detect-agent": "^1.2.3",
|
|
45
|
-
"deepmerge": "^4.3.1",
|
|
46
|
-
"fs-extra": "^11.3.5",
|
|
47
|
-
"minimist": "^1.2.8",
|
|
48
|
-
"prettier": "^3.8.3",
|
|
49
|
-
"rimraf": "^6.1.3",
|
|
50
|
-
"rslog": "^2.1.1",
|
|
51
|
-
"simple-git-hooks": "^2.13.1",
|
|
52
|
-
"tinyexec": "^1.2.2",
|
|
53
|
-
"typescript": "^6.0.3"
|
|
35
|
+
"@types/node": "^24.13.3",
|
|
36
|
+
"typescript": "^7.0.2",
|
|
37
|
+
"rstack": "0.5.0-alpha.1"
|
|
54
38
|
},
|
|
55
39
|
"engines": {
|
|
56
|
-
"node": "
|
|
40
|
+
"node": ">=22.12.0"
|
|
57
41
|
},
|
|
58
42
|
"publishConfig": {
|
|
59
43
|
"access": "public",
|
|
60
44
|
"registry": "https://registry.npmjs.org/"
|
|
61
45
|
},
|
|
62
46
|
"scripts": {
|
|
63
|
-
"build": "
|
|
64
|
-
"dev": "
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"test": "rstest",
|
|
68
|
-
"bump": "npx bumpp"
|
|
47
|
+
"build": "rs lib",
|
|
48
|
+
"dev": "rs lib --watch",
|
|
49
|
+
"start": "node ./dist/index.js",
|
|
50
|
+
"test": "rs test"
|
|
69
51
|
}
|
|
70
52
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rstack-app-lit-js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rs build",
|
|
8
|
+
"check": "rs lint && rs fmt --check",
|
|
9
|
+
"dev": "rs dev",
|
|
10
|
+
"format": "rs fmt",
|
|
11
|
+
"lint": "rs lint",
|
|
12
|
+
"preview": "rs preview",
|
|
13
|
+
"test": "rs test",
|
|
14
|
+
"test:watch": "rs test --watch"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"lit": "^3.3.3"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"happy-dom": "^20.11.2",
|
|
21
|
+
"rstack": "^0.4.0"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// Rstack configuration guide: https://rstack.rs/config
|
|
3
|
+
import { define } from 'rstack';
|
|
4
|
+
|
|
5
|
+
define.app({
|
|
6
|
+
html: {
|
|
7
|
+
template: './src/index.html',
|
|
8
|
+
},
|
|
9
|
+
source: {
|
|
10
|
+
decorators: {
|
|
11
|
+
version: 'legacy',
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
define.test({
|
|
17
|
+
testEnvironment: 'happy-dom',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
define.lint(async () => {
|
|
21
|
+
const { js } = await import('rstack/lint');
|
|
22
|
+
|
|
23
|
+
return [js.configs.recommended];
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
define.fmt({
|
|
27
|
+
singleQuote: true,
|
|
28
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { html, css, LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
export class MyElement extends LitElement {
|
|
4
|
+
static styles = css`
|
|
5
|
+
.content {
|
|
6
|
+
display: flex;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
line-height: 1.1;
|
|
9
|
+
text-align: center;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.content h1 {
|
|
15
|
+
font-size: 3.6rem;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content p {
|
|
20
|
+
font-size: 1.2rem;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
return html`
|
|
28
|
+
<div class="content">
|
|
29
|
+
<h1>Rstack with Lit</h1>
|
|
30
|
+
<p>Start building amazing things with Rstack.</p>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { expect, test } from 'rstack/test';
|
|
2
|
+
import { MyElement } from '../src/my-element';
|
|
3
|
+
|
|
4
|
+
test('renders the main page', async () => {
|
|
5
|
+
customElements.define('my-element', MyElement);
|
|
6
|
+
const element = document.createElement('my-element');
|
|
7
|
+
document.body.append(element);
|
|
8
|
+
|
|
9
|
+
await element.updateComplete;
|
|
10
|
+
|
|
11
|
+
expect(element.shadowRoot?.textContent).toContain('Rstack with Lit');
|
|
12
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rstack-app-lit-ts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rs build",
|
|
8
|
+
"check": "rs lint --type-check && rs fmt --check",
|
|
9
|
+
"dev": "rs dev",
|
|
10
|
+
"format": "rs fmt",
|
|
11
|
+
"lint": "rs lint",
|
|
12
|
+
"preview": "rs preview",
|
|
13
|
+
"test": "rs test",
|
|
14
|
+
"test:watch": "rs test --watch"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"lit": "^3.3.3"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^24.13.3",
|
|
21
|
+
"happy-dom": "^20.11.2",
|
|
22
|
+
"rstack": "^0.4.0",
|
|
23
|
+
"typescript": "^7.0.2"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Rstack configuration guide: https://rstack.rs/config
|
|
2
|
+
import { define } from 'rstack';
|
|
3
|
+
|
|
4
|
+
define.app({
|
|
5
|
+
html: {
|
|
6
|
+
template: './src/index.html',
|
|
7
|
+
},
|
|
8
|
+
source: {
|
|
9
|
+
decorators: {
|
|
10
|
+
version: 'legacy',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
define.test({
|
|
16
|
+
testEnvironment: 'happy-dom',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
define.lint(async () => {
|
|
20
|
+
const { js, ts } = await import('rstack/lint');
|
|
21
|
+
|
|
22
|
+
return [js.configs.recommended, ts.configs.recommended];
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
define.fmt({
|
|
26
|
+
singleQuote: true,
|
|
27
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { html, css, LitElement } from 'lit';
|
|
2
|
+
|
|
3
|
+
export class MyElement extends LitElement {
|
|
4
|
+
static styles = css`
|
|
5
|
+
.content {
|
|
6
|
+
display: flex;
|
|
7
|
+
min-height: 100vh;
|
|
8
|
+
line-height: 1.1;
|
|
9
|
+
text-align: center;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.content h1 {
|
|
15
|
+
font-size: 3.6rem;
|
|
16
|
+
font-weight: 700;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.content p {
|
|
20
|
+
font-size: 1.2rem;
|
|
21
|
+
font-weight: 400;
|
|
22
|
+
opacity: 0.5;
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
return html`
|
|
28
|
+
<div class="content">
|
|
29
|
+
<h1>Rstack with Lit</h1>
|
|
30
|
+
<p>Start building amazing things with Rstack.</p>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { expect, test } from 'rstack/test';
|
|
2
|
+
import { MyElement } from '../src/my-element';
|
|
3
|
+
|
|
4
|
+
test('renders the main page', async () => {
|
|
5
|
+
customElements.define('my-element', MyElement);
|
|
6
|
+
const element = document.createElement('my-element') as MyElement;
|
|
7
|
+
document.body.append(element);
|
|
8
|
+
|
|
9
|
+
await element.updateComplete;
|
|
10
|
+
|
|
11
|
+
expect(element.shadowRoot?.textContent).toContain('Rstack with Lit');
|
|
12
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["DOM", "ES2020"],
|
|
4
|
+
"target": "ES2020",
|
|
5
|
+
"noEmit": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"types": ["rstack/types", "node"],
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"useDefineForClassFields": false,
|
|
10
|
+
|
|
11
|
+
/* modules */
|
|
12
|
+
"moduleDetection": "force",
|
|
13
|
+
"moduleResolution": "bundler",
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"resolveJsonModule": true,
|
|
16
|
+
"allowImportingTsExtensions": true,
|
|
17
|
+
|
|
18
|
+
/* type checking */
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true
|
|
21
|
+
},
|
|
22
|
+
"include": ["src"]
|
|
23
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rstack-app-preact-js",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rs build",
|
|
8
|
+
"check": "rs lint && rs fmt --check",
|
|
9
|
+
"dev": "rs dev",
|
|
10
|
+
"format": "rs fmt",
|
|
11
|
+
"lint": "rs lint",
|
|
12
|
+
"preview": "rs preview",
|
|
13
|
+
"test": "rs test",
|
|
14
|
+
"test:watch": "rs test --watch"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"preact": "^10.29.8"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@rsbuild/plugin-preact": "^2.0.0",
|
|
21
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
22
|
+
"@testing-library/preact": "^3.2.4",
|
|
23
|
+
"happy-dom": "^20.11.2",
|
|
24
|
+
"rstack": "^0.4.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
// Rstack configuration guide: https://rstack.rs/config
|
|
3
|
+
import { define } from 'rstack';
|
|
4
|
+
|
|
5
|
+
define.app(async () => {
|
|
6
|
+
const { pluginPreact } = await import('@rsbuild/plugin-preact');
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
plugins: [pluginPreact()],
|
|
10
|
+
};
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
define.test({
|
|
14
|
+
setupFiles: ['./tests/rstest.setup.js'],
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
define.lint(async () => {
|
|
18
|
+
const { js, reactHooksPlugin, reactPlugin } = await import('rstack/lint');
|
|
19
|
+
|
|
20
|
+
return [
|
|
21
|
+
js.configs.recommended,
|
|
22
|
+
reactPlugin.configs.recommended,
|
|
23
|
+
reactHooksPlugin.configs.recommended,
|
|
24
|
+
];
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
define.fmt({
|
|
28
|
+
singleQuote: true,
|
|
29
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
color: #fff;
|
|
4
|
+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
|
5
|
+
background-image: linear-gradient(to bottom, #020917, #101725);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.content {
|
|
9
|
+
display: flex;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
line-height: 1.1;
|
|
12
|
+
text-align: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content h1 {
|
|
18
|
+
font-size: 3.6rem;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content p {
|
|
23
|
+
font-size: 1.2rem;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/preact';
|
|
2
|
+
import { expect, test } from 'rstack/test';
|
|
3
|
+
import App from '../src/App';
|
|
4
|
+
|
|
5
|
+
test('renders the main page', () => {
|
|
6
|
+
render(<App />);
|
|
7
|
+
expect(screen.getByText('Rstack with Preact')).toBeInTheDocument();
|
|
8
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rstack-app-preact-ts",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "rs build",
|
|
8
|
+
"check": "rs lint --type-check && rs fmt --check",
|
|
9
|
+
"dev": "rs dev",
|
|
10
|
+
"format": "rs fmt",
|
|
11
|
+
"lint": "rs lint",
|
|
12
|
+
"preview": "rs preview",
|
|
13
|
+
"test": "rs test",
|
|
14
|
+
"test:watch": "rs test --watch"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"preact": "^10.29.8"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@rsbuild/plugin-preact": "^2.0.0",
|
|
21
|
+
"@testing-library/jest-dom": "^7.0.0",
|
|
22
|
+
"@testing-library/preact": "^3.2.4",
|
|
23
|
+
"@types/node": "^24.13.3",
|
|
24
|
+
"happy-dom": "^20.11.2",
|
|
25
|
+
"rstack": "^0.4.0",
|
|
26
|
+
"typescript": "^7.0.2"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Rstack configuration guide: https://rstack.rs/config
|
|
2
|
+
import { define } from 'rstack';
|
|
3
|
+
|
|
4
|
+
define.app(async () => {
|
|
5
|
+
const { pluginPreact } = await import('@rsbuild/plugin-preact');
|
|
6
|
+
|
|
7
|
+
return {
|
|
8
|
+
plugins: [pluginPreact()],
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
define.test({
|
|
13
|
+
setupFiles: ['./tests/rstest.setup.ts'],
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
define.lint(async () => {
|
|
17
|
+
const { js, ts, reactHooksPlugin, reactPlugin } = await import('rstack/lint');
|
|
18
|
+
|
|
19
|
+
return [
|
|
20
|
+
js.configs.recommended,
|
|
21
|
+
ts.configs.recommended,
|
|
22
|
+
reactPlugin.configs.recommended,
|
|
23
|
+
reactHooksPlugin.configs.recommended,
|
|
24
|
+
];
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
define.fmt({
|
|
28
|
+
singleQuote: true,
|
|
29
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
color: #fff;
|
|
4
|
+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
|
5
|
+
background-image: linear-gradient(to bottom, #020917, #101725);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.content {
|
|
9
|
+
display: flex;
|
|
10
|
+
min-height: 100vh;
|
|
11
|
+
line-height: 1.1;
|
|
12
|
+
text-align: center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.content h1 {
|
|
18
|
+
font-size: 3.6rem;
|
|
19
|
+
font-weight: 700;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.content p {
|
|
23
|
+
font-size: 1.2rem;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
opacity: 0.5;
|
|
26
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { render, screen } from '@testing-library/preact';
|
|
2
|
+
import { expect, test } from 'rstack/test';
|
|
3
|
+
import App from '../src/App';
|
|
4
|
+
|
|
5
|
+
test('renders the main page', () => {
|
|
6
|
+
render(<App />);
|
|
7
|
+
expect(screen.getByText('Rstack with Preact')).toBeInTheDocument();
|
|
8
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"lib": ["DOM", "ES2020"],
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"noEmit": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"types": ["rstack/types", "node"],
|
|
9
|
+
"jsxImportSource": "preact",
|
|
10
|
+
"useDefineForClassFields": true,
|
|
11
|
+
|
|
12
|
+
/* modules */
|
|
13
|
+
"moduleDetection": "force",
|
|
14
|
+
"moduleResolution": "bundler",
|
|
15
|
+
"verbatimModuleSyntax": true,
|
|
16
|
+
"resolveJsonModule": true,
|
|
17
|
+
"allowImportingTsExtensions": true,
|
|
18
|
+
"paths": {
|
|
19
|
+
"react": ["./node_modules/preact/compat/"],
|
|
20
|
+
"react-dom": ["./node_modules/preact/compat/"]
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/* type checking */
|
|
24
|
+
"noUnusedLocals": true,
|
|
25
|
+
"noUnusedParameters": true
|
|
26
|
+
},
|
|
27
|
+
"include": ["src"]
|
|
28
|
+
}
|