create-rstack 3.3.3 → 3.3.5

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 (54) hide show
  1. package/README.md +1 -0
  2. package/dist/index.js +21 -2
  3. package/package.json +4 -4
  4. package/template-app-lit/package.json +2 -2
  5. package/template-app-lit-ts/package.json +3 -3
  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 +5 -5
  9. package/template-app-react-ts/package.json +8 -8
  10. package/template-app-solid/package.json +2 -2
  11. package/template-app-solid-ts/package.json +3 -3
  12. package/template-app-svelte/package.json +2 -2
  13. package/template-app-svelte-ts/package.json +3 -3
  14. package/template-app-vanilla/package.json +3 -3
  15. package/template-app-vanilla-ts/package.json +4 -4
  16. package/template-app-vue/package.json +2 -2
  17. package/template-app-vue-ts/package.json +3 -3
  18. package/template-doc/package.json +6 -6
  19. package/template-doc-i18n/package.json +6 -6
  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 +6 -6
  23. package/template-lib-react-ts/package.json +8 -8
  24. package/template-lib-solid/package.json +2 -2
  25. package/template-lib-solid-ts/package.json +3 -3
  26. package/template-lib-svelte/package.json +2 -2
  27. package/template-lib-svelte-ts/package.json +3 -3
  28. package/template-lib-vue/package.json +2 -2
  29. package/template-lib-vue-ts/package.json +3 -3
  30. package/template-turborepo/README.md +31 -0
  31. package/template-turborepo/apps/web/package.json +27 -0
  32. package/template-turborepo/apps/web/rstack.config.ts +15 -0
  33. package/template-turborepo/apps/web/src/App.tsx +17 -0
  34. package/template-turborepo/apps/web/src/index.css +27 -0
  35. package/template-turborepo/apps/web/src/index.tsx +13 -0
  36. package/template-turborepo/apps/web/tests/app.test.tsx +11 -0
  37. package/template-turborepo/apps/web/tests/rstest.setup.ts +4 -0
  38. package/template-turborepo/apps/web/tests/tsconfig.json +7 -0
  39. package/template-turborepo/apps/web/tsconfig.json +4 -0
  40. package/template-turborepo/apps/web/turbo.json +8 -0
  41. package/template-turborepo/gitignore +16 -0
  42. package/template-turborepo/package.json +20 -0
  43. package/template-turborepo/packages/tsconfig/base.json +22 -0
  44. package/template-turborepo/packages/tsconfig/package.json +11 -0
  45. package/template-turborepo/packages/ui/package.json +31 -0
  46. package/template-turborepo/packages/ui/rstack.config.ts +20 -0
  47. package/template-turborepo/packages/ui/src/button.tsx +8 -0
  48. package/template-turborepo/packages/ui/tests/button.test.tsx +18 -0
  49. package/template-turborepo/packages/ui/tests/rstest.setup.ts +4 -0
  50. package/template-turborepo/packages/ui/tests/tsconfig.json +8 -0
  51. package/template-turborepo/packages/ui/tsconfig.json +7 -0
  52. package/template-turborepo/pnpm-workspace.yaml +3 -0
  53. package/template-turborepo/rstack.config.ts +30 -0
  54. package/template-turborepo/turbo.json +18 -0
package/README.md CHANGED
@@ -50,6 +50,7 @@ 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
+ - `turborepo` - Turborepo
53
54
 
54
55
  ## Documentation
55
56
 
package/dist/index.js CHANGED
@@ -28,7 +28,8 @@ const templateNames = [
28
28
  'lib-solid',
29
29
  'lib-solid-ts',
30
30
  'doc',
31
- 'doc-i18n'
31
+ 'doc-i18n',
32
+ 'turborepo'
32
33
  ];
