Skip to content

Commit

Permalink
new: Update deps. Support Turbo v2. (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Jun 6, 2024
1 parent a35555c commit ba9b7f5
Show file tree
Hide file tree
Showing 16 changed files with 791 additions and 565 deletions.
1,271 changes: 735 additions & 536 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ resolver = "2"
members = ["crates/*"]

[workspace.dependencies]
extism-pdk = "1.1.0"
moon_common = "0.0.4"
moon_config = "0.0.5"
moon_pdk = "0.0.5"
moon_pdk_test_utils = "0.0.6"
moon_target = "0.0.3"
extism-pdk = "1.2.0"
moon_common = "0.0.6"
moon_config = "0.0.8"
moon_pdk = "0.0.7"
moon_pdk_test_utils = "0.0.8"
moon_target = "0.0.5"
rustc-hash = "1.1.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.115"
serde_yaml = "0.9.33"
starbase_utils = { version = "0.6.1", default-features = false }
starbase_sandbox = "0.5.0"
serde = { version = "1.0.203", features = ["derive"] }
serde_json = "1.0.117"
serde_yaml = "0.9.34"
starbase_utils = { version = "0.7.4", default-features = false }
starbase_sandbox = "0.6.2"

# moon_common = { path = "../moon/nextgen/common" }
# moon_config = { path = "../moon/nextgen/config" }
Expand Down
4 changes: 3 additions & 1 deletion crates/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ pub fn format_virtual_path(path: &VirtualPath) -> Cow<'_, str> {
Cow::Owned(real.to_string_lossy().into_owned())
} else if let Some(rel) = path.without_prefix() {
rel.to_string_lossy()
} else if let Some(virt) = path.virtual_path() {
Cow::Owned(virt.to_string_lossy().into_owned())
} else {
path.virtual_path().to_string_lossy()
path.to_string_lossy()
}
}
6 changes: 6 additions & 0 deletions crates/download/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

#### 🚀 Updates

- Updated dependencies.

## 0.0.3

#### 🚀 Updates
Expand Down
2 changes: 1 addition & 1 deletion crates/download/tests/download_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ mod download {
let file = sandbox.path().join("README.md");

assert!(file.exists());
assert_eq!(fs::metadata(file).unwrap().len(), 4013);
assert_eq!(fs::metadata(file).unwrap().len(), 3891);
}

#[test]
Expand Down
6 changes: 6 additions & 0 deletions crates/migrate-nx/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

#### 🚀 Updates

- Updated dependencies.

## 0.0.3

#### 🐞 Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ fileGroups:
- '!**/*'
- /**/*
- '!/**/*'
- ./src/file.ts
- ./src/file.*
- ./src
- src/file.ts
- src/file.*
- src
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ fileGroups:
- '!**/*'
- /**/*
- '!/**/*'
- ./src/file.ts
- ./src/file.*
- ./src
- src/file.ts
- src/file.*
- src
language: javascript
platform: node
7 changes: 7 additions & 0 deletions crates/migrate-turborepo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Unreleased

#### 🚀 Updates

- Added support for Turborepo v2.
- Updated dependencies.

## 0.1.0

#### 🚀 Updates
Expand Down
12 changes: 9 additions & 3 deletions crates/migrate-turborepo/src/turbo_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,29 @@ pub enum TurboOutputMode {
pub struct TurboTask {
pub cache: Option<bool>,
pub depends_on: Option<Vec<String>>,
pub dot_env: Option<Vec<String>>,
pub env: Option<Vec<String>>,
pub inputs: Option<Vec<String>>,
pub output_mode: Option<TurboOutputMode>,
pub outputs: Option<Vec<String>>,
pub pass_through_env: Option<Vec<String>>,
pub persistent: Option<bool>,
// v2
pub output_logs: Option<TurboOutputMode>,
// v1 (removed)
pub dot_env: Option<Vec<String>>,
pub output_mode: Option<TurboOutputMode>,
}

#[derive(Default, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct TurboJson {
pub extends: Option<Vec<String>>,
pub global_dependencies: Option<Vec<String>>,
pub global_dot_env: Option<Vec<String>>,
pub global_env: Option<Vec<String>>,
pub global_pass_through_env: Option<Vec<String>>,
// v2
pub tasks: Option<FxHashMap<String, TurboTask>>,
// v1 (removed)
pub global_dot_env: Option<Vec<String>>,
pub pipeline: Option<FxHashMap<String, TurboTask>>,
}

Expand Down
4 changes: 2 additions & 2 deletions crates/migrate-turborepo/src/turbo_migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ impl TurboMigrator {
turbo_json: TurboJson,
from_source: Option<&str>,
) -> AnyResult<()> {
let Some(pipeline) = turbo_json.pipeline else {
let Some(pipeline) = turbo_json.tasks.or_else(|| turbo_json.pipeline) else {
return Ok(());
};

Expand Down Expand Up @@ -312,7 +312,7 @@ impl TurboMigrator {
});
}

if let Some(output_mode) = &turbo_task.output_mode {
if let Some(output_mode) = &turbo_task.output_logs.or_else(|| turbo_task.output_mode) {
let output_style = match output_mode {
TurboOutputMode::HashOnly => Some(TaskOutputStyle::Hash),
TurboOutputMode::NewOnly => Some(TaskOutputStyle::Buffer),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"tasks": {
"client#build": {
"dependsOn": ["^build"]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test": {
"dependsOn": ["build"],
"inputs": ["src/**/*.tsx", "src/**/*.ts", "test/**/*.ts"],
"outputMode": "full"
"outputLogs": "full"
},
"dev": {
"cache": false,
Expand Down
2 changes: 1 addition & 1 deletion crates/unpack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pre-release-replacements = [
moon_extension_common = { path = "../common" }
extism-pdk = { workspace = true }
moon_pdk = { workspace = true }
starbase_archive = { version = "0.6.0", default-features = false, features = [
starbase_archive = { version = "0.7.3", default-features = false, features = [
"tar-gz",
"zip",
] }
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
profile = "default"
channel = "1.77.0"
channel = "1.78.0"

0 comments on commit ba9b7f5

Please sign in to comment.