use esbuild, tsc and eslint instead of tsdx #134
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #130
This PR removes
tsdx
in favor of usingtsc
,eslint
,jest
directly.Bundling
tsdx
usedrollup
for bundling. I opted foresbuild
which is a more modern bundler and is used byaws-cdk
and probably some other big stable projects. Ideally, I would like to avoid bundling altogether and just usetsc
to transpile the typescript sources to runnable javascript. However, the dynamic import ofblake3
in theready
function caused some issues with this. We can revisit at a later time to simplify this.npm workspaces
Using npm workspaces to simplify dependency management of the examples/ directory. Read more here https://docs.npmjs.com/cli/v10/using-npm/workspaces. Essentially, now you only need to do
npm install
in the root directory to get all the dependencies needed to run the scripts and frontend app.Note that when you install the project from github (.e.g.,
npm install WebOfTrust/signify-ts#development
) you still only get the root dependencies, so no unnecessary dependencies will be installed.Remove
text-encoding
packageThis repository has been archived since 2018: https://github.com/inexorabletash/text-encoding and caused issues when bundling because of the way the package was imported. This package should not be needed though. The TextEncoder API is supported by all modern browsers and node.js. See: https://caniuse.com/textencoder.
Restructured package export files
Previously, rollup did some magic to bundle all named exports into a default export. This is not supported by most other bundlers as far as I am aware. So I did it manually by gathering all named exports to
export.ts
, then re-exporting inindex.ts
while also grouping them as thedefault
export. This ensures no existing code will break. However, we should revisit this as well and reconsider what is exported from the library.Linting
I added the "recommended"
.eslintrc
config and just lowered all reported errors to "warning" for now. We should create an issue to resolve the errors. I just did not want this PR to blow up.