33
34
  const resolveTemplateName = (template)=>{
34
35
  if (!templateNames.includes(template)) throw new Error(`Invalid input: template "${template}" not found.`);
@@ -36,7 +37,7 @@ const resolveTemplateName = (template)=>{
36
37
  };
37
38
  const getTemplateName = async ({ template })=>{
38
39
  if ('string' == typeof template) {
39
- if (/^(?:app|lib|doc)(?:-|$)/u.test(template)) return resolveTemplateName(template);
40
+ if (/^(?:app|lib|doc|turborepo)(?:-|$)/u.test(template)) return resolveTemplateName(template);
40
41
  return template;
41
42
  }
42
43
  const projectType = checkCancel(await create_toolkit_select({
@@ -53,9 +54,26 @@ const getTemplateName = async ({ template })=>{
53
54
  {
54
55
  value: 'doc',
55
56
  label: 'Documentation'
57
+ },
58
+ {
59
+ value: 'monorepo',
60
+ label: 'Monorepo'
56
61
  }
57
62
  ]
58
63
  }));
64
+ if ('monorepo' === projectType) {
65
+ const monorepoType = checkCancel(await create_toolkit_select({
66
+ message: 'Select monorepo tool',
67
+ options: [
68
+ {
69
+ value: 'turborepo',
70
+ label: 'Turborepo',
71
+ hint: 'pnpm'
72
+ }
73
+ ]
74
+ }));
75
+ return resolveTemplateName(monorepoType);
76
+ }
59
77
  if ('doc' === projectType) {
60
78
  const documentationType = checkCancel(await create_toolkit_select({
61
79
  message: 'Choose documentation language setup',
@@ -208,5 +226,6 @@ await create({
208
226
  templates: templateNames,
209
227
  builtinTools: [],
210
228
  getTemplateName: getTemplateName,
229
+ getPackageManager: ({ templateName })=>'turborepo' === templateName ? 'pnpm' : void 0,
211
230
  onGitResolved: injectStagedSetup
212
231
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-rstack",
3
- "version": "3.3.3",
3
+ "version": "3.3.5",
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.4"
32
+ "@rstackjs/create-toolkit": "2.2.7"
33
33
  },
34
34
  "devDependencies": {
35
- "@types/node": "^26.4.1",
36
- "rstack": "0.7.3",
35
+ "@types/node": "^26.5.1",
36
+ "rstack": "0.7.5",
37
37
  "typescript": "^7.0.2"
38
38
  },
39
39
  "engines": {
@@ -17,7 +17,7 @@
17
17
  "lit": "^3.3.3"
18
18
  },
19
19
  "devDependencies": {
20
- "happy-dom": "^20.13.2",
21
- "rstack": "^0.7.3"
20
+ "happy-dom": "^20.14.5",
21
+ "rstack": "^0.7.5"
22
22
  }
23
23
  }
@@ -17,9 +17,9 @@
17
17
  "lit": "^3.3.3"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "^26.4.1",
21
- "happy-dom": "^20.13.2",
22
- "rstack": "^0.7.3",
20
+ "@types/node": "^26.5.1",
21
+ "happy-dom": "^20.14.5",
22
+ "rstack": "^0.7.5",
23
23
  "typescript": "^7.0.2"
24
24
  }
25
25
  }
@@ -20,7 +20,7 @@
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
- "happy-dom": "^20.13.2",
24
- "rstack": "^0.7.3"
23
+ "happy-dom": "^20.14.5",
24
+ "rstack": "^0.7.5"
25
25
  }
26
26
  }
@@ -20,9 +20,9 @@
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.4.1",
24
- "happy-dom": "^20.13.2",
25
- "rstack": "^0.7.3",
23
+ "@types/node": "^26.5.1",
24
+ "happy-dom": "^20.14.5",
25
+ "rstack": "^0.7.5",
26
26
  "typescript": "^7.0.2"
27
27
  }
28
28
  }
@@ -14,15 +14,15 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "react": "^19.2.8",
18
- "react-dom": "^19.2.8"
17
+ "react": "^19.3.0",
18
+ "react-dom": "^19.3.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rsbuild/plugin-react": "^2.1.0",
22
- "@testing-library/dom": "^10.4.1",
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
- "happy-dom": "^20.13.2",
26
- "rstack": "^0.7.3"
25
+ "happy-dom": "^20.14.5",
26
+ "rstack": "^0.7.5"
27
27
  }
28
28
  }
@@ -14,19 +14,19 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "dependencies": {
17
- "react": "^19.2.8",
18
- "react-dom": "^19.2.8"
17
+ "react": "^19.3.0",
18
+ "react-dom": "^19.3.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@rsbuild/plugin-react": "^2.1.0",
22
- "@testing-library/dom": "^10.4.1",
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.4.1",
26
- "@types/react": "^19.2.18",
27
- "@types/react-dom": "^19.2.5",
28
- "happy-dom": "^20.13.2",
29
- "rstack": "^0.7.3",
25
+ "@types/node": "^26.5.1",
26
+ "@types/react": "^19.3.0",
27
+ "@types/react-dom": "^19.3.0",
28
+ "happy-dom": "^20.14.5",
29
+ "rstack": "^0.7.5",
30
30
  "typescript": "^7.0.2"
31
31
  }
