Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Commit

Permalink
deps: Audit 03/26 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj authored Mar 26, 2024
1 parent 33f167e commit 5bdcfe8
Show file tree
Hide file tree
Showing 9 changed files with 221 additions and 192 deletions.
336 changes: 178 additions & 158 deletions Cargo.lock

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ members = ["crates/*"]

[workspace.dependencies]
extism-pdk = "1.1.0"
moon_common = "0.0.3"
moon_config = "0.0.4"
moon_pdk = "0.0.4"
moon_pdk_test_utils = "0.0.5"
moon_target = "0.0.2"
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"
rustc-hash = "1.1.0"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0.114"
serde_yaml = "0.9.32"
starbase_utils = { version = "0.5.0", default-features = false }
starbase_sandbox = "0.4.0"
serde_json = "1.0.115"
serde_yaml = "0.9.33"
starbase_utils = { version = "0.6.1", default-features = false }
starbase_sandbox = "0.5.0"

# moon_common = { path = "../moon/nextgen/common" }
# moon_config = { path = "../moon/nextgen/config" }
Expand Down
4 changes: 3 additions & 1 deletion crates/common/src/migrator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,7 @@ impl Migrator {
}

pub fn create_id<T: AsRef<str>>(id: T) -> AnyResult<Id> {
Ok(Id::clean(id.as_ref().replace(':', "."))?)
Ok(Id::clean(
id.as_ref().replace(':', ".").trim_start_matches('@'),
)?)
}
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

#### 🐞 Fixes

- Fixed invalid IDs when converting `package.json` names.

## 0.0.2

#### 🚀 Updates
Expand Down
39 changes: 21 additions & 18 deletions crates/migrate-nx/src/nx_migrator.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::nx_json::*;
use crate::nx_project_json::*;
use moon_common::Id;
use moon_config::FilePath;
use moon_config::PortablePath;
use moon_config::TaskOptionEnvFile;
Expand Down Expand Up @@ -43,17 +44,17 @@ impl NxMigrator {

if !file_groups.contains_key("default") {
file_groups.insert(
"default".into(),
Id::raw("default"),
vec![InputPath::ProjectGlob("**/*".into())],
);
}

if !file_groups.contains_key("production") {
file_groups.insert("production".into(), vec![]);
file_groups.insert(Id::raw("production"), vec![]);
}

if !file_groups.contains_key("sharedGlobals") {
file_groups.insert("sharedGlobals".into(), vec![]);
file_groups.insert(Id::raw("sharedGlobals"), vec![]);
}
}

Expand Down Expand Up @@ -381,9 +382,10 @@ fn inject_args_into_task(nx_target: &NxTargetOptions, config: &mut PartialTaskCo

// https://nx.dev/nx-api/nx/executors/noop
fn migrate_noop_task(nx_target: &NxTargetOptions) -> AnyResult<PartialTaskConfig> {
let mut config = PartialTaskConfig::default();

config.command = Some(PartialTaskArgs::String("noop".into()));
let mut config = PartialTaskConfig {
command: Some(PartialTaskArgs::String("noop".into())),
..PartialTaskConfig::default()
};

inject_args_into_task(nx_target, &mut config);

Expand All @@ -392,9 +394,10 @@ fn migrate_noop_task(nx_target: &NxTargetOptions) -> AnyResult<PartialTaskConfig

// https://nx.dev/nx-api/nx/executors/run-commands
fn migrate_run_commands_task(nx_target: &NxTargetOptions) -> AnyResult<PartialTaskConfig> {
let mut config = PartialTaskConfig::default();

config.platform = Some(PlatformType::System);
let mut config = PartialTaskConfig {
platform: Some(PlatformType::System),
..PartialTaskConfig::default()
};

// https://nx.dev/nx-api/nx/executors/run-commands#options
if let Some(options) = &nx_target.options {
Expand Down Expand Up @@ -483,16 +486,16 @@ fn migrate_task(
package = &package[index + 1..];
}

let mut config = PartialTaskConfig::default();

config.command = Some(PartialTaskArgs::String(if package == target {
target.to_owned()
} else {
format!("{package} {target}")
}));

inject_args = true;
config

PartialTaskConfig {
command: Some(PartialTaskArgs::String(if package == target {
target.to_owned()
} else {
format!("{package} {target}")
})),
..PartialTaskConfig::default()
}
}
} else {
let mut config = PartialTaskConfig::default();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ fileGroups:
- '**/*'
- '!**/*'
- /**/*
- /!**/*
- '!/**/*'
- ./src/file.ts
- ./src/file.*
- ./src
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ fileGroups:
- '**/*'
- '!**/*'
- /**/*
- /!**/*
- '!/**/*'
- ./src/file.ts
- ./src/file.*
- ./src
language: javascript
platform: node
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.5.0", default-features = false, features = [
starbase_archive = { version = "0.6.0", 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.76.0"
channel = "1.77.0"

0 comments on commit 5bdcfe8

Please sign in to comment.