-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(unstable): ability to use a local copy of jsr packages (#25068)
- Loading branch information
Showing
45 changed files
with
323 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"tempDir": true, | ||
"steps": [{ | ||
"if": "unix", | ||
"args": "compile --output my-app main/main.ts", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"if": "unix", | ||
"commandName": "./my-app", | ||
"args": [], | ||
"output": "main.out" | ||
}, { | ||
"if": "windows", | ||
"args": "compile --output my-app.exe main/main.ts", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"if": "windows", | ||
"commandName": "./my-app.exe", | ||
"args": [], | ||
"output": "main.out" | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "@denotest/add", | ||
"exports": "./mod.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function add(a: number, b: number): number { | ||
return (a + b) * 2; // it adds wrong | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"patch": [ | ||
"../add" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { add } from "jsr:@denotest/add"; | ||
|
||
console.log(add(1, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"tempDir": true, | ||
"tests": { | ||
"matching_version": { | ||
"cwd": "./my-pkg", | ||
"steps": [{ | ||
"args": "test", | ||
"output": "test.out" | ||
}, { | ||
"args": "lint", | ||
"output": "Checked 2 files\n" | ||
}] | ||
}, | ||
"not_matching_version": { | ||
"steps": [{ | ||
"args": "run --allow-read=. --allow-write=. modify_version.ts", | ||
"output": "[WILDCARD]" | ||
}, { | ||
"cwd": "./my-pkg", | ||
"args": "test", | ||
"output": "not_matching_version.out" | ||
}] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@denotest/add", | ||
"version": "1.0.0", | ||
"exports": "./mod.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { add } from "./mod.ts"; | ||
|
||
// this test should not be run or linted | ||
Deno.test("add", () => { | ||
let unusedVar = 5; // purposefully causing a lint error to ensure it's not linted | ||
if (add(1, 2) !== 3) { | ||
throw new Error("fail"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function add(a: number, b: number): number { | ||
console.log("adding", a, "and", b); | ||
return a + b; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const data = JSON.parse(Deno.readTextFileSync("./add/deno.json")); | ||
data.version = "2.0.0"; | ||
Deno.writeTextFileSync("./add/deno.json", JSON.stringify(data, null, 2)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "@scope/my-pkg", | ||
"version": "1.0.0", | ||
"exports": "./mod.ts", | ||
"imports": { | ||
"@denotest/add": "jsr:@denotest/add@1" | ||
}, | ||
"patch": [ | ||
"../add" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { add } from "./mod.ts"; | ||
|
||
Deno.test("add", () => { | ||
if (add(1, 2) !== 3) { | ||
throw new Error("fail"); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { add } from "@denotest/add"; | ||
import "@denotest/add"; // ensure it only warns once |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Warning Patch '@denotest/[email protected]' was not used because it did not match '@denotest/add@1' | ||
at file:///[WILDLINE]/my-pkg/mod.ts:1:21 | ||
Download http://127.0.0.1:4250/@denotest/add/meta.json | ||
Download http://127.0.0.1:4250/@denotest/add/1.0.0_meta.json | ||
Download http://127.0.0.1:4250/@denotest/add/1.0.0/mod.ts | ||
Check file:///[WILDLINE]/mod.test.ts | ||
running 1 test from ./mod.test.ts | ||
add ... ok ([WILDLINE]) | ||
|
||
ok | 1 passed | 0 failed ([WILDLINE]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Check file:///[WILDLINE]/mod.test.ts | ||
running 1 test from ./mod.test.ts | ||
add ... | ||
------- output ------- | ||
adding 1 and 2 | ||
----- output end ----- | ||
add ... ok ([WILDLINE]) | ||
|
||
ok | 1 passed | 0 failed ([WILDLINE]) | ||
|
4 changes: 4 additions & 0 deletions
4
tests/specs/run/workspaces/member_not_match_constraint/__test__.jsonc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"args": "test", | ||
"output": "test.out" | ||
} |
5 changes: 5 additions & 0 deletions
5
tests/specs/run/workspaces/member_not_match_constraint/add/deno.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@denotest/add", | ||
"version": "2.0.0", | ||
"exports": "./mod.ts" | ||
} |
4 changes: 4 additions & 0 deletions
4
tests/specs/run/workspaces/member_not_match_constraint/add/mod.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function add(a: number, b: number): number { | ||
console.log("local"); | ||
return a + b; | ||
} |
Oops, something went wrong.