32
32
  }
@@ -21,7 +21,7 @@
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
- "happy-dom": "^20.13.2",
25
- "rstack": "^0.7.3"
24
+ "happy-dom": "^20.14.5",
25
+ "rstack": "^0.7.5"
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.4.1",
25
- "happy-dom": "^20.13.2",
26
- "rstack": "^0.7.3",
24
+ "@types/node": "^26.5.1",
25
+ "happy-dom": "^20.14.5",
26
+ "rstack": "^0.7.5",
27
27
  "typescript": "^7.0.2"
28
28
  }
29
29
  }
@@ -20,8 +20,8 @@
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
- "happy-dom": "^20.13.2",
23
+ "happy-dom": "^20.14.5",
24
24
  "prettier-plugin-svelte": "^4.1.1",
25
- "rstack": "^0.7.3"
25
+ "rstack": "^0.7.5"
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.4.1",
24
- "happy-dom": "^20.13.2",
23
+ "@types/node": "^26.5.1",
24
+ "happy-dom": "^20.14.5",
25
25
  "prettier-plugin-svelte": "^4.1.1",
26
- "rstack": "^0.7.3",
26
+ "rstack": "^0.7.5",
27
27
  "svelte-check": "^4.7.6",
28
28
  "typescript": "^6.0.3"
29
29
  }
@@ -14,9 +14,9 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "devDependencies": {
17
- "@testing-library/dom": "^10.4.1",
17
+ "@testing-library/dom": "^10.4.2",
18
18
  "@testing-library/jest-dom": "^7.0.1",
19
- "happy-dom": "^20.13.2",
20
- "rstack": "^0.7.3"
19
+ "happy-dom": "^20.14.5",
20
+ "rstack": "^0.7.5"
21
21
  }
22
22
  }
@@ -14,11 +14,11 @@
14
14
  "test:watch": "rs test --watch"
15
15
  },
16
16
  "devDependencies": {
17
- "@testing-library/dom": "^10.4.1",
17
+ "@testing-library/dom": "^10.4.2",
18
18
  "@testing-library/jest-dom": "^7.0.1",
19
- "@types/node": "^26.4.1",
20
- "happy-dom": "^20.13.2",
21
- "rstack": "^0.7.3",
19
+ "@types/node": "^26.5.1",
20
+ "happy-dom": "^20.14.5",
21
+ "rstack": "^0.7.5",
22
22
  "typescript": "^7.0.2"
23
23
  }
24
24
  }
@@ -20,7 +20,7 @@
20
20
  "@rsbuild/plugin-vue": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@vue/test-utils": "^2.5.0",
23
- "happy-dom": "^20.13.2",
24
- "rstack": "^0.7.3"
23
+ "happy-dom": "^20.14.5",
24
+ "rstack": "^0.7.5"
25
25
  }
26
26
  }
@@ -19,10 +19,10 @@
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-vue": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
- "@types/node": "^26.4.1",
22
+ "@types/node": "^26.5.1",
23
23
  "@vue/test-utils": "^2.5.0",
24
- "happy-dom": "^20.13.2",
25
- "rstack": "^0.7.3",
24
+ "happy-dom": "^20.14.5",
25
+ "rstack": "^0.7.5",
26
26
  "typescript": "^6.0.3",
27
27
  "vue-tsc": "^3.3.11"
28
28
  }
@@ -13,12 +13,12 @@
13
13
  },
14
14
  "devDependencies": {
15
15
  "@rspress/core": "^2.0.21",
16
- "@types/node": "^26.4.1",
17
- "@types/react": "^19.2.18",
18
- "@types/react-dom": "^19.2.5",
19
- "react": "^19.2.8",
20
- "react-dom": "^19.2.8",
21
- "rstack": "^0.7.3",
16
+ "@types/node": "^26.5.1",
17
+ "@types/react": "^19.3.0",
18
+ "@types/react-dom": "^19.3.0",
19
+ "react": "^19.3.0",
20
+ "react-dom": "^19.3.0",
21
+ "rstack": "^0.7.5",
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.21",
16
- "@types/node": "^26.4.1",
17
- "@types/react": "^19.2.18",
18
- "@types/react-dom": "^19.2.5",
19
- "react": "^19.2.8",
20
- "react-dom": "^19.2.8",
21
- "rstack": "^0.7.3",
16
+ "@types/node": "^26.5.1",
17
+ "@types/react": "^19.3.0",
18
+ "@types/react-dom": "^19.3.0",
19
+ "react": "^19.3.0",
20
+ "react-dom": "^19.3.0",
21
+ "rstack": "^0.7.5",
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.7.3"
21
+ "rstack": "^0.7.5"
22
22
  },
