tylersong 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "tylersong",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "나의 CLI 자기소개 도구",
5
- "main": "index.js",
5
+ "main": "dist/index.js",
6
6
  "bin": {
7
- "tylersong": "index.js"
7
+ "tylersong": "dist/index.js"
8
8
  },
9
9
  "type": "module",
10
10
  "keywords": [
@@ -13,11 +13,26 @@
13
13
  "author": "송민성",
14
14
  "license": "MIT",
15
15
  "scripts": {
16
- "test": "echo \"No test specified\""
16
+ "build": "tsc",
17
+ "build:bun": "bun build src/index.ts --outdir dist --target node",
18
+ "dev": "tsx src/index.ts",
19
+ "dev:bun": "bun run src/index.ts",
20
+ "start": "node dist/index.js",
21
+ "start:bun": "bun run dist/index.js",
22
+ "test": "echo \"No test specified\"",
23
+ "prepublishOnly": "npm run build"
17
24
  },
18
25
  "dependencies": {
19
26
  "chalk": "^5.4.1",
20
27
  "commander": "^13.1.0",
21
28
  "inquirer": "^12.4.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/chalk": "^0.4.31",
32
+ "@types/inquirer": "^9.0.8",
33
+ "@types/node": "^24.1.0",
34
+ "ts-node": "^10.9.2",
35
+ "tsx": "^4.20.3",
36
+ "typescript": "^5.9.2"
22
37
  }
23
38
  }
@@ -5,8 +5,16 @@ import chalk from "chalk";
5
5
  import { program } from "commander";
6
6
  import { exec } from "child_process";
7
7
 
8
- const openUrl = (url) => {
9
- const command =
8
+ interface ProgramOptions {
9
+ github?: boolean;
10
+ }
11
+
12
+ interface UserAnswer {
13
+ showInfo: boolean;
14
+ }
15
+
16
+ const openUrl = (url: string): void => {
17
+ const command: string =
10
18
  process.platform === "win32"
11
19
  ? "start"
12
20
  : process.platform === "darwin"
@@ -15,20 +23,20 @@ const openUrl = (url) => {
15
23
  exec(`${command} ${url}`);
16
24
  };
17
25
 
18
- program.version("1.0.3").description("송민성의 개발자 프로필 CLI");
26
+ program.version("1.0.6");
19
27
 
20
28
  program.option("-g, --github", "GitHub 프로필 열기");
21
29
 
22
30
  program.parse(process.argv);
23
31
 
24
- const options = program.opts();
32
+ const options: ProgramOptions = program.opts();
25
33
 
26
34
  if (Object.keys(options).length > 0) {
27
35
  if (options.github) openUrl("https://github.com/alstjd0051");
28
36
  process.exit(0);
29
37
  }
30
38
 
31
- const main = async () => {
39
+ const main = async (): Promise<void> => {
32
40
  // 도움말 옵션 체크
33
41
  if (process.argv.includes("--help")) {
34
42
  console.log(
@@ -49,7 +57,7 @@ const main = async () => {
49
57
  }
50
58
 
51
59
  // 사용자 질문
52
- const answer = await inquirer.prompt([
60
+ const answer: UserAnswer = await inquirer.prompt([
53
61
  {
54
62
  type: "confirm",
55
63
  name: "showInfo",
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "node",
6
+ "outDir": "./dist",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "sourceMap": true,
15
+ "resolveJsonModule": true,
16
+ "allowSyntheticDefaultImports": true
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": ["node_modules", "dist"]
20
+ }
@@ -1,48 +0,0 @@
1
- name: Node.js Package
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- tags: ["v*"]
7
- pull_request:
8
- branches: [main]
9
-
10
- jobs:
11
- build:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v3
15
-
16
- - name: Setup Node.js
17
- uses: actions/setup-node@v3
18
- with:
19
- node-version: "18.x"
20
- registry-url: "https://registry.npmjs.org/"
21
-
22
- - name: Install dependencies
23
- run: npm ci || npm install
24
-
25
- - name: Run tests
26
- run: npm test || true
27
-
28
- publish:
29
- needs: build
30
- runs-on: ubuntu-latest
31
- if: startsWith(github.ref, 'refs/tags/v')
32
-
33
- steps:
34
- - uses: actions/checkout@v3
35
-
36
- - name: Setup Node.js
37
- uses: actions/setup-node@v3
38
- with:
39
- node-version: "18.x"
40
- registry-url: "https://registry.npmjs.org/"
41
-
42
- - name: Install dependencies
43
- run: npm ci || npm install
44
-
45
- - name: Publish to npm
46
- run: npm publish
47
- env:
48
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}