Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

30 changes: 19 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,30 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x] # NOTE: Keep in sync with README.
node-version: [22.x, 24.x] # NOTE: Keep in sync with README.
# See Node.js release schedule: https://nodejs.org/en/about/previous-releases
# - v18 EOL: Apr 30 2025
# - v20 EOL: Apr 30 2026
# - v22 EOL: Apr 30 2027
# - v24 EOL: Apr 30 2028
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v7
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v7
with:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: npm run test
cache: yarn
- run: corepack enable
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn test
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn install
- run: yarn run prettier-check
- run: yarn run eslint
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24.x
cache: yarn
- run: corepack enable
- run: yarn install --frozen-lockfile
- run: yarn prettier-check
- run: yarn eslint
6 changes: 3 additions & 3 deletions .github/workflows/pr-auditor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
check-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
with:
repository: 'sourcegraph/devx-service'
token: ${{ secrets.PR_AUDITOR_TOKEN }}
- uses: actions/setup-go@v4
with: { go-version: '1.22' }
- uses: actions/setup-go@v7
with: { go-version: '1.27' }

- run: 'go run ./cmd/pr-auditor'
env:
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ jobs:
release-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: actions/setup-node@v3
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: actions/setup-node@v7
with:
node-version: 20
node-version: 24
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: yarn run build
cache: yarn
- run: corepack enable
- run: yarn install --frozen-lockfile
- run: yarn build
- run: du -h dist/src/main.js
- run: npm publish --access public
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -28,20 +30,20 @@ jobs:
- run: echo "MINOR=${PATCH%.*}" >> $GITHUB_ENV
- run: echo "MAJOR=${MINOR%.*}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push snapshot
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v3
uses: docker/build-push-action@v7
with:
push: true
tags: |
sourcegraph/scip-typescript:latest-snapshot
- name: Build and push tag
if: startsWith(github.ref, 'refs/tags/v')
uses: docker/build-push-action@v3
uses: docker/build-push-action@v7
with:
push: true
tags: |
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/scip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn install
- run: yarn global add tsx @sourcegraph/src
- run: tsx src/main.ts index

- name: Upload SCIP to Cloud
run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
env:
SRC_ENDPOINT: https://sourcegraph.com/
SRC_ACCESS_TOKEN: ${{ secrets.SRC_ACCESS_TOKEN_DOTCOM }}
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24.x
cache: yarn
- run: corepack enable
- run: yarn install --frozen-lockfile
- run: yarn global add @sourcegraph/src
- run: yarn tsx src/main.ts index

- name: Upload SCIP to S2
run: src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ dist
node_modules
src/scip.ts
snapshots/output
**/pnpm-lock.yaml
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodejs 20.17.0
pnpm 9.11.0
nodejs 24.19.0
pnpm 11.22.0
yarn 1.22.22
8 changes: 7 additions & 1 deletion Development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Developing scip-typescript

Please note that the yarn version used by CI is `v1.22.19` - you should use this version as well to prevent lockfile conflicts.
Development requires Node.js 22 or 24 and Yarn `v1.22.22`. The versions used by
the project are recorded in `.tool-versions` and `package.json`.

## References

Expand All @@ -13,8 +14,13 @@ Please note that the yarn version used by CI is `v1.22.19` - you should use this
## Running tests

```sh
# Type-check and compile the project
npm run build
# Run snapshot tests
npm run test
# Run formatting and lint checks
npm run prettier-check
npm run eslint
# Update snapshot test outputs
npm run update-snapshots
```
Expand Down
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,29 @@
#
# Alternate way of determining the Index digest using the docker CLI.
#
# $ docker buildx imagetools inspect node:22.12.0-slim
# Name: docker.io/library/node:22.12.0-slim
# $ docker buildx imagetools inspect node:24.19.0-slim
# Name: docker.io/library/node:24.19.0-slim
# MediaType: application/vnd.oci.image.index.v1+json
# Digest: sha256:a4b757cd491c7f0b57f57951f35f4e85b7e1ad54dbffca4cf9af0725e1650cd8
# Digest: sha256:3638d9a6fe4030bd716be989438248074489337ba3275657f93595428be4fc03
# And use this digest in FROM
ARG base_sha=9b741b28148b0195d62fa456ed84dd6c953c1f17a3761f3e6e6797a754d9edff
ARG base_sha=3638d9a6fe4030bd716be989438248074489337ba3275657f93595428be4fc03

FROM node:24.6.0-slim@sha256:${base_sha}
FROM node:24.19.0-slim@sha256:${base_sha}

ENV NODE_OPTIONS=--max-old-space-size=4096

