@launch77/cli 1.2.0 → 1.4.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 (215) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cli.js +8 -1
  3. package/dist/cli.js.map +1 -1
  4. package/dist/infrastructure/git.d.ts +37 -0
  5. package/dist/infrastructure/git.d.ts.map +1 -0
  6. package/dist/infrastructure/git.js +82 -0
  7. package/dist/infrastructure/git.js.map +1 -0
  8. package/dist/infrastructure/github.d.ts +43 -0
  9. package/dist/infrastructure/github.d.ts.map +1 -0
  10. package/dist/infrastructure/github.js +89 -0
  11. package/dist/infrastructure/github.js.map +1 -0
  12. package/dist/infrastructure/template-generator.d.ts +1 -1
  13. package/dist/infrastructure/template-generator.d.ts.map +1 -1
  14. package/dist/infrastructure/template.d.ts +5 -0
  15. package/dist/infrastructure/template.d.ts.map +1 -1
  16. package/dist/infrastructure/template.js +11 -0
  17. package/dist/infrastructure/template.js.map +1 -1
  18. package/dist/modules/app/commands/create-app.js +1 -1
  19. package/dist/modules/app/commands/create-app.js.map +1 -1
  20. package/dist/modules/app/commands/delete-app.js +1 -1
  21. package/dist/modules/app/commands/delete-app.js.map +1 -1
  22. package/dist/modules/app/services/app-svc.d.ts +1 -1
  23. package/dist/modules/app/services/app-svc.d.ts.map +1 -1
  24. package/dist/modules/app/services/manifest-svc.d.ts +1 -1
  25. package/dist/modules/app/services/manifest-svc.d.ts.map +1 -1
  26. package/dist/modules/catalog/config/catalog-config.test.js +1 -1
  27. package/dist/modules/catalog/config/catalog-config.test.js.map +1 -1
  28. package/dist/modules/catalog/schemas/catalog-ui-components.schema.json +2 -18
  29. package/dist/modules/git/commands/git-connect.d.ts +3 -0
  30. package/dist/modules/git/commands/git-connect.d.ts.map +1 -0
  31. package/dist/modules/git/commands/git-connect.js +156 -0
  32. package/dist/modules/git/commands/git-connect.js.map +1 -0
  33. package/dist/modules/git/errors/git-errors.d.ts +21 -0
  34. package/dist/modules/git/errors/git-errors.d.ts.map +1 -0
  35. package/dist/modules/git/errors/git-errors.js +41 -0
  36. package/dist/modules/git/errors/git-errors.js.map +1 -0
  37. package/dist/modules/git/index.d.ts +5 -0
  38. package/dist/modules/git/index.d.ts.map +1 -0
  39. package/dist/modules/git/index.js +8 -0
  40. package/dist/modules/git/index.js.map +1 -0
  41. package/dist/modules/git/services/git-service.d.ts +24 -0
  42. package/dist/modules/git/services/git-service.d.ts.map +1 -0
  43. package/dist/modules/git/services/git-service.js +56 -0
  44. package/dist/modules/git/services/git-service.js.map +1 -0
  45. package/dist/modules/git/services/github-service.d.ts +27 -0
  46. package/dist/modules/git/services/github-service.d.ts.map +1 -0
  47. package/dist/modules/git/services/github-service.js +45 -0
  48. package/dist/modules/git/services/github-service.js.map +1 -0
  49. package/dist/modules/plugin/commands/plugin-create.d.ts +3 -0
  50. package/dist/modules/plugin/commands/plugin-create.d.ts.map +1 -0
  51. package/dist/modules/plugin/commands/plugin-create.js +59 -0
  52. package/dist/modules/plugin/commands/plugin-create.js.map +1 -0
  53. package/dist/modules/plugin/commands/plugin-install.d.ts.map +1 -1
  54. package/dist/modules/plugin/commands/plugin-install.js +9 -24
  55. package/dist/modules/plugin/commands/plugin-install.js.map +1 -1
  56. package/dist/modules/plugin/errors/plugin-errors.d.ts +24 -1
  57. package/dist/modules/plugin/errors/plugin-errors.d.ts.map +1 -1
  58. package/dist/modules/plugin/errors/plugin-errors.js +79 -6
  59. package/dist/modules/plugin/errors/plugin-errors.js.map +1 -1
  60. package/dist/modules/plugin/index.d.ts +4 -2
  61. package/dist/modules/plugin/index.d.ts.map +1 -1
  62. package/dist/modules/plugin/index.js +4 -2
  63. package/dist/modules/plugin/index.js.map +1 -1
  64. package/dist/modules/plugin/lib/plugin-registry.d.ts +6 -12
  65. package/dist/modules/plugin/lib/plugin-registry.d.ts.map +1 -1
  66. package/dist/modules/plugin/lib/plugin-registry.js +13 -30
  67. package/dist/modules/plugin/lib/plugin-registry.js.map +1 -1
  68. package/dist/modules/plugin/lib/plugin-resolver.d.ts +76 -0
  69. package/dist/modules/plugin/lib/plugin-resolver.d.ts.map +1 -0
  70. package/dist/modules/plugin/lib/plugin-resolver.js +128 -0
  71. package/dist/modules/plugin/lib/plugin-resolver.js.map +1 -0
  72. package/dist/modules/plugin/lib/plugin-resolver.test.d.ts +2 -0
  73. package/dist/modules/plugin/lib/plugin-resolver.test.d.ts.map +1 -0
  74. package/dist/modules/plugin/lib/plugin-resolver.test.js +175 -0
  75. package/dist/modules/plugin/lib/plugin-resolver.test.js.map +1 -0
  76. package/dist/modules/plugin/services/plugin-create-service.d.ts +16 -0
  77. package/dist/modules/plugin/services/plugin-create-service.d.ts.map +1 -0
  78. package/dist/modules/plugin/services/plugin-create-service.js +47 -0
  79. package/dist/modules/plugin/services/plugin-create-service.js.map +1 -0
  80. package/dist/modules/plugin/services/plugin-svc.d.ts +8 -3
  81. package/dist/modules/plugin/services/plugin-svc.d.ts.map +1 -1
  82. package/dist/modules/plugin/services/plugin-svc.js +96 -15
  83. package/dist/modules/plugin/services/plugin-svc.js.map +1 -1
  84. package/dist/modules/release/commands/release-init.d.ts +3 -0
  85. package/dist/modules/release/commands/release-init.d.ts.map +1 -0
  86. package/dist/modules/release/commands/release-init.js +92 -0
  87. package/dist/modules/release/commands/release-init.js.map +1 -0
  88. package/dist/modules/release/errors/release-errors.d.ts +7 -0
  89. package/dist/modules/release/errors/release-errors.d.ts.map +1 -0
  90. package/dist/modules/release/errors/release-errors.js +13 -0
  91. package/dist/modules/release/errors/release-errors.js.map +1 -0
  92. package/dist/modules/release/index.d.ts +4 -0
  93. package/dist/modules/release/index.d.ts.map +1 -0
  94. package/dist/modules/release/index.js +7 -0
  95. package/dist/modules/release/index.js.map +1 -0
  96. package/dist/modules/release/services/release-service.d.ts +34 -0
  97. package/dist/modules/release/services/release-service.d.ts.map +1 -0
  98. package/dist/modules/release/services/release-service.js +154 -0
  99. package/dist/modules/release/services/release-service.js.map +1 -0
  100. package/dist/modules/workspace/commands/init-workspace.d.ts.map +1 -1
  101. package/dist/modules/workspace/commands/init-workspace.js +4 -5
  102. package/dist/modules/workspace/commands/init-workspace.js.map +1 -1
  103. package/dist/modules/workspace/services/workspace-service.d.ts +2 -1
  104. package/dist/modules/workspace/services/workspace-service.d.ts.map +1 -1
  105. package/dist/modules/workspace/services/workspace-service.js +27 -1
  106. package/dist/modules/workspace/services/workspace-service.js.map +1 -1
  107. package/dist/templates/plugin/README.md.hbs +39 -0
  108. package/dist/{plugins/theme/package.json → templates/plugin/package.json.hbs} +5 -3
  109. package/dist/templates/plugin/plugin.json.hbs +7 -0
  110. package/dist/templates/plugin/src/generator.ts.hbs +64 -0
  111. package/dist/templates/plugin/templates/src/.gitkeep +0 -0
  112. package/dist/templates/plugin/tsconfig.json +10 -0
  113. package/dist/{plugins/theme → templates/plugin}/tsup.config.ts +0 -1
  114. package/dist/templates/workspace/.github/workflows/ci.yml +102 -0
  115. package/dist/templates/workspace/package.json +16 -1
  116. package/dist/templates/workspace/turbo.json +5 -0
  117. package/dist/utils/launch77-context.d.ts +1 -1
  118. package/dist/utils/launch77-context.d.ts.map +1 -1
  119. package/dist/utils/launch77-context.js +25 -2
  120. package/dist/utils/launch77-context.js.map +1 -1
  121. package/dist/utils/launch77-validation.d.ts +1 -1
  122. package/dist/utils/launch77-validation.d.ts.map +1 -1
  123. package/dist/utils/string.d.ts +13 -0
  124. package/dist/utils/string.d.ts.map +1 -0
  125. package/dist/utils/string.js +18 -0
  126. package/dist/utils/string.js.map +1 -0
  127. package/package.json +7 -10
  128. package/src/cli.ts +10 -1
  129. package/src/infrastructure/git.ts +86 -0
  130. package/src/infrastructure/github.ts +111 -0
  131. package/src/infrastructure/template-generator.ts +1 -1
  132. package/src/infrastructure/template.ts +14 -0
  133. package/src/modules/app/commands/create-app.ts +1 -1
  134. package/src/modules/app/commands/delete-app.ts +1 -1
  135. package/src/modules/app/services/app-svc.ts +1 -1
  136. package/src/modules/app/services/manifest-svc.ts +1 -1
  137. package/src/modules/catalog/config/catalog-config.test.ts +1 -1
  138. package/src/modules/git/commands/git-connect.ts +183 -0
  139. package/src/modules/git/errors/git-errors.ts +44 -0
  140. package/src/modules/git/index.ts +9 -0
  141. package/src/modules/git/services/git-service.ts +63 -0
  142. package/src/modules/git/services/github-service.ts +52 -0
  143. package/src/modules/plugin/commands/plugin-create.ts +68 -0
  144. package/src/modules/plugin/commands/plugin-install.ts +9 -26
  145. package/src/modules/plugin/errors/plugin-errors.ts +87 -6
  146. package/src/modules/plugin/index.ts +4 -2
  147. package/src/modules/plugin/lib/plugin-registry.ts +14 -37
  148. package/src/modules/plugin/lib/plugin-resolver.test.ts +215 -0
  149. package/src/modules/plugin/lib/plugin-resolver.ts +160 -0
  150. package/src/modules/plugin/services/plugin-create-service.ts +69 -0
  151. package/src/modules/plugin/services/plugin-svc.ts +108 -15
  152. package/src/modules/release/commands/release-init.ts +102 -0
  153. package/src/modules/release/errors/release-errors.ts +13 -0
  154. package/src/modules/release/index.ts +8 -0
  155. package/src/modules/release/services/release-service.ts +170 -0
  156. package/src/modules/workspace/commands/init-workspace.ts +4 -6
  157. package/src/modules/workspace/services/workspace-service.ts +30 -1
  158. package/src/utils/launch77-context.ts +29 -3
  159. package/src/utils/launch77-validation.ts +1 -1
  160. package/src/utils/string.ts +17 -0
  161. package/templates/plugin/README.md.hbs +39 -0
  162. package/templates/plugin/package.json.hbs +34 -0
  163. package/templates/plugin/plugin.json.hbs +7 -0
  164. package/templates/plugin/src/generator.ts.hbs +64 -0
  165. package/templates/plugin/templates/src/.gitkeep +0 -0
  166. package/templates/plugin/tsconfig.json +10 -0
  167. package/templates/plugin/tsup.config.ts +9 -0
  168. package/templates/workspace/.github/workflows/ci.yml +102 -0
  169. package/templates/workspace/package.json +5 -0
  170. package/templates/workspace/turbo.json +5 -0
  171. package/tests/integration/cli.test.ts +25 -0
  172. package/tests/integration/setup.ts +20 -0
  173. package/vitest.config.ts +9 -0
  174. package/vitest.integration.config.ts +9 -0
  175. package/dist/app-templates/webapp/.env.ci +0 -6
  176. package/dist/app-templates/webapp/.env.example +0 -9
  177. package/dist/app-templates/webapp/.eslintrc.json +0 -6
  178. package/dist/app-templates/webapp/README.md.hbs +0 -80
  179. package/dist/app-templates/webapp/app/about/page.tsx.hbs +0 -41
  180. package/dist/app-templates/webapp/app/dashboard/page.tsx.hbs +0 -51
  181. package/dist/app-templates/webapp/app/globals.css +0 -31
  182. package/dist/app-templates/webapp/app/layout.tsx.hbs +0 -26
  183. package/dist/app-templates/webapp/app/page.tsx.hbs +0 -30
  184. package/dist/app-templates/webapp/next.config.js +0 -99
  185. package/dist/app-templates/webapp/package.json.hbs +0 -30
  186. package/dist/app-templates/webapp/postcss.config.js +0 -6
  187. package/dist/app-templates/webapp/tailwind.config.ts +0 -24
  188. package/dist/app-templates/webapp/tsconfig.json +0 -29
  189. package/dist/app-templates/webapp/vercel.json.hbs +0 -7
  190. package/dist/modules/catalog/schemas/schemas/catalog-ui-components.schema.json +0 -145
  191. package/dist/plugins/theme/plugin.json +0 -9
  192. package/dist/plugins/theme/src/generator.ts +0 -92
  193. package/dist/plugins/theme/src/utils/config-modifier.ts +0 -142
  194. package/dist/plugins/theme/src/utils/css-modifier.ts +0 -89
  195. package/dist/plugins/theme/templates/app/theme-test/page.tsx +0 -156
  196. package/dist/plugins/theme/templates/src/modules/theme/README.md +0 -209
  197. package/dist/plugins/theme/templates/src/modules/theme/config/brand.css +0 -23
  198. package/dist/plugins/theme/tsconfig.json +0 -14
  199. package/dist/templates/templates/startup/apps/.gitkeep +0 -8
  200. package/dist/templates/templates/workspace/.launch77/workspace.json +0 -3
  201. package/dist/templates/templates/workspace/README.md +0 -62
  202. package/dist/templates/templates/workspace/app-templates/.gitkeep +0 -1
  203. package/dist/templates/templates/workspace/apps/.gitkeep +0 -1
  204. package/dist/templates/templates/workspace/libraries/.gitkeep +0 -1
  205. package/dist/templates/templates/workspace/package.json +0 -31
  206. package/dist/templates/templates/workspace/plugins/.gitkeep +0 -1
  207. package/dist/templates/templates/workspace/tsconfig.json +0 -22
  208. package/dist/templates/templates/workspace/turbo.json +0 -25
  209. package/launch77-cli-1.2.0.tgz +0 -0
  210. package/src/modules/plugin/lib/launch77-workspace.code-workspace +0 -14
  211. /package/dist/templates/{templates/workspace → workspace}/.eslintignore +0 -0
  212. /package/dist/templates/{templates/workspace → workspace}/.eslintrc.js +0 -0
  213. /package/dist/templates/{templates/workspace → workspace}/.husky/pre-push +0 -0
  214. /package/dist/templates/{templates/workspace → workspace}/.lintstagedrc.json +0 -0
  215. /package/dist/templates/{templates/workspace → workspace}/.prettierrc +0 -0
