Skip to content

Commit

Permalink
add rust to version sync script
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmossas committed Jun 18, 2024
1 parent 9090318 commit 4f79a34
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 61 deletions.
26 changes: 24 additions & 2 deletions internal/scripts/version-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async function main() {
if (!version) {
throw Error("No version in package.json file");
}
// DART packages
const pubspecParts = readFileSync(
"languages/dart/dart-client/pubspec.yaml",
{ encoding: "utf-8" },
Expand All @@ -27,6 +28,7 @@ async function main() {
"languages/dart/dart-client/pubspec.yaml",
pubspecParts.join("\n"),
);
// PACKAGE JSONS
const childPackageJsons = await globby([
"languages/**/package.json",
"tooling/**/package.json",
Expand All @@ -47,9 +49,29 @@ async function main() {
);
});
await Promise.all(tasks);

// sync test clients
execSync("nx run-many -t pub -- get");
execSync("nx run-many -t pub -- get", {
stdio: "inherit",
});

// RUST client
const cargoTomlParts = readFileSync(
"languages/rust/rust-client/cargo.toml",
{ encoding: "utf-8" },
).split("\n");
for (let i = 0; i < cargoTomlParts.length; i++) {
const line = cargoTomlParts[i];
if (line?.startsWith("version = ")) {
cargoTomlParts[i] = `version = "${version}"`;
}
}
writeFileSync(
"languages/rust/rust-client/cargo.toml",
cargoTomlParts.join("\n"),
);
execSync(`nx run-many -t cargo -- check`, {
stdio: "inherit",
});
}

void main();
2 changes: 1 addition & 1 deletion languages/rust/rust-client/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion languages/rust/rust-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
[package]
name = "arri_client"
version = "0.1.0"
version = "0.51.2"
edition = "2021"
description = "Client library needed to use rust code generated by the [ARRI cli](https://github.com/modiimedia/arri)"
license = "MIT"
publish = true
homepage = "https://github.com/modiimedia/arri"
repository = "https://github.com/modiimedia/arri"
keywords = ["arrirpc", "arri", "http", "rpc", "sse", "json"]
categories = ["parsing", "web-programming::http-client"]
include = ["/src"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion languages/rust/rust-codegen-reference/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions languages/rust/rust-codegen-reference/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"implicitDependencies": ["rust-client"],
"targets": {
"cargo": {
"executor": "nx:run-commands",
"options": {
"command": "cargo",
"cwd": "languages/rust/rust-codegen-reference"
}
},
"test": {
"executor": "nx:run-commands",
"inputs": [
Expand Down
18 changes: 5 additions & 13 deletions languages/rust/rust-codegen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"name": "@arrirpc/codegen-rust",
"type": "module",
"license": "MIT",
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -17,14 +12,11 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"dependencies": {
"@arrirpc/codegen-utils": "workspace:*",
"pathe": "^1.1.2"
},
"devDependencies": {
"@arrirpc/schema": "workspace:*"
}
"devDependencies": { "@arrirpc/schema": "workspace:*" },
"version": "0.51.2"
}
17 changes: 4 additions & 13 deletions languages/ts/ts-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"license": "MIT",
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -27,7 +20,5 @@
"ofetch": "^1.3.4",
"ws": "^8.17.1"
},
"devDependencies": {
"@types/ws": "^8.5.10"
}
"devDependencies": { "@types/ws": "^8.5.10" }
}
2 changes: 1 addition & 1 deletion tests/clients/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions tests/clients/rust/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
"command": "cargo test -- --nocapture",
"cwd": "tests/clients/rust"
}
},
"cargo": {
"executor": "nx:run-commands",
"options": {
"command": "cargo",
"cwd": "tests/clients/rust"
}
}
}
}
21 changes: 5 additions & 16 deletions tooling/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,9 @@
"version": "0.51.2",
"type": "module",
"license": "MIT",
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bin": {
"arri": "./dist/cli.mjs"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bin": { "arri": "./dist/cli.mjs" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -21,9 +14,7 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"dependencies": {
"@arrirpc/codegen-dart": "workspace:*",
"@arrirpc/codegen-kotlin": "workspace:*",
Expand All @@ -46,7 +37,5 @@
"pathe": "^1.1.2",
"prettier": "^3.3.2"
},
"devDependencies": {
"@types/degit": "^2.8.6"
}
"devDependencies": { "@types/degit": "^2.8.6" }
}
17 changes: 4 additions & 13 deletions tooling/json-schema-to-jtd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
"name": "json-schema-to-jtd",
"version": "0.51.2",
"license": "MIT",
"author": {
"name": "joshmossas",
"url": "https://github.com/joshmossas"
},
"bugs": {
"url": "https://github.com/modiimedia/arri/issues"
},
"author": { "name": "joshmossas", "url": "https://github.com/joshmossas" },
"bugs": { "url": "https://github.com/modiimedia/arri/issues" },
"repository": {
"type": "git",
"url": "https://github.com/modiimedia/arri.git",
Expand All @@ -18,10 +13,6 @@
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"jtd-utils": "workspace:*"
}
"files": ["dist"],
"dependencies": { "jtd-utils": "workspace:*" }
}

0 comments on commit 4f79a34

Please sign in to comment.