diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-10 14:46:09 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-10 14:46:09 -0400 |
commit | 4d2d764816d266e42f3b2251248b100abb667c83 (patch) | |
tree | 814e4f208e6824b0d5a4217f14912b2512b185ed /tests | |
parent | 69afa8718f322cf2ef5f5cf5bcecb10f1122f490 (diff) |
feat(jsr): support publishing jsr packages in npm workspaces (#24507)
Supports publishing an npm workspace with a directory structure similar
to the following:
- workspace
- package.json
- package-a
- package.json
- jsr.json
- package-b
- package.json
- jsr.json
deno_config PR: https://github.com/denoland/deno_config/pull/77
Closes https://github.com/denoland/deno/issues/23638
Diffstat (limited to 'tests')
9 files changed, 46 insertions, 0 deletions
diff --git a/tests/specs/publish/npm_workspace/__test__.jsonc b/tests/specs/publish/npm_workspace/__test__.jsonc new file mode 100644 index 000000000..27e899aaa --- /dev/null +++ b/tests/specs/publish/npm_workspace/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "publish --dry-run", + "output": "publish.out" +} diff --git a/tests/specs/publish/npm_workspace/add/index.ts b/tests/specs/publish/npm_workspace/add/index.ts new file mode 100644 index 000000000..8d9b8a22a --- /dev/null +++ b/tests/specs/publish/npm_workspace/add/index.ts @@ -0,0 +1,3 @@ +export function add(a: number, b: number): number { + return a + b; +} diff --git a/tests/specs/publish/npm_workspace/add/jsr.json b/tests/specs/publish/npm_workspace/add/jsr.json new file mode 100644 index 000000000..2f20d6794 --- /dev/null +++ b/tests/specs/publish/npm_workspace/add/jsr.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/add", + "version": "1.0.0", + "exports": "./index.ts" +} diff --git a/tests/specs/publish/npm_workspace/add/package.json b/tests/specs/publish/npm_workspace/add/package.json new file mode 100644 index 000000000..af9d7b752 --- /dev/null +++ b/tests/specs/publish/npm_workspace/add/package.json @@ -0,0 +1,4 @@ +{ + "name": "add", + "version": "1.0.0" +} diff --git a/tests/specs/publish/npm_workspace/package.json b/tests/specs/publish/npm_workspace/package.json new file mode 100644 index 000000000..a5d8565f4 --- /dev/null +++ b/tests/specs/publish/npm_workspace/package.json @@ -0,0 +1,3 @@ +{ + "workspaces": ["./add", "./subtract"] +} diff --git a/tests/specs/publish/npm_workspace/publish.out b/tests/specs/publish/npm_workspace/publish.out new file mode 100644 index 000000000..21c91ae19 --- /dev/null +++ b/tests/specs/publish/npm_workspace/publish.out @@ -0,0 +1,15 @@ +Publishing a workspace... +Check file:///[WILDLINE]/npm_workspace/add/index.ts +Check file:///[WILDLINE]/npm_workspace/subtract/index.ts +Checking for slow types in the public API... +Check file:///[WILDLINE]/npm_workspace/add/index.ts +Check file:///[WILDLINE]/npm_workspace/subtract/index.ts +Simulating publish of @scope/add@1.0.0 with files: + file:///[WILDLINE]/npm_workspace/add/index.ts ([WILDLINE]) + file:///[WILDLINE]/npm_workspace/add/jsr.json ([WILDLINE]) + file:///[WILDLINE]/npm_workspace/add/package.json ([WILDLINE]) +Simulating publish of @scope/subtract@1.0.0 with files: + file:///[WILDLINE]/npm_workspace/subtract/index.ts ([WILDLINE]) + file:///[WILDLINE]/npm_workspace/subtract/jsr.json ([WILDLINE]) + file:///[WILDLINE]/npm_workspace/subtract/package.json ([WILDLINE]) +Warning Aborting due to --dry-run diff --git a/tests/specs/publish/npm_workspace/subtract/index.ts b/tests/specs/publish/npm_workspace/subtract/index.ts new file mode 100644 index 000000000..b5bd2dfcf --- /dev/null +++ b/tests/specs/publish/npm_workspace/subtract/index.ts @@ -0,0 +1,3 @@ +export function subtract(a: number, b: number): number { + return a - b; +} diff --git a/tests/specs/publish/npm_workspace/subtract/jsr.json b/tests/specs/publish/npm_workspace/subtract/jsr.json new file mode 100644 index 000000000..cb003e374 --- /dev/null +++ b/tests/specs/publish/npm_workspace/subtract/jsr.json @@ -0,0 +1,5 @@ +{ + "name": "@scope/subtract", + "version": "1.0.0", + "exports": "./index.ts" +} diff --git a/tests/specs/publish/npm_workspace/subtract/package.json b/tests/specs/publish/npm_workspace/subtract/package.json new file mode 100644 index 000000000..64507c3c7 --- /dev/null +++ b/tests/specs/publish/npm_workspace/subtract/package.json @@ -0,0 +1,4 @@ +{ + "name": "subtract", + "version": "1.0.0" +} |