-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(unstable): ability to use a local copy of jsr packages #25068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
41e2794
feat: ability to use local copies of jsr packages
dsherret 2dcccfb
Merge branch 'main' into feat_patch_option
dsherret 10c21f6
add integration test
dsherret c29b4e7
update schema
dsherret 79ce7ab
Add test for diagnostic
dsherret 1be8bdb
Add test for workspace member not matching constraint
dsherret 23eb40b
add npm pkgs
dsherret bdfc9f5
remove this
dsherret 7855824
update
dsherret 753029d
Merge branch 'main' into feat_patch_option
dsherret 32e38c0
add tests for npm
dsherret 0a5d1d2
mark as unstable
dsherret d584e2c
Commit what I have, but I'm going to remove the npm portion of this b…
dsherret beacee5
remove npm support. Massive task
dsherret 3d68e24
reverts
dsherret 5b137f3
Merge branch 'main' into feat_patch_option
dsherret cc23986
update to actual version
dsherret ce9f774
revert whitespace changes
dsherret f90c19a
maybe fix linux ci
dsherret 004c3c4
Merge branch 'main' into feat_patch_option
dsherret 2cc61f5
revert
dsherret File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the message say that this patch was not used due to not matching constraints?