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

Refactor client-react-hooks and the examples-nextjs to use the grpc client #34

Merged
merged 28 commits into from
Nov 11, 2024

Conversation

tim-hm
Copy link
Collaborator

@tim-hm tim-hm commented Nov 8, 2024

No description provided.

…ix esbuild

Pnpm workspaces facilitates proper tsc resolution because it makes workspace peers available in node_modules. If the exact same value is also in `tsconfig.json` then esbuild considers the dependency part of the package and includes it in the build causing downstream issues.
… web with a single bundle

Provided consuming environments support top level await, this is the simplest approach to supporting node and web standards with a single bundle. This expects the default `wasm-pack` target is used (eg `wasm-pack --target bundle`) and then one must manually edit index.js to arrive at:

```ts
import { __wbg_set_wasm } from "./index_bg.js";
const wasm = await import('./index_bg.wasm');
__wbg_set_wasm(wasm);
export * from "./index_bg.js";
```
When there were 5+ packages it made sense to consolidate the esbuild logic but this is no longer the case and so this helps reduce complexity.
…ntiation

Given that permissions will always be default or set explicitly, this instantiates the builder with the default set to avoid situations where permissions hasn't been explicitly set.
…Status>`

This is so `queryPoolStatus` follows the same structure as the other methods on VmClient.
Replaced by `examples-nextjs`.
Although `#/...` was concise it broke typechecking in the hooks project and I'm unsure how to fix it. So, reverting to the approach were we use the package name directly.
@tim-hm tim-hm force-pushed the timhm/feat-react-hooks-to-grpc-client branch from 008591e to 5f10c71 Compare November 8, 2024 16:59
Copy link

github-actions bot commented Nov 11, 2024

Coverage Report for ./client-vms

Status Category Percentage Covered / Total
🔵 Lines 87.03% 2047 / 2352
🔵 Statements 87.03% 2047 / 2352
🔵 Functions 80.45% 210 / 261
🔵 Branches 93.54% 362 / 387
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
client-vms/esbuild.config.mjs 0% 0% 0% 0% 1-25
client-vms/src/auth.ts 98.78% 93.33% 100% 98.78% 92
client-vms/src/index.ts 0% 0% 0% 0% 1
client-vms/src/logger.ts 75% 50% 100% 75% 9-12
client-vms/src/util.ts 92.59% 88.88% 100% 92.59% 28-29
client-vms/src/payment/builder.ts 96.15% 80% 100% 96.15% 52-53
client-vms/src/payment/client.ts 100% 100% 100% 100%
client-vms/src/payment/grpc-compat.ts 94.28% 100% 66.66% 94.28% 46-47
client-vms/src/payment/index.ts 100% 100% 100% 100%
client-vms/src/types/compute-permission-command.ts 42.46% 100% 55.55% 42.46% 19-22, 25-28, 46-56, 59-68, 71-75, 87-95
client-vms/src/types/index.ts 100% 100% 100% 100%
client-vms/src/types/permission-command.ts 61.11% 87.5% 66.66% 61.11% 22-26, 41-48, 52-55, 61-65
client-vms/src/types/types.ts 100% 100% 100% 100%
client-vms/src/types/user-id.ts 84% 85.71% 100% 84% 12-15
client-vms/src/types/values-permissions.ts 55.76% 93.33% 35.71% 55.76% 46-47, 63-66, 74-79, 82-84, 87-89, 92-94, 97-99, 102-106, 109-115, 118-127, 140-141
client-vms/src/vm/builder.ts 89.14% 78.94% 88.88% 89.14% 54-56, 118-120, 122-127, 136-137
client-vms/src/vm/client.ts 100% 100% 100% 100%
client-vms/src/vm/index.ts 100% 100% 100% 100%
client-vms/src/vm/operation/delete-values.ts 98.68% 100% 92.3% 98.68% 53
client-vms/src/vm/operation/index.ts 100% 100% 100% 100%
client-vms/src/vm/operation/invoke-compute.ts 93.46% 96.66% 88.23% 93.46% 75, 109-114, 187-189
client-vms/src/vm/operation/overwrite-permissions.ts 99.06% 100% 92.85% 99.06% 60
client-vms/src/vm/operation/query-pool-status.ts 98.64% 100% 91.66% 98.64% 58
client-vms/src/vm/operation/retrieve-compute-result.ts 94.94% 92.59% 92.3% 94.94% 64, 98-101
client-vms/src/vm/operation/retrieve-permissions.ts 98.96% 100% 92.85% 98.96% 59
client-vms/src/vm/operation/retrieve-values.ts 99.06% 100% 92.85% 99.06% 64
client-vms/src/vm/operation/retry-client.ts 77.96% 77.77% 100% 77.96% 21-32, 51-52
client-vms/src/vm/operation/store-program.ts 97.43% 100% 86.66% 97.43% 49-50, 71
client-vms/src/vm/operation/store-values.ts 93.61% 96.42% 87.5% 93.61% 92-97, 182-184
client-vms/src/vm/operation/update-permissions.ts 75.72% 100% 50% 75.72% 73, 176-178, 181-183, 186-188, 191-193, 196-198, 201-203, 206-208, 211-213, 216-218, 226-228, 231-233, 236-243
Generated in workflow #38 for commit 418ab56 by the Vitest Coverage Report Action

@tim-hm tim-hm force-pushed the timhm/feat-react-hooks-to-grpc-client branch from 3735528 to 58f327e Compare November 11, 2024 14:38
@tim-hm tim-hm merged commit 6d94db4 into main Nov 11, 2024
2 checks passed
@tim-hm tim-hm deleted the timhm/feat-react-hooks-to-grpc-client branch November 11, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant