Closed shanefontaine closed 7 months ago
Name | Link |
---|---|
Latest commit | 24ee9ef56e512c051f392d1ad712e796d507cedf |
Latest deploy log | https://app.netlify.com/sites/hop-sdk-docs/deploys/6615c171847a01000817db0a |
@miguelmota
typechain
explainer (19ae7757735affd33dfecaded24fad2aff3fd067) (8ddc2e0f2c089b68fb6fdc2d816f054d4e1a35c2)abi
in sdk
and sdk-core
to top-level, check into repo, and remove from build (a82e905e32cc190dfe1ff0ab3135a2f9abc3cb44)stream-browserify
from FE. It built just fine on my machine without it (5a10cf1571fca9e13362fc3a9018a962bf2a985f)I really like the new top-level, not built ABI. Only thing I don't love is the use of X__factory
throughout, but I see that as a remnant of tyepchain
and whenever we find a replacement we can just replace that with something more friendly and requiring less context.
@shanefontaine looks great 👍
@miguelmota Ready to merge whenever.
I was relatively against Husky because I didn't understand what problem it solved. I see now that it adds the ability to check stuff at the git hook level on the local machine, something I didn't realize was possible. Because of how small the API is and how lightweight it is (1.1kb - LICENCE
is the largest file in the repo), I've warmed up to using it a bit. Two places where I see value:
.npmignore
in favor of .gitignore
.
Simplify and cleanup after config updates.
All TS, lint, and test configs live at the root of the monorepo & each package only extends and adds what they need, if anything. Most per-package configs are pass-through files and only exist to help developers understand the structure of the package (i.e. if there is a
jest.config.mjs
I know the package is testing usingjest
) and for tooling to easily understand where to look without changing the defaults of every tool.Almost every non-config file change in this PR is a lint. The valuable changes to observe are only the config files.
Config
TS Config
NodeNext
formodule
andmoduleResolution
at the top-leveltsconfig.json
since this will likely be the default for the way we use most packages. Individual packages can explicitly choose others.NodeNext
will work in effectively all cases. For packages bundling ESM (sdk
,frontend
), we useESNext
andBundler
for the ESM build since that gives the bundler the most flexibility to work with.moduleResolution
default formodule: "ESNext"
isnode
, which "...should not be used for new projects.".node16
andnodenext
are the only correctmodule
options for all apps and libraries that are intended to run in Node.js v12 or later, whether they use ES modules or not.” TS Docstsconfig
(i.e../sdk-core/src/tsconfig.json
). The initial intention was to treat each subdir (i.e.src
andtest
) as individual modules and then reference each other. This satisfied all builds and tooling. However, this is only required if multiple subdirs are being built. If there is only a single subdir being built,src
, and one that is not emitted,test
, then references are not necessary and everything, including tooling, works as-is.Packages
All
ts-node
in favor oftsx
. Addedwatch
script to all relevant packages. New flow to run a backend package iswatch
thenstart
.tsx
runs on compiled code which is whywatch
is added. I would still preferts-node
(or something similar) but spent hours trying to get it to work correctly without crazy config or unintuitive stuff. I think the project is slowly dying -- see all the open issues about this. Happy to go with another package that achieves this same goal if there is one.hop-node
andhop-node-core
verbatimModuleSyntax
tsconfig rule as well as DX internally (IMO) via linting rules.sdk
andsdk-core
@hop-protocol/sdk/networks
) but new dual CJS/ESM with modern exports defined achieves the same without the additional build step.sdk-core
-- we can now plug in whatever tool we want (after figuring out what the best is). The downside of this is that it is more difficult to add new contracts until the new tool is adopted. Given the static nature of these dirs, I believe this is ok. If we need to add a new contract, we can just run an independent typechain run on the single contract. The ultimate goal, however, would be to just use the latest tooling and not deal with any of this, however, I know this is easier said than done.ts-nocheck
script fromsdk
andsdk-core
. They are no longer needed with updated TS config.V2 Explorer Backend
module_aliases
and simplifies aliases. Standardizes syntax with other packages in our monorepo for easier internal DX.Tooling
Linting
eslint@9.0.0
(released on Fri, April 5th). Updated all packages to use new default flat config. All rules remain the samedist
/build
/etc (this was the reason for the long lints last week was this)Other
react-router
that was required for pre-vite packages.20.12.1
over20.10.0
. It is still the same major, the new LTS, and updated for latest security release.