Skip to content

Commit 9c2e165

Browse files
authored
feat!: remove subcommands (#47)
1 parent 1bb7475 commit 9c2e165

File tree

11 files changed

+41
-76
lines changed

11 files changed

+41
-76
lines changed
Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@ name: Release
22

33
on:
44
push:
5-
tags:
6-
- 'v*'
5+
branches:
6+
- main
7+
- beta
78

89
jobs:
910
release:
1011
runs-on: ubuntu-latest
1112
permissions:
12-
contents: write
13+
contents: write # to be able to publish a GitHub release
14+
id-token: write # to enable use of OIDC for npm provenance
1315
steps:
1416
- uses: actions/checkout@v3
1517
with:
@@ -25,6 +27,8 @@ jobs:
2527
- name: install
2628
run: pnpm i
2729

28-
- run: npx changelogithub
30+
- name: release
31+
run: pnpm semantic-release
2932
env:
3033
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34+
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

.github/workflows/release.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@ name: Release
22

33
on:
44
push:
5-
branches:
6-
- main
7-
- beta
5+
tags:
6+
- 'v*'
87

98
jobs:
109
release:
1110
runs-on: ubuntu-latest
1211
permissions:
13-
contents: write # to be able to publish a GitHub release
14-
id-token: write # to enable use of OIDC for npm provenance
12+
contents: write
1513
steps:
1614
- uses: actions/checkout@v3
1715
with:
@@ -27,8 +25,6 @@ jobs:
2725
- name: install
2826
run: pnpm i
2927

30-
- name: release
31-
run: pnpm semantic-release
28+
- run: npx changelogithub
3229
env:
3330
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34-
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"@vitest/coverage-v8": "^0.34.3",
4444
"bumpp": "^9.2.0",
4545
"concurrently": "^8.2.1",
46+
"conventional-changelog-conventionalcommits": "^7.0.1",
4647
"cross-env": "^7.0.3",
4748
"eslint": "^8.48.0",
4849
"eslint-plugin-simple-import-sort": "^10.0.0",

pnpm-lock.yaml

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

release.config.cjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,20 @@
33
/** @type {import('semantic-release').Options} */
44
module.exports = {
55
branches: ['main', 'next', { name: 'beta', prerelease: true }],
6+
plugins: [
7+
[
8+
'@semantic-release/commit-analyzer',
9+
{
10+
preset: 'conventionalcommits',
11+
},
12+
],
13+
[
14+
'@semantic-release/release-notes-generator',
15+
{
16+
preset: 'conventionalcommits',
17+
},
18+
],
19+
'@semantic-release/npm',
20+
'@semantic-release/github',
21+
],
622
};

src/commands/clean.ts

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

src/commands/list.ts

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

src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { log } from '@clack/prompts';
44
import { cli } from 'cleye';
55

66
import { description, version } from '../package.json';
7-
import clean from './commands/clean.js';
8-
import list from './commands/list.js';
97
import { checkDir } from './operations/check-dir.js';
108
import { createWorkspace } from './operations/create-workspace.js';
119
import { getWorkspace } from './operations/get-workspace.js';
@@ -27,7 +25,7 @@ cli(
2725
examples: ['codew .'],
2826
},
2927

30-
commands: [list, clean],
28+
commands: [],
3129
},
3230
async (argv) => {
3331
const path = argv._.path;

test/operations/create-workspace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { basename, resolve } from 'node:path';
44

55
import { afterEach, beforeEach, expect, test, vi } from 'vitest';
66

7-
import { DbData } from '../../src/db.ts';
7+
import { DbData } from '../../src/db.js';
88
import { createWorkspace } from '../../src/operations/create-workspace.js';
99

1010
const mocks = vi.hoisted(() => {

0 commit comments

Comments
 (0)