Skip to content

Commit

Permalink
chore: switch to picocolors (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Aug 16, 2024
1 parent 8293819 commit 0ba4a74
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 26 deletions.
20 changes: 10 additions & 10 deletions packages/cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import fs from 'node:fs';
import path from 'node:path';
import * as p from '@clack/prompts';
import { bold, cyan, grey, yellow } from 'kleur/colors';
import * as colors from 'picocolors';
import { create } from './index.js';
import { dist, package_manager } from './utils.js';

const { version } = JSON.parse(fs.readFileSync(new URL('package.json', import.meta.url), 'utf-8'));
let cwd = process.argv[2] || '.';

console.log(`
${grey(`create-svelte version ${version}`)}
${colors.gray(`create-svelte version ${version}`)}
`);

p.intro('Welcome to SvelteKit!');
Expand Down Expand Up @@ -90,27 +90,27 @@ await create(cwd, {
p.outro('Your project is ready!');

if (!options.types && options.template === 'skeletonlib') {
const warning = yellow('▲');
const warning = colors.yellow('▲');
console.log(
`${warning} You chose to not add type checking, but TypeScript will still be installed in order to generate type definitions when building the library\n`
);
}

console.log('Install more integrations with:');
console.log(bold(cyan(' npx svelte-add')));
console.log(colors.bold(colors.cyan(' npx svelte-add')));

console.log('\nNext steps:');
let i = 1;

const relative = path.relative(process.cwd(), cwd);
if (relative !== '') {
console.log(` ${i++}: ${bold(cyan(`cd ${relative}`))}`);
console.log(` ${i++}: ${colors.bold(colors.cyan(`cd ${relative}`))}`);
}

console.log(` ${i++}: ${bold(cyan(`${package_manager} install`))}`);
console.log(` ${i++}: ${colors.bold(colors.cyan(`${package_manager} install`))}`);
// prettier-ignore
console.log(` ${i++}: ${bold(cyan('git init && git add -A && git commit -m "Initial commit"'))} (optional)`);
console.log(` ${i++}: ${bold(cyan(`${package_manager} run dev -- --open`))}`);
console.log(` ${i++}: ${colors.bold(colors.cyan('git init && git add -A && git commit -m "Initial commit"'))} (optional)`);
console.log(` ${i++}: ${colors.bold(colors.cyan(`${package_manager} run dev -- --open`))}`);

console.log(`\nTo close the dev server, hit ${bold(cyan('Ctrl-C'))}`);
console.log(`\nStuck? Visit us at ${cyan('https://svelte.dev/chat')}`);
console.log(`\nTo close the dev server, hit ${colors.bold(colors.cyan('Ctrl-C'))}`);
console.log(`\nStuck? Visit us at ${colors.cyan('https://svelte.dev/chat')}`);
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"main": "./index.js",
"dependencies": {
"@clack/prompts": "^0.7.0",
"kleur": "^4.1.5"
"picocolors": "^1.0.1"
},
"devDependencies": {
"@types/gitignore-parser": "^0.0.3",
Expand Down
7 changes: 1 addition & 6 deletions packages/cli/types/internal.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ export type File = {
contents: string;
};

export type Condition =
| 'typescript'
| 'checkjs'
| 'skeleton'
| 'default'
| 'skeletonlib';
export type Condition = 'typescript' | 'checkjs' | 'skeleton' | 'default' | 'skeletonlib';

export type Common = {
files: Array<{
Expand Down
12 changes: 3 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ba4a74

Please sign in to comment.