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

chore: run pnpm run build before typedoc to avoid type errors #266

Merged
merged 1 commit into from
Dec 9, 2022

Conversation

yusefnapora
Copy link
Contributor

I noticed earlier today that running pnpm run docs fails with a bunch of typescript errors unless you run pnpm run build first.

This just updates the docs npm script to pnpm run build && typedoc --out docs, so we'll always have build output to make typedoc happy.

error output if you don't build first
packages/access-client/src/agent.js:12:24 - error TS2307: Cannot find module '@web3-storage/capabilities/space' or its corresponding type declarations.

12 import * as Space from '@web3-storage/capabilities/space'
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/access-client/src/agent.js:13:26 - error TS2307: Cannot find module '@web3-storage/capabilities/voucher' or its corresponding type declarations.

13 import * as Voucher from '@web3-storage/capabilities/voucher'
                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

packages/access-client/src/agent.js:260:65 - error TS2694: Namespace '"/home/yusef/work/repos/w3protocol/packages/access-client/src/types"' has no exported member 'Top'.

260     const del = /** @type {Ucanto.Delegation<[import('./types').Top]>} */ (
                                                                    ~~~

packages/access-client/src/agent.js:286:7 - error TS2322: Type '{ identity: Client.URI<"mailto:">; }' is not assignable to type 'undefined'.

286       nb: { identity: URI.from(`mailto:${email}`) },
          ~~

many more lines omitted...

@yusefnapora
Copy link
Contributor Author

BTW, I noticed that the reusable docs deploy workflow says that it's never been run, but looking at the CI config, it should get triggered whenever we release something that included a change to the capabilities or client packages.

I'm not sure if that's not working, or if we just haven't done any releases for those packages yet since setting up the CI workflows, but it may be worth double checking on the next release that those dependent workflows are getting run.

@gobengo
Copy link
Contributor

gobengo commented Dec 7, 2022

@yusefnapora When I recently created the @web3-storage/capabilities subpackage, I also noticed that the 'release' workflow didn't seem to run the 'docs' job.

(aside: I am beginning to think it should be considered an anti-pattern to chain much logic in gh actions off of a release-please job. anecdotally, it seems to lead to quite fragile workflows with little recourse if e.g. release-please isn't working due to rate limits etc)

@hugomrdias hugomrdias merged commit 77bd413 into main Dec 9, 2022
@hugomrdias hugomrdias deleted the fix/build-before-typedoc branch December 9, 2022 16:03
gobengo pushed a commit that referenced this pull request Apr 11, 2023
I noticed earlier today that running `pnpm run docs` fails with a bunch
of typescript errors unless you run `pnpm run build` first.

This just updates the `docs` npm script to `pnpm run build && typedoc
--out docs`, so we'll always have build output to make typedoc happy.
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.

3 participants