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

cosmic-proto export patterns #9310

Merged
merged 2 commits into from
May 2, 2024
Merged

cosmic-proto export patterns #9310

merged 2 commits into from
May 2, 2024

Conversation

turadg
Copy link
Member

@turadg turadg commented May 1, 2024

refs: #9307

Description

Simplify codegen exports using exports subpath patterns

Reviewers,

  • should the exported path have .js?
  • should Agoric exports be under agoric like the others?

Security Considerations

Scaling Considerations

Documentation Considerations

Testing Considerations

Upgrade Considerations

Copy link

cloudflare-workers-and-pages bot commented May 1, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c3b233
Status: ✅  Deploy successful!
Preview URL: https://e36524de.agoric-sdk.pages.dev
Branch Preview URL: https://ta-proto-wildcard.agoric-sdk.pages.dev

View logs

0xpatrickdev
0xpatrickdev previously approved these changes May 1, 2024
@0xpatrickdev
Copy link
Member

@turadg 🎉 LGTM - i am going to apply a small patch as I'd like to depend on this.

--- a/packages/cosmic-proto/test/test-vatsafe.js
+++ b/packages/cosmic-proto/test/test-vatsafe.js
@@ -3,7 +3,7 @@
 import test from '@endo/ses-ava/prepare-endo.js';
 import { cosmos } from '@agoric/cosmic-proto';

-import { MsgDelegate } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx';
+import { MsgDelegate } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';

 // @ts-expect-error
 cosmos.staking.v1beta1.MsgDelegate.missing;
--- a/packages/boot/test/bootstrapTests/test-vat-orchestration.ts
+++ b/packages/boot/test/bootstrapTests/test-vat-orchestration.ts
@@ -6,7 +6,7 @@ import {
  MsgDelegate,
  MsgDelegateResponse,
} from '@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js';
-import { Any } from '@agoric/cosmic-proto/google/protobuf/any';
+import { Any } from '@agoric/cosmic-proto/google/protobuf/any.js';
import type { ChainAccount, OrchestrationService } from '@agoric/orchestration';
import { decodeBase64 } from '@endo/base64';
import { M, matches } from '@endo/patterns';

@0xpatrickdev 0xpatrickdev added the automerge:squash Automatically squash merge label May 1, 2024
@turadg turadg added automerge:rebase Automatically rebase updates, then merge and removed automerge:squash Automatically squash merge labels May 1, 2024
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To answer your posed questions, yes, please also export dist/codegen/agoric as /agoric/* (but do not yet remove the lifted swingset, vstorage, etc), and yes, please use the .js suffix on the exports.

packages/cosmic-proto/package.json Show resolved Hide resolved
@@ -24,21 +24,17 @@
"default": "./dist/vatsafe.js"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should ./vatsafe get the same treatment?

"./vatsafe/*.js": {
  "types": "./dist/codegen/vatsafe/*.d.ts",
  "default": "./dist/codegen/vatsafe/*.js"
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's meant to be one module

@michaelfig michaelfig removed the automerge:rebase Automatically rebase updates, then merge label May 2, 2024
@michaelfig
Copy link
Member

I approved, but removed the automerge:rebase so that you get a chance to address comments before putting this PR back on the merge train.

Copy link
Member

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the issue and work-around for the current Endo bundler limitation, and thanks for documenting in package.json.md. That could be A Thing™.

@turadg turadg added the automerge:rebase Automatically rebase updates, then merge label May 2, 2024
@mergify mergify bot merged commit 2347e82 into master May 2, 2024
75 checks passed
@mergify mergify bot deleted the ta/proto-wildcard branch May 2, 2024 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants