Skip to content

Commit 9889ead

Browse files
authored
Merge pull request #250 from underctrl-io/fix-templates
refactor: update command initialization scripts and add .gitignore to template directories
2 parents 831d0ae + 0b083ec commit 9889ead

File tree

6 files changed

+43
-72
lines changed

6 files changed

+43
-72
lines changed

packages/create-commandkit/src/functions/copyTemplates.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,44 @@ const templates = {
1111
ts: path.join(__dirname, '..', 'templates', 'TypeScript'),
1212
};
1313

14+
const gitignore = `
15+
# dependencies
16+
node_modules
17+
18+
# build output
19+
build
20+
out
21+
dist
22+
23+
# commandkit
24+
.commandkit
25+
dist
26+
compiled-commandkit.config.mjs
27+
28+
# env
29+
**/*.env*
30+
!**/*.env.example*
31+
32+
# logging
33+
logs
34+
*.log
35+
npm-debug.log*
36+
yarn-debug.log*
37+
yarn-error.log*
38+
lerna-debug.log*
39+
.pnpm-debug.log*
40+
41+
# yarn v2+
42+
.yarn/cache
43+
.yarn/unplugged
44+
.yarn/build-state.yml
45+
.yarn/install-state.gz
46+
.pnp.*
47+
48+
# other
49+
**/*.DS_Store
50+
`;
51+
1452
export async function copyTemplates({
1553
dir,
1654
lang,
@@ -19,4 +57,5 @@ export async function copyTemplates({
1957
dir: string;
2058
}) {
2159
await fs.copy(templates[lang], dir);
60+
await fs.writeFile(path.join(dir, '.gitignore'), gitignore);
2261
}

packages/create-commandkit/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ export const textColors = {
77
export const commands = {
88
init: {
99
npm: 'npm init -y',
10-
yarn: 'yarn init -y; yarn config set nodeLinker node-modules; yarn set version stable',
10+
yarn: 'yarn init -y; yarn set version stable; yarn config set nodeLinker node-modules;',
1111
pnpm: 'pnpm init',
12-
bun: 'bun init -y',
12+
bun: 'bun init -y -m',
1313
},
1414
};

packages/create-commandkit/templates/JavaScript/.gitignore

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/create-commandkit/templates/JavaScript/src/app/events/ready/log.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ import { Logger } from 'commandkit/logger';
44
* @param {import('discord.js').Client<true>} client
55
*/
66
export default function log(client) {
7-
Logger.success(`Logged in as ${client.user.username}!`);
7+
Logger.info(`Logged in as ${client.user.username}!`);
88
}

packages/create-commandkit/templates/TypeScript/.gitignore

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/create-commandkit/templates/TypeScript/src/app/events/ready/log.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ import type { Client } from 'discord.js';
22
import { Logger } from 'commandkit/logger';
33

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

0 commit comments

Comments
 (0)