diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-11-17 02:28:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-17 01:28:38 +0000 |
commit | 9534e6e1131542653c4e266f712c4067af2c8ec0 (patch) | |
tree | 1a74cccdcdb6bb12c10ab3e2a34d93fd8c4ccc55 /cli/args/import_map.rs | |
parent | 544923afdc67e9946453901642746f37f22c8e24 (diff) |
feat(unstable): Workspaces support (#20410)
This commit adds unstable workspace support. This is extremely
bare-bones and
minimal first-pass at this.
With this change `deno.json` supports specifying `workspaces` key, that
accepts a list of subdirectories. Each workspace can have its own import
map. It's required to specify a `"name"` and `"version"` properties in the
configuration file for the workspace:
```jsonc
// deno.json
{
"workspaces": [
"a",
"b"
},
"imports": {
"express": "npm:express@5"
}
}
```
``` jsonc
// a/deno.json
{
"name": "a",
"version": "1.0.2",
"imports": {
"kleur": "npm:kleur"
}
}
```
```jsonc
// b/deno.json
{
"name": "b",
"version": "0.51.0",
"imports": {
"chalk": "npm:chalk"
}
}
```
`--unstable-workspaces` flag is required to use this feature:
```
$ deno run --unstable-workspaces mod.ts
```
---------
Co-authored-by: David Sherret <dsherret@gmail.com>
Diffstat (limited to 'cli/args/import_map.rs')
-rw-r--r-- | cli/args/import_map.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/args/import_map.rs b/cli/args/import_map.rs index 9d1b2bbda..5ebb425eb 100644 --- a/cli/args/import_map.rs +++ b/cli/args/import_map.rs @@ -36,7 +36,7 @@ pub async fn resolve_import_map_from_specifier( import_map_from_value(specifier, value) } -fn import_map_from_value( +pub fn import_map_from_value( specifier: &Url, json_value: serde_json::Value, ) -> Result<ImportMap, AnyError> { |