Skip to content

Commit 3736a13

Browse files
Add support for pnpm (#219)
1 parent 4834ff7 commit 3736a13

23 files changed

+199
-24
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ yarn install
4343
scip-typescript index --yarn-workspaces
4444
```
4545

46+
### Index a TypeScript project using pnpm workspaces
47+
48+
Navigate to the project root, containing `package.json`.
49+
50+
```sh
51+
pnpm install
52+
53+
scip-typescript index --pnpm-workspaces
54+
```
55+
4656
### Indexing in CI
4757

4858
Add the following run steps to your CI pipeline:

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build": "node ./node_modules/typescript/bin/tsc -b .",
1414
"test": "uvu -r ts-node/register --ignore dist",
1515
"update-snapshots": "uvu -r ts-node/register --ignore dist --update-snapshots",
16-
"prepare": "cd snapshots && yarn && cd input/multi-project && yarn"
16+
"prepare": "cd snapshots && yarn && cd input/multi-project && yarn && cd ../pnpm-workspaces && pnpm install"
1717
},
1818
"repository": {
1919
"type": "git",
@@ -54,6 +54,7 @@
5454
"eslint": "^7.32.0",
5555
"eslint-plugin-unicorn": "^21.0.0",
5656
"eslint-plugin-unused-imports": "^2.0.0",
57+
"pnpm": "7.20.0",
5758
"prettier": "2.8.1",
5859
"ts-node": "^10.7.0",
5960
"typescript-eslint": "0.0.1-alpha.0",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "pnpm-workspaces",
3+
"version": "1.0.0",
4+
"description": "Example TS/JS project",
5+
"main": "src/main.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"private": true,
12+
"packageManager": "pnpm@7.20.0"
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@example/a",
3+
"version": "1.0.0",
4+
"description": "Example TS/JS project",
5+
"main": "src/a.ts",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC"
11+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function a(): string {
2+
return ''
3+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"baseUrl": ".",
6+
"outDir": "dist"
7+
},
8+
"include": ["src/*"]
9+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "@example/b",
3+
"version": "1.0.0",
4+
"description": "Example TS/JS project",
5+
"main": "src/b.ts",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "",
10+
"license": "ISC",
11+
"dependencies": {
12+
"@example/a": "1.0.0"
13+
}
14+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { a } from '@example/a'
2+
3+
export function b() {
4+
return a()
5+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": ".",
5+
"baseUrl": "./src",
6+
"sourceRoot": "src",
7+
"outDir": "dist"
8+
},
9+
"include": ["src/*"],
10+
"references": [{ "path": "../a" }]
11+
}

snapshots/input/pnpm-workspaces/packages/b/tsconfig.tsbuildinfo

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)