mirror of
https://github.com/denoland/deno.git
synced 2024-12-21 23:04:45 -05:00
fix(workspace): support wildcard packages (#26568)
This commit adds support for wildcard packages in `workspace` configuration option in `deno.json`. This is now supported: ``` { "workspace": [ "./packages/*" ] } ``` Closes https://github.com/denoland/deno/issues/25783
This commit is contained in:
parent
84aee0be9a
commit
051552172c
14 changed files with 73 additions and 3 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1387,9 +1387,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_config"
|
||||
version = "0.37.2"
|
||||
version = "0.38.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5900bfb37538d83b19ba0b157cdc785770e38422ee4632411e3bd3d90ac0f537"
|
||||
checksum = "966825073480a6ac7e01977a3879d13edc8d6ea2d65ea164b37156a5fb206e9a"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_package_json",
|
||||
|
|
|
@ -70,7 +70,7 @@ winres.workspace = true
|
|||
[dependencies]
|
||||
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
|
||||
deno_cache_dir = { workspace = true }
|
||||
deno_config = { version = "=0.37.2", features = ["workspace", "sync"] }
|
||||
deno_config = { version = "=0.38.2", features = ["workspace", "sync"] }
|
||||
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
|
||||
deno_doc = { version = "0.156.0", default-features = false, features = ["rust", "html", "syntect"] }
|
||||
deno_graph = { version = "=0.84.1" }
|
||||
|
|
5
tests/specs/run/workspaces/wildcard/__test__.jsonc
Normal file
5
tests/specs/run/workspaces/wildcard/__test__.jsonc
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"args": "run -L debug -A main.ts",
|
||||
"output": "main.out",
|
||||
"tempDir": true
|
||||
}
|
8
tests/specs/run/workspaces/wildcard/deno.json
Normal file
8
tests/specs/run/workspaces/wildcard/deno.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"workspace": [
|
||||
"./packages/*"
|
||||
],
|
||||
"imports": {
|
||||
"chalk": "npm:chalk"
|
||||
}
|
||||
}
|
22
tests/specs/run/workspaces/wildcard/main.out
Normal file
22
tests/specs/run/workspaces/wildcard/main.out
Normal file
|
@ -0,0 +1,22 @@
|
|||
[WILDCARD]Workspace config generated this import map {
|
||||
"imports": {
|
||||
"chalk": "npm:chalk",
|
||||
"chalk/": "npm:/chalk/"
|
||||
},
|
||||
"scopes": {
|
||||
"./packages/bar/": {
|
||||
"@/": "./packages/bar/",
|
||||
"secret_mod/": "./packages/bar/some_mod/"
|
||||
},
|
||||
"./packages/foo/": {
|
||||
"~/": "./packages/foo/",
|
||||
"foo/": "./packages/foo/bar/"
|
||||
}
|
||||
}
|
||||
}
|
||||
[WILDCARD]
|
||||
hello from foo
|
||||
buzz from foo
|
||||
hello from bar
|
||||
buzz from bar
|
||||
[Function: chalk][WILDCARD]
|
5
tests/specs/run/workspaces/wildcard/main.ts
Normal file
5
tests/specs/run/workspaces/wildcard/main.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import chalk from "chalk";
|
||||
import "./packages/foo/mod.ts";
|
||||
import "./packages/bar/mod.ts";
|
||||
|
||||
console.log(chalk);
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "asdfasdfasdf",
|
||||
"version": "0.0.0",
|
||||
"imports": {
|
||||
"@/": "./",
|
||||
"secret_mod/": "./some_mod/"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export const buzz = "buzz from bar";
|
5
tests/specs/run/workspaces/wildcard/packages/bar/mod.ts
Normal file
5
tests/specs/run/workspaces/wildcard/packages/bar/mod.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { hello } from "secret_mod/hello.ts";
|
||||
import { buzz } from "@/fizz/buzz.ts";
|
||||
|
||||
console.log(hello);
|
||||
console.log(buzz);
|
|
@ -0,0 +1 @@
|
|||
export const hello = "hello from bar";
|
|
@ -0,0 +1 @@
|
|||
export const hello = "hello from foo";
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "qwerqwer",
|
||||
"version": "0.0.0",
|
||||
"imports": {
|
||||
"~/": "./",
|
||||
"foo/": "./bar/"
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
export const buzz = "buzz from foo";
|
5
tests/specs/run/workspaces/wildcard/packages/foo/mod.ts
Normal file
5
tests/specs/run/workspaces/wildcard/packages/foo/mod.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
import { hello } from "foo/hello.ts";
|
||||
import { buzz } from "~/fizz/buzz.ts";
|
||||
|
||||
console.log(hello);
|
||||
console.log(buzz);
|
Loading…
Reference in a new issue