Update index.js
This commit is contained in:
39
index.js
39
index.js
@@ -54,15 +54,6 @@ async function main() {
|
|||||||
message: `${color.green('🌱 Do you want to initialize a git repository?')}`,
|
message: `${color.green('🌱 Do you want to initialize a git repository?')}`,
|
||||||
initialValue: true,
|
initialValue: true,
|
||||||
}),
|
}),
|
||||||
gitOrg: ({ results }) => {
|
|
||||||
if (!results.shouldGit) return undefined;
|
|
||||||
return p.text({
|
|
||||||
message: `${color.cyan('🐙 Enter the GitHub organization/user to push to (leave empty to skip remote):')}`,
|
|
||||||
placeholder: 'my-org-or-username',
|
|
||||||
initialValue: 'lumify-systems',
|
|
||||||
validate: (v) => (v && !/^([\w-]+)$/.test(v) ? `${color.red('❌ Invalid org/user name!')}` : undefined),
|
|
||||||
});
|
|
||||||
},
|
|
||||||
packageManager: () =>
|
packageManager: () =>
|
||||||
p.select({
|
p.select({
|
||||||
message: `${color.magenta('📦 Which package manager do you want to use?')}`,
|
message: `${color.magenta('📦 Which package manager do you want to use?')}`,
|
||||||
@@ -356,34 +347,6 @@ async function main() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
const org = typeof project.gitOrg === 'string' ? project.gitOrg.trim() : '';
|
|
||||||
if (org) {
|
|
||||||
const githubUrl = `https://github.com/new?name=${kebabName}&owner=${org}&visibility=private&description=${encodeURIComponent('This website was built using the official Lumify starter template for building with Sveltekit, Sanity, Bun, and Shadcn UI — bundled into a NX monorepo.')}`;
|
|
||||||
p.note(
|
|
||||||
`Please create a new GitHub repository:\n\n` +
|
|
||||||
`${color.bold('Repository:')} ${color.cyan(kebabName)}\n` +
|
|
||||||
`${color.bold('Organization:')} ${color.cyan(org)}\n\n` +
|
|
||||||
`${color.dim('Opening GitHub in your browser...')}\n` +
|
|
||||||
`${color.dim('Repository details will be pre-filled.')}`,
|
|
||||||
'GitHub Setup Required'
|
|
||||||
);
|
|
||||||
await runCommand('xdg-open', [githubUrl], process.cwd());
|
|
||||||
await p.text({
|
|
||||||
message: 'Press Enter after you have created the GitHub repository to continue',
|
|
||||||
placeholder: '',
|
|
||||||
validate: () => undefined,
|
|
||||||
});
|
|
||||||
await p.tasks([
|
|
||||||
{
|
|
||||||
title: `${color.magenta('🚀 Pushing to GitHub')}`,
|
|
||||||
task: async () => {
|
|
||||||
await runCommand('git', ['remote', 'add', 'origin', `git@github.com:${org}/${kebabName}.git`], rootDir);
|
|
||||||
await runCommand('git', ['push', '-u', 'origin', 'main'], rootDir);
|
|
||||||
return 'Pushed to GitHub successfully!';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const pmRun = `${project.packageManager} run dev`;
|
const pmRun = `${project.packageManager} run dev`;
|
||||||
@@ -391,7 +354,7 @@ async function main() {
|
|||||||
|
|
||||||
p.text({
|
p.text({
|
||||||
message:
|
message:
|
||||||
`${color.bgGreen(color.black('✨ Setup complete! ✨'))}\n${color.dim('Need help?')} ${color.underline(color.cyan('https://docs.lumify.systems/'))} ${color.yellow('💡')}`,
|
`${color.bgGreen(color.black('✨ Setup complete! ✨'))}\n${color.dim('Need help?')} ${color.underline(color.cyan('https://duckduckgo.com/'))} ${color.yellow('💡')}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
p.outro(
|
p.outro(
|
||||||
|
|||||||
Reference in New Issue
Block a user