Skip to content

Commit

Permalink
refactor: replace emojis :)
Browse files Browse the repository at this point in the history
  • Loading branch information
maneike committed Oct 14, 2024
1 parent e827baa commit ef2304d
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const asciiArt = `

function displayHeader() {
console.log(chalk.hex('#3100F5').bold(asciiArt));
console.log(chalk.bold('\n๐Ÿธ Welcome to Stapler!\n'));
console.log(chalk.bold('\n๐Ÿ–‡๏ธ Welcome to Stapler!\n'));
}

const program = new Command();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface ProjectOptions {
export async function createProject(options: ProjectOptions) {
const { name, usePayload } = options;

console.log(`๐Ÿธ Stapling ${name}...`);
console.log(`๐Ÿ–‡๏ธ Stapling ${name}...`);
execSync(`npx create-turbo@latest ${name} -m pnpm`, {
stdio: 'inherit',
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/env/createEnvFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const requiredEnvVariables: Record<string, 'required' | 'optional'> = {

// Function to create .env file with empty fields
export const createEnvFile = (destinationDirectory: string) => {
console.log('๐Ÿธ Creating .env file...');
console.log('๐Ÿ–‡๏ธ Creating .env file...');
let envTemplate = '';
for (const [key, status] of Object.entries(requiredEnvVariables)) {
envTemplate += `${key}=\n`;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/github/ghInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function installGitHubCLI(): boolean {
console.log('๐Ÿ–‡๏ธ GitHub CLI installed successfully.');
return true;
} catch (error) {
console.error('๐Ÿธ Failed to install GitHub CLI.');
console.error('๐Ÿ–‡๏ธ Failed to install GitHub CLI.');
console.log('๐Ÿ–‡๏ธ Please install it manually from: https://github.com/cli/cli#installation');
return false;
}
Expand Down
8 changes: 4 additions & 4 deletions packages/core/utils/payload/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import { updatePackages } from './updatePackages';
import { preparePayloadConfig } from './preparePayloadConfig';

export const preparePayload = async () => {
console.log('๐Ÿธ Initializing Payload...');
console.log('๐Ÿ–‡๏ธ Initializing Payload...');

process.chdir('./apps/web/');

prepareTsConfig();

updatePackages();

console.log('๐Ÿธ Moving files to (app) directory...');
console.log('๐Ÿ–‡๏ธ Moving files to (app) directory...');
execSync(
`mkdir -p ./app/\\(app\\) && find ./app -maxdepth 1 ! -path './app' ! -path './app/\\(app\\)' -exec mv {} ./app/\\(app\\)/ \\;`,
{
stdio: 'inherit',
},
);

console.log('๐Ÿธ Installing Payload to Next.js...');
console.log('๐Ÿ–‡๏ธ Installing Payload to Next.js...');
execSync(`npx create-payload-app@beta`, { stdio: 'inherit' });

// Payload doesn't work with Turbopack yet
Expand All @@ -32,7 +32,7 @@ export const preparePayload = async () => {
// Check if the payload configuration file exists
const payloadConfigPath = join(process.cwd(), 'payload.config.ts');
if (!existsSync(payloadConfigPath)) {
console.error('๐Ÿธ Payload installation cancelled/failed.');
console.error('๐Ÿ–‡๏ธ Payload installation cancelled/failed.');
} else {
await preparePayloadConfig(payloadConfigPath);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/utils/payload/preparePayloadConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { PathLike } from 'fs';
import fs from 'fs/promises';

export const preparePayloadConfig = async (configPath: PathLike) => {
console.log('๐Ÿธ Preparing payload.config.ts...');
console.log('๐Ÿ–‡๏ธ Preparing payload.config.ts...');

try {
// Read the payload.config.ts file
Expand All @@ -20,6 +20,6 @@ export const preparePayloadConfig = async (configPath: PathLike) => {
// Write the updated payload.config.ts back to the file
await fs.writeFile(configPath, updatedConfig);
} catch (err) {
console.error('๐Ÿธ Error during processing payload.config.ts', err);
console.error('๐Ÿ–‡๏ธ Error during processing payload.config.ts', err);
}
};
6 changes: 3 additions & 3 deletions packages/core/utils/payload/prepareTsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import fs from 'fs';
import path from 'path';

export const prepareTsConfig = () => {
console.log('๐Ÿธ Preparing tsconfig.json...');
console.log('๐Ÿ–‡๏ธ Preparing tsconfig.json...');

// Path to your tsconfig.json file
const tsconfigPath = path.join(process.cwd(), 'tsconfig.json');

// Read the tsconfig.json file
fs.readFile(tsconfigPath, 'utf8', (err, data) => {
if (err) {
console.error('๐Ÿธ Error reading tsconfig.json', err);
console.error('๐Ÿ–‡๏ธ Error reading tsconfig.json', err);
return;
}

Expand All @@ -33,7 +33,7 @@ export const prepareTsConfig = () => {
// Write the updated tsconfig.json back to the file
fs.writeFile(tsconfigPath, JSON.stringify(tsconfig, null, 2), (err) => {
if (err) {
console.error('๐Ÿธ Error writing to tsconfig.json', err);
console.error('๐Ÿ–‡๏ธ Error writing to tsconfig.json', err);
}
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/core/utils/payload/removeTurboFlag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import fs from 'fs';
import path from 'path';

export const removeTurboFlag = () => {
console.log('๐Ÿธ Removing --turbo flag from dev script...');
console.log('๐Ÿ–‡๏ธ Removing --turbo flag from dev script...');

// Path to your package.json file
const packageJsonPath = path.join(process.cwd(), 'package.json');

// Read the package.json file
fs.readFile(packageJsonPath, 'utf8', (err: Error | null, data: string) => {
if (err) {
console.error('๐Ÿธ Error reading package.json', err);
console.error('๐Ÿ–‡๏ธ Error reading package.json', err);
return;
}

Expand All @@ -25,7 +25,7 @@ export const removeTurboFlag = () => {
// Write the updated package.json back to the file
fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), (err: Error | null) => {
if (err) {
console.error('๐Ÿธ Error writing to package.json', err);
console.error('๐Ÿ–‡๏ธ Error writing to package.json', err);
}
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/core/utils/payload/updatePackages.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { execSync } from 'child_process';

export const updatePackages = () => {
console.log('๐Ÿธ Updating Next and React to their respective release candidates...');
console.log('๐Ÿ–‡๏ธ Updating Next and React to their respective release candidates...');
execSync(`pnpm up next@rc react@rc react-dom@rc eslint-config-next@rc`, {
stdio: 'inherit',
});

console.log('๐Ÿธ Installing necessary packages...');
console.log('๐Ÿ–‡๏ธ Installing necessary packages...');
execSync(`pnpm i pg sharp`, {
stdio: 'inherit',
});
Expand Down
2 changes: 1 addition & 1 deletion packages/core/utils/prettier/prettify.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { execSync } from 'child_process';

export const prettify = async () => {
console.log('๐Ÿธ Prettifying your Stapler...');
console.log('๐Ÿ–‡๏ธ Prettifying your Stapler...');

const ignorePatterns = [
'node_modules/',
Expand Down
6 changes: 3 additions & 3 deletions packages/core/utils/supabase/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import path from 'path';
import fs from 'fs';

export const installSupabase = async (destinationDirectory: string) => {
console.log('๐Ÿธ Installing supabase-js...');
console.log('๐Ÿ–‡๏ธ Installing supabase-js...');
execSync(`supabase init`, { stdio: 'inherit' });

console.log('๐Ÿธ Adding Supabase Files...');
console.log('๐Ÿ–‡๏ธ Adding Supabase Files...');
const templateDirectory = path.join(__dirname, '../templates/supabase/files');

templateGenerator(supabaseFiles, templateDirectory, destinationDirectory);
Expand All @@ -18,7 +18,7 @@ export const installSupabase = async (destinationDirectory: string) => {
fs.appendFileSync(workspacePath, addSupabaseToWorkspace);

process.chdir('supabase');
console.log('๐Ÿธ Installing Supabase dependencies...');
console.log('๐Ÿ–‡๏ธ Installing Supabase dependencies...');
execSync('pnpm install', { stdio: 'inherit' });
process.chdir('..');
};

0 comments on commit ef2304d

Please sign in to comment.