Skip to content

Commit

Permalink
Upgrades + CI
Browse files Browse the repository at this point in the history
  • Loading branch information
guiyom-e committed Sep 13, 2023
1 parent 94f3f17 commit d6837d8
Show file tree
Hide file tree
Showing 12 changed files with 1,301 additions and 615 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ module.exports = {
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/eslint-config-prettier",
],
"@vue/eslint-config-prettier"
]
};
13 changes: 13 additions & 0 deletions .github/actions/install-node-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Install Node Dependencies"
description: "Install dependencies using yarn"
runs:
using: "composite"
steps:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "yarn"
- name: Install dependencies
run: yarn install
shell: bash
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
39 changes: 39 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
pull_request:
types: [opened, synchronize, reopened]
merge_group:
types: [checks_requested]

# cancel previous runs on the same PR
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

name: ⛷ PR tests

env:
CI: true
TARGET_SHA: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}

defaults:
run:
shell: bash

jobs:
build-format-lint-test:
name: 🚀 Build, lint and test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: "📥️ Checkout"
uses: actions/checkout@v3
with:
ref: ${{ env.TARGET_SHA }}
- name: "⚙️📦️ Install & cache node dependencies"
uses: ./.github/actions/install-node-deps
- name: "⚙️🛠️ Build"
run: yarn build
- name: "🧪🖼️ Test linter"
run: yarn test:lint
- name: "🧪🔬 Run unit tests"
run: yarn test:unit
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "none",
"tabWidth": 2,
"semi": true,
"singleQuote": false
}
7 changes: 6 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
"recommendations": [
"vue.volar",
"vue.vscode-typescript-vue-plugin",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<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>
<title>Dojo Battleship Theodo</title>
</head>
<body>
<div id="app"></div>
Expand Down
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,30 @@
"name": "dojo-battleship",
"version": "0.0.0",
"private": true,
"homepage": "https://theodo.github.io/dojo-battleship/",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 4173",
"test:lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --ignore-path .gitignore",
"test:unit": "vitest --environment jsdom",
"test": "yarn test:unit",
"test": "yarn test:lint && yarn test:unit",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
},
"dependencies": {
"vue": "^3.2.37"
"vue": "^3.3.4"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.0",
"@vitejs/plugin-vue": "^2.3.3",
"@vue/eslint-config-prettier": "^7.0.0",
"@vue/test-utils": "^2.0.0",
"eslint": "^8.5.0",
"eslint-plugin-vue": "^9.0.0",
"jsdom": "^20.0.0",
"prettier": "^2.5.1",
"sass": "^1.53.0",
"vite": "^2.9.16",
"vitest": "^0.15.1"
"@rushstack/eslint-patch": "^1.3.3",
"@vitejs/plugin-vue": "^4.3.4",
"@vue/eslint-config-prettier": "^8.0.0",
"@vue/test-utils": "^2.4.1",
"eslint": "^8.48.0",
"eslint-plugin-vue": "^9.17.0",
"jsdom": "^22.1.0",
"prettier": "^3.0.3",
"sass": "^1.66.1",
"vite": "^4.4.9",
"vitest": "^0.34.4"
}
}
9 changes: 9 additions & 0 deletions test/App.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { describe, it } from "vitest";
import { mount } from "@vue/test-utils";
import App from "@/App.vue";

describe("Mount app", () => {
it("Should render", () => {
mount(App);
});
});
6 changes: 3 additions & 3 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),
},
},
"@": fileURLToPath(new URL("./src", import.meta.url))
}
}
});
Loading

0 comments on commit d6837d8

Please sign in to comment.