Skip to content

Commit

Permalink
Merge pull request #2 from Pugma/setupEnvironments
Browse files Browse the repository at this point in the history
cargo / node & each GitHub Actions setup
  • Loading branch information
Pugma authored May 3, 2024
2 parents 8196a34 + 84d2c99 commit 7544f3d
Show file tree
Hide file tree
Showing 28 changed files with 3,700 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: client

on:
pull_request:
branches:
- main
paths:
- "/client/**/*"
- .github/workflows/client.yaml

jobs:
setup-packages:
name: Check npm packages
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
sparse-checkout: client
- name: setup node
uses: actions/setup-node@v4
with:
node-version-file: ./client/.node-version
cache: npm
cache-dependency-path: ./client/package-lock.json
- name: npm ci
run: npm ci
working-directory: ./client/
build-check:
name: Check npm build
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
sparse-checkout: client
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ./client/.node-version
cache: npm
cache-dependency-path: ./client/package-lock.json
- name: npm ci
run: npm ci
working-directory: ./client/
- name: Run build
run: npm run build
working-directory: ./client/
23 changes: 23 additions & 0 deletions .github/workflows/server.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: server

on:
pull_request:
branches:
- main
paths:
- "/server/**/*"
- .github/workflows/server.yaml

jobs:
build-check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
sparse-checkout: server
- name: install cargo
run: curl -y --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- name: build files
run: cargo build --release
working-directory: ./server/
15 changes: 15 additions & 0 deletions client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution')

module.exports = {
root: true,
'extends': [
'plugin:vue/vue3-essential',
'eslint:recommended',
'@vue/eslint-config-typescript',
'@vue/eslint-config-prettier/skip-formatting'
],
parserOptions: {
ecmaVersion: 'latest'
}
}
30 changes: 30 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo
1 change: 1 addition & 0 deletions client/.node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
8 changes: 8 additions & 0 deletions client/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
7 changes: 7 additions & 0 deletions client/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"Vue.volar",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
39 changes: 39 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# client

This template should help get you started developing with Vue 3 in Vite.

## Recommended IDE Setup

[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).

## Type Support for `.vue` Imports in TS

TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types.

## Customize configuration

See [Vite Configuration Reference](https://vitejs.dev/config/).

## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run dev
```

### Type-Check, Compile and Minify for Production

```sh
npm run build
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```
1 change: 1 addition & 0 deletions client/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
13 changes: 13 additions & 0 deletions client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
Loading

0 comments on commit 7544f3d

Please sign in to comment.