Skip to content

Commit

Permalink
feat!: build .d.ts instead of .ts
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg committed Nov 7, 2022
1 parent 3fb23e9 commit e9e44d2
Show file tree
Hide file tree
Showing 34 changed files with 5,697 additions and 10,548 deletions.
2 changes: 2 additions & 0 deletions packages/agoric-cli/src/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { stringToPath } from '@cosmjs/crypto';
import { Decimal } from '@cosmjs/math';
import { Bech32 } from '@cosmjs/encoding';

// @ts-expect-error ESM confusion
// eslint-disable-next-line import/no-unresolved -- doesn't understand "exports" field
import { MsgInstallBundle } from '@agoric/cosmic-proto/swingset/msgs.js';

// https://github.com/Agoric/agoric-sdk/blob/master/golang/cosmos/daemon/main.go
Expand Down
10 changes: 9 additions & 1 deletion packages/cosmic-proto/MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
We check-in and publish the `gen` generated artifacts to npm.
This package is updated rarely and so the build is checked into SCM. That is, the `dist` files and a copied subset to `swingset` so they can be imported in consumers that don't yet support ESM. At one time these were symlinks but [NPM won't publish symlinks](https://github.com/npm/npm/issues/3310).

To include `dist` files requires overriding the repo-wide .gitignore of `dist`:
```
git add -f dist/agoric dist/cosmos
```

We used to check in `gen` but they're redundant with `dist` and include `.ts` which creates problems for downstream consumers using TypeScript ([ref](https://github.com/microsoft/TypeScript/issues/47387#issuecomment-1168711813)).
To rebuild the generated artifacts, install `protoc` [1] and run `yarn rebuild` in
this package.

Expand Down Expand Up @@ -46,3 +53,4 @@ To surface additional stubs:
symbolic links for aliasing when necessary.

[1] http://google.github.io/proto-lens/installing-protoc.html

5 changes: 5 additions & 0 deletions packages/cosmic-proto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

This package exports JavaScript and TypeScript generated from Cosmic Swingset
Protobuf IDL so that clients can communicate with the Agoric chain.

Package exports are defined in `exports` and also made available in the
`swingset/` file path for backwards compatibility.

See also [MAINTAINERS.md](MAINTAINERS.md).
349 changes: 349 additions & 0 deletions packages/cosmic-proto/dist/agoric/swingset/msgs.d.ts

Large diffs are not rendered by default.

Loading

0 comments on commit e9e44d2

Please sign in to comment.