feat: stale dep as a nuxt module

This commit is contained in:
三咲智子 Kevin Deng 2023-01-14 02:57:31 +08:00
parent 3defa7f110
commit b6c916517c
No known key found for this signature in database
GPG key ID: 69992F2250DFD93E
4 changed files with 34 additions and 22 deletions

11
modules/stale-dep.ts Normal file
View file

@ -0,0 +1,11 @@
import { defineNuxtModule } from '@nuxt/kit'
import { check } from 'stale-dep'
export default defineNuxtModule({
meta: {
name: 'stale-dep',
},
setup() {
return check('pnpm')
},
})

View file

@ -30,6 +30,7 @@ export default defineNuxtConfig({
'~/modules/build-env', '~/modules/build-env',
'~/modules/tauri/index', '~/modules/tauri/index',
'~/modules/pwa/index', // change to '@vite-pwa/nuxt' once released and remove pwa module '~/modules/pwa/index', // change to '@vite-pwa/nuxt' once released and remove pwa module
'~/modules/stale-dep',
], ],
experimental: { experimental: {
payloadExtraction: false, payloadExtraction: false,

View file

@ -6,23 +6,23 @@
"license": "MIT", "license": "MIT",
"homepage": "https://elk.zone/", "homepage": "https://elk.zone/",
"scripts": { "scripts": {
"build": "stale-dep && nuxi build", "build": "nuxi build",
"dev": "stale-dep && nuxi dev --port 5314", "dev": "nuxi dev --port 5314",
"dev:pwa": "stale-dep && VITE_DEV_PWA=true nuxi dev --port 5314", "dev:pwa": "VITE_DEV_PWA=true nuxi dev --port 5314",
"dev:mocked": "stale-dep && nuxi dev --port 5314 --dotenv .env.mock", "dev:mocked": "nuxi dev --port 5314 --dotenv .env.mock",
"dev:mocked:pwa": "stale-dep && VITE_DEV_PWA=true nuxi dev --port 5314 --dotenv .env.mock", "dev:mocked:pwa": "VITE_DEV_PWA=true nuxi dev --port 5314 --dotenv .env.mock",
"dev:mocked:pwa:ssl": "stale-dep && VITE_DEV_PWA=true nuxi dev --port 5314 --https --ssl-cert ./https-dev-config/localhost.crt --ssl-key ./https-dev-config/localhost.key --dotenv .env.mock", "dev:mocked:pwa:ssl": "VITE_DEV_PWA=true nuxi dev --port 5314 --https --ssl-cert ./https-dev-config/localhost.crt --ssl-key ./https-dev-config/localhost.key --dotenv .env.mock",
"start": "PORT=5314 node .output/server/index.mjs", "start": "PORT=5314 node .output/server/index.mjs",
"start:https": "PORT=5314 node ./https-dev-config/local-https-server.mjs", "start:https": "PORT=5314 node ./https-dev-config/local-https-server.mjs",
"lint": "eslint --cache .", "lint": "eslint --cache .",
"typecheck": "stale-dep && nuxi typecheck", "typecheck": "stale-dep && nuxi typecheck",
"prepare": "esno scripts/prepare.ts", "prepare": "esno scripts/prepare.ts",
"generate": "stale-dep && nuxi generate", "generate": "nuxi generate",
"test:unit": "stale-dep && vitest", "test:unit": "stale-dep && vitest",
"test:typecheck": "stale-dep && vue-tsc --noEmit && vue-tsc --noEmit --project service-worker/tsconfig.json", "test:typecheck": "stale-dep && vue-tsc --noEmit && vue-tsc --noEmit --project service-worker/tsconfig.json",
"test": "stale-dep && nr test:unit", "test": "stale-dep && nr test:unit",
"update:team:avatars": "esno scripts/avatars.ts", "update:team:avatars": "esno scripts/avatars.ts",
"postinstall": "nuxi prepare && simple-git-hooks && stale-dep -u", "postinstall": "stale-dep -u && simple-git-hooks && nuxi prepare",
"release": "stale-dep && bumpp && esno scripts/release.ts" "release": "stale-dep && bumpp && esno scripts/release.ts"
}, },
"dependencies": { "dependencies": {
@ -105,7 +105,7 @@
"rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-node-polyfills": "^0.2.1",
"simple-git": "^3.15.1", "simple-git": "^3.15.1",
"simple-git-hooks": "^2.8.1", "simple-git-hooks": "^2.8.1",
"stale-dep": "^0.2.1", "stale-dep": "^0.3.1",
"std-env": "^3.3.1", "std-env": "^3.3.1",
"theme-vitesse": "^0.6.0", "theme-vitesse": "^0.6.0",
"typescript": "^4.9.4", "typescript": "^4.9.4",

View file

@ -105,7 +105,7 @@ importers:
simple-git: ^3.15.1 simple-git: ^3.15.1
simple-git-hooks: ^2.8.1 simple-git-hooks: ^2.8.1
slimeform: ^0.8.0 slimeform: ^0.8.0
stale-dep: ^0.2.1 stale-dep: ^0.3.1
std-env: ^3.3.1 std-env: ^3.3.1
tauri-plugin-log-api: github:tauri-apps/tauri-plugin-log tauri-plugin-log-api: github:tauri-apps/tauri-plugin-log
tauri-plugin-store-api: github:tauri-apps/tauri-plugin-store tauri-plugin-store-api: github:tauri-apps/tauri-plugin-store
@ -203,7 +203,7 @@ importers:
rollup-plugin-node-polyfills: 0.2.1 rollup-plugin-node-polyfills: 0.2.1
simple-git: 3.15.1 simple-git: 3.15.1
simple-git-hooks: 2.8.1 simple-git-hooks: 2.8.1
stale-dep: 0.2.1 stale-dep: 0.3.1
std-env: 3.3.1 std-env: 3.3.1
theme-vitesse: 0.6.0 theme-vitesse: 0.6.0
typescript: 4.9.4 typescript: 4.9.4
@ -1759,8 +1759,8 @@ packages:
vue-i18n: vue-i18n:
optional: true optional: true
dependencies: dependencies:
'@intlify/message-compiler': 9.3.0-beta.14 '@intlify/message-compiler': 9.3.0-beta.15
'@intlify/shared': 9.3.0-beta.14 '@intlify/shared': 9.3.0-beta.15
jsonc-eslint-parser: 1.4.1 jsonc-eslint-parser: 1.4.1
source-map: 0.6.1 source-map: 0.6.1
vue-i18n: 9.3.0-beta.13-972e836 vue-i18n: 9.3.0-beta.13-972e836
@ -1792,11 +1792,11 @@ packages:
source-map: 0.6.1 source-map: 0.6.1
dev: true dev: true
/@intlify/message-compiler/9.3.0-beta.14: /@intlify/message-compiler/9.3.0-beta.15:
resolution: {integrity: sha512-PlZ3pl+YYuql54Nq+26wv6ohIa8Ig6ALrvQI+f2zZKUtkupb49M4wyVN3bDQbFlgYVE7/u3n19BJSY8lEuX5Eg==} resolution: {integrity: sha512-kxx+pXsyoWhyFLEaJgnMk4AFiW3fvaCqpiql1alOHtkvQwzDKlrcKJ784GO4v/8SLt6JUHWfPpQH65GoYahdLA==}
engines: {node: '>= 14'} engines: {node: '>= 14'}
dependencies: dependencies:
'@intlify/shared': 9.3.0-beta.14 '@intlify/shared': 9.3.0-beta.15
source-map: 0.6.1 source-map: 0.6.1
dev: true dev: true
@ -1810,8 +1810,8 @@ packages:
engines: {node: '>= 14'} engines: {node: '>= 14'}
dev: true dev: true
/@intlify/shared/9.3.0-beta.14: /@intlify/shared/9.3.0-beta.15:
resolution: {integrity: sha512-mJ/rFan+4uVsBAQSCAJnpQaPvSjQ49mJMNmGelTUbTDAmgf0oexYxwqtKOlFFyY3hmQ8lUDYaGQKuYrFgRuHnA==} resolution: {integrity: sha512-thDJ+TGK8GGmOrgh/Vul24pPvRtRGvCyuGXcw/uh2t3lyJsCPfhzY5ZihJFkGvKEl4/J4M0F/SAeWKoZNm7hlw==}
engines: {node: '>= 14'} engines: {node: '>= 14'}
dev: true dev: true
@ -1831,7 +1831,7 @@ packages:
optional: true optional: true
dependencies: dependencies:
'@intlify/bundle-utils': 3.4.0_qjugkpmxfnp3l7d6jb7y3o5rvi '@intlify/bundle-utils': 3.4.0_qjugkpmxfnp3l7d6jb7y3o5rvi
'@intlify/shared': 9.3.0-beta.14 '@intlify/shared': 9.3.0-beta.15
'@rollup/pluginutils': 4.2.1 '@rollup/pluginutils': 4.2.1
'@vue/compiler-sfc': 3.2.45 '@vue/compiler-sfc': 3.2.45
debug: 4.3.4 debug: 4.3.4
@ -10829,8 +10829,8 @@ packages:
deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility'
dev: true dev: true
/stale-dep/0.2.1: /stale-dep/0.3.1:
resolution: {integrity: sha512-hZpAD9MmVlrPxCUoi/trN6WDc4TFDHwnFOKz4itfc1C+EKpg5dlYIf93RFDHlattRB1xyWCSJpyexGJdhSOyYw==} resolution: {integrity: sha512-mBoA6pZRWXA5jL1Yg6cd1gVQ7OPsZD7wkgSZUxjBxohepLolq8s/w0PKEmI35TIk2ggXKhW3JR35JQyS9J8B+g==}
engines: {node: '>=14.19.0'} engines: {node: '>=14.19.0'}
hasBin: true hasBin: true
dependencies: dependencies:
@ -12283,7 +12283,7 @@ packages:
vue-router: vue-router:
optional: true optional: true
dependencies: dependencies:
'@intlify/shared': 9.3.0-beta.14 '@intlify/shared': 9.3.0-beta.15
'@intlify/vue-i18n-bridge': 0.8.0_qjugkpmxfnp3l7d6jb7y3o5rvi '@intlify/vue-i18n-bridge': 0.8.0_qjugkpmxfnp3l7d6jb7y3o5rvi
'@intlify/vue-router-bridge': 0.8.0 '@intlify/vue-router-bridge': 0.8.0
ufo: 1.0.1 ufo: 1.0.1