[Experiment] Move package to Deno first #12
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.
As a prelude: I realize this is a very invasive change. If you are not
interested, feel free to just close the PR. I mostly did this to get a feel for
what our current state of Node->Deno and Deno->NPM tooling is like (I ran out of
own packages to convert 🙃).
What?
This PR moves the
observables-with-streams
package to be written for "Denofirst". This means that the TypeScript used is "Deno flavored", i.e. with
.ts
extensions.The tests were moved over to
Deno.test
andhttps://deno.land/std/testing/asserts.ts
. They now run in Deno rather than ina browser. The streams implementation in Deno is just as (or more) correct than
Chrome, so the tests are still passing :-).
Proof.
How?
src/
has had its.ts
extensions added in importstests/
theMocha.*
calls have been replaced withDeno.test
.tests/
the chai asserts have been replaced with simpleassert
andassertEquals
fromstd/testing/asserts.ts
.src/sources/from-timer.ts
has been updated to clear the interval when thestream is closed to appease Deno's test sanitizers. (Fixes
fromTimer
does not stop interval when observable is cancelled #13)deno fmt
make
rather thannpm run
build.ts
script was added that generates adist/
folder from the sourcecode. It uses
dnt
to generate the plain JSESM code and type declaration files. Rollup is then used to generate the
dist/dist/really-big-bundle.js
.CONTRIBUTING
make build
cd dist && npm publish
git tag v1.0.0
)What's next?
After merging this PR (if you want to), you should register
https://deno.land/x/observables-with-streams and create a new release. This will
make it easier for Deno users to use the package.
Docs on Netlify can be disabled after this change too, as docs can now be viewed
on doc.deno.land. Example: https://doc.deno.land/https://raw.githubusercontent.com/surma/observables-with-streams/28c55be6d855780c677fd1f4ba975f4d3144891d/src/index.ts