sh-ui-cli 0.22.2 → 0.23.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.
Files changed (111) hide show
  1. package/README.md +19 -2
  2. package/bin/sh-ui.mjs +7 -0
  3. package/data/changelog/versions.json +14 -0
  4. package/package.json +13 -2
  5. package/src/create/cli-args.js +63 -0
  6. package/src/create/generator.js +542 -0
  7. package/src/create/index.mjs +68 -0
  8. package/src/create/plugins/index.js +17 -0
  9. package/src/create/plugins/nextIntl.js +197 -0
  10. package/src/create/plugins/sentry.js +689 -0
  11. package/src/create/theme/decode.js +66 -0
  12. package/src/create/theme/inject.js +111 -0
  13. package/src/mcp.mjs +81 -27
  14. package/src/paths.mjs +5 -0
  15. package/templates/flutter-standalone/README.md +34 -0
  16. package/templates/flutter-standalone/analysis_options.yaml +1 -0
  17. package/templates/flutter-standalone/lib/main.dart +103 -0
  18. package/templates/flutter-standalone/lib/sh_ui/foundation/sh_ui_tokens.dart +389 -0
  19. package/templates/flutter-standalone/pubspec.yaml +20 -0
  20. package/templates/flutter-standalone/sh-ui.config.json +15 -0
  21. package/templates/monorepo/.dockerignore +7 -0
  22. package/templates/monorepo/.eslintrc.js +8 -0
  23. package/templates/monorepo/.prettierrc +17 -0
  24. package/templates/monorepo/README.md +103 -0
  25. package/templates/monorepo/package.json +24 -0
  26. package/templates/monorepo/packages/eslint-config/base.js +31 -0
  27. package/templates/monorepo/packages/eslint-config/fsd.js +119 -0
  28. package/templates/monorepo/packages/eslint-config/next.js +65 -0
  29. package/templates/monorepo/packages/eslint-config/package.json +31 -0
  30. package/templates/monorepo/packages/eslint-config/react-internal.js +36 -0
  31. package/templates/monorepo/packages/typescript-config/base.json +20 -0
  32. package/templates/monorepo/packages/typescript-config/nextjs.json +13 -0
  33. package/templates/monorepo/packages/typescript-config/package.json +5 -0
  34. package/templates/monorepo/packages/typescript-config/react-library.json +8 -0
  35. package/templates/monorepo/packages/ui/ui-apps/.gitkeep +0 -0
  36. package/templates/monorepo/packages/ui/ui-core/eslint.config.js +3 -0
  37. package/templates/monorepo/packages/ui/ui-core/package.json +23 -0
  38. package/templates/monorepo/packages/ui/ui-core/src/lib/utils.ts +6 -0
  39. package/templates/monorepo/packages/ui/ui-core/tsconfig.json +11 -0
  40. package/templates/monorepo/pnpm-workspace.yaml +5 -0
  41. package/templates/monorepo/tsconfig.json +3 -0
  42. package/templates/monorepo/turbo.json +26 -0
  43. package/templates/nextjs-app/.env.example +2 -0
  44. package/templates/nextjs-app/Dockerfile +11 -0
  45. package/templates/nextjs-app/README.md +64 -0
  46. package/templates/nextjs-app/app/layout.tsx +22 -0
  47. package/templates/nextjs-app/app/page.tsx +7 -0
  48. package/templates/nextjs-app/eslint.config.js +10 -0
  49. package/templates/nextjs-app/next.config.ts +12 -0
  50. package/templates/nextjs-app/package.json +45 -0
  51. package/templates/nextjs-app/postcss.config.mjs +1 -0
  52. package/templates/nextjs-app/src/app/layouts/.gitkeep +0 -0
  53. package/templates/nextjs-app/src/app/providers/GlobalProvider/index.tsx +23 -0
  54. package/templates/nextjs-app/src/app/providers/index.tsx +1 -0
  55. package/templates/nextjs-app/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
  56. package/templates/nextjs-app/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
  57. package/templates/nextjs-app/src/app/providers/theme/ThemeProviders.tsx +12 -0
  58. package/templates/nextjs-app/src/entities/.gitkeep +0 -0
  59. package/templates/nextjs-app/src/features/.gitkeep +0 -0
  60. package/templates/nextjs-app/src/shared/api/.gitkeep +0 -0
  61. package/templates/nextjs-app/src/shared/config/.gitkeep +0 -0
  62. package/templates/nextjs-app/src/shared/hooks/.gitkeep +0 -0
  63. package/templates/nextjs-app/src/shared/lib/.gitkeep +0 -0
  64. package/templates/nextjs-app/src/shared/model/.gitkeep +0 -0
  65. package/templates/nextjs-app/src/shared/ui/.gitkeep +0 -0
  66. package/templates/nextjs-app/src/views/.gitkeep +0 -0
  67. package/templates/nextjs-app/src/widgets/.gitkeep +0 -0
  68. package/templates/nextjs-app/tsconfig.json +23 -0
  69. package/templates/nextjs-app/vitest.config.ts +15 -0
  70. package/templates/nextjs-app/vitest.setup.ts +1 -0
  71. package/templates/nextjs-standalone/.env.example +2 -0
  72. package/templates/nextjs-standalone/.prettierrc +17 -0
  73. package/templates/nextjs-standalone/README.md +77 -0
  74. package/templates/nextjs-standalone/app/globals.css +33 -0
  75. package/templates/nextjs-standalone/app/layout.tsx +22 -0
  76. package/templates/nextjs-standalone/app/page.tsx +7 -0
  77. package/templates/nextjs-standalone/eslint.config.js +162 -0
  78. package/templates/nextjs-standalone/next.config.ts +10 -0
  79. package/templates/nextjs-standalone/package.json +66 -0
  80. package/templates/nextjs-standalone/postcss.config.mjs +5 -0
  81. package/templates/nextjs-standalone/sh-ui.config.json +19 -0
  82. package/templates/nextjs-standalone/src/app/layouts/.gitkeep +0 -0
  83. package/templates/nextjs-standalone/src/app/providers/GlobalProvider/index.tsx +23 -0
  84. package/templates/nextjs-standalone/src/app/providers/index.tsx +1 -0
  85. package/templates/nextjs-standalone/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
  86. package/templates/nextjs-standalone/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
  87. package/templates/nextjs-standalone/src/app/providers/theme/ThemeProviders.tsx +12 -0
  88. package/templates/nextjs-standalone/src/entities/.gitkeep +0 -0
  89. package/templates/nextjs-standalone/src/features/.gitkeep +0 -0
  90. package/templates/nextjs-standalone/src/shared/api/.gitkeep +0 -0
  91. package/templates/nextjs-standalone/src/shared/config/.gitkeep +0 -0
  92. package/templates/nextjs-standalone/src/shared/hooks/.gitkeep +0 -0
  93. package/templates/nextjs-standalone/src/shared/lib/utils.ts +6 -0
  94. package/templates/nextjs-standalone/src/shared/model/.gitkeep +0 -0
  95. package/templates/nextjs-standalone/src/shared/styles/tokens.css +95 -0
  96. package/templates/nextjs-standalone/src/shared/ui/.gitkeep +0 -0
  97. package/templates/nextjs-standalone/src/views/.gitkeep +0 -0
  98. package/templates/nextjs-standalone/src/widgets/.gitkeep +0 -0
  99. package/templates/nextjs-standalone/tsconfig.json +39 -0
  100. package/templates/nextjs-standalone/vitest.config.ts +15 -0
  101. package/templates/nextjs-standalone/vitest.setup.ts +1 -0
  102. package/templates/ui-app-template/eslint.config.js +3 -0
  103. package/templates/ui-app-template/package.json +38 -0
  104. package/templates/ui-app-template/postcss.config.mjs +5 -0
  105. package/templates/ui-app-template/sh-ui.config.json +14 -0
  106. package/templates/ui-app-template/src/components/.gitkeep +0 -0
  107. package/templates/ui-app-template/src/hooks/.gitkeep +0 -0
  108. package/templates/ui-app-template/src/lib/.gitkeep +0 -0
  109. package/templates/ui-app-template/src/styles/globals.css +37 -0
  110. package/templates/ui-app-template/src/styles/tokens.css +95 -0
  111. package/templates/ui-app-template/tsconfig.json +11 -0
