diff --git a/.depcheckrc.yml b/.depcheckrc.yml deleted file mode 100644 index 107384a..0000000 --- a/.depcheckrc.yml +++ /dev/null @@ -1,8 +0,0 @@ -# https://github.com/depcheck/depcheck#usage -# pnpm add json -g -# pnpm exec depcheck --json | json - -# pnpm exec depcheck - -# ignores: ["eslint", "babel-*"] -# skip-missing: true diff --git a/.depcheck.js b/.github/.depcheck.js similarity index 93% rename from .depcheck.js rename to .github/.depcheck.js index da70242..d5aae27 100644 --- a/.depcheck.js +++ b/.github/.depcheck.js @@ -1,10 +1,10 @@ // https://github.com/depcheck/depcheck?tab=readme-ov-file#api -// node .depcheck.js +// node .github/.depcheck.js import depcheck from 'depcheck'; const unused = await depcheck(process.cwd(), { - ignorePatterns: ['tsconfig.json'], + ignorePatterns: [], }); console.debug(`unused.dependencies :>>`, unused.dependencies); // an array containing the unused dependencies diff --git a/.github/.depcheckrc.yaml b/.github/.depcheckrc.yaml new file mode 100644 index 0000000..ff400bd --- /dev/null +++ b/.github/.depcheckrc.yaml @@ -0,0 +1,9 @@ +# https://github.com/depcheck/depcheck#usage +# ##### +# pnpm exec depcheck --config .github/.depcheckrc.yaml +# ##### +# pnpm add json -g +# pnpm exec depcheck --json | json + +ignores: ['@iconify-json/*'] +skip-missing: true diff --git a/.github/workflows/depcheck.yaml b/.github/workflows/depcheck.yaml index a4f2e3e..3fcee91 100644 --- a/.github/workflows/depcheck.yaml +++ b/.github/workflows/depcheck.yaml @@ -11,7 +11,7 @@ jobs: steps: - uses: yanhao98/composite-actions/setup-node-environment@ae9301946790d96f75c7ebe54a34bbaf9f5469d0 - run: npx depcheck || true - - run: node .depcheck.js + - run: node .github/.depcheck.js - run: npx taze --help - run: npx taze - run: npx taze -a diff --git a/playwright.config.ts b/playwright.config.ts index ce88ec8..5830c25 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -60,7 +60,7 @@ export default defineConfig({ reporter: 'html', /* Retry on CI only */ retries: process.env.CI ? 2 : 0, - testDir: './tests/e2e', + testDir: './tests/playwright', /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ use: { /* Base URL to use in actions like `await page.goto('/')`. */ diff --git a/src/styles/index.ts b/src/styles/index.ts index 7cbb09a..eed6789 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -1,5 +1,4 @@ import 'nprogress/nprogress.css'; // -// https://unocss.dev/guide/style-reset#tailwind-compat // // import '@unocss/reset/tailwind.css'; import '@unocss/reset/tailwind-compat.css'; @@ -11,7 +10,7 @@ import './main.less'; import 'primeicons/primeicons.css'; -import './reset-primevue.css'; -import './reset-antdv.less'; +import './reset/reset-primevue.css'; +import './reset/reset-antdv.less'; import 'virtual:uno.css'; diff --git a/src/styles/reset-antdv.less b/src/styles/reset/reset-antdv.less similarity index 100% rename from src/styles/reset-antdv.less rename to src/styles/reset/reset-antdv.less diff --git a/src/styles/reset-primevue.css b/src/styles/reset/reset-primevue.css similarity index 100% rename from src/styles/reset-primevue.css rename to src/styles/reset/reset-primevue.css diff --git a/src/styles/reset-vant.css b/src/styles/reset/reset-vant.css similarity index 100% rename from src/styles/reset-vant.css rename to src/styles/reset/reset-vant.css diff --git a/src/styles/reset/tailwind.css b/src/styles/reset/tailwind.css index 9e5ecab..7b59e56 100644 --- a/src/styles/reset/tailwind.css +++ b/src/styles/reset/tailwind.css @@ -1,4 +1,8 @@ -/* https://github.com/unocss/unocss/issues/2127 */ +/* https://unocss.dev/guide/style-reset#tailwind-compat */ + +/* The background color of some button styles in component libraries are lost when referencing the tailwind.css file. + https://github.com/unocss/unocss/issues/2127 +*/ :where(button:not(.ant-btn):not(.p-button)), :where([type='button']:not(.ant-btn):not(.p-button)), diff --git a/tests/e2e/api-page.spec.ts b/tests/playwright/api-page.spec.ts similarity index 100% rename from tests/e2e/api-page.spec.ts rename to tests/playwright/api-page.spec.ts diff --git a/tests/e2e/test-1.spec.ts b/tests/playwright/test-1.spec.ts similarity index 100% rename from tests/e2e/test-1.spec.ts rename to tests/playwright/test-1.spec.ts diff --git a/vite.config.plugins.ts b/vite.config.plugins.ts index b3aafd3..799aec7 100644 --- a/vite.config.plugins.ts +++ b/vite.config.plugins.ts @@ -96,11 +96,7 @@ export function Plugins() { createUtils4uAutoImports([ 'primevue', // 参考重写 utils4u 的 createUtils4uAutoImports 的逻辑 https://github.com/unplugin/unplugin-auto-import/blob/main/src/presets/vueuse-core.ts ]), - { - 'utils4u/vue-use': createUtils4uAutoImports(['primevue'])['utils4u/vue-use'].filter( - (item) => !['useCountdown'].includes(item.toString()), // FIXME: Duplicated imports "useCountdown", the one from "@vueuse/core" has been ignored and "utils4u/vue-use" is used - ), - }, + createUtils4uAutoImports(['primevue'])['utils4u/vue-use'], ), { 'consola/browser': ['consola'],