Skip to content

Commit

Permalink
feat: initial base template
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecMMiller committed Oct 1, 2023
1 parent b787882 commit 480b261
Show file tree
Hide file tree
Showing 6 changed files with 2,196 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploys to NPM

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 20
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'yarn'
- run: yarn install
- run: yarn lint
- run: yarn build
- run: yarn semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint
21 changes: 21 additions & 0 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MatchScore, SkillsScore } from '@18x18az/maestro-interfaces'

interface MatchResults {
redScore: number
blueScore: number
}

export function calculateAllianceScore (): number {
return 1
}

export function calculateMatchScore (score: MatchScore): MatchResults {
const redScore = calculateAllianceScore()
const blueScore = calculateAllianceScore()

return { redScore, blueScore }
}

export function calculateSkillsScore (score: SkillsScore): number {
return 1
}
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@18x18az/abacus",
"version": "0.0.0",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"repository": "https://github.com/18x18az/abacus",
"author": "Alec Miller <alecmichaelmiller@gmail.com>",
"license": "MIT",
"scripts": {
"build": "rimraf dist && tsc",
"lint": "ts-standard",
"prepare": "husky install",
"semantic-release": "semantic-release --branches main"
},
"files": [
"dist/**"
],
"devDependencies": {
"@types/node": "^20.5.0",
"husky": "^8.0.3",
"ts-standard": "^12.0.2",
"typescript": "^5.1.6"
},
"dependencies": {
"@18x18az/maestro-interfaces": "^1.5.1"
}
}
22 changes: 22 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"sourceMap": true,
"allowJs": true,
"resolveJsonModule": true,
"incremental": true,
"noImplicitAny": false,
"noLib": false,
"target": "es6",
"outDir": "./dist",
"skipLibCheck": true,
"baseUrl": "./lib",
"strictNullChecks": true
}
}
Loading

0 comments on commit 480b261

Please sign in to comment.