create-rstack 3.4.4 → 3.4.6

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.
Files changed (76) hide show
  1. package/README.md +2 -0
  2. package/dist/index.js +20 -3
  3. package/package.json +4 -4
  4. package/template-app-lit/package.json +1 -1
  5. package/template-app-lit-ts/package.json +2 -2
  6. package/template-app-preact/package.json +2 -2
  7. package/template-app-preact-ts/package.json +3 -3
  8. package/template-app-react/package.json +1 -1
  9. package/template-app-react-ts/package.json +2 -2
  10. package/template-app-solid/package.json +1 -1
  11. package/template-app-solid-ts/package.json +2 -2
  12. package/template-app-svelte/package.json +1 -1
  13. package/template-app-svelte-ts/package.json +2 -2
  14. package/template-app-vanilla/package.json +1 -1
  15. package/template-app-vanilla-ts/package.json +2 -2
  16. package/template-app-vue/package.json +2 -2
  17. package/template-app-vue-ts/package.json +4 -4
  18. package/template-doc/package.json +2 -2
  19. package/template-doc-i18n/package.json +2 -2
  20. package/template-lib-node/package.json +1 -1
  21. package/template-lib-node-ts/package.json +2 -2
  22. package/template-lib-react/package.json +1 -1
  23. package/template-lib-react-ts/package.json +2 -2
  24. package/template-lib-solid/package.json +1 -1
  25. package/template-lib-solid-ts/package.json +2 -2
  26. package/template-lib-svelte/package.json +1 -1
  27. package/template-lib-svelte-ts/package.json +2 -2
  28. package/template-lib-vue/package.json +2 -2
  29. package/template-lib-vue-ts/package.json +4 -4
  30. package/template-nx/.env +2 -0
  31. package/template-nx/README.md +37 -0
  32. package/template-nx/apps/web/package.json +26 -0
  33. package/template-nx/apps/web/rstack.config.ts +13 -0
  34. package/template-nx/apps/web/src/App.tsx +17 -0
  35. package/template-nx/apps/web/src/index.css +27 -0
  36. package/template-nx/apps/web/src/index.tsx +13 -0
  37. package/template-nx/apps/web/tests/app.test.tsx +11 -0
  38. package/template-nx/apps/web/tests/rstest.setup.ts +4 -0
  39. package/template-nx/apps/web/tests/tsconfig.json +7 -0
  40. package/template-nx/apps/web/tsconfig.json +4 -0
  41. package/template-nx/gitignore +17 -0
  42. package/template-nx/nx.json +33 -0
  43. package/template-nx/package.json +20 -0
  44. package/template-nx/packages/ui/package.json +39 -0
  45. package/template-nx/packages/ui/rstack.config.ts +20 -0
  46. package/template-nx/packages/ui/src/button.tsx +8 -0
  47. package/template-nx/packages/ui/tests/button.test.tsx +18 -0
  48. package/template-nx/packages/ui/tests/rstest.setup.ts +4 -0
  49. package/template-nx/packages/ui/tests/tsconfig.json +8 -0
  50. package/template-nx/packages/ui/tsconfig.json +7 -0
  51. package/template-nx/pnpm-workspace.yaml +6 -0
  52. package/template-nx/rstack.config.ts +29 -0
  53. package/template-nx/tsconfig.base.json +22 -0
  54. package/template-pnpm/README.md +33 -0
  55. package/template-pnpm/apps/web/package.json +26 -0
  56. package/template-pnpm/apps/web/rstack.config.ts +13 -0
  57. package/template-pnpm/apps/web/src/App.tsx +17 -0
  58. package/template-pnpm/apps/web/src/index.css +27 -0
  59. package/template-pnpm/apps/web/src/index.tsx +13 -0
  60. package/template-pnpm/apps/web/tests/app.test.tsx +11 -0
  61. package/template-pnpm/apps/web/tests/rstest.setup.ts +4 -0
  62. package/template-pnpm/apps/web/tests/tsconfig.json +7 -0
  63. package/template-pnpm/apps/web/tsconfig.json +4 -0
  64. package/template-pnpm/gitignore +13 -0
  65. package/template-pnpm/package.json +19 -0
  66. package/template-pnpm/packages/ui/package.json +30 -0
  67. package/template-pnpm/packages/ui/rstack.config.ts +20 -0
  68. package/template-pnpm/packages/ui/src/button.tsx +8 -0
  69. package/template-pnpm/packages/ui/tests/button.test.tsx +18 -0
  70. package/template-pnpm/packages/ui/tests/rstest.setup.ts +4 -0
  71. package/template-pnpm/packages/ui/tests/tsconfig.json +8 -0
  72. package/template-pnpm/packages/ui/tsconfig.json +7 -0
  73. package/template-pnpm/pnpm-workspace.yaml +3 -0
  74. package/template-pnpm/rstack.config.ts +29 -0
  75. package/template-pnpm/tsconfig.base.json +22 -0
  76. package/template-turborepo/package.json +4 -4
