Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 1.73 KB

CONTRIBUTING.md

File metadata and controls

29 lines (22 loc) · 1.73 KB

Guidelines

Setting up

  1. Clone the repository
  2. Run npm install

Scripts

  • npm run build generates the bundled JavaScript (.js) and TypeScript type definitions (.d.ts), and outputs them to dist/. These generated files are not checked into version control.
  • npm test runs the three test suites:
    • npm run test:wpt runs the Web Platform Tests for Streams against the generated JavaScript bundle, to verify that the polyfill's run-time behavior matches the specification.
    • npm run test:types runs the TypeScript compiler against some reference code that uses the generated type definitions, to verify that the code successfully passes the type check.
    • npm run test:unit runs a few unit tests in a Node environment, to verify that the polyfill also works without a browser environment.
    • npm run test:bundlers runs integration tests with popular bundlers, to verify that they can correctly resolve and bundle the polyfill.

Miscellaneous

  • Do not manually change any files within test/web-platform-tests, as they are part of a Git submodule.
  • If you want to update the polyfill to a newer version of the streams specification:
    1. Find the commit of the web-platform-tests Git submodule of the reference implementation.
    2. Update the submodule in test/web-platform-tests to the same commit.
    3. Update the polyfill implementation to pass the new tests.
    4. Commit, push and open a pull request. Thanks! 😁
  • The polyfill's API should remain backwards compatible. The type tests can help to check API compatibility.