Skip to content

Commit

Permalink
ci: add lint-staged check
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Sep 15, 2024
1 parent 41bdc33 commit 86b565d
Show file tree
Hide file tree
Showing 15 changed files with 922 additions and 330 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/vercel.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Production Tag Deployment

env:
Expand All @@ -7,7 +6,7 @@ env:
on:
push:
# Pattern matched against refs/tags
tags:
tags:
- '*' # Push events to every tag not containing /

jobs:
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
shamefully-hoist=true
strict-peer-dependencies=false
shell-emulator=true
ignore-workspace-root-check=true
4 changes: 2 additions & 2 deletions app/app.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { installPrompt } from './utils/pwa'
import { appName } from '~/constants'
import { useIndexedDB } from '~/composables/db'
import { appName } from '~/constants'
import { installPrompt } from './utils/pwa'
// https://nuxt.com/docs/api/composables/use-head
useHead({
Expand Down
4 changes: 2 additions & 2 deletions app/components/ChooseFood.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import { storeToRefs } from 'pinia'
import type { StuffItem } from '~/types'
import { useEmojiAnimation } from '~/composables/animation'
import { meat, staple, tools, vegetable } from '~/data/food'
import { useEmojiAnimation } from '~/composables/animation'
import type { StuffItem } from '~/types'
const rStore = useRecipeStore()
const { curTool } = storeToRefs(rStore)
Expand Down
4 changes: 2 additions & 2 deletions app/components/tags/DishTag.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { DbRecipeItem } from '~/utils/db'
import { recipeHistories } from '~/composables/store/history'
import { tools } from '~/data/food'
import type { RecipeItem } from '~/types'
import { getEmojisFromStuff } from '~/utils'
import { recipeHistories } from '~/composables/store/history'
import type { DbRecipeItem } from '~/utils/db'
const props = defineProps<{
dish: RecipeItem | DbRecipeItem
Expand Down
2 changes: 1 addition & 1 deletion app/composables/animation.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isClient } from '@vueuse/core'
import type { Ref } from 'vue'
import { isClient } from '@vueuse/core'

export function useEmojiAnimation(recipeBtn: Ref<HTMLButtonElement | undefined>) {
const { x, y } = usePointer()
Expand Down
4 changes: 2 additions & 2 deletions app/composables/store/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { acceptHMRUpdate, defineStore } from 'pinia'
import { useStorage } from '@vueuse/core'
import { acceptHMRUpdate, defineStore } from 'pinia'
import { ref } from 'vue'
import { defaultSettings } from '../../utils/settings'
import { namespace } from '../../constants'
import { defaultSettings } from '../../utils/settings'

export const useAppStore = defineStore('app', () => {
const deferredPrompt = ref<Event | any>()
Expand Down
6 changes: 3 additions & 3 deletions app/composables/store/recipe.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { acceptHMRUpdate, defineStore } from 'pinia'
import { useGtm } from '@gtm-support/vue-gtm'
import { useStorage } from '@vueuse/core'
import { acceptHMRUpdate, defineStore } from 'pinia'
import { computed, onMounted, ref, watch } from 'vue'
import { useGtm } from '@gtm-support/vue-gtm'
import type { RecipeItem, StuffItem } from '~/types'
import { db } from '../../utils/db'
import { useAppStore } from './app'
import type { RecipeItem, StuffItem } from '~/types'

const namespace = 'cook'

Expand Down
2 changes: 1 addition & 1 deletion app/config/pwa.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import process from 'node:process'
import type { ModuleOptions } from '@vite-pwa/nuxt'
import process from 'node:process'
import { appDescription, appName } from '../constants/index'

const scope = '/'
Expand Down
2 changes: 1 addition & 1 deletion app/data/recipe.json

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions app/styles/css-vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,5 @@
// cook custom
:root {
--cook-bottom-menu-padding-bottom: 20px;
--cook-bottom-menu-height: calc(
64px + var(--cook-bottom-menu-padding-bottom)
);
--cook-bottom-menu-height: calc(64px + var(--cook-bottom-menu-padding-bottom));
}
20 changes: 15 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"vue-about-me": "^1.2.7"
},
"devDependencies": {
"@antfu/eslint-config": "^2.27.3",
"@antfu/eslint-config": "^3.6.0",
"@headlessui/vue": "^1.7.23",
"@iconify-json/carbon": "^1.2.1",
"@iconify-json/fe": "^1.2.0",
Expand All @@ -55,19 +55,29 @@
"eslint": "^9.10.0",
"eslint-plugin-format": "^0.1.2",
"fake-indexeddb": "^6.0.0",
"happy-dom": "^14.12.3",
"jsdom": "^24.1.3",
"jsdom": "^25.0.0",
"lint-staged": "^15.2.10",
"nuxt": "3.13.1",
"nuxt-fix-ofetch": "^0.0.14",
"nuxt-fix-ofetch": "^0.0.15",
"nuxt-vitest": "^0.11.5",
"pinia": "^2.2.2",
"sass": "^1.78.0",
"serve": "^14.2.3",
"simple-git-hooks": "^2.11.1",
"star-markdown-css": "^0.5.1",
"tsx": "^4.19.1",
"typescript": "^5.6.2",
"typescript": "^5.5.4",
"unocss": "^0.62.3",
"vitest": "^2.1.1",
"vue-tsc": "^2.1.6"
},
"resolutions": {
"@typescript-eslint/utils": "^8.2.0"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
}
}
1,192 changes: 888 additions & 304 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/convert.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RecipeItem, Recipes } from '../app/types'
// convert csv to json
import fs from 'node:fs'
import consola from 'consola'
import type { RecipeItem, Recipes } from '../app/types'

import { config } from './config'

Expand Down
2 changes: 1 addition & 1 deletion test/recipe.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { beforeEach, describe, expect, it } from 'vitest'
import { createPinia, setActivePinia } from 'pinia'
import { beforeEach, describe, expect, it } from 'vitest'
import { useRecipeStore } from '../composables/store'

describe('recipe interaction', () => {
Expand Down

0 comments on commit 86b565d

Please sign in to comment.