package/README.md CHANGED
@@ -50,7 +50,9 @@ npx create-rstack --dir my-project --template app-vanilla-ts --no-git
50
50
  - `lib-solid-ts` - TypeScript Solid library
51
51
  - `doc` - Basic documentation site
52
52
  - `doc-i18n` - Multilingual documentation site
53
+ - `pnpm` - pnpm workspace
53
54
  - `turborepo` - Turborepo
55
+ - `nx` - Nx
54
56
 
55
57
  ## Documentation
56
58
 
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@ import { checkCancel, create, select as create_toolkit_select } from "@rstackjs/
2
2
  import { access, appendFile, mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import node_path from "node:path";
4
4
  const packageRoot = node_path.join(import.meta.dirname, '..');
5
+ const { version: version } = JSON.parse(await readFile(node_path.join(packageRoot, 'package.json'), 'utf-8'));
5
6
  const templateNames = [
6
7
  'app-vanilla',
7
8
  'app-vanilla-ts',
@@ -29,7 +30,9 @@ const templateNames = [
29
30
  'lib-solid-ts',
30
31
  'doc',
31
32
  'doc-i18n',
32
- 'turborepo'
33
+ 'pnpm',
34
+ 'turborepo',
35
+ 'nx'
33
36
  ];
34
37
  const resolveTemplateName = (template)=>{
35
38
  if (!templateNames.includes(template)) throw new Error(`Invalid input: template "${template}" not found.`);
@@ -37,7 +40,7 @@ const resolveTemplateName = (template)=>{
37
40
  };
38
41
  const getTemplateName = async ({ template })=>{
39
42
  if ('string' == typeof template) {
40
- if (/^(?:app|lib|doc|turborepo)(?:-|$)/u.test(template)) return resolveTemplateName(template);
43
+ if (/^(?:app|lib|doc|pnpm|turborepo|nx)(?:-|$)/u.test(template)) return resolveTemplateName(template);
41
44
  return template;
42
45
  }
43
46
  const projectType = checkCancel(await create_toolkit_select({
@@ -65,10 +68,19 @@ const getTemplateName = async ({ template })=>{
65
68
  const monorepoType = checkCancel(await create_toolkit_select({
66
69
  message: 'Select monorepo tool',
67
70
  options: [
71
+ {
72
+ value: 'pnpm',
73
+ label: 'pnpm workspace'
74
+ },
68
75
  {
69
76
  value: 'turborepo',
70
77
  label: 'Turborepo',
71
78
  hint: 'pnpm'
79
+ },
80
+ {
81
+ value: 'nx',
82
+ label: 'Nx',
83
+ hint: 'pnpm'
72
84
  }
73
85
  ]
74
86
  }));
@@ -223,9 +235,14 @@ const injectStagedSetup = async ({ templateName, distFolder, gitEnabled, isGitRo
223
235
  await create({
224
236
  root: packageRoot,
225
237
  name: 'rstack',
238
+ banner: `create-rstack v${version}`,
226
239
  templates: templateNames,
227
240
  builtinTools: [],
228
241
  getTemplateName: getTemplateName,
229
- getPackageManager: ({ templateName })=>'turborepo' === templateName ? 'pnpm' : void 0,
242
+ getPackageManager: ({ templateName })=>[
243
+ 'pnpm',
244
+ 'turborepo',
245
+ 'nx'
246
+ ].includes(templateName) ? 'pnpm' : void 0,
230
247
  onGitResolved: injectStagedSetup
231
248
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rstack",
3
- "version": "3.4.4",
3
+ "version": "3.4.6",
4
4
  "description": "Create a new Rstack project",
5
5
  "homepage": "https://rstack.rs",
6
6
  "bugs": {
@@ -29,11 +29,11 @@
29
29
  "bin.js"
30
30
  ],
31
31
  "dependencies": {
32
- "@rstackjs/create-toolkit": "2.2.7"
32
+ "@rstackjs/create-toolkit": "2.2.11"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/node": "^26.6.4",
36
- "rstack": "0.8.4",
35
+ "@types/node": "^26.6.5",
36
+ "rstack": "0.8.6",
37
37
  "typescript": "^7.0.2"
38
38
  },
39
39
  "engines": {
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "happy-dom": "^21.0.1",
21
- "rstack": "^0.8.4"
21
+ "rstack": "^0.8.6"
22
22
  }
23
23
  }
@@ -17,9 +17,9 @@
17
17
  "lit": "^3.3.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "^26.6.4",
20
+ "@types/node": "^26.6.5",
21
21
  "happy-dom": "^21.0.1",
22
- "rstack": "^0.8.4",
22
+ "rstack": "^0.8.6",
23
23
  "typescript": "^7.0.2"
24
24
  }
25
25
  }
@@ -14,13 +14,13 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "preact": "^11.0.0"
17
+ "preact": "^11.0.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-preact": "^2.1.0",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@testing-library/preact": "^3.2.4",
23
23
  "happy-dom": "^21.0.1",
24
- "rstack": "^0.8.4"
24
+ "rstack": "^0.8.6"
25
25
  }
26
26
  }
@@ -14,15 +14,15 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "preact": "^11.0.0"
17
+ "preact": "^11.0.1"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-preact": "^2.1.0",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@testing-library/preact": "^3.2.4",
23
- "@types/node": "^26.6.4",
23
+ "@types/node": "^26.6.5",
24
24
  "happy-dom": "^21.0.1",
25
- "rstack": "^0.8.4",
25
+ "rstack": "^0.8.6",
26
26
  "typescript": "^7.0.2"
27
27
  }
28
28
  }
@@ -23,6 +23,6 @@
23
23
  "@testing-library/jest-dom": "^7.0.1",
24
24
  "@testing-library/react": "^16.3.3",
25
25
  "happy-dom": "^21.0.1",
26
- "rstack": "^0.8.4"
26
+ "rstack": "^0.8.6"
27
27
  }
28
28
  }
@@ -22,11 +22,11 @@
22
22
  "@testing-library/dom": "^10.4.2",
23
23
  "@testing-library/jest-dom": "^7.0.1",
24
24
  "@testing-library/react": "^16.3.3",
25
- "@types/node": "^26.6.4",
25
+ "@types/node": "^26.6.5",
26
26
  "@types/react": "^19.3.0",
27
27
  "@types/react-dom": "^19.3.0",
28
28
  "happy-dom": "^21.0.1",
29
- "rstack": "^0.8.4",
29
+ "rstack": "^0.8.6",
30
30
  "typescript": "^7.0.2"
31
31
  }
32
32
  }
@@ -22,6 +22,6 @@
22
22
  "@solidjs/testing-library": "^0.8.10",
23
23
  "@testing-library/jest-dom": "^7.0.1",
24
24
  "happy-dom": "^21.0.1",
25
- "rstack": "^0.8.4"
25
+ "rstack": "^0.8.6"
26
26
  }
