Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1 from tiki/release/1.0
Browse files Browse the repository at this point in the history
feat!: setup simple proxy to route api req
  • Loading branch information
mike-audi authored Apr 3, 2023
2 parents d13f4d6 + db44367 commit ebede0e
Show file tree
Hide file tree
Showing 19 changed files with 14,750 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
lib
23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"browser": true,
"es2021": true,
"jest/globals": true
},
"extends": ["standard", "prettier", "eslint:recommended", "plugin:@typescript-eslint/recommended"],
"plugins": ["prettier", "@typescript-eslint"],
"overrides": [
{
"files": ["test/**"],
"plugins": ["jest"]
}
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"rules": {
"prettier/prettier": ["error"]
}
}
33 changes: 33 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -------------------------------------------------------------------------------------
# Backend development owns this repo as a whole.
# -------------------------------------------------------------------------------------
* @tiki/backend-development


# -------------------------------------------------------------------------------------
# Content should have eyes on any Markdown changes.
# -------------------------------------------------------------------------------------
*.md @tiki/content @tiki/backend-development


# -------------------------------------------------------------------------------------
# Core development should all have eyes on any changes under .github/
# -------------------------------------------------------------------------------------
/.github/ @tiki/core-development @tiki/backend-development


# -------------------------------------------------------------------------------------
# Governance needs to have eyes on any licensing or risk-related changes
# -------------------------------------------------------------------------------------
LICENSE @tiki/governance @tiki/backend-development
/.github/CODEOWNERS @tiki/governance @tiki/core-development @tiki/backend-development


# -------------------------------------------------------------------------------------
# Backend development and infrastructure care about Docker, databases, and Terraform
# -------------------------------------------------------------------------------------

*.dockerfile @tiki/backend-development @tiki/infrastructure
docker-compose.yaml @tiki/backend-development @tiki/infrastructure
/database/ @tiki/backend-development @tiki/infrastructure
/infra/ @tiki/backend-development @tiki/infrastructure
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "npm"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "gh-action"

- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "docker"
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CodeQL

on:
pull_request:
branches:
- main

# Cancel any active builds when new commits are pushed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
runs-on: ubuntu-22.04
permissions:
actions: read
contents: read
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: javascript

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

on:
pull_request:
branches:
- main
types:
- closed

# Cancel any active builds when new commits are pushed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
Deploy:
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18

- name: Get version
id: version
run: echo "current=$(npm pkg get version | tr -d '"')" >> $GITHUB_OUTPUT

- name: Run CI
run: npm ci

- name: Wrangler
uses: cloudflare/[email protected]
with:
apiToken: ${{ secrets.CF_API_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.current }}
56 changes: 56 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Version

on:
pull_request:
branches:
- main

# Cancel any active builds when new commits are pushed
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
Version:
if: startsWith(github.head_ref, 'release/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Checkout PR
id: getpr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr checkout ${{ github.event.pull_request.number }}
export PR_BRANCH=$(git branch --show-current)
echo "branch=$PR_BRANCH" >> $GITHUB_OUTPUT
- name: Get Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ steps.getpr.outputs.branch }}

- name: Set Worker Version
id: package_version
uses: KageKirin/set-node-package-version@v1
with:
version: ${{ steps.semver.outputs.nextStrict }}

- name: Commit Changes
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "GH Action"
git add package.json
git commit -m 'version bump'
git push
outputs:
version: ${{ steps.semver.outputs.nextStrict }}
125 changes: 125 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

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

# 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/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# 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
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Wrangler Dev Secrets
.dev.vars

# IDEA
.idea
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-xml
- id: check-yaml
args: [--allow-multiple-documents, --unsafe]
- id: destroyed-symlinks
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: end-of-file-fixer
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch=main]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
17 changes: 17 additions & 0 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) TIKI Inc.
* MIT license. See LICENSE file in root directory.
*/

module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
]
]
}
Loading

0 comments on commit ebede0e

Please sign in to comment.