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

Tooling refactor + @ucans/core integration #152

Merged
merged 19 commits into from
Jul 8, 2022
Merged

Tooling refactor + @ucans/core integration #152

merged 19 commits into from
Jul 8, 2022

Conversation

dholms
Copy link
Collaborator

@dholms dholms commented Jul 8, 2022

Please forgive this monstrosity of a PR 👹

As I was pulling ucans core in, I was running into tooling issues & decided to revamp everything.

Whole new monorepo setup + build tools + testing tools.

Alrighty things that happened:

  • switched out tsc builds for esbuild this bundles everything as one package and will be significantly better in web. esbuild is fast, handles both cjs and esm, and can output as cjs/esm/umd.
  • switched out Ava for Jest. Jest gives more in-depth feedback and has better TS integration so doesn't freak out on a tsc error
  • switched out module types to cjs. This was necessary for Jest. ESM is a lot newer and has some rough edges that were causing headaches. also after beating my head against an ESM module this last week, I think we should try not to subject developers that our using our tools to that until the ecosystem is moer mature
  • switched out react-scripts for Vite. This is faster, runs on esbuild, more easily configurable, etc
  • moved most of the config to the root: eslint, prettier, etc. I also moved the root jest config to the root as well as the root tsconfig. each module imports & extends the jest config + tsconfig
  • used a composite tsconfig with references to each package in it. This means that packages directly reference the typescript code of the packages that they rely on. So for instance @adxp/auth directly builds in the src/*.ts of @adxp/crypto instead of building in the already compiled dist/*.js. Better bundling & no more building submodules and restarting your TS server!
  • added in Lerna which helps with monorepo management. More shared dependencies, and build tools for buliding the entire repo. Now when a user downloads the repo and runs yarn in root, it installs all dependencies & builds all packages.
  • This PR also includes the initial work that was being down before i launched into the land of sleeky smooth yaks: it integrates an alpha version of the new @ucans/core library. We don't rely on any of the crypto from the original library right now, only the crypto we bring ourselves. It's totally pluggable so we can add in did resolution methods or new crypto at will. I also only pull this library into @adxp/crypto and @adxp/auth and then build + export abstractions around it. All of our auth semantics are directly in the auth library so developers don't have to worry about them or understand them. This keeps downstream developers from having to mess with the nitty gritty of UCANs which can be overwhelming at first.

@dholms dholms requested a review from pfrazee July 8, 2022 16:20
@dholms dholms changed the base branch from main to dev July 8, 2022 16:20
@pfrazee
Copy link
Collaborator

pfrazee commented Jul 8, 2022

Superb work. This is going to save us a lot of work in the long-run. Well done!

@pfrazee pfrazee merged commit a11c175 into dev Jul 8, 2022
@pfrazee pfrazee deleted the tooling branch July 8, 2022 16:41
@dholms dholms mentioned this pull request Aug 17, 2022
mloar pushed a commit to mloar/atproto that referenced this pull request Nov 15, 2023
* revamp crypto lib

* reworkign ucan capabilities

* fixing up auth lib

* migrating to monorepo

* got jest working with esm

* tests & fixed CID parsing

* common tests up to date

* ported did-sdk

* cli + did:web hanging fix

* ported server

* poted example app

* working on server build

* server build working

* integrating dev-env

* patched up frontend scripts

* patching up cli & dev env build script

* docs & readme

* fixing up package.jsons

* wiped out unneeded dev deps
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.

None yet

2 participants