27
27
  }
@@ -21,9 +21,9 @@
21
21
  "@rsbuild/plugin-solid": "^1.2.2",
22
22
  "@solidjs/testing-library": "^0.8.10",
23
23
  "@testing-library/jest-dom": "^7.0.1",
24
- "@types/node": "^26.6.4",
24
+ "@types/node": "^26.6.5",
25
25
  "happy-dom": "^21.0.1",
26
- "rstack": "^0.8.4",
26
+ "rstack": "^0.8.6",
27
27
  "typescript": "^7.0.2"
28
28
  }
29
29
  }
@@ -22,6 +22,6 @@
22
22
  "@testing-library/svelte": "^5.4.2",
23
23
  "happy-dom": "^21.0.1",
24
24
  "prettier-plugin-svelte": "^4.1.1",
25
- "rstack": "^0.8.4"
25
+ "rstack": "^0.8.6"
26
26
  }
27
27
  }
@@ -20,10 +20,10 @@
20
20
  "@rsbuild/plugin-svelte": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@testing-library/svelte": "^5.4.2",
23
- "@types/node": "^26.6.4",
23
+ "@types/node": "^26.6.5",
24
24
  "happy-dom": "^21.0.1",
25
25
  "prettier-plugin-svelte": "^4.1.1",
26
- "rstack": "^0.8.4",
26
+ "rstack": "^0.8.6",
27
27
  "svelte-check": "^4.7.6",