23
23
  "engines": {
24
24
  "node": ">=22.12.0"
@@ -24,8 +24,8 @@
24
24
  "test:watch": "rs test --watch"
25
25
  },
26
26
  "devDependencies": {
27
- "@types/node": "^26.4.1",
28
- "rstack": "^0.7.3",
27
+ "@types/node": "^26.5.1",
28
+ "rstack": "^0.7.5",
29
29
  "typescript": "^7.0.2"
30
30
  },
31
31
  "engines": {
@@ -18,14 +18,14 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-react": "^2.1.0",
21
- "@testing-library/dom": "^10.4.1",
21
+ "@testing-library/dom": "^10.4.2",
22
22
  "@testing-library/jest-dom": "^7.0.1",
23
23
  "@testing-library/react": "^16.3.3",
24
- "@types/react-dom": "^19.2.5",
25
- "happy-dom": "^20.13.2",
26
- "react": "^19.2.8",
27
- "react-dom": "^19.2.8",
28
- "rstack": "^0.7.3"
24
+ "@types/react-dom": "^19.3.0",
25
+ "happy-dom": "^20.14.5",
26
+ "react": "^19.3.0",
27
+ "react-dom": "^19.3.0",
28
+ "rstack": "^0.7.5"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "react": ">=18.0.0",
@@ -24,16 +24,16 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@rsbuild/plugin-react": "^2.1.0",
27
- "@testing-library/dom": "^10.4.1",
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.4.1",
31
- "@types/react": "^19.2.18",
32
- "@types/react-dom": "^19.2.5",
33
- "happy-dom": "^20.13.2",
34
- "react": "^19.2.8",
35
- "react-dom": "^19.2.8",
36
- "rstack": "^0.7.3",
30
+ "@types/node": "^26.5.1",
31
+ "@types/react": "^19.3.0",
32
+ "@types/react-dom": "^19.3.0",
33
+ "happy-dom": "^20.14.5",
34
+ "react": "^19.3.0",
35
+ "react-dom": "^19.3.0",
36
+ "rstack": "^0.7.5",
37
37
  "typescript": "^7.0.2"
38
38
  },
39
39
  "peerDependencies": {
@@ -26,8 +26,8 @@
26
26
  "@rsbuild/plugin-solid": "^1.2.2",
27
27
  "@solidjs/testing-library": "^0.8.10",
28
28
  "@testing-library/jest-dom": "^7.0.1",
29
- "happy-dom": "^20.13.2",
30
- "rstack": "^0.7.3",
29
+ "happy-dom": "^20.14.5",
30
+ "rstack": "^0.7.5",
31
31
  "solid-js": "^1.9.15"
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.4.1",
32
- "happy-dom": "^20.13.2",
33
- "rstack": "^0.7.3",
31
+ "@types/node": "^26.5.1",
32
+ "happy-dom": "^20.14.5",
33
+ "rstack": "^0.7.5",
34
34
  "solid-js": "^1.9.15",
35
35
  "typescript": "^7.0.2"
36
36
  },
@@ -18,9 +18,9 @@
18
18
  },
19
19
  "devDependencies": {
20
20
  "@rsbuild/plugin-svelte": "^2.0.1",
21
- "happy-dom": "^20.13.2",
21
+ "happy-dom": "^20.14.5",
22
22
  "prettier-plugin-svelte": "^4.1.1",
23
- "rstack": "^0.7.3",
23
+ "rstack": "^0.7.5",
24
24
  "svelte": "^5.57.0"
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.4.1",
28
- "happy-dom": "^20.13.2",
27
+ "@types/node": "^26.5.1",
28
+ "happy-dom": "^20.14.5",
29
29
  "prettier-plugin-svelte": "^4.1.1",
30
- "rstack": "^0.7.3",
30
+ "rstack": "^0.7.5",
31
31
  "svelte": "^5.57.0",
32
32
  "svelte-check": "^4.7.6",
33
33
  "svelte2tsx": "^0.7.61",
@@ -20,8 +20,8 @@
20
20
  "@rsbuild/plugin-vue": "^2.0.1",
21
21
  "@testing-library/jest-dom": "^7.0.1",
22
22
  "@vue/test-utils": "^2.5.0",
23
- "happy-dom": "^20.13.2",
24
- "rstack": "^0.7.3",
23
+ "happy-dom": "^20.14.5",
24
+ "rstack": "^0.7.5",
25
25
  "vue": "^3.5.42"
26
26
  },
