favicon and text fixes

This commit is contained in:
2025-07-25 03:12:56 +02:00
parent b32f57a61c
commit eaa72f3b2a
2 changed files with 18 additions and 15 deletions

View File

@@ -103,7 +103,7 @@ async function main() {
await p.tasks([ await p.tasks([
{ {
title: `${color.yellow('📁 Copying template contents to root...')}`, title: `${color.yellow('📁 Copying template contents to root')}`,
task: async () => { task: async () => {
const __dirname = path.dirname(new URL(import.meta.url).pathname); const __dirname = path.dirname(new URL(import.meta.url).pathname);
const templateDir = path.resolve(__dirname, 'template'); const templateDir = path.resolve(__dirname, 'template');
@@ -113,14 +113,14 @@ async function main() {
}, },
}, },
{ {
title: `${color.green(`📦 Installing dependencies with ${project.packageManager}...`)}`, title: `${color.green(`📦 Installing dependencies with ${project.packageManager}`)}`,
task: async () => { task: async () => {
await runCommand(project.packageManager === 'bun' ? 'bun' : 'npm', ['install'], rootDir); await runCommand(project.packageManager === 'bun' ? 'bun' : 'npm', ['install'], rootDir);
return 'Dependencies installed successfully'; return 'Dependencies installed successfully';
}, },
}, },
{ {
title: `${color.cyan('🔑 Checking Sanity login status...')}`, title: `${color.cyan('🔑 Checking Sanity login status')}`,
task: async () => { task: async () => {
await fs.ensureDir(studioDir); await fs.ensureDir(studioDir);
let loggedIn = false; let loggedIn = false;
@@ -146,7 +146,7 @@ async function main() {
}, },
}, },
{ {
title: `${color.magenta('🛠️ Creating Sanity project...')}`, title: `${color.magenta('🛠️ Creating Sanity project')}`,
task: async () => { task: async () => {
spawnSync(pmx, [ spawnSync(pmx, [
"sanity", "sanity",
@@ -205,7 +205,7 @@ async function main() {
}, },
}, },
{ {
title: `${color.green('🔐 Creating Sanity viewer token...')}`, title: `${color.green('🔐 Creating Sanity viewer token')}`,
task: async () => { task: async () => {
if (!(await fs.pathExists(studioDir))) throw new Error(`Studio directory not found at ${studioDir}`); if (!(await fs.pathExists(studioDir))) throw new Error(`Studio directory not found at ${studioDir}`);
const addOut = await new Promise((res, rej) => { const addOut = await new Promise((res, rej) => {
@@ -234,9 +234,9 @@ async function main() {
if (project.faviconPath && project.faviconPath.trim()) { if (project.faviconPath && project.faviconPath.trim()) {
await p.tasks([ await p.tasks([
{ {
title: `${color.yellow('🌟 Generating favicon...')}`, title: `${color.yellow('🌟 Generating favicon')}`,
task: async () => { task: async () => {
await runCommand(pmx, ['bun-create-favicon', project.faviconPath, 'packages/ui/favicon/'], rootDir); await runCommand(pmx, ['create', "favicon", project.faviconPath, 'packages/ui/favicon'], rootDir);
await fs.copy(path.join(rootDir, 'packages/ui/favicon/'), path.join(rootDir, 'apps/client/public/'), { overwrite: true }); await fs.copy(path.join(rootDir, 'packages/ui/favicon/'), path.join(rootDir, 'apps/client/public/'), { overwrite: true });
await fs.copy(path.join(rootDir, 'packages/ui/favicon/'), path.join(rootDir, 'apps/studio/static/'), { overwrite: true }); await fs.copy(path.join(rootDir, 'packages/ui/favicon/'), path.join(rootDir, 'apps/studio/static/'), { overwrite: true });
return 'Favicon generated and copied!'; return 'Favicon generated and copied!';
@@ -269,7 +269,7 @@ async function main() {
if (project.shouldGit) { if (project.shouldGit) {
await p.tasks([ await p.tasks([
{ {
title: `${color.green('🌱 Setting up Git repository...')}`, title: `${color.green('🌱 Setting up Git repository')}`,
task: async () => { task: async () => {
await runCommand('git', ['config', '--global', 'init.defaultBranch', 'main'], process.cwd()); await runCommand('git', ['config', '--global', 'init.defaultBranch', 'main'], process.cwd());
await runCommand('git', ['init'], rootDir); await runCommand('git', ['init'], rootDir);
@@ -289,13 +289,13 @@ async function main() {
); );
await runCommand('xdg-open', [githubUrl], process.cwd()); await runCommand('xdg-open', [githubUrl], process.cwd());
await p.text({ await p.text({
message: 'Press Enter after you have created the GitHub repository to continue...', message: 'Press Enter after you have created the GitHub repository to continue',
placeholder: '', placeholder: '',
validate: () => undefined, validate: () => undefined,
}); });
await p.tasks([ await p.tasks([
{ {
title: `${color.magenta('🚀 Pushing to GitHub...')}`, title: `${color.magenta('🚀 Pushing to GitHub')}`,
task: async () => { task: async () => {
await runCommand('git', ['remote', 'add', 'origin', `git@github.com:${org}/${kebabName}.git`], rootDir); await runCommand('git', ['remote', 'add', 'origin', `git@github.com:${org}/${kebabName}.git`], rootDir);
await runCommand('git', ['push', '-u', 'origin', 'main'], rootDir); await runCommand('git', ['push', '-u', 'origin', 'main'], rootDir);

View File

@@ -1,10 +1,13 @@
{ {
"name": "sanity-template", "name": "@lumify-systems/template-sanity",
"version": "0.1.0", "version": "1.2.1",
"private": true, "publishConfig": {
"description": "Bun create template for Lumify web/studio monorepo setup.", "access": "restricted",
"registry": "https://npm.pkg.github.com"
},
"description": "Template for Lumify Sanity and Next.js monorepo setup.",
"bin": { "bin": {
"sanity-template": "./index.js" "template-sanity": "./index.js"
}, },
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [