create-better-system 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +23 -2
- package/package.json +6 -6
package/index.js
CHANGED
|
@@ -119,14 +119,18 @@ console.log('🔤 Configuring fonts...')
|
|
|
119
119
|
const layoutPath = path.join(projectPath, 'apps', 'frontend', 'app', 'layout.tsx')
|
|
120
120
|
let layout = await fs.readFile(layoutPath, 'utf-8')
|
|
121
121
|
|
|
122
|
+
const isInterHeading = headingFontNextName === 'Inter'
|
|
123
|
+
|
|
122
124
|
layout = layout
|
|
123
125
|
.replace(
|
|
124
126
|
'// __HEADING_FONT_IMPORT__',
|
|
125
|
-
`import { ${headingFontNextName} } from "next/font/google"`
|
|
127
|
+
isInterHeading ? '' : `import { ${headingFontNextName} } from "next/font/google"`
|
|
126
128
|
)
|
|
127
129
|
.replace(
|
|
128
130
|
'// __HEADING_FONT_DECLARATION__',
|
|
129
|
-
|
|
131
|
+
isInterHeading
|
|
132
|
+
? `const ${headingFontVarName} = Inter({\n variable: "--font-heading",\n subsets: ["latin"],\n weight: ["400", "500", "700"],\n})`
|
|
133
|
+
: `const ${headingFontVarName} = ${headingFontNextName}({\n variable: "--font-heading",\n subsets: ["latin"],\n weight: ["400", "500", "700"],\n})`
|
|
130
134
|
)
|
|
131
135
|
.replaceAll('__HEADING_FONT_CLASS__', `\${${headingFontVarName}.variable}`)
|
|
132
136
|
.replaceAll('__PROJECT_NAME__', projectName)
|
|
@@ -222,6 +226,23 @@ for (const [placeholder, value] of Object.entries(figmaReplacements)) {
|
|
|
222
226
|
|
|
223
227
|
await fs.writeFile(figmaRulesPath, figmaRules)
|
|
224
228
|
|
|
229
|
+
// ─── Setup backend .env ───────────────────────────────────────────────────────
|
|
230
|
+
|
|
231
|
+
console.log('🔑 Generating APP_KEY...')
|
|
232
|
+
|
|
233
|
+
const backendPath = path.join(projectPath, 'apps', 'backend')
|
|
234
|
+
const envExamplePath = path.join(backendPath, '.env.example')
|
|
235
|
+
const envPath = path.join(backendPath, '.env')
|
|
236
|
+
|
|
237
|
+
await fs.copy(envExamplePath, envPath)
|
|
238
|
+
|
|
239
|
+
const { stdout: appKey } = await execa('node', ['ace', 'generate:key'], { cwd: backendPath })
|
|
240
|
+
const generatedKey = appKey.trim().split('\n').pop().trim()
|
|
241
|
+
|
|
242
|
+
let envContent = await fs.readFile(envPath, 'utf-8')
|
|
243
|
+
envContent = envContent.replace('APP_KEY=', `APP_KEY=${generatedKey}`)
|
|
244
|
+
await fs.writeFile(envPath, envContent)
|
|
245
|
+
|
|
225
246
|
// ─── Update root package.json ─────────────────────────────────────────────────
|
|
226
247
|
|
|
227
248
|
console.log('📝 Updating package.json...')
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-better-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"bin": {
|
|
5
|
-
|
|
5
|
+
"create-better-system": "index.js"
|
|
6
6
|
},
|
|
7
7
|
"type": "module",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
"inquirer": "^9.0.0",
|
|
10
|
+
"execa": "^8.0.0",
|
|
11
|
+
"fs-extra": "^11.0.0"
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
}
|