Skip to content

Commit c4d04b4

Browse files
authored
chore: add type-check script to package.json (#25)
* fix: npm private * fix: corrected incorrect import * chore: add type-check script * chore: type check script depends on build script * chore: add changeset
1 parent cc1b15b commit c4d04b4

File tree

10 files changed

+29
-20
lines changed

10 files changed

+29
-20
lines changed

.changeset/loose-pianos-try.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@offlegacy/git-intent-core": patch
3+
"git-intent": patch
4+
---
5+
6+
chore: add type-check script to package.json

.github/workflows/build-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ jobs:
3636
- uses: pnpm/action-setup@v4
3737
name: Install pnpm
3838
id: pnpm-install
39-
4039
- name: Setup Node.js & pnpm cache
4140
uses: actions/setup-node@v4
4241
with:
@@ -46,6 +45,9 @@ jobs:
4645
- name: Install dependencies
4746
run: pnpm install
4847

48+
- name: Type check
49+
run: pnpm type-check
50+
4951
- name: Build packages
5052
run: pnpm build
5153

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"changeset": "changeset",
2525
"version-packages": "changeset version",
2626
"release": "turbo build && changeset publish",
27-
"cli": "pnpm --filter='git-intent' start"
27+
"cli": "pnpm --filter='git-intent' start",
28+
"type-check": "turbo type-check"
2829
},
2930
"devDependencies": {
3031
"@biomejs/biome": "^1.9.4",

packages/cli/package.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
"todo-driven"
1414
],
1515
"license": "MIT",
16-
"files": [
17-
"dist"
18-
],
16+
"files": ["dist"],
1917
"type": "module",
2018
"bin": {
2119
"git-intent": "./dist/index.cjs"
@@ -30,12 +28,11 @@
3028
"start": "node dist/index.cjs",
3129
"format": "biome format",
3230
"format:fix": "biome format --write",
33-
"pkg:build:macos": "pnpm build && pkg . --no-bytecode -t node18-macos-arm64 -o build/git-intent-macos"
31+
"pkg:build:macos": "pnpm build && pkg . --no-bytecode -t node18-macos-arm64 -o build/git-intent-macos",
32+
"type-check": "tsc --noEmit"
3433
},
3534
"pkg": {
36-
"assets": [
37-
"dist/**/*"
38-
],
35+
"assets": ["dist/**/*"],
3936
"outputPath": "build"
4037
},
4138
"dependencies": {

packages/cli/src/commands/commit.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { git, storage } from '@offlegacy/git-intent-core';
1+
import { gitService, storage } from '@offlegacy/git-intent-core';
22
import chalk from 'chalk';
33
import { Command } from 'commander';
44

@@ -17,7 +17,7 @@ const commit = new Command()
1717

1818
const message = options.message ? `${currentCommit.message}\n\n${options.message}` : currentCommit.message;
1919

20-
await git.createCommit(message);
20+
await gitService.createCommit(message);
2121
await storage.deleteCommit(currentCommit.id);
2222

2323
console.log(chalk.green('✓ Intention completed and committed'));

packages/cli/src/commands/start.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { git, storage } from '@offlegacy/git-intent-core';
1+
import { gitService, storage } from '@offlegacy/git-intent-core';
22
import chalk from 'chalk';
33
import { Command } from 'commander';
44
import prompts from 'prompts';
@@ -48,7 +48,7 @@ const start = new Command()
4848
return;
4949
}
5050

51-
const currentBranch = await git.getCurrentBranch();
51+
const currentBranch = await gitService.getCurrentBranch();
5252
targetCommit.status = 'in_progress';
5353
targetCommit.metadata.startedAt = new Date().toISOString();
5454
targetCommit.metadata.branch = currentBranch;

packages/core/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
{
22
"name": "@offlegacy/git-intent-core",
33
"version": "0.0.13",
4-
"private": true,
54
"description": "Core functionality for git-intent",
65
"type": "module",
76
"main": "dist/index.cjs",
87
"module": "dist/index.js",
98
"types": "dist/index.d.ts",
10-
"files": [
11-
"dist"
12-
],
9+
"files": ["dist"],
1310
"scripts": {
1411
"dev": "tsup --watch",
15-
"build": "tsup"
12+
"build": "tsup",
13+
"type-check": "tsc --noEmit"
1614
},
1715
"dependencies": {
1816
"fs-extra": "^11.3.0",

packages/core/tsup.config.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@ import { createTsupConfig } from '../../tsup.config.base';
22

33
export default createTsupConfig({
44
entry: ['src/index.ts'],
5-
dts: true,
65
});

tsup.config.base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export function createTsupConfig(options: Partial<Options> = {}) {
44
return defineConfig({
55
format: ['esm', 'cjs'],
66
clean: true,
7+
dts: true,
78
...options,
89
});
910
}

turbo.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@
1111
"persistent": true
1212
},
1313
"test": {
14-
"dependsOn": ["build"],
14+
"dependsOn": ["^build"],
1515
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"]
1616
},
1717
"clean": {
1818
"cache": false
19+
},
20+
"type-check": {
21+
"dependsOn": ["^build"],
22+
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts", "test/**/*.tsx"],
23+
"outputs": []
1924
}
2025
}
2126
}

0 commit comments

Comments
 (0)