Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rewrite in Go #249

Merged
merged 4 commits into from
Sep 21, 2023
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
16 changes: 0 additions & 16 deletions .devcontainer/Dockerfile

This file was deleted.

28 changes: 0 additions & 28 deletions .devcontainer/devcontainer.json

This file was deleted.

103 changes: 36 additions & 67 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,97 +10,66 @@ jobs:

steps:
- name: Checkout git repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Compile TypeScript
run: yarn run build
- name: Upload compiled TypeScript
uses: actions/upload-artifact@v3
with:
name: tsc_output
path: tsc_output
style:
name: Check style
go-version-file: './go.mod'
- name: Compile app
run: go build
check-formatting:
name: Check formatting

runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Check style
run: yarn run style
go-version-file: './go.mod'
- name: Check formatting
run: gofmt -l .
lint:
name: Lint
name: Check formatting

runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
go-version-file: './go.mod'
- name: Lint
run: yarn run lint
test:
name: Test

runs-on: ubuntu-latest

steps:
- name: Checkout git repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: golangci/golangci-lint-action@v3
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Build
run: yarn run build
- name: Test
run: yarn run test
publish:
name: Publish
version: latest
release:
name: Release

runs-on: ubuntu-latest

if: ${{ github.ref == 'refs/heads/main' }}

needs: [build, lint, test]
needs: [build, lint]

steps:
- name: Checkout git repository
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4
- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: './go.mod'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
node-version: '18'
cache: 'yarn'
- name: Install dependencies with Yarn
run: yarn install --immutable
- name: Compile TypeScript for publishing
run: yarn run build
- name: Run semantic release
run: yarn run semantic-release
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
158 changes: 41 additions & 117 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Created by https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode
# Edit at https://www.gitignore.io/?templates=node,linux,macos,windows,visualstudiocode
# Created by https://www.toptal.com/developers/gitignore/api/linux,windows,visualstudiocode,macos,go
# Edit at https://www.toptal.com/developers/gitignore?templates=linux,windows,visualstudiocode,macos,go

### Go ###
# If you prefer the allow list template instead of the deny list, see community template:
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work

### Linux ###
*~
Expand All @@ -25,6 +48,7 @@
# Icon must end with two \r
Icon


# Thumbnails
._*

Expand All @@ -44,122 +68,28 @@ Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# parcel-bundler cache (https://parceljs.org/)
.cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# rollup.js default build output
dist/

# Uncomment the public line if your project uses Gatsby
# https://nextjs.org/blog/next-9-1#public-directory-support
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
# public

# Storybook build outputs
.out
.storybook-out

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# Temporary folders
tmp/
temp/
### macOS Patch ###
# iCloud generated files
*.icloud

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Local History for Visual Studio Code
.history/

# Built Visual Studio Code Extensions
*.vsix

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

### Windows ###
# Windows thumbnail cache files
Expand Down Expand Up @@ -187,15 +117,9 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/node,linux,macos,windows,visualstudiocode
# End of https://www.toptal.com/developers/gitignore/api/linux,windows,visualstudiocode,macos,go

# TypeScript compiler output
tsc_output
# Built binaries
how

# Yarn
.yarn/*
!.yarn/releases
!.yarn/plugins
!.yarn/sdks
!.yarn/versions
.pnp.*
dist/
Loading