28
28
  "typescript": "^6.0.3"
29
29
  }
@@ -17,6 +17,6 @@
17
17
  "@testing-library/dom": "^10.4.2",
18
18
  "@testing-library/jest-dom": "^7.0.1",
19
19
  "happy-dom": "^21.0.1",
20
- "rstack": "^0.8.4"
20
+ "rstack": "^0.8.6"
21
21
  }
22
22
  }
@@ -16,9 +16,9 @@
16
16
  "devDependencies": {
17
17
  "@testing-library/dom": "^10.4.2",
18
18
  "@testing-library/jest-dom": "^7.0.1",
19
- "@types/node": "^26.6.4",
19
+ "@types/node": "^26.6.5",
20
20
  "happy-dom": "^21.0.1",
21
- "rstack": "^0.8.4",
21
+ "rstack": "^0.8.6",
22
22
  "typescript": "^7.0.2"
23
23
  }
24
24
  }
@@ -14,13 +14,13 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "vue": "^3.5.43"
17
+ "vue": "^3.5.44"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-vue": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@vue/test-utils": "^2.5.1",
23
23
  "happy-dom": "^21.0.1",
24
- "rstack": "^0.8.4"
24
+ "rstack": "^0.8.6"
25
25
  }
26
26
  }
@@ -14,16 +14,16 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "vue": "^3.5.43"
17
+ "vue": "^3.5.44"
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-vue": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
- "@types/node": "^26.6.4",
22
+ "@types/node": "^26.6.5",
23
23
  "@vue/test-utils": "^2.5.1",
24
24
  "happy-dom": "^21.0.1",
25
- "rstack": "^0.8.4",
25
+ "rstack": "^0.8.6",
26
26
  "typescript": "^6.0.3",
27
- "vue-tsc": "^3.3.12"
27
+ "vue-tsc": "^3.3.13"
28
28
  }
29
29
  }
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rspress/core": "^2.0.23",
16
- "@types/node": "^26.6.4",
16
+ "@types/node": "^26.6.5",
17
17
  "@types/react": "^19.3.0",
18
18
  "@types/react-dom": "^19.3.0",
