-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from kuubson/boost-config
Boost config
- Loading branch information
Showing
78 changed files
with
9,070 additions
and
3,915 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
lint_and_test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18.x' | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Run pnpm check | ||
run: pnpm check | ||
|
||
- name: Run unit tests | ||
run: pnpm test:unit:run | ||
|
||
- name: Run integration tests | ||
run: pnpm test:integration:run | ||
|
||
- name: Start server background process (for e2e tests) | ||
run: pnpm pm2:start | ||
|
||
- name: Install cypress | ||
run: pnpm cypress:install # NOTE: Install cypress manually due to pnpm cache issue | ||
|
||
- name: Run e2e tests | ||
run: pnpm test:e2e:run | ||
|
||
- name: Stop server background process | ||
run: pnpm pm2:delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# lockfile | ||
pnpm-lock.yaml | ||
|
||
# dependencies | ||
node_modules | ||
|
||
# testing | ||
coverage | ||
|
||
# builds | ||
dist | ||
|
||
# vite | ||
dev-dist | ||
|
||
# misc | ||
.DS_Store | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.pnpm-debug.log* | ||
tsconfig.tsbuildinfo | ||
|
||
# env files | ||
.env | ||
.env.test | ||
|
||
# turbo | ||
.turbo | ||
|
||
# cypress | ||
screenshots | ||
videos | ||
downloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"customSyntax": "postcss-styled-syntax", | ||
"rules": { | ||
"custom-property-pattern": "^[a-z][a-zA-Z0-9]+$", | ||
"declaration-block-no-duplicate-properties": true, | ||
"no-descending-specificity": true, | ||
"value-no-vendor-prefix": null, | ||
"property-no-vendor-prefix": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": ["@react-vite-trpc/eslint-config"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@react-vite-trpc/config", | ||
"version": "1.0.0", | ||
"private": true, | ||
"sideEffects": false, | ||
"main": "src/index.ts", | ||
"types": "src/index.ts", | ||
"scripts": { | ||
"dev": "pnpm build:lib --watch", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"ts:check": "tsc -b", | ||
"check": "pnpm lint && pnpm ts:check", | ||
"build:lib": "tsup src/index.ts --format cjs" | ||
}, | ||
"dependencies": { | ||
"envalid": "^7.3.1" | ||
}, | ||
"devDependencies": { | ||
"@react-vite-trpc/eslint-config": "workspace:*", | ||
"@react-vite-trpc/tsconfig": "workspace:*", | ||
"@types/node": "^20.4.5", | ||
"tsup": "^7.1.0", | ||
"typescript": "^5.1.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './services' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { cleanEnv } from 'envalid' | ||
|
||
const { isProd } = cleanEnv(process.env, {}) | ||
|
||
export class HttpService { | ||
private static readonly host = 'react-vite-trpc.onrender.com' // NOTE: must be a raw hostname | ||
|
||
private static readonly serverPort = 3001 | ||
|
||
private static readonly clientPort = 3000 | ||
|
||
public static readonly serverUrl = isProd ? `https://${this.host}` : `http://localhost:${this.serverPort}` | ||
|
||
public static readonly clientUrl = isProd ? `https://${this.host}` : `http://localhost:${this.clientPort}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { HttpService } from './httpService' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@react-vite-trpc/tsconfig/base.json", | ||
"compilerOptions": { | ||
"baseUrl": "src", | ||
"outDir": "dist" | ||
}, | ||
"references": [] | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'prettier', 'unused-imports'], | ||
ignorePatterns: ['node_modules', '.turbo', 'dist', 'dev-dist', 'coverage'], | ||
rules: { | ||
'prettier/prettier': ['error', { endOfLine: 'auto' }], | ||
'no-return-await': ['error'], | ||
'prefer-destructuring': ['error'], | ||
'object-shorthand': ['error'], | ||
'no-unneeded-ternary': ['error'], | ||
'prefer-template': ['error'], | ||
'@typescript-eslint/consistent-type-imports': ['error', { fixStyle: 'inline-type-imports' }], | ||
'no-empty': ['error', { allowEmptyCatch: true }], | ||
'unused-imports/no-unused-imports': 'warn', | ||
'@typescript-eslint/no-unused-vars': [ | ||
'error', | ||
{ | ||
argsIgnorePattern: '^_', | ||
varsIgnorePattern: '^_', | ||
}, | ||
], | ||
'object-curly-newline': [ | ||
'warn', | ||
{ | ||
ObjectExpression: { | ||
multiline: true, | ||
minProperties: 2, | ||
}, | ||
}, | ||
], | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@react-vite-trpc/eslint-config", | ||
"version": "1.0.0", | ||
"private": true, | ||
"sideEffects": false, | ||
"main": "eslint.js", | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^6.2.1", | ||
"@typescript-eslint/parser": "^6.2.1", | ||
"eslint": "^8.46.0", | ||
"eslint-config-prettier": "^9.0.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "^7.33.1", | ||
"eslint-plugin-unused-imports": "^3.0.0", | ||
"prettier": "^2.8.8", | ||
"typescript": "^5.1.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
extends: ['./eslint', 'plugin:react/recommended'], | ||
settings: { react: { version: '18.2.0' } }, | ||
rules: { | ||
'@typescript-eslint/ban-types': 'warn', | ||
'react/no-unescaped-entities': 'warn', | ||
'react/react-in-jsx-scope': 'off', | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
{ "extends": "@react-vite-trpc/tsconfig/react.json" } | ||
{ | ||
"extends": "@react-vite-trpc/tsconfig/react.json", | ||
"compilerOptions": { | ||
"baseUrl": "src", | ||
"outDir": "dist" | ||
}, | ||
"references": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 kuubson | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.