@@ -1,142 +0,0 @@
1
- import fs from 'fs/promises'
2
-
3
- export interface AddTailwindPresetResult {
4
- success: boolean
5
- error?: string
6
- alreadyExists?: boolean
7
- }
8
-
9
- /**
10
- * Add Launch77 theme preset to tailwind.config.ts
11
- * Idempotent - won't duplicate if preset already exists
12
- */
13
- export async function addTailwindPreset(
14
- filePath: string,
15
- presetRequire: string
16
- ): Promise<AddTailwindPresetResult> {
17
- try {
18
- // Check if file exists
19
- const fileExists = await fs
20
- .access(filePath)
21
- .then(() => true)
22
- .catch(() => false)
23
-
24
- if (!fileExists) {
25
- return {
26
- success: false,
27
- error: `File not found: ${filePath}`,
28
- }
29
- }
30
-
31
- // Read file content
32
- const content = await fs.readFile(filePath, 'utf-8')
33
-
34
- // Check if preset already exists
35
- if (content.includes(presetRequire)) {
36
- return {
37
- success: true,
38
- alreadyExists: true,
39
- }
40
- }
41
-
42
- // Find the config object and check for existing presets property
43
- const lines = content.split('\n')
44
- let configStartIndex = -1
45
- let presetsIndex = -1
46
- let indentation = ' '
47
-
48
- // Find where the config object starts
49
- for (let i = 0; i < lines.length; i++) {
50
- const line = lines[i]
51
-
52
- // Look for the config object declaration
53
- if (line.includes('satisfies Config') || line.includes(': Config =')) {
54
- configStartIndex = i
55
- // Detect indentation from first property
56
- for (let j = i + 1; j < lines.length; j++) {
57
- const propLine = lines[j]
58
- const match = propLine.match(/^(\s+)\w+:/)
59
- if (match) {
60
- indentation = match[1]
61
- break
62
- }
63
- }
64
- }
65
-
66
- // Check if presets property already exists
67
- if (line.includes('presets:')) {
68
- presetsIndex = i
69
- }
70
- }
71
-
72
- if (configStartIndex === -1) {
73
- return {
74
- success: false,
75
- error: 'Could not find Tailwind config object',
76
- }
77
- }
78
-
79
- let newContent: string
80
-
81
- if (presetsIndex !== -1) {
82
- // Presets property exists - add to existing array
83
- const presetsLine = lines[presetsIndex]
84
-
85
- // Check if it's an empty array
86
- if (presetsLine.includes('[]')) {
87
- // Replace empty array with array containing our preset
88
- lines[presetsIndex] = presetsLine.replace('[]', `[${presetRequire}]`)
89
- } else {
90
- // Add to existing array - find the opening bracket
91
- const openBracketIndex = presetsLine.indexOf('[')
92
- if (openBracketIndex !== -1) {
93
- // Insert after the opening bracket
94
- lines[presetsIndex] =
95
- presetsLine.slice(0, openBracketIndex + 1) +
96
- presetRequire +
97
- ', ' +
98
- presetsLine.slice(openBracketIndex + 1)
99
- } else {
100
- return {
101
- success: false,
102
- error: 'Could not parse existing presets array',
103
- }
104
- }
105
- }
106
- newContent = lines.join('\n')
107
- } else {
108
- // No presets property - add it as first property in config
109
- // Find the line after config object starts (skip opening brace)
110
- let insertIndex = configStartIndex + 1
111
-
112
- // Skip the opening brace line if it's on the same line
113
- if (lines[configStartIndex].includes('{')) {
114
- // Opening brace is on same line, insert after
115
- } else {
116
- // Find the opening brace
117
- while (insertIndex < lines.length && !lines[insertIndex].includes('{')) {
118
- insertIndex++
119
- }
120
- insertIndex++
121
- }
122
-
123
- // Insert presets property
124
- const presetsLine = `${indentation}presets: [${presetRequire}],`
125
- lines.splice(insertIndex, 0, presetsLine)
126
-
127
- newContent = lines.join('\n')
128
- }
129
-
130
- // Write back to file
131
- await fs.writeFile(filePath, newContent, 'utf-8')
132
-
133
- return {
134
- success: true,
135
- }
136
- } catch (error) {
137
- return {
138
- success: false,
139
- error: error instanceof Error ? error.message : String(error),
140
- }
141
- }
142
- }
@@ -1,89 +0,0 @@
1
- import fs from 'fs/promises'
2
-
3
- export interface InsertCssImportsResult {
4
- success: boolean
5
- error?: string
6
- alreadyExists?: boolean
7
- }
8
-
9
- /**
10
- * Insert CSS imports after @tailwind directives
11
- * Idempotent - won't duplicate if imports already exist
12
- */
13
- export async function insertCssImports(
14
- filePath: string,
15
- imports: string[]
16
- ): Promise<InsertCssImportsResult> {
17
- try {
18
- // Check if file exists
19
- const fileExists = await fs
20
- .access(filePath)
21
- .then(() => true)
22
- .catch(() => false)
23
-
24
- if (!fileExists) {
25
- return {
26
- success: false,
27
- error: `File not found: ${filePath}`,
28
- }
29
- }
30
-
31
- // Read file content
32
- const content = await fs.readFile(filePath, 'utf-8')
33
-
34
- // Check if imports already exist
35
- const allImportsExist = imports.every((importLine) => content.includes(importLine))
36
-
37
- if (allImportsExist) {
38
- return {
39
- success: true,
40
- alreadyExists: true,
41
- }
42
- }
43
-
44
- // Find the last @tailwind directive
45
- const lines = content.split('\n')
46
- let lastTailwindIndex = -1
47
-
48
- for (let i = 0; i < lines.length; i++) {
49
- if (lines[i].trim().startsWith('@tailwind')) {
50
- lastTailwindIndex = i
51
- }
52
- }
53
-
54
- if (lastTailwindIndex === -1) {
55
- return {
56
- success: false,
57
- error: 'Could not find @tailwind directives',
58
- }
59
- }
60
-
61
- // Insert imports after the last @tailwind directive
62
- const importsToAdd = imports.filter((importLine) => !content.includes(importLine))
63
-
64
- if (importsToAdd.length === 0) {
65
- return {
66
- success: true,
67
- alreadyExists: true,
68
- }
69
- }
70
-
71
- // Build the new content
72
- const before = lines.slice(0, lastTailwindIndex + 1)
73
- const after = lines.slice(lastTailwindIndex + 1)
74
-
75
- const newContent = [...before, '', '/* Launch77 Theme */', ...importsToAdd, ...after].join('\n')
76
-
77
- // Write back to file
78
- await fs.writeFile(filePath, newContent, 'utf-8')
79
-
80
- return {
81
- success: true,
82
- }
83
- } catch (error) {
84
- return {
85
- success: false,
86
- error: error instanceof Error ? error.message : String(error),
87
- }
88
- }
89
- }
@@ -1,156 +0,0 @@
1
- import Link from 'next/link'
2
-
3
- export default function ThemeTestPage() {
4
- return (
5
- <main className="min-h-screen bg-background p-8">
6
- <div className="max-w-4xl mx-auto space-y-8">
7
- {/* Header */}
8
- <div className="space-y-2">
9
- <h1 className="text-4xl font-bold text-foreground">
10
- Theme Test Page
11
- </h1>
12
- <p className="text-muted-foreground">
13
- Test your theme colors and see changes in real-time
14
- </p>
15
- </div>
16
-
17
- {/* Instructions */}
18
- <div className="bg-card border border-border rounded-lg p-6 space-y-4">
19
- <h2 className="text-2xl font-semibold text-card-foreground">
20
- How to Test Your Theme
21
- </h2>
22
- <ol className="list-decimal list-inside space-y-2 text-card-foreground">
23
- <li>Open <code className="bg-muted px-2 py-1 rounded text-sm">app/brand.css</code></li>
24
- <li>Uncomment and change the color values (HSL format)</li>
25
- <li>Save the file and watch this page update automatically</li>
26
- </ol>
27
- <p className="text-sm text-muted-foreground">
28
- Example: Change <code className="bg-muted px-2 py-1 rounded">--color-primary</code> to <code className="bg-muted px-2 py-1 rounded">270 91% 65%</code> for purple
29
- </p>
30
- </div>
31
-
32
- {/* Color Swatches */}
33
- <div className="space-y-4">
34
- <h2 className="text-2xl font-semibold text-foreground">
35
- Theme Colors
36
- </h2>
37
- <div className="grid grid-cols-2 md:grid-cols-3 gap-4">
38
- <div className="space-y-2">
39
- <div className="h-24 bg-primary rounded-lg flex items-center justify-center">
40
- <span className="text-primary-foreground font-semibold">Primary</span>
41
- </div>
42
- <p className="text-sm text-muted-foreground">--color-primary</p>
43
- </div>
44
-
45
- <div className="space-y-2">
46
- <div className="h-24 bg-secondary rounded-lg flex items-center justify-center">
47
- <span className="text-secondary-foreground font-semibold">Secondary</span>
48
- </div>
49
- <p className="text-sm text-muted-foreground">--color-secondary</p>
50
- </div>
51
-
52
- <div className="space-y-2">
53
- <div className="h-24 bg-accent rounded-lg flex items-center justify-center">
54
- <span className="text-accent-foreground font-semibold">Accent</span>
55
- </div>
56
- <p className="text-sm text-muted-foreground">--color-accent</p>
57
- </div>
58
-
59
- <div className="space-y-2">
60
- <div className="h-24 bg-muted rounded-lg flex items-center justify-center">
61
- <span className="text-muted-foreground font-semibold">Muted</span>
62
- </div>
63
- <p className="text-sm text-muted-foreground">--color-muted</p>
64
- </div>
65
-
66
- <div className="space-y-2">
67
- <div className="h-24 bg-card border border-border rounded-lg flex items-center justify-center">
68
- <span className="text-card-foreground font-semibold">Card</span>
69
- </div>
70
- <p className="text-sm text-muted-foreground">--color-card</p>
71
- </div>
72
-
73
- <div className="space-y-2">
74
- <div className="h-24 bg-destructive rounded-lg flex items-center justify-center">
75
- <span className="text-destructive-foreground font-semibold">Destructive</span>
76
- </div>
77
- <p className="text-sm text-muted-foreground">--color-destructive</p>
78
- </div>
79
- </div>
80
- </div>
81
-
82
- {/* Interactive Components */}
83
- <div className="space-y-4">
84
- <h2 className="text-2xl font-semibold text-foreground">
85
- Component Examples
86
- </h2>
87
-
88
- {/* Buttons */}
89
- <div className="space-y-3">
90
- <h3 className="text-lg font-medium text-foreground">Buttons</h3>
91
- <div className="flex flex-wrap gap-3">
92
- <button className="px-6 py-3 bg-primary text-primary-foreground rounded-lg hover:opacity-90 transition-opacity font-medium">
93
- Primary Button
94
- </button>
95
- <button className="px-6 py-3 bg-secondary text-secondary-foreground rounded-lg hover:opacity-90 transition-opacity font-medium">
96
- Secondary Button
97
- </button>
98
- <button className="px-6 py-3 bg-accent text-accent-foreground rounded-lg hover:opacity-90 transition-opacity font-medium">
99
- Accent Button
100
- </button>
101
- <button className="px-6 py-3 bg-destructive text-destructive-foreground rounded-lg hover:opacity-90 transition-opacity font-medium">
102
- Destructive Button
103
- </button>
104
- </div>
105
- </div>
106
-
107
- {/* Cards */}
108
- <div className="space-y-3">
109
- <h3 className="text-lg font-medium text-foreground">Cards</h3>
110
- <div className="grid md:grid-cols-2 gap-4">
111
- <div className="bg-card border border-border rounded-lg p-6 space-y-2">
112
- <h4 className="font-semibold text-card-foreground">Card Title</h4>
113
- <p className="text-muted-foreground">
114
- This card uses the card background and border colors from your theme.
115
- </p>
116
- </div>
117
- <div className="bg-muted rounded-lg p-6 space-y-2">
118
- <h4 className="font-semibold text-foreground">Muted Card</h4>
119
- <p className="text-muted-foreground">
120
- This card uses the muted background color for a subtle effect.
121
- </p>
122
- </div>
123
- </div>
124
- </div>
125
-
126
- {/* Form Elements */}
127
- <div className="space-y-3">
128
- <h3 className="text-lg font-medium text-foreground">Form Elements</h3>
129
- <div className="space-y-3 max-w-md">
130
- <input
131
- type="text"
132
- placeholder="Input with border color"
133
- className="w-full px-4 py-2 bg-background border border-input rounded-lg focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background"
134
- />
135
- <textarea
136
- placeholder="Textarea with theme colors"
137
- rows={3}
138
- className="w-full px-4 py-2 bg-background border border-input rounded-lg focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:ring-offset-background"
139
- />
140
- </div>
141
- </div>
142
- </div>
143
-
144
- {/* Back Link */}
145
- <div className="pt-8 border-t border-border">
146
- <Link
147
- href="/"
148
- className="inline-flex items-center text-primary hover:underline"
149
- >
150
- ← Back to Home
151
- </Link>
152
- </div>
153
- </div>
154
- </main>
155
- )
156
- }
@@ -1,209 +0,0 @@
1
- # Theme Module
2
-
3
- ## Overview
4
-
5
- This module provides theme customization using the @launch77-shared/lib-theme Tailwind CSS preset.
6
-
7
- ## Features
8
-
9
- - Launch77 theme preset with semantic color tokens
10
- - Brand color customization via CSS variables
11
- - Automatic base styles and accessibility features
12
- - Dark mode support
13
- - Theme test page for visual verification
14
-
15
- ## Setup
16
-
17
- The theme plugin has already installed the @launch77-shared/lib-theme package. Follow these manual steps to complete the setup:
18
-
19
- ### 1. Update app/globals.css
20
-
21
- Add these imports at the top of your `app/globals.css` file:
22
-
23
- ```css
24
- @import '@launch77-shared/lib-theme/tokens.css';
25
-
26
- @tailwind base;
27
- @tailwind components;
28
- @tailwind utilities;
29
-
30
- @import '../src/modules/theme/config/brand.css';
31
- ```
32
-
33
- ### 2. Update tailwind.config.ts
34
-
35
- Replace your Tailwind config with:
36
-
37
- ```typescript
38
- import type { Config } from 'tailwindcss'
39
-
40
- const config: Config = {
41
- presets: [require('@launch77-shared/lib-theme')],
42
- content: [
43
- './app/**/*.{js,ts,jsx,tsx,mdx}',
44
- './components/**/*.{js,ts,jsx,tsx,mdx}',
45
- './lib/**/*.{js,ts,jsx,tsx,mdx}',
46
- ],
47
- }
48
-
49
- export default config
50
- ```
51
-
52
- ## Theme Customization
53
-
54
- ### Brand Colors
55
-
56
- Edit `src/modules/theme/config/brand.css` to customize your brand colors:
57
-
58
- ```css
59
- :root {
60
- /* Primary brand color */
61
- --color-primary: 158 64% 52%;
62
- --color-primary-foreground: 0 0% 100%;
63
-
64
- /* Accent color */
65
- --color-accent: 25 95% 53%;
66
- --color-accent-foreground: 0 0% 100%;
67
-
68
- /* Secondary color */
69
- --color-secondary: 270 50% 40%;
70
- --color-secondary-foreground: 0 0% 100%;
71
- }
72
- ```
73
-
74
- ### HSL Color Format
75
-
76
- Colors use HSL format (Hue Saturation Lightness) without the `hsl()` wrapper:
77
-
78
- - **Hue**: 0-360 (color wheel position)
79
- - **Saturation**: 0-100% (color intensity)
80
- - **Lightness**: 0-100% (brightness)
81
-
82
- Example: `270 91% 65%` = purple
83
-
84
- ### Available Theme Colors
85
-
86
- The theme includes semantic color tokens:
87
-
88
- - `primary` - Main brand color
89
- - `secondary` - Secondary brand color
90
- - `accent` - Accent/highlight color
91
- - `muted` - Subtle backgrounds
92
- - `card` - Card backgrounds
93
- - `destructive` - Error/danger states
94
- - `background` - Page background
95
- - `foreground` - Text color
96
- - `border` - Border color
97
- - `input` - Input borders
98
- - `ring` - Focus rings
99
-
100
- Each color has a corresponding `-foreground` variant for text on that background.
101
-
102
- ## Testing Your Theme
103
-
104
- Visit the theme test page to see your theme in action:
105
-
106
- ```
107
- http://localhost:3000/theme-test
108
- ```
109
-
110
- The test page shows:
111
- - All theme color swatches
112
- - Interactive components (buttons, cards, forms)
113
- - Real-time updates when you modify brand.css
114
-
115
- ### How to Test
116
-
117
- 1. Open `src/modules/theme/config/brand.css` in your editor
118
- 2. Uncomment and change color values
119
- 3. Save the file
120
- 4. Watch the theme-test page update automatically
121
-
122
- ## Usage in Components
123
-
124
- Use theme colors via Tailwind utility classes:
125
-
126
- ```tsx
127
- // Backgrounds
128
- <div className="bg-primary text-primary-foreground">Primary</div>
129
- <div className="bg-secondary text-secondary-foreground">Secondary</div>
130
- <div className="bg-accent text-accent-foreground">Accent</div>
131
-
132
- // Borders
133
- <div className="border border-border">With border</div>
134
-
135
- // Text colors
136
- <p className="text-foreground">Main text</p>
137
- <p className="text-muted-foreground">Subtle text</p>
138
-
139
- // Interactive states
140
- <button className="bg-primary hover:opacity-90 focus:ring-2 focus:ring-ring">
141
- Button
142
- </button>
143
- ```
144
-
145
- ## Dark Mode
146
-
147
- The theme includes dark mode support. Add the `.dark` class to enable:
148
-
149
- ```tsx
150
- // In your root layout
151
- <html className={isDarkMode ? 'dark' : ''}>
152
- ```
153
-
154
- Customize dark mode colors in `brand.css`:
155
-
156
- ```css
157
- .dark {
158
- --color-primary: 158 64% 52%;
159
- --color-primary-foreground: 240 5.9% 10%;
160
- }
161
- ```
162
-
163
- ## Module Structure
164
-
165
- ```
166
- src/modules/theme/
167
- ├── config/
168
- │ └── brand.css # Brand color customization
169
- └── README.md # This file
170
- ```
171
-
172
- ## Troubleshooting
173
-
174
- ### Colors not updating
175
-
176
- 1. Check import order in `globals.css` - brand.css should come AFTER `@tailwind` directives
177
- 2. Ensure brand.css path is correct: `@import '../src/modules/theme/config/brand.css'`
178
- 3. Clear Next.js cache: `rm -rf .next && npm run dev`
179
-
180
- ### Theme preset not working
181
-
182
- 1. Verify `tailwind.config.ts` includes the preset: `presets: [require('@launch77-shared/lib-theme')]`
183
- 2. Check @launch77-shared/lib-theme is installed: `npm list @launch77-shared/lib-theme`
184
- 3. Restart dev server after config changes
185
-
186
- ### TypeScript errors
187
-
188
- The theme uses CSS variables and Tailwind classes - no TypeScript configuration needed. If you see type errors in CSS files, add to `.gitignore`:
189
-
190
- ```
191
- *.css.d.ts
192
- ```
193
-
194
- ## Next Steps
195
-
196
- 1. Complete the manual setup steps above
197
- 2. Visit `/theme-test` to verify installation
198
- 3. Customize brand colors in `brand.css`
199
- 4. Start building with Launch77 theme tokens
200
-
201
- ## Documentation
202
-
203
- For complete theme documentation, see:
204
- - `node_modules/@launch77-shared/lib-theme/docs/THEME.md`
205
- - Launch77 theme library documentation
206
-
207
- ## Support
208
-
209
- For issues or questions about the theme module, refer to the Launch77 documentation or contact the development team.
@@ -1,23 +0,0 @@
1
- /* Brand Colors */
2
- /* Customize your theme by overriding CSS variables */
3
-
4
- :root {
5
- /* Example: Customize primary color */
6
- /* --color-primary: 158 64% 52%; */
7
- /* --color-primary-foreground: 0 0% 100%; */
8
-
9
- /* Example: Customize accent color */
10
- /* --color-accent: 25 95% 53%; */
11
- /* --color-accent-foreground: 0 0% 100%; */
12
-
13
- /* Example: Customize secondary color */
14
- /* --color-secondary: 270 50% 40%; */
15
- /* --color-secondary-foreground: 0 0% 100%; */
16
- }
17
-
18
- /* Dark mode overrides */
19
- .dark {
20
- /* Example: Customize colors for dark mode */
21
- /* --color-primary: 158 64% 52%; */
22
- /* --color-primary-foreground: 240 5.9% 10%; */
23
- }
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "../../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "./dist",
5
- "rootDir": "./src",
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "target": "ES2022",
9
- "lib": ["ES2022"],
10
- "types": ["node"]
11
- },
12
- "include": ["src/**/*"],
13
- "exclude": ["node_modules", "dist"]
14
- }
@@ -1,8 +0,0 @@
1
- # Apps Directory
2
-
3
- This directory will contain all applications for this startup.
4
-
5
- Create new apps using:
6
- ```bash
7
- launch77 create-app marketing-site <app-name>
8
- ```
@@ -1,3 +0,0 @@
1
- {
2
- "version": "1.0.0"
3
- }