Skip to content

Commit 6d14799

Browse files
committed
Initial public release
Signed-off-by: Tyler Smalley <[email protected]>
1 parent da9a5c5 commit 6d14799

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+9701
-0
lines changed

.envrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if has nix; then
2+
use flake
3+
fi
4+
5+
PATH_add tool

.eslintrc.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"root": true,
3+
"parser": "@typescript-eslint/parser",
4+
"parserOptions": {
5+
"ecmaVersion": 6,
6+
"sourceType": "module"
7+
},
8+
"env": {
9+
"node": true
10+
},
11+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
12+
"plugins": ["@typescript-eslint", "unicorn"],
13+
"rules": {
14+
"@typescript-eslint/no-unused-vars": "off",
15+
"unicorn/filename-case": [
16+
"error",
17+
{
18+
"case": "kebabCase"
19+
}
20+
]
21+
},
22+
"ignorePatterns": ["out", "dist", "**/*.d.ts"],
23+
"overrides": [
24+
{
25+
"files": ["src/webviews/**/*.ts", "src/webviews/**/*.tsx"],
26+
"extends": ["plugin:react-hooks/recommended"],
27+
"plugins": ["react-hooks"],
28+
"rules": {
29+
"react-hooks/rules-of-hooks": "error",
30+
"react-hooks/exhaustive-deps": "warn"
31+
}
32+
}
33+
]
34+
}

.github/workflows/on-main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: on-main
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
uses: './.github/workflows/test.yml'
10+
11+
pre-release:
12+
name: 'Pre Release'
13+
uses: ./.github/workflows/release.yml
14+
needs: test
15+
16+
with:
17+
prerelease: true
18+
title: 'Development'
19+
release_name: 'latest'
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: on-pull-request
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
test:
9+
uses: './.github/workflows/test.yml'
10+
11+
package:
12+
uses: ./.github/workflows/package.yml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'tagged-release'
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: 'Release'
11+
uses: ./.github/workflows/release.yml
12+
13+
with:
14+
prerelease: false

