Skip to content

Commit 39d0f68

Browse files
authored
Improve configuration for npm publish of @roo-code/types (#4062)
1 parent 59f1d4c commit 39d0f68

File tree

10 files changed

+65
-231
lines changed

10 files changed

+65
-231
lines changed

.github/workflows/code-qa.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ jobs:
134134
working-directory: apps/vscode-e2e
135135
run: xvfb-run -a pnpm test:ci
136136

137-
unit-test:
138-
needs: [platform-unit-test] # [platform-unit-test, integration-test]
137+
qa:
138+
needs: [check-translations, knip, compile, platform-unit-test, integration-test]
139139
runs-on: ubuntu-latest
140140
steps:
141141
- name: NO-OP

MONOREPO.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ pnpm install
2424
If things are in good working order then you should be able to build a vsix and install it in VSCode:
2525

2626
```sh
27-
pnpm build --out ../bin/roo-code-main.vsix && \
27+
pnpm build -- --out ../bin/roo-code-main.vsix && \
2828
code --install-extension bin/roo-code-main.vsix
2929
```
30+
31+
To fully stress the monorepo setup, run the following:
32+
33+
```sh
34+
pnpm clean && pnpm lint
35+
pnpm clean && pnpm check-types
36+
pnpm clean && pnpm test
37+
pnpm clean && pnpm bundle
38+
pnpm clean && pnpm build
39+
pnpm clean && pnpm npx turbo watch:bundle
40+
pnpm clean && pnpm npx turbo watch:tsc
41+
cd apps/vscode-e2e && pnpm test:ci
42+
```
File renamed without changes.

packages/types/npm/package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@roo-code/types",
3+
"version": "1.19.0",
4+
"description": "TypeScript type definitions for Roo Code.",
5+
"publishConfig": {
6+
"access": "public",
7+
"name": "@roo-code/types"
8+
},
9+
"author": "Roo Code Team",
10+
"license": "MIT",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/RooCodeInc/Roo-Code.git"
14+
},
15+
"bugs": {
16+
"url": "https://github.com/RooCodeInc/Roo-Code/issues"
17+
},
18+
"homepage": "https://github.com/RooCodeInc/Roo-Code/tree/main/packages/types",
19+
"keywords": [
20+
"roo",
21+
"roo-code",
22+
"ai"
23+
],
24+
"main": "./dist/index.cjs",
25+
"module": "./dist/index.js",
26+
"types": "./dist/index.d.ts",
27+
"exports": {
28+
".": {
29+
"types": "./dist/index.d.ts",
30+
"import": "./dist/index.js",
31+
"require": {
32+
"types": "./dist/index.d.cts",
33+
"default": "./dist/index.cjs"
34+
}
35+
}
36+
},
37+
"files": [
38+
"dist"
39+
]
40+
}

packages/types/package.json

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,26 @@
11
{
22
"name": "@roo-code/types",
3-
"version": "1.16.0",
4-
"description": "TypeScript type definitions for Roo Code.",
5-
"publishConfig": {
6-
"access": "public",
7-
"main": "./dist/index.js",
8-
"module": "./dist/index.mjs",
9-
"types": "./dist/index.d.ts",
10-
"exports": {
11-
".": {
12-
"types": "./dist/index.d.ts",
13-
"import": "./dist/index.mjs",
14-
"require": "./dist/index.js"
15-
}
16-
}
17-
},
18-
"author": "Roo Code Team",
19-
"license": "MIT",
20-
"repository": {
21-
"type": "git",
22-
"url": "git+https://github.com/RooCodeInc/Roo-Code.git"
23-
},
24-
"bugs": {
25-
"url": "https://github.com/RooCodeInc/Roo-Code/issues"
26-
},
27-
"homepage": "https://github.com/RooCodeInc/Roo-Code/tree/main/packages/types",
28-
"keywords": [
29-
"roo",
30-
"roo-code",
31-
"ai"
32-
],
33-
"main": "./dist/index.js",
3+
"version": "0.0.0",
4+
"type": "module",
5+
"main": "./dist/index.cjs",
346
"exports": {
357
".": {
368
"types": "./src/index.ts",
379
"import": "./src/index.ts",
3810
"require": {
39-
"types": "./dist/index.d.ts",
40-
"default": "./dist/index.js"
11+
"types": "./dist/index.d.cts",
12+
"default": "./dist/index.cjs"
4113
}
4214
}
4315
},
44-
"files": [
45-
"dist"
46-
],
4716
"scripts": {
4817
"lint": "eslint src --ext=ts --max-warnings=0",
4918
"check-types": "tsc --noEmit",
5019
"test": "vitest --globals --run",
5120
"build": "tsup",
52-
"prepublishOnly": "pnpm run build",
53-
"publish:test": "pnpm publish --dry-run",
54-
"publish": "pnpm publish",
55-
"clean": "rimraf dist .turbo"
21+
"npm:publish:test": "tsup --outDir npm/dist && cd npm && npm publish --dry-run",
22+
"npm:publish": "tsup --outDir npm/dist && cd npm && npm publish",
23+
"clean": "rimraf dist npm/dist .turbo"
5624
},
5725
"dependencies": {
5826
"zod": "^3.24.2"

packages/types/src/__tests__/cjs-import.test.ts

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

packages/types/src/__tests__/esm-import.test.ts

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

packages/types/src/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// npx vitest run --globals src/__tests__/index.test.ts
1+
// npx vitest run src/__tests__/index.test.ts
22

33
import { GLOBAL_STATE_KEYS } from "../index.js"
44

packages/types/src/__tests__/package-exports.test.ts

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

packages/types/tsup.config.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,4 @@ export default defineConfig({
88
splitting: false,
99
sourcemap: true,
1010
outDir: "dist",
11-
outExtension({ format }) {
12-
return {
13-
js: format === "cjs" ? ".js" : ".mjs",
14-
}
15-
},
1611
})

0 commit comments

Comments
 (0)