svelte and nx rewrite
This commit is contained in:
12
index.js
12
index.js
@@ -201,6 +201,14 @@ async function main() {
|
||||
connFile = connFile.replace(/projectId: "[^"]+"/, `projectId: "${sanityJson.projectId}"`);
|
||||
await fs.writeFile(connPath, connFile);
|
||||
|
||||
// Update wrangler.jsonc with project name
|
||||
const wranglerPath = path.join(rootDir, "apps/client/wrangler.jsonc");
|
||||
if (await fs.pathExists(wranglerPath)) {
|
||||
let wranglerFile = await fs.readFile(wranglerPath, "utf8");
|
||||
wranglerFile = wranglerFile.replace(/"name": "[^"]+"/, `"name": "${kebabName}"`);
|
||||
await fs.writeFile(wranglerPath, wranglerFile);
|
||||
}
|
||||
|
||||
return `Sanity project created with ID: ${sanityJson.projectId}`;
|
||||
},
|
||||
},
|
||||
@@ -246,7 +254,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const corsOrigins = [
|
||||
'http://localhost:3000',
|
||||
'http://localhost:5173',
|
||||
'https://*.api.sanity.io',
|
||||
'wss://*.api.sanity.io',
|
||||
`https://${kebabName}.sanity.studio`,
|
||||
@@ -321,7 +329,7 @@ async function main() {
|
||||
` ${color.bold(color.green(pmRun))} ${color.dim('# Start your local dev server')} ${color.yellow('🖥️')}\n` +
|
||||
` ${color.bold(color.green(pmDeploy))} ${color.dim('# Deploy your Sanity Studio')} ${color.yellow('🚀')}\n\n` +
|
||||
color.dim('Local development:\n') +
|
||||
` • App: ${color.cyan('http://localhost:3000')} ${color.yellow('🌐')}\n` +
|
||||
` • App: ${color.cyan('http://localhost:5173')} ${color.yellow('🌐')}\n` +
|
||||
` • Studio: ${color.cyan('http://localhost:3333')} ${color.yellow('🛠️')}\n\n` +
|
||||
color.dim('After deploying:\n') +
|
||||
` • Studio: ${color.cyan(`https://${kebabName}.sanity.studio`)} ${color.yellow('✨')}`
|
||||
|
||||
Reference in New Issue
Block a user