Skip to content

Commit 121bc67

Browse files
committed
Polish.
1 parent c32c590 commit 121bc67

6 files changed

Lines changed: 27 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
extensive work, as the JavaScript ecosystem is quite unique. The following plugins are being
1717
introduced:
1818
- `unstable_javascript`
19-
- A new JavaScript specific plugin that is a superset of all JavaScript runtimes (Deno coming
20-
soon).
19+
- A new JavaScript specific plugin that is a superset of all JavaScript runtimes (Bun & Node,
20+
with Deno coming soon).
2121
- Implements tier 1 and 2 features, and is now in charge of defining the package manager,
2222
installing dependencies, extending the project graph (aliases and tasks), parsing
2323
lockfiles/manifests, and much more.

crates/actions/tests/sync_workspace_test.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,14 @@ mod sync_workspace {
6969

7070
assert_eq!(
7171
ids,
72-
["tc-tier1", "tc-tier2", "tc-tier2-setup-env", "tc-tier3"]
72+
[
73+
"tc-tier1",
74+
"tc-tier2",
75+
"tc-tier2-reqs",
76+
"tc-tier2-setup-env",
77+
"tc-tier3",
78+
"tc-tier3-reqs"
79+
]
7380
);
7481

7582
// Verify operation and changed files

crates/cli/tests/snapshots/toolchain_info_test__toolchain_info__renders.snap

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ Configuration ──────────────────────
5151
Tier 1 - Usage detection ───────────────────────────────────
5252

5353
Config files: tsconfig.json, tsconfig.*.json, *.tsconfig.json, .tsbuildinfo, *.tsbuildinfo
54-
Executable names: tsc, tsserver
5554
APIs:
5655
🟢 register_toolchain (required)
5756
🟢 define_toolchain_config
@@ -72,7 +71,7 @@ Tier 2 - Platform integration ────────────────
7271
⚫️ extend_task_script
7372
⚫️ locate_dependencies_root
7473
⚫️ install_dependencies
75-
🟢 hash_task_contents
74+
⚫️ hash_task_contents
7675
⚫️ parse_lock
7776
⚫️ parse_manifest
7877
⚫️ setup_environment

crates/project-builder/tests/project_builder_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,15 @@ mod project_builder {
226226
assert_eq!(project.language, LanguageType::JavaScript);
227227
assert_eq!(
228228
project.toolchains,
229-
vec![Id::raw("unstable_javascript"), Id::raw("unstable_bun")]
229+
vec![Id::raw("unstable_bun"), Id::raw("unstable_javascript")]
230230
);
231231

232232
let project = build_lang_project("bun-config").await;
233233

234234
assert_eq!(project.language, LanguageType::JavaScript);
235235
assert_eq!(
236236
project.toolchains,
237-
vec![Id::raw("unstable_javascript"), Id::raw("unstable_bun")]
237+
vec![Id::raw("unstable_bun"), Id::raw("unstable_javascript")]
238238
);
239239
}
240240

@@ -374,7 +374,7 @@ mod project_builder {
374374
assert_eq!(project.language, LanguageType::Unknown);
375375
assert_eq!(
376376
project.toolchains,
377-
vec![Id::raw("typescript"), Id::raw("system")]
377+
vec![Id::raw("system"), Id::raw("typescript")]
378378
);
379379

380380
let project = build_lang_project("ts-disabled").await;

crates/project-graph/tests/project_graph_test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,10 +1594,10 @@ mod project_graph {
15941594
let graph = build_graph_from_fixture("query").await;
15951595

15961596
let projects = graph
1597-
.query_projects(build_query("task=build && taskToolchain=deno").unwrap())
1597+
.query_projects(build_query("task=build && taskToolchain=system").unwrap())
15981598
.unwrap();
15991599

1600-
assert_eq!(get_ids_from_projects(projects), vec!["d"]);
1600+
assert_eq!(get_ids_from_projects(projects), vec!["a", "d"]);
16011601
}
16021602

16031603
#[tokio::test]

crates/workspace-graph/src/query_projects.rs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,17 @@ impl WorkspaceGraph {
120120
.get_all_for_project(&project.id, false)?
121121
.iter()
122122
.any(|task| {
123-
let toolchains = task
124-
.toolchains
125-
.iter()
126-
.map(|t| t.as_str())
127-
.collect::<Vec<_>>();
123+
let mut toolchains = vec![];
124+
125+
// Support stable and unstable IDs
126+
for id in &task.toolchains {
127+
let (stable_id, unstable_id) = Id::stable_and_unstable(&id);
128+
toolchains.push(stable_id);
129+
toolchains.push(unstable_id);
130+
}
131+
132+
let toolchains =
133+
toolchains.iter().map(|t| t.as_str()).collect::<Vec<_>>();
128134

129135
condition.matches_list(ids, &toolchains).unwrap_or_default()
130136
})),

0 commit comments

Comments
 (0)