Skip to content

Commit

Permalink
fix: add type check to client ci, rm type errors
Browse files Browse the repository at this point in the history
- remove base class from tutorial API that didn't get fully implemented
- remove TSX shim since this appears unused and causes compiler to
  complain

ref virtualcommons#878
  • Loading branch information
sgfost committed Aug 1, 2023
1 parent 08e86cf commit 363a8d4
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 46 deletions.
57 changes: 28 additions & 29 deletions .github/workflows/check-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,47 @@ name: Check Code Style/Lint

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:

client:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Clean install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Check formatting
# run regardless of whether linting caught errors
if: ${{ success() || failure() }}
run: yarn style
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Clean install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Check formatting
# run regardless of whether linting caught errors
if: ${{ success() || failure() }}
run: yarn style

server:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./server
steps:
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Clean install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Check formatting
# run regardless of whether linting caught errors
if: ${{ success() || failure() }}
run: yarn style
- uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Clean install
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Check formatting
# run regardless of whether linting caught errors
if: ${{ success() || failure() }}
run: yarn style
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ deploy: build

.PHONY: buildprod
buildprod: docker-compose.yml
docker compose run --rm client yarn build
docker compose run --rm client yarn type-check-build
docker compose run --rm server yarn build

.PHONY: clean
Expand Down
4 changes: 3 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"type-check-build": "tsc --noEmit && vue-cli-service build",
"loadtest": "ts-node -r tsconfig-paths/register src/loadtest.ts",
"test:unit": "NODE_ENV=test vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "eslint ./ --ext .ts,.vue",
"lint:fix": "eslint --fix ./ --ext .ts,.vue",
"style": "prettier --config ../.prettierrc --check 'src/**/*.{ts,vue}'",
"style:fix": "prettier --config ../.prettierrc --write 'src/**/*.{ts,vue}'"
"style:fix": "prettier --config ../.prettierrc --write 'src/**/*.{ts,vue}'",
"type-check": "tsc --noEmit"
},
"dependencies": {
"@colyseus/schema": "^1.0.9",
Expand Down
3 changes: 1 addition & 2 deletions client/src/api/tutorial/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ import { ChatMarsLogView, HUDLeftView, HUDRightView } from "@port-of-mars/shared
import * as _ from "lodash";
import { Store } from "vuex/types/index";
import { StateTransform } from "@port-of-mars/client/types/tutorial";
import { AbstractGameAPI } from "@port-of-mars/client/api/game/types";
import { SfxManager } from "@port-of-mars/client/util";

export class TutorialAPI implements AbstractGameAPI {
export class TutorialAPI {
count: number = 1;
private store!: Store<State>;
private stateStack: Array<StateTransform[]> = [];
Expand Down
13 changes: 0 additions & 13 deletions client/src/types/shims-tsx.d.ts

This file was deleted.

0 comments on commit 363a8d4

Please sign in to comment.