@@ -0,0 +1,95 @@
1
+ /* Generated by @sh-ui/tokens — do not edit directly */
2
+ /* base=neutral radius=md mode=light-dark */
3
+
4
+ /* sh-ui:theme-colors-start */
5
+ :root {
6
+ --background: #FFFFFF;
7
+ --background-subtle: #FAFAFA;
8
+ --background-muted: #F5F5F5;
9
+ --background-inverse: #0A0A0A;
10
+ --foreground: #0A0A0A;
11
+ --foreground-muted: #525252;
12
+ --foreground-subtle: #A3A3A3;
13
+ --foreground-inverse: #FFFFFF;
14
+ --border: #E5E5E5;
15
+ --border-strong: #D4D4D4;
16
+ --primary: #171717;
17
+ --primary-foreground: #FAFAFA;
18
+ --primary-hover: #262626;
19
+ --danger: #DC2626;
20
+ --danger-foreground: #FFFFFF;
21
+ }
22
+ .dark {
23
+ --background: #0A0A0A;
24
+ --background-subtle: #171717;
25
+ --background-muted: #262626;
26
+ --background-inverse: #FFFFFF;
27
+ --foreground: #FAFAFA;
28
+ --foreground-muted: #A3A3A3;
29
+ --foreground-subtle: #737373;
30
+ --foreground-inverse: #0A0A0A;
31
+ --border: #262626;
32
+ --border-strong: #404040;
33
+ --primary: #FAFAFA;
34
+ --primary-foreground: #171717;
35
+ --primary-hover: #E5E5E5;
36
+ --danger: #DC2626;
37
+ --danger-foreground: #FFFFFF;
38
+ }
39
+ /* sh-ui:theme-colors-end */
40
+
41
+ :root {
42
+ /* sh-ui:theme-radius-start */
43
+ --radius: 0.5rem;
44
+ /* sh-ui:theme-radius-end */
45
+ --space-0: 0px;
46
+ --space-1: 4px;
47
+ --space-2: 8px;
48
+ --space-3: 12px;
49
+ --space-4: 16px;
50
+ --space-5: 20px;
51
+ --space-6: 24px;
52
+ --space-8: 32px;
53
+ --space-10: 40px;
54
+ --space-12: 48px;
55
+ --space-16: 64px;
56
+ --text-xs: 12px;
57
+ --text-sm: 14px;
58
+ --text-base: 16px;
59
+ --text-lg: 18px;
60
+ --text-xl: 20px;
61
+ --text-2xl: 24px;
62
+ --text-3xl: 30px;
63
+ --text-4xl: 36px;
64
+ --weight-regular: 400;
65
+ --weight-medium: 500;
66
+ --weight-semibold: 600;
67
+ --weight-bold: 700;
68
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
69
+ --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
70
+ --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
71
+ --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.18);
72
+ --duration-fast: 120ms;
73
+ --duration-base: 160ms;
74
+ --duration-slow: 200ms;
75
+ --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
76
+ --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
77
+ --control-sm: 32px;
78
+ --control-md: 40px;
79
+ --control-lg: 48px;
80
+ --border-width: 1px;
81
+ --border-width-strong: 2px;
82
+ --opacity-disabled: 0.5;
83
+ --z-base: 0;
84
+ --z-sticky: 100;
85
+ --z-dropdown: 200;
86
+ --z-overlay: 300;
87
+ --z-modal: 400;
88
+ --z-popover: 500;
89
+ --z-toast: 600;
90
+ --z-tooltip: 700;
91
+ --bp-sm: 640px;
92
+ --bp-md: 768px;
93
+ --bp-lg: 1024px;
94
+ --bp-xl: 1280px;
95
+ }
File without changes
@@ -0,0 +1,39 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/tsconfig",
3
+ "compilerOptions": {
4
+ "target": "ES2022",
5
+ "lib": ["es2022", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "moduleResolution": "Bundler",
8
+ "moduleDetection": "force",
9
+ "declaration": true,
10
+ "declarationMap": true,
11
+ "esModuleInterop": true,
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ "skipLibCheck": true,
15
+ "strict": true,
16
+ "noUncheckedIndexedAccess": true,
17
+ "allowJs": true,
18
+ "jsx": "preserve",
19
+ "noEmit": true,
20
+ "incremental": true,
21
+ "baseUrl": ".",
22
+ "paths": {
23
+ "@/*": ["./*"]
24
+ },
25
+ "plugins": [
26
+ {
27
+ "name": "next"
28
+ }
29
+ ]
30
+ },
31
+ "include": [
32
+ "next-env.d.ts",
33
+ "next.config.ts",
34
+ "**/*.ts",
35
+ "**/*.tsx",
36
+ ".next/types/**/*.ts"
37
+ ],
38
+ "exclude": ["node_modules"]
39
+ }
@@ -0,0 +1,15 @@
1
+ import path from 'node:path';
2
+ import { defineConfig } from 'vitest/config';
3
+
4
+ export default defineConfig({
5
+ resolve: {
6
+ alias: {
7
+ '@': path.resolve(__dirname, '.'),
8
+ },
9
+ },
10
+ test: {
11
+ globals: true,
12
+ environment: 'jsdom',
13
+ setupFiles: ['./vitest.setup.ts'],
14
+ },
15
+ });
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom/vitest';
@@ -0,0 +1,3 @@
1
+ import { config } from "@workspace/eslint-config/react-internal"
2
+
3
+ export default config
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@workspace/ui-app-name",
3
+ "version": "0.0.0",
4
+ "type": "module",
5
+ "private": true,
6
+ "scripts": {
7
+ "lint": "eslint . --max-warnings 0"
8
+ },
9
+ "dependencies": {
10
+ "@base-ui-components/react": "latest",
11
+ "@workspace/ui-core": "workspace:*",
12
+ "lucide-react": "^0.575.0",
13
+ "next-themes": "^0.4.6",
14
+ "react": "^19.2.4",
15
+ "react-dom": "^19.2.4",
16
+ "react-hook-form": "^7.56.4",
17
+ "sonner": "^2.0.7",
18
+ "zod": "^3.25.76"
19
+ },
20
+ "devDependencies": {
21
+ "@tailwindcss/postcss": "^4.1.18",
22
+ "@types/node": "^25.1.0",
23
+ "@types/react": "^19.2.10",
24
+ "@types/react-dom": "^19.2.3",
25
+ "@workspace/eslint-config": "workspace:*",
26
+ "@workspace/typescript-config": "workspace:*",
27
+ "eslint": "^9.39.2",
28
+ "tailwindcss": "^4.1.18",
29
+ "typescript": "^5.9.3"
30
+ },
31
+ "exports": {
32
+ "./globals.css": "./src/styles/globals.css",
33
+ "./postcss.config": "./postcss.config.mjs",
34
+ "./lib/*": "./src/lib/*.ts",
35
+ "./components/*": "./src/components/*.tsx",
36
+ "./hooks/*": "./src/hooks/*.ts"
37
+ }
38
+ }
@@ -0,0 +1,5 @@
1
+ const config = {
2
+ plugins: { "@tailwindcss/postcss": {} },
3
+ };
4
+
5
+ export default config;
@@ -0,0 +1,14 @@
1
+ {
2
+ "platform": "react",
3
+ "style": "default",
4
+ "theme": {
5
+ "base": "neutral",
6
+ "radius": "md",
7
+ "mode": "light-dark"
8
+ },
9
+ "paths": {
10
+ "tokens": "src/styles/tokens.css",
11
+ "components": "src/components",
12
+ "utils": "src/lib/utils.ts"
13
+ }
14
+ }
File without changes
File without changes
@@ -0,0 +1,37 @@
1
+ @import 'tailwindcss';
2
+
3
+ @source "../../../../../apps/**/*.{ts,tsx}";
4
+ @source "../**/*.{ts,tsx}";
5
+
6
+ @import './tokens.css';
7
+
8
+ @custom-variant dark (&:is(.dark *));
9
+
10
+ @theme inline {
11
+ --color-background: var(--background);
12
+ --color-background-subtle: var(--background-subtle);
13
+ --color-background-muted: var(--background-muted);
14
+ --color-background-inverse: var(--background-inverse);
15
+ --color-foreground: var(--foreground);
16
+ --color-foreground-muted: var(--foreground-muted);
17
+ --color-foreground-subtle: var(--foreground-subtle);
18
+ --color-foreground-inverse: var(--foreground-inverse);
19
+ --color-border: var(--border);
20
+ --color-border-strong: var(--border-strong);
21
+ --color-primary: var(--primary);
22
+ --color-primary-foreground: var(--primary-foreground);
23
+ --color-primary-hover: var(--primary-hover);
24
+ --color-danger: var(--danger);
25
+ --color-danger-foreground: var(--danger-foreground);
26
+ --radius-sm: calc(var(--radius) - 2px);
27
+ --radius-md: var(--radius);
28
+ --radius-lg: calc(var(--radius) + 2px);
29
+ --radius-xl: calc(var(--radius) + 4px);
30
+ }
31
+
32
+ @layer base {
33
+ body {
34
+ background: var(--background);
35
+ color: var(--foreground);
36
+ }
37
+ }
@@ -0,0 +1,95 @@
1
+ /* Generated by @sh-ui/tokens — do not edit directly */
2
+ /* base=neutral radius=md mode=light-dark */
3
+
4
+ /* sh-ui:theme-colors-start */
5
+ :root {
6
+ --background: #FFFFFF;
7
+ --background-subtle: #FAFAFA;
8
+ --background-muted: #F5F5F5;
9
+ --background-inverse: #0A0A0A;
10
+ --foreground: #0A0A0A;
11
+ --foreground-muted: #525252;
12
+ --foreground-subtle: #A3A3A3;
13
+ --foreground-inverse: #FFFFFF;
14
+ --border: #E5E5E5;
15
+ --border-strong: #D4D4D4;
16
+ --primary: #171717;
17
+ --primary-foreground: #FAFAFA;
18
+ --primary-hover: #262626;
19
+ --danger: #DC2626;
20
+ --danger-foreground: #FFFFFF;
21
+ }
22
+ .dark {
23
+ --background: #0A0A0A;
24
+ --background-subtle: #171717;
25
+ --background-muted: #262626;
26
+ --background-inverse: #FFFFFF;
27
+ --foreground: #FAFAFA;
28
+ --foreground-muted: #A3A3A3;
29
+ --foreground-subtle: #737373;
30
+ --foreground-inverse: #0A0A0A;
31
+ --border: #262626;
32
+ --border-strong: #404040;
33
+ --primary: #FAFAFA;
34
+ --primary-foreground: #171717;
35
+ --primary-hover: #E5E5E5;
36
+ --danger: #DC2626;
37
+ --danger-foreground: #FFFFFF;
38
+ }
39
+ /* sh-ui:theme-colors-end */
40
+
41
+ :root {
42
+ /* sh-ui:theme-radius-start */
43
+ --radius: 0.5rem;
44
+ /* sh-ui:theme-radius-end */
45
+ --space-0: 0px;
46
+ --space-1: 4px;
47
+ --space-2: 8px;
48
+ --space-3: 12px;
49
+ --space-4: 16px;
50
+ --space-5: 20px;
51
+ --space-6: 24px;
52
+ --space-8: 32px;
53
+ --space-10: 40px;
54
+ --space-12: 48px;
55
+ --space-16: 64px;
56
+ --text-xs: 12px;
57
+ --text-sm: 14px;
58
+ --text-base: 16px;
59
+ --text-lg: 18px;
60
+ --text-xl: 20px;
61
+ --text-2xl: 24px;
62
+ --text-3xl: 30px;
63
+ --text-4xl: 36px;
64
+ --weight-regular: 400;
65
+ --weight-medium: 500;
66
+ --weight-semibold: 600;
67
+ --weight-bold: 700;
68
+ --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
69
+ --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
70
+ --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
71
+ --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.18);
72
+ --duration-fast: 120ms;
73
+ --duration-base: 160ms;
74
+ --duration-slow: 200ms;
75
+ --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
76
+ --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
77
+ --control-sm: 32px;
78
+ --control-md: 40px;
79
+ --control-lg: 48px;
80
+ --border-width: 1px;
81
+ --border-width-strong: 2px;
82
+ --opacity-disabled: 0.5;
83
+ --z-base: 0;
84
+ --z-sticky: 100;
85
+ --z-dropdown: 200;
86
+ --z-overlay: 300;
87
+ --z-modal: 400;
88
+ --z-popover: 500;
89
+ --z-toast: 600;
90
+ --z-tooltip: 700;
91
+ --bp-sm: 640px;
92
+ --bp-md: 768px;
93
+ --bp-lg: 1024px;
94
+ --bp-xl: 1280px;
95
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@workspace/typescript-config/react-library.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "paths": {
6
+ "@workspace/ui-app-name/*": ["./src/*"]
7
+ }
8
+ },
9
+ "include": ["."],
10
+ "exclude": ["node_modules", "dist"]
11
+ }