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

lexicon CLI HOWTO when updating packages #55

Open
justin opened this issue Jul 16, 2023 · 1 comment
Open

lexicon CLI HOWTO when updating packages #55

justin opened this issue Jul 16, 2023 · 1 comment

Comments

@justin
Copy link

justin commented Jul 16, 2023

I tried updating my fork to use the latest version of the @atproto packages, but there are lexicon changes that seem to be required (and fixed). I'm fine fixing them on my own, but I'm not 100% sure how to use the @atproto/lex-cli package to update the src/lexicon directory properly.

Could someone explain it? Happy to update the README as a PR afterwards.

@stacygrace
Copy link

I just ran into this issue myself. Here's what I've done to get things working after updating all @atproto packages to their latest versions. Note: I also indulged in some hubris and upgraded yarn to 3.6.1 using the 'node-modules' nodeLinker which added some complexity so you may not need to do it exactly like I did when it comes to how you reference the lex-cli commands.

Clone the https://github.com/bluesky-social/atproto repo and run yarn install.

The lex-cli is now available at ./node_modules/.bin/lex

Run ./node_modules/.bin/lex gen-server ./output lexicons/**/*.json. The first argument to lex gen-server is just the directory you want to spit the resulting files out to and I just called it output arbitrarily. Could be wherever you want.

You'll be prompted with a list of the files to be generated and asked if you want to continue. Hit y, then enter. It will think for a second and then declare API generated.

In your output folder, or whatever you named it, you'll find a directory called types, and three files: index.ts, lexicons.ts, and util.ts. Copy all of these and then go to your feed-generator repo.

Delete the contents of the src/lexicon directory, then paste in the files you just generated.

Run yarn start and you should have the firehose streaming in your console.

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

No branches or pull requests

2 participants