Skip to content
Merged
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
33 changes: 0 additions & 33 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: 22.x
- run: npm install
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
Expand Down
6 changes: 6 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
version: '1.66.2',
});
15 changes: 8 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"amodio.tsl-problem-matcher"
]
}
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint",
"connor4312.esbuild-problem-matchers",
"ms-vscode.extension-test-runner"
]
}
30 changes: 17 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/test-workspaces/single-file/file.txt",
"--extensionDevelopmentPath=${workspaceFolder}"
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/test-workspaces/single-file/file.txt"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
"preLaunchTask": "${defaultBuildTask}",
},
{
"name": "Run Extension (single root workspace)",
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/test-workspaces/single-root",
"--extensionDevelopmentPath=${workspaceFolder}"
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/test-workspaces/single-root"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
Expand All @@ -36,29 +38,31 @@
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/test-workspaces/multi-root/test.code-workspace",
"--extensionDevelopmentPath=${workspaceFolder}"
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"${workspaceFolder}/test-workspaces/multi-root/test.code-workspace"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"name": "Run Extension (multi root workspace with proxy)",
"type": "extensionHost",
"request": "launch",
"args": [
"${workspaceFolder}/test-workspaces/single-root",
"--disable-extensions",
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
"${workspaceFolder}/test-workspaces/multi-root/test.code-workspace"
],
"outFiles": [
"${workspaceFolder}/out/**/*.js",
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "tasks: watch-tests"
}
"preLaunchTask": "${defaultBuildTask}",
"env": {
"HTTPS_PROXY": "http://localhost:8080"
},
},
]
}
22 changes: 11 additions & 11 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true, // set this to false to include "dist" folder in search results
".vscode-test": true,
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true, // set this to false to include "dist" folder in search results
".vscode-test": true,
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
50 changes: 37 additions & 13 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,43 @@
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
"label": "watch",
"dependsOn": [
"npm: watch:tsc",
"npm: watch:esbuild"
],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch:esbuild",
"group": "build",
"problemMatcher": "$esbuild-watch",
"isBackground": true,
"label": "npm: watch:esbuild",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch:tsc",
"group": "build",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"label": "npm: watch:tsc",
"presentation": {
"group": "watch",
"reveal": "never"
}
},
{
"type": "npm",
"script": "watch-tests",
Expand Down
13 changes: 4 additions & 9 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@
.gitattributes
.github/**
.gitignore
.release
.travis.yml
.vscode-test/**
.vscode/**
.yarnrc
*.vsix
**/.eslintrc.json
**/.vscode-test.*
**/*.map
**/*.ts
**/eslint.config.mjs
**/tsconfig.json
docs/**
esbuild.js
icon/**
node_modules/**
out/**
out/**/*.map
out/test/**
src/**
test-workspaces/**
TODO.md
tslint.json
types/**
webpack.config.js
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog


## v0.10.0

- Rebuilt extension on top of scaffold generated by the latest [generator-code](https://www.npmjs.com/package/generator-code) (v1.11.6)
- Implemented use of GitHub authentication provider when the GitHub API rate limit is reached.
- Raised minium API level to 1.66 to get access to
- authentication providers (see https://code.visualstudio.com/updates/v1_48#_using-authentication-providers)
- Github authentication provider (authentication flow requires v1.66 and higher)
- pre-release versions (see https://code.visualstudio.com/updates/v1_63#_pre-release-extensions)
- Upgraded to latest https-proxy-agent


## v0.9.0

- Migrated to async/await and native promises
Expand Down
53 changes: 8 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,59 +25,22 @@ Start command palette (with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> or <kb
}
```

### Authenticated GitHub API Requests
## GitHub API Rate Limits

This extension makes API calls to the [GitHub REST API](https://docs.github.com/en/rest) which are subject to [rate limits](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#rate-limiting).

By default, requests sent to the GitHub REST API are unauthenticated. Although the rate limit for unauthenticated requests is low, this should usually not be an issue because of caching and the most likely infrequent usage of this extension.
By default, requests sent to the GitHub REST API are unauthenticated. Although the rate limit for unauthenticated requests is low, this should usually not be an issue because of caching and the typical infrequent usage of this extension.

If you reach the rate limit (e.g. because you work inside a corporate network), you can switch to [authenticated requests](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#authentication) by setting the `GITHUB_AUTHORIZATION` environment variable.

#### Examples

Using a [personal access token](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#oauth2-token-sent-in-a-header):

export GITHUB_AUTHORIZATION='Token <oauth2-token>'
code

Using an [OAuth2 key/secret](https://docs.github.com/en/rest/overview/resources-in-the-rest-api#oauth2-keysecret)

export GITHUB_AUTHORIZATION='Basic <base65-encoded-key-secret>'
code
If you reach the rate limit (e.g. because you work inside a corporate network), the extension will ask you if you want to the Authenticaton Provider for GitHub. If you agree, the extension will use authenticated GitHub API calls, which come with a mich higher rate limit than unauthenticated calls.


## Roadmap

### v0.1
- Basic implementation that allows to pull a single `.gitignore` file

### v0.2
- Add language support for `.gitignore` files

### v0.3
- Support reading `.gitignore` files from subdirectories in the github/gitignore repository

### v0.4
- Support adding multiple `.gitignore` files and merge it to a `.gitignore` file

### v0.5
- Support proxy

### v0.6
- Update extension to more recent vscode ecosystem
- Update dependencies

### v0.7
- Support multi-root workspaces (see contribution by @hangxingliu)

### v0.8
- Fix bugs
- Remove `github` dependency
- Update dependencies

### v0.x
- Switch to async/await
- Further improve proxy support
- Implement logging accroding to best practices
- Replace `https-proxy-agent` package by high level `proxy-agent` package
- Switch to fetch API (requires vscode v1.82)
- Further test and improve proxy support
- Add unit tests with active proxy


Expand All @@ -88,7 +51,7 @@ See [CHANGELOG.md](CHANGELOG.md)

## License

See [LICENSE](LICENSE) file
See [LICENSE](LICENSE)


## Credits
Expand Down
Loading