Skip to content

Conversation

@shuuji3
Copy link
Collaborator

@shuuji3 shuuji3 commented Jan 19, 2025

When cloning this repository for the first time, @tsky/client's type-checking fails due to a lack of type definitions of @tsky/lexicons. This is because there is no dist/index.d.ts (exported by @tsky/lexicons) in a clean repository.

This PR ensures the existence of those files by running pnpm build when we run pnpm install for the first time.

Initial installation

$ git clone https://github.com/tsky-dev/tsky && cd tsky/
$ pnpm run --filter @tsky/client test:typescript

> @tsky/client@0.0.1 test:typescript /tmp/tsky/packages/client
> tsc --noEmit

src/bsky/feed.ts:4:8 - error TS2307: Cannot find module '@tsky/lexicons' or its corresponding type declarations.

4 } from '@tsky/lexicons';
         ~~~~~~~~~~~~~~~~

src/bsky/index.ts:1:39 - error TS2307: Cannot find module '@tsky/lexicons' or its corresponding type declarations.

1 import type { AppBskyActorDefs } from '@tsky/lexicons';
                                        ~~~~~~~~~~~~~~~~

src/tsky/client.ts:7:42 - error TS2307: Cannot find module '@tsky/lexicons' or its corresponding type declarations.

7 import type { Procedures, Queries } from '@tsky/lexicons';
                                           ~~~~~~~~~~~~~~~~

src/tsky/tsky.ts:3:30 - error TS2307: Cannot find module '@tsky/lexicons' or its corresponding type declarations.

3 import type { Queries } from '@tsky/lexicons';
                               ~~~~~~~~~~~~~~~~


Found 4 errors in 4 files.

Errors  Files
     1  src/bsky/feed.ts:4
     1  src/bsky/index.ts:1
     1  src/tsky/client.ts:7
     1  src/tsky/tsky.ts:3
/tmp/tsky/packages/client:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @tsky/client@0.0.1 test:typescript: `tsc --noEmit`
Exit status 2

After running build script

$ pnpm build

> tsky@0.1.0 build /tmp/tsky
> pnpm run -r build

Scope: 4 of 5 workspace projects
docs build$ vitepress build
│   vitepress v1.5.0
│ - building client + server bundles...
│ ✓ building client + server bundles...
│ - rendering pages...
│ ✓ rendering pages...
│ build complete in 1.98s.
└─ Done in 2.1s
packages/lex-cli build$ tsc
└─ Done in 1.5s
packages/lexicons build$ tsx ./scripts/generate-types.ts && tsc
│ Getting latest lexicon commit...
│ Downloading lexicons from atproto...
│ Building lex-cli...
│ > @tsky/lex-cli@0.0.1 build /tmp/tsky/packages/lex-cli
│ > tsc
│ Running lex-cli to generate types...
│ Done! Types generated at /tmp/tsky/packages/lexicons/src/lib/lexicons.ts
└─ Done in 3.7s
packages/client build$ pkgroll
└─ Done in 639ms

$ pnpm run --filter @tsky/client test:typescript

> @tsky/client@0.0.1 test:typescript /tmp/tsky/packages/client
> tsc --noEmit

@netlify
Copy link

netlify bot commented Jan 19, 2025

Deploy Preview for tsky canceled.

Name Link
🔨 Latest commit 4222f09
🔍 Latest deploy log https://app.netlify.com/sites/tsky/deploys/678d23054120020008a6cc41

@patak-dev patak-dev merged commit 4389b45 into main Jan 19, 2025
6 checks passed
@patak-dev patak-dev deleted the shuuji3/build/ensure-clean-build branch January 19, 2025 16:51
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.

4 participants