Skip to content

Commit b055633

Browse files
committed
chore: wrapped up the template
1 parent 8e04890 commit b055633

File tree

6 files changed

+215
-22
lines changed

6 files changed

+215
-22
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,11 @@ env:
66
LEFTHOOK: 0
77

88
jobs:
9-
build:
10-
9+
verify:
1110
runs-on: ubuntu-latest
1211

13-
strategy:
14-
matrix:
15-
node-version: [ 18.x ]
16-
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
17-
1812
steps:
1913
- uses: actions/checkout@v2
20-
2114
- name: Cache multiple paths
2215
uses: actions/cache@v2
2316
with:
@@ -39,19 +32,26 @@ jobs:
3932
${{ runner.os }}-yarn-
4033
4134
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v2
35+
uses: actions/setup-node@v3
4336
with:
44-
node-version: ${{ matrix.node-version }}
37+
node-version: 18
4538
cache: 'yarn'
4639

4740
- run: yarn --pure-lockfile
48-
- run: yarn lint
41+
- run: yarn ci
42+
- run: npx semantic-release --dry-run
43+
id: get-next-version
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
outputs:
47+
new-release-published: ${{ steps.get-next-version.outputs.new-release-published }}
48+
new-release-version: ${{ steps.get-next-version.outputs.new-release-version }}
4949

5050
release:
51-
needs: [build]
51+
needs: [verify]
52+
if: needs.verify.outputs.new-release-published == 'true'
5253
name: Release
5354
runs-on: ubuntu-latest
54-
if: ${{github.ref == 'ref/head/main'}} || ${{github.ref == 'ref/head/next'}}
5555
steps:
5656
- name: Checkout
5757
uses: actions/checkout@v2
@@ -79,14 +79,15 @@ jobs:
7979
${{ runner.os }}-yarn-
8080
8181
- name: Use Node.js ${{ matrix.node-version }}
82-
uses: actions/setup-node@v2
82+
uses: actions/setup-node@v3
8383
with:
84-
node-version: ${{ matrix.node-version }}
84+
node-version: 18
8585
cache: 'yarn'
8686

8787
- name: Install deps
8888
run: yarn --pure-lockfile --offline
89-
89+
- name: Build
90+
run: yarn build
9091
- name: Release
9192
env:
9293
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.releaserc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
],
1515
"plugins": [
1616
"@semantic-release/commit-analyzer",
17+
"semantic-release-export-data",
1718
"@semantic-release/release-notes-generator",
1819
[
1920
"@semantic-release/changelog",
@@ -22,7 +23,12 @@
2223
"changelogFile": "CHANGELOG.md"
2324
}
2425
],
25-
"@semantic-release/npm",
26+
[
27+
"@semantic-release/npm",
28+
{
29+
"postversion": "yarn build"
30+
}
31+
],
2632
"@semantic-release/github",
2733
[
2834
"@semantic-release/git",

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@
3636
"release": "semantic-release"
3737
},
3838
"dependencies": {
39+
"@types/inquirer": "^9.0.1",
3940
"@types/node": "^18.0.0",
40-
"core-js": "^3.19.1",
4141
"chalk": "^5.0.1",
42-
"commander": "^9.3.0"
42+
"commander": "^9.3.0",
43+
"core-js": "^3.19.1",
44+
"inquirer": "^9.1.0"
4345
},
4446
"commitlint": {
4547
"extends": [
@@ -76,6 +78,7 @@
7678
"npm-run-all": "^4.1.5",
7779
"rimraf": "^3.0.2",
7880
"semantic-release": "^19.0.3",
81+
"semantic-release-export-data": "^1.0.0",
7982
"ts-node": "^10.8.1",
8083
"typescript": "^4.4.4",
8184
"uuid": "^8.3.2",

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env node
2+
3+
import { Command } from 'commander';
4+
import { version } from '../package.json';
5+
6+
const APP_NAME = 'Meza\'s CLI tool template';
7+
const APP_DESCRIPTION = 'A template for CLI typescript apps';
8+
9+
const program = new Command();
10+
program.name(APP_NAME).version(version).description(APP_DESCRIPTION);
11+
12+
program.parse();

src/types/environment.d.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
declare global {
2+
// eslint-disable-next-line no-unused-vars
3+
namespace NodeJS {
4+
// eslint-disable-next-line no-unused-vars
5+
interface ProcessEnv {}
6+
}
7+
}
8+
9+
export {};

0 commit comments

Comments
 (0)