Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: rust client generation (initial implementation) #56

Merged
merged 114 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
c07b007
setup rust project
joshmossas Feb 3, 2024
9ffabfd
rename crate
joshmossas Feb 3, 2024
99d9c0f
blah
joshmossas Feb 7, 2024
373fea6
additional experiments
joshmossas Feb 7, 2024
c89f171
messing with rust client
joshmossas Feb 12, 2024
3bbe071
Merge branch 'master' into rust-experiments
joshmossas Feb 13, 2024
a447728
clean up dependencies
joshmossas Feb 13, 2024
01588c6
blah
joshmossas Feb 13, 2024
45c5990
starting to create a rust client reference
joshmossas Feb 17, 2024
de208b0
further progress on rust-client-reference
joshmossas Feb 17, 2024
219709c
Merge branch 'master' into rust-experiments
joshmossas Feb 19, 2024
21b5310
test rust client finished minus streaming
joshmossas Feb 19, 2024
03789aa
sse experiments
joshmossas Feb 19, 2024
c62342b
alsdkfjsa
joshmossas Feb 20, 2024
1db9b42
blarg
joshmossas Feb 20, 2024
ff8ae34
Merge branch 'master' into rust-experiments
joshmossas Feb 23, 2024
fb2ba12
further rust progress
joshmossas Mar 4, 2024
1638543
Merge branch 'master' into rust-experiments
joshmossas Mar 4, 2024
0d7fb62
further rust progress
joshmossas Mar 4, 2024
16e80e7
Merge branch 'master' into rust-experiments
joshmossas Mar 6, 2024
a708dd8
rust client progress
joshmossas Mar 10, 2024
0bf03b8
Merge branch 'master' into rust-experiments
joshmossas Mar 10, 2024
4490ba9
get rust formatting to work
joshmossas Mar 10, 2024
853694f
further codegen progress
joshmossas Mar 11, 2024
f791665
asdf
joshmossas Mar 11, 2024
cf65c51
further rust progress
joshmossas Mar 11, 2024
7aef6fe
get all basic type generation finished
joshmossas Mar 12, 2024
cb446cf
further progress
joshmossas Mar 12, 2024
b2963e0
fixing hashmap issues
joshmossas Mar 12, 2024
d70b1d6
asdf
joshmossas Mar 12, 2024
697bf47
further progress
joshmossas Mar 12, 2024
7de3f8a
start working on records
joshmossas Mar 12, 2024
cfd8cf7
further record progress
joshmossas Mar 12, 2024
282f0ac
Merge branch 'master' of https://github.com/modiimedia/arri into rust…
joshmossas Mar 13, 2024
56f4cb4
Merge branch 'master' into rust-experiments
joshmossas Mar 21, 2024
030a335
start rust recursive support
joshmossas Mar 22, 2024
15ec499
recursive object example
joshmossas Mar 22, 2024
a7f58be
rust recursive type progress
joshmossas Mar 22, 2024
02c65e6
pub get
joshmossas Mar 22, 2024
79e2544
ref fixes and other codegen fixes
joshmossas Mar 22, 2024
a6c698e
recursive discriminator reference
joshmossas Mar 22, 2024
5be8f72
finish initial recursive implementation
joshmossas Mar 22, 2024
0899df2
fix recursion issues
joshmossas Mar 22, 2024
927abcc
blah
joshmossas Mar 22, 2024
2d4e761
rename arri request error to arri error
joshmossas Mar 24, 2024
2c712b2
fix test issues
joshmossas Mar 24, 2024
3aabcfb
setting up rust service generation
joshmossas Mar 24, 2024
49ebf8d
Merge branch 'master' into rust-experiments
joshmossas Mar 28, 2024
b9a33e0
Merge branch 'master' into rust-experiments
joshmossas Apr 18, 2024
14107fd
fix generation step
joshmossas Apr 18, 2024
63add3d
Merge branch 'master' into rust-experiments
joshmossas Apr 20, 2024
963047c
asdfas
joshmossas Apr 20, 2024
ffbcfa9
Merge branch 'master' into rust-experiments
joshmossas May 1, 2024
233e8f1
Merge branch 'master' into rust-experiments
joshmossas May 14, 2024
4c54e53
move to new folder structure
joshmossas May 14, 2024
02199d4
Merge branch 'master' into rust-experiments
joshmossas May 14, 2024
de19158
Merge branch 'master' into feature/rust-codegen
joshmossas May 17, 2024
73c3294
cargo build
joshmossas May 17, 2024
8382094
rewrite rust codegen reference
joshmossas May 17, 2024
06fce2c
further rust progress
joshmossas May 18, 2024
dbe7590
finished ObjectWithOptionalFields (tests failing)
joshmossas May 19, 2024
3ac13ab
fix failed test
joshmossas May 19, 2024
9ec1d2d
remove unneeded imports
joshmossas May 19, 2024
bc61784
progress
joshmossas May 19, 2024
eceb4e3
lint rules + start over on rust codegen
joshmossas May 20, 2024
b459176
Merge branch 'master' into feature/rust-codegen
joshmossas May 20, 2024
a2fec9a
start working out rust stuff
joshmossas May 20, 2024
063bf08
start adding templates for recursive types
joshmossas May 20, 2024
2135c93
setup reference for recursive objects
joshmossas May 20, 2024
dc14194
asdf
joshmossas May 20, 2024
fa5e368
Merge branch 'master' into feature/rust-codegen
joshmossas May 20, 2024
6801b0a
Merge branch 'master' into feature/rust-codegen
joshmossas May 21, 2024
e400de9
add f64 and i8 to generation
joshmossas May 21, 2024
ba6876c
start working on object generation
joshmossas May 21, 2024
3c62755
further rust progress (enums, and arrays)
joshmossas May 22, 2024
2cb34a1
set up refs
joshmossas May 24, 2024
c0c54cb
Merge branch 'master' into feature/rust-codegen
joshmossas May 28, 2024
d3d32c4
Merge branch 'master' into feature/rust-codegen
joshmossas May 28, 2024
568d5c1
Merge branch 'master' into feature/rust-codegen
joshmossas May 28, 2024
624e78b
fix build err
joshmossas May 28, 2024
cdf1770
blah
joshmossas May 28, 2024
9a376b6
prefix arri commands with pnpm
joshmossas May 28, 2024
a52c74d
another attempt
joshmossas May 28, 2024
3afee75
make tests not run on drafts
joshmossas May 28, 2024
74e9ee0
Merge branch 'master' into feature/rust-codegen
joshmossas Jun 5, 2024
237a1ff
remove serve
joshmossas Jun 5, 2024
9e87924
move parenthesis to correct place
joshmossas Jun 5, 2024
9c395dd
fix import
joshmossas Jun 5, 2024
46502c2
Merge branch 'master' into feature/rust-codegen
joshmossas Jun 12, 2024
eaef3e3
asdf
joshmossas Jun 12, 2024
ab0bb9a
fix build errors
joshmossas Jun 12, 2024
580d3da
remove rust-codegen
joshmossas Jun 12, 2024
13b0639
Merge branch 'master' into feature/rust-codegen
joshmossas Jun 14, 2024
febd724
fix toJson output issue
joshmossas Jun 14, 2024
b35c0c2
Merge branch 'master' into feature/rust-codegen
joshmossas Jun 17, 2024
82a61fb
update
joshmossas Jun 17, 2024
1cf1908
getting output to better match example_client.rs
joshmossas Jun 17, 2024
66ca4c7
start working out discriminator generation
joshmossas Jun 18, 2024
f46f313
Merge branch 'master' into feature/rust-codegen
joshmossas Jun 18, 2024
5e2cc46
further progress on discriminator
joshmossas Jun 18, 2024
a4f86d2
get type generation working
joshmossas Jun 18, 2024
764d574
start setting up functions
joshmossas Jun 18, 2024
27fbcfc
start setting up see stuff
joshmossas Jun 18, 2024
dad2cd8
get http rpcs working
joshmossas Jun 18, 2024
761a34a
finish codegen for http rpcs
joshmossas Jun 18, 2024
9baba2e
cleanup codegen output
joshmossas Jun 18, 2024
8ec8b19
finish rust simple http implementation
joshmossas Jun 18, 2024
9090318
setup github actions for rust
joshmossas Jun 18, 2024
4f79a34
add rust to version sync script
joshmossas Jun 18, 2024
a4f2ac5
remove extra keywords
joshmossas Jun 18, 2024
a93ae5c
add rust client to publish-all script
joshmossas Jun 18, 2024
6a8f4a6
remove @nx/eslint reference
joshmossas Jun 18, 2024
30daef8
fix linting error
joshmossas Jun 18, 2024
52f8a1e
add "setup gradle step"
joshmossas Jun 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
fetch-depth: 0
- name: Install Dart
uses: dart-lang/setup-dart@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
Expand Down Expand Up @@ -78,6 +82,10 @@ jobs:
fetch-depth: 0
- name: Install Dart
uses: dart-lang/setup-dart@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ dist
tmp
/out-tsc
**/.output
**/target

