Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions packages/create-commandkit/src/functions/copyTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,44 @@ const templates = {
ts: path.join(__dirname, '..', 'templates', 'TypeScript'),
};

const gitignore = `
# dependencies
node_modules

# build output
build
out
dist

# commandkit
.commandkit
dist
compiled-commandkit.config.mjs

# env
**/*.env*
!**/*.env.example*

# logging
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# yarn v2+
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# other
**/*.DS_Store
`;

export async function copyTemplates({
dir,
lang,
Expand All @@ -19,4 +57,5 @@ export async function copyTemplates({
dir: string;
}) {
await fs.copy(templates[lang], dir);
await fs.writeFile(path.join(dir, '.gitignore'), gitignore);
}
4 changes: 2 additions & 2 deletions packages/create-commandkit/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export const textColors = {
export const commands = {
init: {
npm: 'npm init -y',
yarn: 'yarn init -y; yarn config set nodeLinker node-modules; yarn set version stable',
yarn: 'yarn init -y; yarn set version stable; yarn config set nodeLinker node-modules;',
pnpm: 'pnpm init',
bun: 'bun init -y',
bun: 'bun init -y -m',
},
};
34 changes: 0 additions & 34 deletions packages/create-commandkit/templates/JavaScript/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import { Logger } from 'commandkit/logger';
* @param {import('discord.js').Client<true>} client
*/
export default function log(client) {
Logger.success(`Logged in as ${client.user.username}!`);
Logger.info(`Logged in as ${client.user.username}!`);
}
34 changes: 0 additions & 34 deletions packages/create-commandkit/templates/TypeScript/.gitignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import type { Client } from 'discord.js';
import { Logger } from 'commandkit/logger';

export default function log(client: Client<true>) {
Logger.success(`Logged in as ${client.user.username}!`);
Logger.info(`Logged in as ${client.user.username}!`);
}