19
19
  "react": "^19.3.0",
20
20
  "react-dom": "^19.3.0",
21
- "rstack": "^0.8.4",
21
+ "rstack": "^0.8.6",
22
22
  "typescript": "^7.0.2"
23
23
  }
24
24
  }
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rspress/core": "^2.0.23",
16
- "@types/node": "^26.6.4",
16
+ "@types/node": "^26.6.5",
17
17
  "@types/react": "^19.3.0",
18
18
  "@types/react-dom": "^19.3.0",
19
19
  "react": "^19.3.0",
20
20
  "react-dom": "^19.3.0",
21
- "rstack": "^0.8.4",
21
+ "rstack": "^0.8.6",
22
22
  "typescript": "^7.0.2"
23
23
  }
24
24
  }
@@ -18,7 +18,7 @@
18
18
  "test:watch": "rs test --watch"
19
19
  },
20
20
  "devDependencies": {
21
- "rstack": "^0.8.4"
21
+ "rstack": "^0.8.6"
22
22
  },
23
23
  "engines": {
24
24
  "node": "^20.19.0 || >=22.12.0"
@@ -24,8 +24,8 @@
24
24
  "test:watch": "rs test --watch"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "^26.6.4",
28
- "rstack": "^0.8.4",
27
+ "@types/node": "^26.6.5",
28
+ "rstack": "^0.8.6",
29
29
  "typescript": "^7.0.2"
30
30
  },
31
31
  "engines": {
@@ -25,7 +25,7 @@
25
25
  "happy-dom": "^21.0.1",
26
26
  "react": "^19.3.0",
27
27
  "react-dom": "^19.3.0",
28
- "rstack": "^0.8.4"
28
+ "rstack": "^0.8.6"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=18.0.0",
@@ -27,13 +27,13 @@
27
27
  "@testing-library/dom": "^10.4.2",
28
28
  "@testing-library/jest-dom": "^7.0.1",
29
29
  "@testing-library/react": "^16.3.3",
30
- "@types/node": "^26.6.4",
30
+ "@types/node": "^26.6.5",
31
31
  "@types/react": "^19.3.0",
32
32
  "@types/react-dom": "^19.3.0",
33
33
  "happy-dom": "^21.0.1",
34
34
  "react": "^19.3.0",
35
35
  "react-dom": "^19.3.0",
36
- "rstack": "^0.8.4",
36
+ "rstack": "^0.8.6",
37
37
  "typescript": "^7.0.2"
38
38
  },
39
39
  "peerDependencies": {
@@ -27,7 +27,7 @@
27
27
  "@solidjs/testing-library": "^0.8.10",
28
28
  "@testing-library/jest-dom": "^7.0.1",
29
29
  "happy-dom": "^21.0.1",
30
- "rstack": "^0.8.4",
30
+ "rstack": "^0.8.6",
31
31
  "solid-js": "^1.9.17"
32
32
  },
33
33
  "peerDependencies": {
@@ -28,9 +28,9 @@
28
28
  "@rsbuild/plugin-solid": "^1.2.2",
29
29
  "@solidjs/testing-library": "^0.8.10",
30
30
  "@testing-library/jest-dom": "^7.0.1",
31
- "@types/node": "^26.6.4",
31
+ "@types/node": "^26.6.5",
32
32
  "happy-dom": "^21.0.1",
33
- "rstack": "^0.8.4",
33
+ "rstack": "^0.8.6",
34
34
  "solid-js": "^1.9.17",
35
35
  "typescript": "^7.0.2"
36
36
  },
@@ -20,7 +20,7 @@
20
20
  "@rsbuild/plugin-svelte": "^2.0.1",
21
21
  "happy-dom": "^21.0.1",
22
22
  "prettier-plugin-svelte": "^4.1.1",
23
- "rstack": "^0.8.4",
23
+ "rstack": "^0.8.6",
24
24
  "svelte": "^5.57.2"