RUN apt update && \
apt install -y git bash curl ca-certificates python3 make build-essential automake autoconf curl && \
RUN apt-get update && \
apt-get install -y --no-install-recommends git bash curl ca-certificates python3 make build-essential automake autoconf && \
rm -rf /var/lib/apt/lists/* && \
npm install -g n yarn pnpm --force
npm install -g n@10.2.0 yarn@1.22.22 pnpm@11.22.0 --force

WORKDIR /app

COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile --ignore-scripts

COPY . .
RUN npm install && npm run build && npm install -g .
RUN yarn build && npm install -g . --ignore-scripts

WORKDIR /src

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
npm install -g @sourcegraph/scip-typescript
```

Currently, Node v18, Node v20 are supported. <!-- Source of truth: .github/workflows/ci.yml -->
Currently, Node v22 and Node v24 are supported. <!-- Source of truth: .github/workflows/ci.yml -->

### Indexing a TypeScript project

Expand Down Expand Up @@ -62,7 +62,7 @@ npm install -g @sourcegraph/scip-typescript @sourcegraph/src
npm install # or yarn install
scip-typescript index
# Upload index with any necessary tokens (shown here using GitHub workflow syntax)
src lsif upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
src code-intel upload -github-token='${{ secrets.GITHUB_TOKEN }}' -no-progress
```

For more examples, see the
Expand Down
23 changes: 23 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import eslint from '@eslint/js'
import { defineConfig } from 'eslint/config'
import tseslint from 'typescript-eslint'

export default defineConfig(
{
ignores: ['dist/**', 'snapshots/**', 'src/scip.ts'],
},
eslint.configs.recommended,
{
files: ['src/**/*.ts'],
extends: [tseslint.configs.recommendedTypeChecked],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
'class-methods-use-this': 'error',
},
}
)
51 changes: 22 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
"bin": "dist/src/main.js",
"main": "./dist/src/main.js",
"scripts": {
"prettier": "prettier --write --list-different '**/*.{ts,js?(on),md,yml}'",
"prettier-check": "prettier --check '**/*.{ts,js?(on),md,yml}'",
"tslint": "tslint -p tsconfig.json --format stylish",
"eslint": "eslint --cache '**/*.ts?(x)'",
"build": "node ./node_modules/typescript/bin/tsc -b .",
"test": "uvu -r tsm --ignore dist",
"update-snapshots": "uvu -r tsm --ignore dist --update-snapshots",
"prepare": "cd snapshots && yarn && cd input/multi-project && yarn && cd ../pnpm-workspaces && pnpm install"
"prettier": "prettier --write --list-different '**/*.{ts,mjs,js,json,md,yml,yaml}'",
"prettier-check": "prettier --check '**/*.{ts,mjs,js,json,md,yml,yaml}'",
"eslint": "eslint --cache .",
"build": "tsc -b .",
"test": "tsx ./node_modules/uvu/bin.js --ignore dist",
"update-snapshots": "tsx ./node_modules/uvu/bin.js --ignore dist --update-snapshots",
"prepare": "yarn --cwd snapshots install --frozen-lockfile && yarn --cwd snapshots/input/multi-project install --frozen-lockfile && pnpm --dir snapshots/input/pnpm-workspaces install --frozen-lockfile"
},
"repository": {
"type": "git",
Expand All @@ -28,37 +27,31 @@
],
"author": "Code Intelligence at Sourcegraph",
"license": "Apache-2.0",
"engines": {
"node": ">=22.13.0"
},
"packageManager": "yarn@1.22.22",
"bugs": {
"url": "https://github.com/sourcegraph/scip-typescript/issues"
},
"homepage": "https://github.com/sourcegraph/scip-typescript#readme",
"dependencies": {
"commander": "^12.1.0",
"google-protobuf": "^3.21.4",
"commander": "^14.0.3",
"google-protobuf": "^4.0.2",
"progress": "^2.0.3",
"typescript": "^5.6.2"
"typescript": "^6.0.3"
},
"devDependencies": {
"@sourcegraph/eslint-config": "0.37.1",
"@sourcegraph/prettierrc": "3.0.3",
"@sourcegraph/tsconfig": "4.0.1",
"@types/diff": "7.0.1",
"@eslint/js": "10.0.1",
"@types/google-protobuf": "3.15.12",
"@types/node": "20.16.10",
"@types/node": "24.13.3",
"@types/progress": "2.0.7",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"diff": "7.0.0",
"eslint": "^8.57.1",
"eslint-plugin-etc": "^2.0.3",
"eslint-plugin-rxjs": "^5.0.3",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-unused-imports": "^4.1.4",
"pnpm": "9.11.0",
"prettier": "3.5.3",
"tsm": "^2.3.0",
"tsx": "^4.19.1",
"typescript-eslint": "7.18.0",
"diff": "9.0.0",
"eslint": "10.9.0",
"pnpm": "11.22.0",
"prettier": "3.9.6",
"tsx": "4.23.12",
"typescript-eslint": "8.67.0",
"uvu": "^0.5.6"
}
}
2 changes: 1 addition & 1 deletion snapshots/input/invalid-package-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"author": "",
"license": "ISC",
"private": true,
"packageManager": "pnpm@7.20.0"
"packageManager": "pnpm@11.22.0"
}

This file was deleted.

2 changes: 1 addition & 1 deletion snapshots/input/pnpm-workspaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"author": "",
"license": "ISC",
"private": true,
"packageManager": "pnpm@7.20.0"
"packageManager": "pnpm@11.22.0"
}

This file was deleted.

8 changes: 2 additions & 6 deletions snapshots/output/pure-js/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ function print_fib(a) {
// ^^^^^^^^^ definition pure-js 1.0.0 src/`main.js`/print_fib().
// ^ definition pure-js 1.0.0 src/`main.js`/print_fib().(a)
console.log(fib(a))
//^^^^^^^ reference typescript 5.6.2 lib/`lib.dom.d.ts`/console.
//^^^^^^^ reference @types/node 20.16.10 `globals.d.ts`/global/console.
//^^^^^^^ reference @types/node 20.16.10 `console.d.ts`/`"node:console"`/global/console/
//^^^^^^^ reference @types/node 20.16.10 `console.d.ts`/`"node:console"`/global/console.
// ^^^ reference typescript 5.6.2 lib/`lib.dom.d.ts`/Console#log().
// ^^^ reference @types/node 20.16.10 `console.d.ts`/`"node:console"`/global/Console#log().
//^^^^^^^ reference typescript 6.0.3 lib/`lib.dom.d.ts`/console.
// ^^^ reference typescript 6.0.3 lib/`lib.dom.d.ts`/Console#log().
// ^^^ reference pure-js 1.0.0 src/`main.js`/fib().
// ^ reference pure-js 1.0.0 src/`main.js`/print_fib().(a)
}
Expand Down
Loading
Loading