27
27
  "peerDependencies": {
@@ -25,10 +25,10 @@
25
25
  "devDependencies": {
26
26
  "@rsbuild/plugin-vue": "^2.0.1",
27
27
  "@testing-library/jest-dom": "^7.0.1",
28
- "@types/node": "^26.4.1",
28
+ "@types/node": "^26.5.1",
29
29
  "@vue/test-utils": "^2.5.0",
30
- "happy-dom": "^20.13.2",
31
- "rstack": "^0.7.3",
30
+ "happy-dom": "^20.14.5",
31
+ "rstack": "^0.7.5",
32
32
  "typescript": "^6.0.3",
33
33
  "vue": "^3.5.42",
34
34
  "vue-tsc": "^3.3.11"
@@ -0,0 +1,31 @@
1
+ # Rstack + Turborepo
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
+ - `packages/tsconfig`: 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 development.
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
+ Run `pnpm run build` before `pnpm run check`.
27
+
28
+ ## Learn more
29
+
30
+ - [Rstack CLI monorepo guide](https://rstack.rs/guide/monorepo)
31
+ - [Turborepo documentation](https://turborepo.com/docs)
@@ -0,0 +1,27 @@
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
+ "@repo/tsconfig": "workspace:^",
19
+ "@rsbuild/plugin-react": "^2.1.0",
20
+ "@testing-library/dom": "^10.4.2",
21
+ "@testing-library/jest-dom": "^7.0.1",
22
+ "@testing-library/react": "^16.3.3",
23
+ "@types/react": "^19.3.0",
24
+ "@types/react-dom": "^19.3.0",
25
+ "happy-dom": "^20.14.5"
26
+ }
27
+ }
@@ -0,0 +1,15 @@
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
+ html: { title: 'Web | Rstack' },
9
+ server: { port: 3000 },
10
+ };
11
+ });
12
+
13
+ define.test({
14
+ setupFiles: ['./tests/rstest.setup.ts'],
15
+ });
@@ -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>Turborepo + 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": "@repo/tsconfig/base.json",
3
+ "include": ["src", "rstack.config.ts"]
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "dev": {
5
+ "persistent": true
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,16 @@
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
+ # Turborepo
16
+ .turbo/
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "rstack-turborepo",
3
+ "private": true,
4
+ "type": "module",
5
+ "scripts": {
6
+ "build": "turbo run build",
7
+ "check": "rs check --type-check",
8
+ "dev": "turbo watch dev",
9
+ "format": "rs fmt",
10
+ "lint": "rs lint",
11
+ "test": "turbo run test"
12
+ },
13
+ "devDependencies": {
14
+ "@types/node": "^26.5.1",
15
+ "rstack": "^0.7.5",
16
+ "turbo": "^2.10.12",
17
+ "typescript": "^7.0.2"
18
+ },
19
+ "packageManager": "pnpm@12.4.1"
20
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
5
+ "target": "ES2022",
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "moduleDetection": "force",
9
+ "jsx": "react-jsx",
10
+ "strict": true,
11
+ "noEmit": true,
12
+ "skipLibCheck": true,
13
+ "isolatedModules": true,
14
+ "verbatimModuleSyntax": true,
15
+ "resolveJsonModule": true,
16
+ "allowImportingTsExtensions": true,
17
+ "noUncheckedIndexedAccess": true,
18
+ "noUnusedLocals": true,
19
+ "noUnusedParameters": true,
20
+ "types": ["rstack/types", "node"]
21
+ }
22
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "@repo/tsconfig",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "exports": {
6
+ "./base.json": "./base.json"
7
+ },
8
+ "files": [
9
+ "base.json"
10
+ ]
11
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@repo/ui",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "exports": {
7
+ "./button": {
8
+ "types": "./dist/button.d.ts",
9
+ "default": "./dist/button.js"
10
+ }
11
+ },
12
+ "scripts": {
13
+ "build": "rs lib",
14
+ "dev": "rs lib --no-clean",
15
+ "test": "rs test"
16
+ },
17
+ "dependencies": {
18
+ "react": "^19.3.0"
19
+ },
20
+ "devDependencies": {
21
+ "@repo/tsconfig": "workspace:^",
22
+ "@rsbuild/plugin-react": "^2.1.0",
23
+ "@testing-library/dom": "^10.4.2",
24
+ "@testing-library/jest-dom": "^7.0.1",
25
+ "@testing-library/react": "^16.3.3",
26
+ "@types/react": "^19.3.0",
27
+ "@types/react-dom": "^19.3.0",
28
+ "happy-dom": "^20.14.5",
29
+ "react-dom": "^19.3.0"
30
+ }
31
+ }
@@ -0,0 +1,20 @@
1
+ // Configuration guide: https://rstack.rs/config
2
+ import { define } from 'rstack';
3
+
4
+ define.lib(async () => {
5
+ const { pluginReact } = await import('@rsbuild/plugin-react');
6
+ return {
7
+ dts: true,
8
+ source: {
9
+ entry: { button: './src/button.tsx' },
10
+ },
11
+ output: {
12
+ target: 'web',
13
+ },
14
+ plugins: [pluginReact()],
15
+ };
16
+ });
17
+
18
+ define.test({
19
+ setupFiles: ['./tests/rstest.setup.ts'],
20
+ });
@@ -0,0 +1,8 @@
1
+ import type { ComponentProps } from 'react';
2
+
3
+ export function Button({
4
+ type = 'button',
5
+ ...props
6
+ }: ComponentProps<'button'>) {
7
+ return <button type={type} {...props} />;
8
+ }
@@ -0,0 +1,18 @@
1
+ import { expect, test } from 'rstack/test';
2
+ import { render, screen } from '@testing-library/react';
3
+ import { Button } from '../src/button';
4
+
5
+ test('defaults to a non-submitting button and forwards props', () => {
6
+ render(<Button disabled>Save</Button>);
7
+ const button = screen.getByRole('button', { name: 'Save' });
8
+ expect(button).toHaveAttribute('type', 'button');
9
+ expect(button).toBeDisabled();
10
+ });
11
+
12
+ test('allows a submit button', () => {
13
+ render(<Button type="submit">Submit</Button>);
14
+ expect(screen.getByRole('button', { name: 'Submit' })).toHaveAttribute(
15
+ 'type',
16
+ 'submit',
17
+ );
18
+ });
@@ -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,8 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "..",
5
+ "types": ["rstack/types", "node", "@testing-library/jest-dom"]
6
+ },
7
+ "include": ["./", "../rstack.config.ts"]
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": "@repo/tsconfig/base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src"
5
+ },
6
+ "include": ["src"]
7
+ }
@@ -0,0 +1,3 @@
1
+ packages:
2
+ - apps/*
3
+ - packages/*
@@ -0,0 +1,30 @@
1
+ // Configuration guide: https://rstack.rs/config
2
+ import { define } from 'rstack';
3
+
4
+ define.lint(({ js, ts, reactPlugin, reactHooksPlugin, rstestPlugin }) => [
5
+ js.configs.recommended,
6
+ ts.configs.recommendedTypeChecked,
7
+ reactPlugin.configs.recommended,
8
+ reactHooksPlugin.configs.recommended,
9
+ {
10
+ files: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
11
+ ...rstestPlugin.configs.recommended,
12
+ },
13
+ {
14
+ languageOptions: {
15
+ parserOptions: {
16
+ project: [
17
+ './apps/*/tsconfig.json',
18
+ './apps/*/tests/tsconfig.json',
19
+ './packages/*/tsconfig.json',
20
+ './packages/*/tests/tsconfig.json',
21
+ ],
22
+ },
23
+ },
24
+ },
25
+ ]);
26
+
27
+ define.fmt({
28
+ singleQuote: true,
29
+ ignorePatterns: ['**/dist/**', '**/.turbo/**'],
30
+ });
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://turborepo.dev/schema.json",
3
+ "ui": "tui",
4
+ "tasks": {
5
+ "build": {
6
+ "dependsOn": ["^build"],
7
+ "inputs": ["$TURBO_DEFAULT$", ".env*"],
8
+ "outputs": ["dist/**"]
9
+ },
10
+ "dev": {
11
+ "dependsOn": ["^dev"],
12
+ "cache": false
13
+ },
14
+ "test": {
15
+ "dependsOn": ["^build"]
16
+ }
17
+ }
18
+ }