# dependencies
node_modules
Expand Down
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"mathiasfrohlich.kotlin",
"dart-code.dart-code",
"dart-code.flutter",
"dart-code.dart-code"
"rust-lang.rust-analyzer",
"tamasfe.even-better-toml"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Arri",
"arrirpc",
"autoroutes",
"chrono",
"citty",
"codegen",
"Consola",
Expand All @@ -32,6 +33,7 @@
"nitropack",
"ofetch",
"pathe",
"reqwest",
"postversion",
"pubspec",
"scule",
Expand All @@ -43,6 +45,14 @@
"vals",
"websockets"
],
"rust-analyzer.linkedProjects": [
"languages/rust/rust-client/Cargo.toml",
"languages/rust/rust-codegen-reference/Cargo.toml",
"tests/clients/rust/Cargo.toml"
],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer"
},
"eslint.validate": ["json"],
"java.compile.nullAnalysis.mode": "automatic",
"eslint.experimental.useFlatConfig": true
Expand Down
2 changes: 1 addition & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ignoreFiles = [
"**/**/dist/*.d.ts",
"**/*.dart",
"**/*.kt",
"**/*.rust",
"**/*.rs",
"**/*.zig",
"**/*.swift",
"**/*.go",
Expand Down
3 changes: 3 additions & 0 deletions internal/scripts/publish-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ pnpm publish -r --otp $otp

echo "\n\nPublishing Dart client..."
pnpm nx publish dart-client

echo "\n\nPublishing Rust client..."
pnpm nx publish rust-client
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();
Loading
Loading