cli formatting fixes
This commit is contained in:
20
index.js
20
index.js
@@ -125,12 +125,12 @@ async function main() {
|
||||
task: async () => {
|
||||
const __dirname = path.dirname(new URL(import.meta.url).pathname);
|
||||
const templateDir = path.resolve(__dirname, 'template');
|
||||
|
||||
|
||||
// Ensure root directory exists with proper permissions
|
||||
await fs.ensureDir(rootDir);
|
||||
|
||||
|
||||
try {
|
||||
await fs.copy(templateDir, rootDir, {
|
||||
await fs.copy(templateDir, rootDir, {
|
||||
overwrite: true,
|
||||
errorOnExist: false,
|
||||
preserveTimestamps: false
|
||||
@@ -138,7 +138,7 @@ async function main() {
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to copy template files: ${error.message}`);
|
||||
}
|
||||
|
||||
|
||||
// Rename gitignore files to .gitignore (dotfiles get lost in npm packages)
|
||||
async function renameGitignoreFiles(dir) {
|
||||
try {
|
||||
@@ -146,7 +146,7 @@ async function main() {
|
||||
for (const item of items) {
|
||||
const itemPath = path.join(dir, item);
|
||||
const stat = await fs.stat(itemPath);
|
||||
|
||||
|
||||
if (stat.isDirectory()) {
|
||||
await renameGitignoreFiles(itemPath);
|
||||
} else if (item === 'gitignore') {
|
||||
@@ -158,7 +158,7 @@ async function main() {
|
||||
throw new Error(`Failed to rename gitignore files: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
await renameGitignoreFiles(rootDir);
|
||||
return 'Template copied!';
|
||||
},
|
||||
@@ -267,7 +267,7 @@ async function main() {
|
||||
title: `${color.blue('🗄️ Setting up production dataset for Sanity CMS')}`,
|
||||
task: async () => {
|
||||
if (!(await fs.pathExists(studioDir))) throw new Error(`Studio directory not found at ${studioDir}`);
|
||||
|
||||
|
||||
try {
|
||||
await runCommand(pmx, ['sanity', 'dataset', 'create', 'production'], studioDir);
|
||||
return 'Production dataset created successfully';
|
||||
@@ -360,7 +360,11 @@ async function main() {
|
||||
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 named\n\`${kebabName}\` under \`${org}\` at:\n\n${color.cyan(githubUrl)}\n\nThe browser will open for you.`,
|
||||
`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());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lumify-systems/template-sanity",
|
||||
"version": "2.1.1",
|
||||
"version": "2.1.2",
|
||||
"publishConfig": {
|
||||
"access": "restricted",
|
||||
"registry": "https://npm.pkg.github.com"
|
||||
|
||||
Reference in New Issue
Block a user