25
25
  },
26
26
  "peerDependencies": {
@@ -24,10 +24,10 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@rsbuild/plugin-svelte": "^2.0.1",
27
- "@types/node": "^26.6.4",
27
+ "@types/node": "^26.6.5",
28
28
  "happy-dom": "^21.0.1",
29
29
  "prettier-plugin-svelte": "^4.1.1",
30
- "rstack": "^0.8.4",
30
+ "rstack": "^0.8.6",
31
31
  "svelte": "^5.57.2",
32
32
  "svelte-check": "^4.7.6",
33
33
  "svelte2tsx": "^0.7.61",
@@ -21,8 +21,8 @@
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@vue/test-utils": "^2.5.1",
23
23
  "happy-dom": "^21.0.1",
24
- "rstack": "^0.8.4",
25
- "vue": "^3.5.43"
24
+ "rstack": "^0.8.6",
25
+ "vue": "^3.5.44"
26
26
  },
27
27
  "peerDependencies": {
28
28
  "vue": ">=3.2.0"
@@ -25,13 +25,13 @@
25
25
  "devDependencies": {
26
26
  "@rsbuild/plugin-vue": "^2.0.1",
27
27
  "@testing-library/jest-dom": "^7.0.1",
28
- "@types/node": "^26.6.4",
28
+ "@types/node": "^26.6.5",
29
29
  "@vue/test-utils": "^2.5.1",
30
30
  "happy-dom": "^21.0.1",
31
- "rstack": "^0.8.4",
31
+ "rstack": "^0.8.6",
32
32
  "typescript": "^6.0.3",
33
- "vue": "^3.5.43",
34
- "vue-tsc": "^3.3.12"
33
+ "vue": "^3.5.44",
34
+ "vue-tsc": "^3.3.13"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "vue": ">=3.2.0"
@@ -0,0 +1,2 @@
1
+ # Let Rstack load environment files for the current command.
2
+ NX_LOAD_DOT_ENV_FILES=false
@@ -0,0 +1,37 @@
1
+ # Nx + Rstack
2
+
3
+ ## Setup
4
+
5
+ ```bash
6
+ pnpm install
7
+ ```
8
+
9
+ ## Structure
10
+
11
+ - `apps/web`: React application.
12
+ - `packages/ui`: Shared UI components.
13
+ - `tsconfig.base.json`: Shared TypeScript configuration.
14
+
15
+ ## Scripts
16
+
17
+ Run from the repository root:
18
+
19
+ - `pnpm run build`: Build all packages.
20
+ - `pnpm run dev`: Start the web app and watch the shared UI package.
21
+ - `pnpm run test`: Run tests.
22
+ - `pnpm run check`: Run lint, formatting, and TypeScript checks.
23
+ - `pnpm run lint`: Lint the workspace.
24
+ - `pnpm run format`: Format the workspace.
25
+
26
+ Nx discovers projects and tasks from workspace package manifests. Build and test tasks are cached, and dependencies are built first.
27
+
28
+ The root `.env` disables Nx's environment-file loading so Rstack can load each project's environment files with the correct mode and priority.
29
+
30
+ Run `pnpm run build` before `pnpm run check`.
31
+
32
+ Use `pnpm exec nx graph` to explore the project graph.
33
+
34
+ ## Learn more
35
+
36
+ - [Rstack CLI monorepo guide](https://rstack.rs/guide/monorepo)
37
+ - [Nx documentation](https://nx.dev/docs/getting-started/intro)
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "web",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "rs build",
8
+ "dev": "rs dev",
9
+ "preview": "rs preview",
10
+ "test": "rs test"
11
+ },
12
+ "dependencies": {
13
+ "@repo/ui": "workspace:^",
14
+ "react": "^19.3.0",
15
+ "react-dom": "^19.3.0"
16
+ },
17
+ "devDependencies": {
18
+ "@rsbuild/plugin-react": "^2.1.1",
19
+ "@testing-library/dom": "^10.4.2",
20
+ "@testing-library/jest-dom": "^7.0.1",
21
+ "@testing-library/react": "^16.3.3",
22
+ "@types/react": "^19.3.0",
23
+ "@types/react-dom": "^19.3.0",
24
+ "happy-dom": "^21.0.1"
25
+ }
26
+ }
@@ -0,0 +1,13 @@
1
+ // Configuration guide: https://rstack.rs/config
2
+ import { define } from 'rstack';
3
+
4
+ define.app(async () => {
5
+ const { pluginReact } = await import('@rsbuild/plugin-react');
6
+ return {
7
+ plugins: [pluginReact()],
8
+ };
9
+ });
10
+
11
+ define.test({
12
+ setupFiles: ['./tests/rstest.setup.ts'],
13
+ });
@@ -0,0 +1,17 @@
1
+ import { Button } from '@repo/ui/button';
2
+
3
+ export function App() {
4
+ return (
5
+ <main>
6
+ <h1>Web</h1>
7
+ <p>Nx + Rstack CLI</p>
8
+ <p>Edit apps/web/src/App.tsx to get started.</p>
9
+ <Button onClick={() => window.alert('Hello from @repo/ui!')}>
10
+ Shared button
11
+ </Button>
12
+ <nav>
13
+ <a href="https://rstack.rs">Rstack documentation</a>
14
+ </nav>
15
+ </main>
16
+ );
17
+ }
@@ -0,0 +1,27 @@
1
+ body {
2
+ margin: 0;
3
+ font-family: system-ui, sans-serif;
4
+ color: #202124;
5
+ background: #f8f9fa;
6
+ }
7
+
8
+ main {
9
+ max-width: 640px;
10
+ margin: 15vh auto;
11
+ padding: 24px;
12
+ }
13
+
14
+ button {
15
+ padding: 10px 16px;
16
+ border: 0;
17
+ border-radius: 8px;
18
+ color: white;
19
+ background: #5755d9;
20
+ cursor: pointer;
21
+ }
22
+
23
+ nav {
24
+ display: flex;
25
+ gap: 20px;
26
+ margin-top: 24px;
27
+ }
@@ -0,0 +1,13 @@
1
+ import { StrictMode } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { App } from './App';
4
+ import './index.css';
5
+
6
+ const root = document.getElementById('root');
7
+ if (root) {
8
+ createRoot(root).render(
9
+ <StrictMode>
10
+ <App />
11
+ </StrictMode>,
12
+ );
13
+ }
@@ -0,0 +1,11 @@
1
+ import { expect, test } from 'rstack/test';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { App } from '../src/App';
4
+
5
+ test('renders the web app with the shared UI package', () => {
6
+ render(<App />);
7
+ expect(screen.getByRole('heading', { name: 'Web' })).toBeInTheDocument();
8
+ expect(
9
+ screen.getByRole('button', { name: 'Shared button' }),
10
+ ).toBeInTheDocument();
11
+ });
@@ -0,0 +1,4 @@
1
+ import { expect } from 'rstack/test';
2
+ import * as jestDomMatchers from '@testing-library/jest-dom/matchers';
3
+
4
+ expect.extend(jestDomMatchers);
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "types": ["rstack/types", "node", "@testing-library/jest-dom"]
5
+ },
6
+ "include": ["./"]
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "include": ["src", "rstack.config.ts"]
4
+ }
@@ -0,0 +1,17 @@
1
+ # Local
2
+ .DS_Store
3
+ *.local
4
+ *.log*
5
+
6
+ # Dist
7
+ node_modules
8
+ dist/
9
+
10
+ # IDE
11
+ .vscode/*
12
+ !.vscode/extensions.json
13
+ .idea
14
+
15
+ # Nx
16
+ .nx/cache/
17
+ .nx/workspace-data/