create-bingstack-app 0.1.3 → 0.1.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.
- package/index.mjs +22 -2
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -27,6 +27,13 @@ async function main() {
|
|
|
27
27
|
if (p.isCancel(projectName)) return cancel()
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
const appDisplayName = await p.text({
|
|
31
|
+
message: 'App display name (shown in the UI)',
|
|
32
|
+
placeholder: 'Acme.inc',
|
|
33
|
+
initialValue: 'Acme.inc',
|
|
34
|
+
})
|
|
35
|
+
if (p.isCancel(appDisplayName)) return cancel()
|
|
36
|
+
|
|
30
37
|
const protectedRoute = await p.text({
|
|
31
38
|
message: 'Main protected page name (shown after sign-in)',
|
|
32
39
|
placeholder: 'dashboard',
|
|
@@ -84,7 +91,7 @@ async function main() {
|
|
|
84
91
|
{
|
|
85
92
|
const s = p.spinner()
|
|
86
93
|
s.start('Configuring project...')
|
|
87
|
-
await applyReplacements(targetDir, projectName, protectedRoute)
|
|
94
|
+
await applyReplacements(targetDir, projectName, protectedRoute, appDisplayName)
|
|
88
95
|
s.stop('Project configured')
|
|
89
96
|
}
|
|
90
97
|
|
|
@@ -95,6 +102,18 @@ async function main() {
|
|
|
95
102
|
s.stop('Dependencies installed')
|
|
96
103
|
}
|
|
97
104
|
|
|
105
|
+
const initGit = await p.confirm({
|
|
106
|
+
message: 'Initialize a git repository?',
|
|
107
|
+
initialValue: true,
|
|
108
|
+
})
|
|
109
|
+
if (p.isCancel(initGit)) return cancel()
|
|
110
|
+
|
|
111
|
+
if (initGit) {
|
|
112
|
+
await execa('git', ['init'], { cwd: targetDir })
|
|
113
|
+
await execa('git', ['add', '-A'], { cwd: targetDir })
|
|
114
|
+
await execa('git', ['commit', '-m', 'Initial commit'], { cwd: targetDir })
|
|
115
|
+
}
|
|
116
|
+
|
|
98
117
|
p.outro(
|
|
99
118
|
`Done! Next steps:\n\n` +
|
|
100
119
|
` cd ${projectName}\n` +
|
|
@@ -103,7 +122,7 @@ async function main() {
|
|
|
103
122
|
)
|
|
104
123
|
}
|
|
105
124
|
|
|
106
|
-
async function applyReplacements(dir, appName, protectedRoute) {
|
|
125
|
+
async function applyReplacements(dir, appName, protectedRoute, appDisplayName) {
|
|
107
126
|
const oldRoute = 'workspace'
|
|
108
127
|
|
|
109
128
|
if (protectedRoute !== oldRoute) {
|
|
@@ -129,6 +148,7 @@ async function applyReplacements(dir, appName, protectedRoute) {
|
|
|
129
148
|
}
|
|
130
149
|
|
|
131
150
|
content = content.replaceAll('TanStack Start Starter', toTitleCase(appName))
|
|
151
|
+
content = content.replaceAll('Acme.inc', appDisplayName)
|
|
132
152
|
|
|
133
153
|
if (protectedRoute !== oldRoute) {
|
|
134
154
|
content = content
|