.github/workflows/package.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: 'package'
2+
3+
on:
4+
workflow_dispatch:
5+
workflow_call:
6+
7+
jobs:
8+
package:
9+
name: 'Package'
10+
runs-on: 'ubuntu-latest'
11+
timeout-minutes: 10
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
- name: Fetch tags
18+
run: git fetch --force --tags
19+
- name: Capture Yarn cache path
20+
id: yarn-cache-folder
21+
run: echo "YARN_CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
22+
- name: Yarn cache
23+
uses: actions/cache@v3
24+
id: yarn-cache
25+
with:
26+
path: ${{ steps.yarn-cache-folder.outputs.YARN_CACHE_FOLDER }}
27+
key: yarn-cache
28+
- name: Install dependencies
29+
run: tool/yarn install --frozen-lockfile
30+
- name: Set up Go
31+
uses: actions/setup-go@v4
32+
with:
33+
go-version: '1.20.x'
34+
- name: Capture version
35+
id: version
36+
run: npm run env | grep npm_package_version >> $GITHUB_OUTPUT
37+
- run: echo "version=${{ steps.version.outputs.npm_package_version }}"
38+
- name: Build Go
39+
run: |
40+
go install github.com/goreleaser/goreleaser@latest
41+
goreleaser build --snapshot --clean
42+
env:
43+
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.npm_package_version }}
44+
- name: Package
45+
run: tool/yarn vsce package --allow-star-activation
46+
- name: Upload vsix artifact
47+
uses: actions/upload-artifact@v3
48+
with:
49+
name: vsix
50+
path: '*.vsix'

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: 'release'
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
prerelease:
7+
description: 'Whether or not this is a pre-release'
8+
required: true
9+
default: false
10+
type: boolean
11+
12+
title:
13+
description: 'The title of the release'
14+
required: false
15+
type: string
16+
17+
release_name:
18+
description: 'The name of the release, uses the tag if not specified'
19+
required: false
20+
type: string
21+
22+
workflow_call:
23+
inputs:
24+
prerelease:
25+
description: 'Whether or not this is a pre-release'
26+
required: true
27+
default: false
28+
type: boolean
29+
30+
title:
31+
description: 'The title of the release'
32+
required: false
33+
type: string
34+
35+
release_name:
36+
description: 'The name of the release, uses the tag if not specified'
37+
required: false
38+
type: string
39+
jobs:
40+
package:
41+
name: 'Package'
42+
uses: ./.github/workflows/package.yml
43+
44+
release:
45+
name: 'Release'
46+
runs-on: 'ubuntu-latest'
47+
needs: 'package'
48+
timeout-minutes: 5
49+
50+
steps:
51+
- uses: actions/checkout@v3
52+
- name: Download vsix artifact
53+
uses: actions/download-artifact@v3
54+
with:
55+
name: vsix
56+
- name: 'Release'
57+
uses: 'marvinpinto/action-automatic-releases@d68defdd11f9dcc7f52f35c1b7c236ee7513bcc1'
58+
with:
59+
repo_token: '${{ secrets.GITHUB_TOKEN }}'
60+
automatic_release_tag: ${{ inputs.release_name }}
61+
prerelease: ${{ inputs.prerelease }}
62+
title: ${{ inputs.title }}
63+
files: |
64+
*.vsix

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 'test'
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
test:
8+
name: 'Test'
9+
strategy:
10+
matrix:
11+
# os: [macos-latest, ubuntu-latest, windows-latest]
12+
os: [ubuntu-latest]
13+
runs-on: ${{ matrix.os }}
14+
timeout-minutes: 10
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Capture Yarn cache path
18+
id: yarn-cache-folder
19+
run: echo "YARN_CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
20+
- name: Yarn cache
21+
uses: actions/cache@v3
22+
id: yarn-cache
23+
if: runner.os != 'Windows'
24+
with:
25+
path: ${{ steps.yarn-cache-folder.outputs.YARN_CACHE_FOLDER }}
26+
key: yarn-cache
27+
- name: Install dependencies
28+
run: tool/yarn install --frozen-lockfile --prefer-offline
29+
# - name: Integration Tests (Linux)
30+
# run: xvfb-run -a tool/yarn test
31+
# if: runner.os == 'Linux'
32+
# - name: Integration Tests (macOS/Windows)
33+
# run: tool/yarn test
34+
# if: runner.os != 'Linux'
35+
- name: Lint
36+
run: tool/yarn lint
37+
- name: Prettier
38+
run: tool/yarn prettier --check .

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# dependencies
2+
/node_modules
3+
4+
# production
5+
out
6+
dist
7+
8+
# vscode
9+
.vscode-test/
10+
*.vsix
11+
12+
# misc
13+
.DS_Store
14+
status.json
15+
16+
# tailscale tooling
17+
/.redo
18+
yarn.cmd
19+
node.cmd
20+
21+
# nix direnv
22+
/.direnv
23+
24+
bin/

.goreleaser.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
before:
2+
hooks:
3+
- go mod tidy
4+
builds:
5+
- env:
6+
- GOWORK=off
7+
- CGO_ENABLED=0
8+
goos:
9+
- linux
10+
- windows
11+
- darwin
12+
goarch:
13+
- arm64
14+
- amd64
15+
main: ./tsrelay
16+
dist: ./bin
17+
archives:
18+
- format: tar.gz
19+
# this name template makes the OS and Arch compatible with the results of uname.
20+
name_template: >-
21+
{{ .ProjectName }}_
22+
{{- title .Os }}_
23+
{{- if eq .Arch "amd64" }}x86_64
24+
{{- else if eq .Arch "386" }}i386
25+
{{- else }}{{ .Arch }}{{ end }}
26+
{{- if .Arm }}v{{ .Arm }}{{ end }}
27+
# use zip for windows archives
28+
format_overrides:
29+
- goos: windows
30+
format: zip
31+
checksum:
32+
name_template: 'checksums.txt'
33+
snapshot:
34+
name_template: '{{ incpatch .Version }}-next'
35+
changelog:
36+
sort: asc
37+
filters:
38+
exclude:
39+
- '^docs:'
40+
- '^test:'

0 commit comments

Comments
 (0)