manager
manager copied to clipboard
M3-5873: Build `api-v4` and `validation` with `tsup` with backwards compatibility
✨ Description
- Use
tsupfor building@linode/api-v4and@linode/validation
📝 Details
- Deprecates
yarn upin favor ofyarn dev - Runs a dev server for
@linode/validationso it rebuilds automatically when you are usingyarn dev/yarn up - Changes any
src/prefixed imports in@linode/api-v4and@linode/validationto be relative path imports (../)- We should do this to keeps those packages simple. Aliases can causes extra complexity and is not beneficial in small packages like ours.
- Configure Cloud Manger's
jestto use@linode/api-v4and@linode/validation'ssrcinstead oflib.- We do this because jest was having trouble resolving exports because of its lackluster esm or exports support.
- Type generation is handled by
tsc - Use
incrementaltsc compilation for@linode/api-v4and@linode/validationfor faster typechecking - We are going to publish
esm,commonjs, andiifeas 3 bundled formats- This results in 3 respective
index.jss for each format (excluding type files) - Cloud Manager consumes
esm - Jest will consume
commonjs - Dependencies are only bundled into the index.js file for the
iifeformat so it is suitable for web use
- This results in 3 respective
🧪 How to test
- Test all of Cloud Manager,
@linode/api-v4, and@linode/validation