Skip to content

Commit

Permalink
refactor: use new public api (#80)
Browse files Browse the repository at this point in the history
* refactor: use new public api

* chore: generate bindings for production
  • Loading branch information
hougesen authored Nov 12, 2024
1 parent 7d7777b commit 81bde05
Show file tree
Hide file tree
Showing 76 changed files with 204 additions and 3,742 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
#### [Unreleased](https://github.com/i18nhero/cli/compare/v0.0.1...HEAD)

- chore: bump package version to v0.0.2-dev [`#79`](https://github.com/i18nhero/cli/pull/79)
- refactor: use new public api [`05d1afd`](https://github.com/i18nhero/cli/commit/05d1afda229797809f05eaac8cfb97810ec53413)

#### [v0.0.1](https://github.com/i18nhero/cli/compare/v0.0.0...v0.0.1)

Expand Down
32 changes: 10 additions & 22 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,34 +40,22 @@ test-coverage:
changelog:
npx auto-changelog -u

generate-web-api:
rm -rf web_api
npx @openapitools/openapi-generator-cli generate -g rust -o web_api -i https://web.api.i18nhero.com/docs-json --global-property=modelDocs=false,apiDocs=false
find ./web_api -type f -exec sed -i 's/crate::/crate::codegen::web_api::/g' {} \;
mkdir -p packages/i18nhero/src/codegen/web_api
rm -rf packages/i18nhero/src/codegen/web_api
mv web_api/src/lib.rs web_api/src/mod.rs
mv web_api/src packages/i18nhero/src/codegen/web_api
rm -rf web_api
cargo fmt

update-help:
cargo run -p i18nhero-codegen

generate-cli-api:
rm -rf cli_api
npx @openapitools/openapi-generator-cli generate -g rust -o cli_api -i https://cli.api.i18nhero.com/spec --global-property=modelDocs=false,apiDocs=false
find ./cli_api -type f -exec sed -i 's/crate::/crate::codegen::cli_api::/g' {} \;
mkdir -p packages/i18nhero/src/codegen/cli_api
rm -rf packages/i18nhero/src/codegen/cli_api
mv cli_api/src/lib.rs cli_api/src/mod.rs
mv cli_api/src packages/i18nhero/src/codegen/cli_api
rm -rf cli_api
generate-api-bindings:
rm -rf public_api
npx @openapitools/openapi-generator-cli generate -g rust -o public_api -i https://api.i18nhero.com/docs-json --global-property=modelDocs=false,apiDocs=false
find ./public_api -type f -exec sed -i 's/crate::/crate::codegen::public_api::/g' {} \;
mkdir -p packages/i18nhero/src/codegen/public_api
rm -rf packages/i18nhero/src/codegen/public_api
mv public_api/src/lib.rs public_api/src/mod.rs
mv public_api/src packages/i18nhero/src/codegen/public_api
rm -rf public_api
cargo fmt

precommit:
just generate-cli-api
just generate-web-api
just generate-api-bindings
just changelog
cargo clean
just dist
Expand Down
2 changes: 1 addition & 1 deletion mdsf.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://raw.githubusercontent.com/hougesen/mdsf/main/schemas/v0.2.7/mdsf.schema.json",
"$schema": "https://raw.githubusercontent.com/hougesen/mdsf/main/schemas/v0.3.0/mdsf.schema.json",
"languages": {
"bash": "shfmt",
"fish": "fish_indent",
Expand Down
48 changes: 0 additions & 48 deletions packages/i18nhero/src/codegen/cli_api/apis/configuration.rs

This file was deleted.

130 changes: 0 additions & 130 deletions packages/i18nhero/src/codegen/cli_api/apis/default_api.rs

This file was deleted.

24 changes: 0 additions & 24 deletions packages/i18nhero/src/codegen/cli_api/models/database_error.rs

This file was deleted.

24 changes: 0 additions & 24 deletions packages/i18nhero/src/codegen/cli_api/models/forbidden_error.rs

This file was deleted.

10 changes: 0 additions & 10 deletions packages/i18nhero/src/codegen/cli_api/models/mod.rs

This file was deleted.

26 changes: 0 additions & 26 deletions packages/i18nhero/src/codegen/cli_api/models/organization.rs

This file was deleted.

This file was deleted.

26 changes: 0 additions & 26 deletions packages/i18nhero/src/codegen/cli_api/models/project.rs

This file was deleted.

Loading

0 comments on commit 81bde05

Please sign in to comment.