GithubHelp home page GithubHelp logo

isabella232 / typescript-error-deltas Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoft/typescript-error-deltas

0.0 0.0 0.0 437 KB

Test popular repos on new versions of Typescript: display new compiler errors

License: MIT License

Shell 1.35% JavaScript 0.06% TypeScript 98.60%

typescript-error-deltas's Introduction

typescript-error-deltas

Download and compile popular open source repos in order to compare new versions of the TypeScript compiler with the current version. For example, this project will clone the prettier repo and compile it with the current version of TypeScript. Then it will compile it with a version of TypeScript from a pull request. Afterward it will compile new errors that are issued only with the new version and post them as a comment on the pull request.

There is no comparison of types, errors, symbols or language service output.

Running

To run online, you can

These commands can also be run locally.

# New Error Detector (a.k.a. "git tests")
node dist/checkGithubRepos.js [post-results] [repo-count] [repo-start-index] [old-ts-version-on-npm] [old-ts-version-on-npm]

# Inline User Test Reporter (a.k.a. "user tests")
node dist/checkUserTestRepos.js [post-results] [ts-repo-url] [head-ref] [requesting-user] [source-issue] [github-comment-id-for-updates] [query-repos-by-stars]

You can view example usage of these commands from how they're currently triggered on Azure Pipelines:

Contributing

User Tests

There are three kinds of user tests, all of which aim to use popular packages with different versions of TypeScript:

  1. Example projects, which specify a popular package in package.json and then provide an example use of it.
  2. Clones of a repo of a popular package, built with tsc.
  3. Clones of a repo of a popular package, built with a custom bash script.

Example projects

Use userTests/axios as an example:

  • Create a package.json with axios as a dependency.
  • Create an example program that uses axios. In our case, just:
    • index.ts
    • tsconfig.json

The example projects could be as large as a complete app as long as it compiles with a single invocation of tsc. However, the current projects almost all consist of a single import, like import x = require('x'). This could obviously be improved.

Clone repos (simple build)

Use userTests/axios-src as an example:

Create test.json like the following:

{
    "cloneUrl": "https://github.com/axios/axios.git",
    "types": ["node"]
}

The types field is optional; it installs @types/ packages for each entry in its array before running tsc. This is mostly useful if the package isn't written in TypeScript and doesn't include types in its own devDependencies.

Like the example projects, the cloned repos must be buildable with a single invocation of tsc.

Clone repos (script build)

Use userTests/azure-sdk as an example; create a script build.sh that:

  • Clones a repo.
  • Installs its dependencies.
  • Alters its TypeScript dependency to use a custom TypeScript version.
  • Builds the repo.

The details vary considerably from project to project. This kind of test allows you to build arbitrary projects.

Legal

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

typescript-error-deltas's People

Contributors

amcasey avatar sandersn avatar danielrosenwasser avatar elibarzilay avatar microsoftopensource avatar romainmenke avatar microsoft-github-operations[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.