|
2 | 2 |
|
3 | 3 | LSIF indexer for TypeScript and JavaScript.
|
4 | 4 |
|
| 5 | +## Quick start |
| 6 | + |
| 7 | +### Installation |
| 8 | + |
| 9 | +```sh |
| 10 | +npm install -g @sourcegraph/lsif-typescript |
| 11 | +``` |
| 12 | + |
| 13 | +### Indexing a TypeScript project |
| 14 | + |
| 15 | +Navigate to the project root, containing `tsconfig.json`. |
| 16 | + |
| 17 | +```sh |
| 18 | +npm install # or yarn install |
| 19 | +lsif-typescript index |
| 20 | +``` |
| 21 | + |
| 22 | +### Indexing a JavaScript project |
| 23 | + |
| 24 | +Navigate to the project root, containing `package.json`. |
| 25 | + |
| 26 | +```sh |
| 27 | +npm install # or yarn install |
| 28 | +lsif-typescript index --infer-tsconfig |
| 29 | +``` |
| 30 | + |
| 31 | +To improve the quality of indexing results for JavaScript, |
| 32 | +consider adding `@types/*` packages as `devDependencies` in `package.json`. |
| 33 | + |
| 34 | +### Index a TypeScript project using Yarn workspaces |
| 35 | + |
| 36 | +Navigate to the project root, containing `package.json`. |
| 37 | + |
| 38 | +``` |
| 39 | +npm install # or yarn install |
| 40 | +lsif-typescript index --yarn-workspaces |
| 41 | +``` |
| 42 | + |
| 43 | +### Indexing in CI |
| 44 | + |
| 45 | +Add the following run steps to your CI pipeline: |
| 46 | + |
| 47 | +```sh |
| 48 | +npm install -g @sourcegraph/lsif-typescript |
| 49 | +npm install # or yarn install |
| 50 | +lsif-typescript index |
| 51 | +# From https://github.com/sourcegraph/src-cli/ |
| 52 | +curl -L https://sourcegraph.com/.api/src-cli/src_linux_amd64 -o /usr/local/bin/src |
| 53 | +chmod +x /usr/local/bin/src |
| 54 | +# Upload index with any necessary tokens (shown here using GitHub workflow syntax) |
| 55 | +src lsif upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress |
| 56 | +``` |
| 57 | + |
| 58 | +For more examples, see the |
| 59 | +[Sourcegraph docs](https://docs.sourcegraph.com/code_intelligence/how-to/index_a_typescript_and_javascript_repository). |
| 60 | + |
| 61 | +## Contributing |
| 62 | + |
5 | 63 | See [Development.md](./Development.md) for docs on how to work on this project.
|
| 64 | + |
| 65 | +Contributors should follow the [Sourcegraph Community Code of Conduct](https://handbook.sourcegraph.com/company-info-and-process/community/code_of_conduct/). |
0 commit comments