Skip to content

Commit d6837d8

Browse files
committed
Upgrades + CI
1 parent 94f3f17 commit d6837d8

File tree

12 files changed

+1301
-615
lines changed

12 files changed

+1301
-615
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
extends: [
77
"plugin:vue/vue3-essential",
88
"eslint:recommended",
9-
"@vue/eslint-config-prettier",
10-
],
9+
"@vue/eslint-config-prettier"
10+
]
1111
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Install Node Dependencies"
2+
description: "Install dependencies using yarn"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Use Node.js
7+
uses: actions/setup-node@v3
8+
with:
9+
node-version-file: ".nvmrc"
10+
cache: "yarn"
11+
- name: Install dependencies
12+
run: yarn install
13+
shell: bash

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "npm" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "monthly"

.github/workflows/pr.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
on:
2+
pull_request:
3+
types: [opened, synchronize, reopened]
4+
merge_group:
5+
types: [checks_requested]
6+
7+
# cancel previous runs on the same PR
8+
concurrency:
9+
group: ${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
name: ⛷ PR tests
13+
14+
env:
15+
CI: true
16+
TARGET_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
jobs:
23+
build-format-lint-test:
24+
name: 🚀 Build, lint and test
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 30
27+
steps:
28+
- name: "📥️ Checkout"
29+
uses: actions/checkout@v3
30+
with:
31+
ref: ${{ env.TARGET_SHA }}
32+
- name: "⚙️📦️ Install & cache node dependencies"
33+
uses: ./.github/actions/install-node-deps
34+
- name: "⚙️🛠️ Build"
35+
run: yarn build
36+
- name: "🧪🖼️ Test linter"
37+
run: yarn test:lint
38+
- name: "🧪🔬 Run unit tests"
39+
run: yarn test:unit

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "none",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": false
6+
}

.vscode/extensions.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
{
2-
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
2+
"recommendations": [
3+
"vue.volar",
4+
"vue.vscode-typescript-vue-plugin",
5+
"dbaeumer.vscode-eslint",
6+
"esbenp.prettier-vscode"
7+
]
38
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" href="/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite App</title>
7+
<title>Dojo Battleship Theodo</title>
88
</head>
99
<body>
1010
<div id="app"></div>

package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,30 @@
22
"name": "dojo-battleship",
33
"version": "0.0.0",
44
"private": true,
5+
"homepage": "https://theodo.github.io/dojo-battleship/",
56
"scripts": {
67
"dev": "vite",
78
"build": "vite build",
89
"preview": "vite preview --port 4173",
10+
"test:lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore",
911
"test:unit": "vitest --environment jsdom",
10-
"test": "yarn test:unit",
12+
"test": "yarn test:lint && yarn test:unit",
1113
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
1214
},
1315
"dependencies": {
14-
"vue": "^3.2.37"
16+
"vue": "^3.3.4"
1517
},
1618
"devDependencies": {
17-
"@rushstack/eslint-patch": "^1.1.0",
18-
"@vitejs/plugin-vue": "^2.3.3",
19-
"@vue/eslint-config-prettier": "^7.0.0",
20-
"@vue/test-utils": "^2.0.0",
21-
"eslint": "^8.5.0",
22-
"eslint-plugin-vue": "^9.0.0",
23-
"jsdom": "^20.0.0",
24-
"prettier": "^2.5.1",
25-
"sass": "^1.53.0",
26-
"vite": "^2.9.16",
27-
"vitest": "^0.15.1"
19+
"@rushstack/eslint-patch": "^1.3.3",
20+
"@vitejs/plugin-vue": "^4.3.4",
21+
"@vue/eslint-config-prettier": "^8.0.0",
22+
"@vue/test-utils": "^2.4.1",
23+
"eslint": "^8.48.0",
24+
"eslint-plugin-vue": "^9.17.0",
25+
"jsdom": "^22.1.0",
26+
"prettier": "^3.0.3",
27+
"sass": "^1.66.1",
28+
"vite": "^4.4.9",
29+
"vitest": "^0.34.4"
2830
}
2931
}

test/App.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { describe, it } from "vitest";
2+
import { mount } from "@vue/test-utils";
3+
import App from "@/App.vue";
4+
5+
describe("Mount app", () => {
6+
it("Should render", () => {
7+
mount(App);
8+
});
9+
});

0 commit comments

Comments
 (0)