tylersong 1.0.1 → 1.0.4

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.
@@ -0,0 +1,48 @@
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}}
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # 버전 업데이트
2
+
3
+ `npm version patch` # 또는 minor/major
4
+
5
+ # 태그와 함께 GitHub에 푸시
6
+
7
+ `git push origin main --tags`
package/index.js CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  import inquirer from "inquirer";
4
4
  import chalk from "chalk";
5
+ import { program } from "commander";
6
+ import { exec } from "child_process";
7
+
8
+ const openUrl = (url) => {
9
+ const command =
10
+ process.platform === "win32"
11
+ ? "start"
12
+ : process.platform === "darwin"
13
+ ? "open"
14
+ : "xdg-open";
15
+ exec(`${command} ${url}`);
16
+ };
17
+
18
+ program.version("1.0.3").description("송민성의 개발자 프로필 CLI");
19
+
20
+ program.option("-g, --github", "GitHub 프로필 열기");
21
+
22
+ program.parse(process.argv);
23
+
24
+ const options = program.opts();
25
+
26
+ if (Object.keys(options).length > 0) {
27
+ if (options.github) openUrl("https://github.com/alstjd0051");
28
+ process.exit(0);
29
+ }
5
30
 
6
31
  const main = async () => {
7
32
  // 도움말 옵션 체크
@@ -14,7 +39,9 @@ const main = async () => {
14
39
  │ npx tylerSong │
15
40
  │ │
16
41
  │ 옵션: │
17
- │ --help 도움말 표시
42
+ -V, --version 버전 정보
43
+ │ -g, --github GitHub 열기 │
44
+ │ -h, --help 도움말 │
18
45
  ╰───────────────────────────────╯
19
46
  `)
20
47
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tylersong",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "description": "나의 CLI 자기소개 도구",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -11,5 +11,13 @@
11
11
  "cli"
12
12
  ],
13
13
  "author": "송민성",
14
- "license": "MIT"
14
+ "license": "MIT",
15
+ "scripts": {
16
+ "test": "echo \"No test specified\""
17
+ },
18
+ "dependencies": {
19
+ "chalk": "^5.4.1",
20
+ "commander": "^13.1.0",
21
+ "inquirer": "^12.4.2"
22
+ }
15
23
  }