From 700daca1315e16f652ee5485701f35136e770408 Mon Sep 17 00:00:00 2001 From: qwqcode Date: Sat, 5 Oct 2024 19:04:12 +0800 Subject: [PATCH] update package.json --- .github/workflows/test-frontend.yml | 5 +- docs/docs/package.json | 8 +- docs/landing/package.json | 6 +- package.json | 11 +- pnpm-lock.yaml | 144 ++++++++++++++++----------- scripts/setup-ui-dev-env.mjs | 49 --------- test/lightbox/package.json | 2 +- test/vue-test/package.json | 8 +- ui/artalk/package.json | 2 +- ui/eslint-plugin-artalk/package.json | 9 +- ui/plugin-katex/package.json | 6 +- ui/plugin-kit/package.json | 4 +- ui/plugin-lightbox/package.json | 7 +- 13 files changed, 117 insertions(+), 144 deletions(-) delete mode 100644 scripts/setup-ui-dev-env.mjs diff --git a/.github/workflows/test-frontend.yml b/.github/workflows/test-frontend.yml index dac04932..5d8f224e 100644 --- a/.github/workflows/test-frontend.yml +++ b/.github/workflows/test-frontend.yml @@ -45,9 +45,12 @@ jobs: - name: Package Build Test run: pnpm build:all - - name: Unit test + - name: Unit Test run: pnpm test + - name: Plugins Build Test + run: pnpm build:plugins + - name: Lint run: pnpm eslint ui && pnpm prettier --check ui diff --git a/docs/docs/package.json b/docs/docs/package.json index c2c73361..3525c1cb 100644 --- a/docs/docs/package.json +++ b/docs/docs/package.json @@ -16,11 +16,9 @@ }, "devDependencies": { "artalk": "workspace:^", - "vitepress": "1.3.4" - }, - "dependencies": { - "@artalk/plugin-katex": "^0.2.3", - "@artalk/plugin-lightbox": "^0.2.3", + "vitepress": "1.3.4", + "@artalk/plugin-katex": "^0.2.4", + "@artalk/plugin-lightbox": "^0.2.4", "katex": "^0.16.11", "lightgallery": "^2.7.2", "vue": "^3.5.6" diff --git a/docs/landing/package.json b/docs/landing/package.json index ed486aef..cc67daec 100644 --- a/docs/landing/package.json +++ b/docs/landing/package.json @@ -14,14 +14,12 @@ "preview": "vite preview", "update:readme": "npx tsx ./scripts/update-readme.ts" }, - "dependencies": { + "devDependencies": { "include-media": "^2.0.0", "normalize.css": "^8.0.1", "react": "^18.3.1", "react-dom": "^18.3.1", - "react-icons": "5.3.0" - }, - "devDependencies": { + "react-icons": "5.3.0", "@headlessui/react": "^2.1.8", "@types/react": "^18.3.7", "@types/react-dom": "^18.3.0", diff --git a/package.json b/package.json index 8fdc31fd..532ee0d4 100644 --- a/package.json +++ b/package.json @@ -10,20 +10,21 @@ "dev:landing": "pnpm -F=docs-landing dev", "build": "pnpm -F artalk build", "build:sidebar": "pnpm -F @artalk/artalk-sidebar build", + "build:all": "pnpm build && pnpm build:sidebar", + "build:plugins": "pnpm -F @artalk/plugin-* build", + "build:auth": "pnpm -F @artalk/plugin-auth build", "build:plugin-kit": "pnpm -F @artalk/plugin-kit build", "build:eslint-plugin": "pnpm -F eslint-plugin-artalk build", - "build:auth": "pnpm -F @artalk/plugin-auth build", - "build:all": "pnpm build && pnpm build:sidebar", "build:docs": "pnpm build && pnpm -F=docs-landing build && pnpm -F=docs-swagger swagger:build && pnpm -F=docs build:docs && pnpm patch:docs", "patch:docs": "cp -rf docs/landing/dist/* docs/swagger/dist/* docs/docs/.vitepress/dist", "lint:eslint": "eslint .", "lint:prettier": "prettier --check .", "lint": "pnpm lint:eslint && pnpm lint:prettier", "lint:fix": "pnpm lint:eslint --fix && pnpm lint:prettier --write", - "test": "pnpm -F artalk test", - "postinstall": "node scripts/setup-ui-dev-env.mjs" + "test": "pnpm -F artalk test" }, "devDependencies": { + "@artalk/plugin-kit": "^1.0.6", "@eslint/compat": "^1.1.1", "@eslint/js": "^9.10.0", "@playwright/test": "^1.47.1", @@ -35,7 +36,7 @@ "eslint": "^9.10.0", "eslint-config-prettier": "9.1.0", "eslint-import-resolver-typescript": "3.6.3", - "eslint-plugin-artalk": "workspace:^", + "eslint-plugin-artalk": "^1.0.1", "eslint-plugin-compat": "^6.0.1", "eslint-plugin-import-x": "^4.2.1", "eslint-plugin-react": "^7.36.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 865cf4ee..90726069 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: devDependencies: + '@artalk/plugin-kit': + specifier: ^1.0.6 + version: 1.0.6(@types/node@22.5.5)(artalk@2.9.1(marked@14.1.2))(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass@1.78.0)(terser@5.33.0)) '@eslint/compat': specifier: ^1.1.1 version: 1.1.1 @@ -42,8 +45,8 @@ importers: specifier: 3.6.3 version: 3.6.3(@typescript-eslint/parser@8.6.0(eslint@9.10.0)(typescript@5.6.2))(eslint-plugin-import-x@4.2.1(eslint@9.10.0)(typescript@5.6.2))(eslint-plugin-import@2.30.0)(eslint@9.10.0) eslint-plugin-artalk: - specifier: workspace:^ - version: link:ui/eslint-plugin-artalk + specifier: ^1.0.1 + version: 1.0.1(eslint@9.10.0)(typescript@5.6.2) eslint-plugin-compat: specifier: ^6.0.1 version: 6.0.1(eslint@9.10.0) @@ -112,47 +115,30 @@ importers: version: 9.4.3(eslint@9.10.0) docs/docs: - dependencies: + devDependencies: '@artalk/plugin-katex': specifier: ^0.2.3 version: 0.2.3(@types/katex@0.16.7)(artalk@ui+artalk)(katex@0.16.11) '@artalk/plugin-lightbox': specifier: ^0.2.3 version: 0.2.3(artalk@ui+artalk)(fancybox@3.0.1)(lightbox2@2.11.4)(lightgallery@2.7.2)(photoswipe@5.4.4) + artalk: + specifier: workspace:^ + version: link:../../ui/artalk katex: specifier: ^0.16.11 version: 0.16.11 lightgallery: specifier: ^2.7.2 version: 2.7.2 - vue: - specifier: ^3.5.6 - version: 3.5.6(typescript@5.6.2) - devDependencies: - artalk: - specifier: workspace:^ - version: link:../../ui/artalk vitepress: specifier: 1.3.4 version: 1.3.4(@algolia/client-search@5.4.3)(@types/node@22.5.5)(@types/react@18.3.7)(postcss@8.4.47)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(sass@1.79.1)(search-insights@2.17.2)(terser@5.33.0)(typescript@5.6.2) + vue: + specifier: ^3.5.6 + version: 3.5.6(typescript@5.6.2) docs/landing: - dependencies: - include-media: - specifier: ^2.0.0 - version: 2.0.0 - normalize.css: - specifier: ^8.0.1 - version: 8.0.1 - react: - specifier: ^18.3.1 - version: 18.3.1 - react-dom: - specifier: ^18.3.1 - version: 18.3.1(react@18.3.1) - react-icons: - specifier: 5.3.0 - version: 5.3.0(react@18.3.1) devDependencies: '@headlessui/react': specifier: ^2.1.8 @@ -172,9 +158,24 @@ importers: i18next-browser-languagedetector: specifier: ^8.0.0 version: 8.0.0 + include-media: + specifier: ^2.0.0 + version: 2.0.0 + normalize.css: + specifier: ^8.0.1 + version: 8.0.1 + react: + specifier: ^18.3.1 + version: 18.3.1 + react-dom: + specifier: ^18.3.1 + version: 18.3.1(react@18.3.1) react-i18next: specifier: ^15.0.2 version: 15.0.2(i18next@23.15.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-icons: + specifier: 5.3.0 + version: 5.3.0(react@18.3.1) usehooks-ts: specifier: ^3.1.0 version: 3.1.0(react@18.3.1) @@ -186,7 +187,7 @@ importers: version: 1.25.2(enzyme@3.11.0) test/lightbox: - dependencies: + devDependencies: '@artalk/plugin-lightbox': specifier: workspace:^ version: link:../../ui/plugin-lightbox @@ -210,16 +211,6 @@ importers: version: 5.4.4 test/vue-test: - dependencies: - artalk: - specifier: workspace:* - version: link:../../ui/artalk - vue: - specifier: ^3.5.6 - version: 3.5.6(typescript@5.6.2) - vue-router: - specifier: ^4.4.5 - version: 4.4.5(vue@3.5.6(typescript@5.6.2)) devDependencies: '@tsconfig/node18': specifier: ^18.2.4 @@ -233,6 +224,15 @@ importers: '@vue/tsconfig': specifier: ^0.5.1 version: 0.5.1 + artalk: + specifier: workspace:^ + version: link:../../ui/artalk + vue: + specifier: ^3.5.6 + version: 3.5.6(typescript@5.6.2) + vue-router: + specifier: ^4.4.5 + version: 4.4.5(vue@3.5.6(typescript@5.6.2)) vue-tsc: specifier: ^2.1.6 version: 2.1.6(typescript@5.6.2) @@ -298,8 +298,8 @@ importers: ui/eslint-plugin-artalk: dependencies: '@typescript-eslint/utils': - specifier: '>=8' - version: 8.6.0(eslint@9.10.0)(typescript@5.6.2) + specifier: ^8.8.0 + version: 8.8.0(eslint@9.10.0)(typescript@5.6.2) eslint: specifier: '>=9' version: 9.10.0 @@ -312,14 +312,10 @@ importers: version: 8.3.0(@microsoft/api-extractor@7.47.9(@types/node@22.5.5))(@swc/core@1.7.26(@swc/helpers@0.5.13))(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) ui/plugin-auth: - dependencies: + devDependencies: artalk: specifier: workspace:^ version: link:../artalk - devDependencies: - '@artalk/plugin-kit': - specifier: workspace:^ - version: link:../plugin-kit solid-js: specifier: ^1.8.22 version: 1.8.22 @@ -335,16 +331,13 @@ importers: '@types/katex': specifier: ^0.16.7 version: 0.16.7 - artalk: - specifier: workspace:^ - version: link:../artalk katex: specifier: ^0.16.11 version: 0.16.11 devDependencies: - '@artalk/plugin-kit': + artalk: specifier: workspace:^ - version: link:../plugin-kit + version: link:../artalk marked: specifier: ^14.1.2 version: 14.1.2 @@ -354,9 +347,6 @@ importers: '@microsoft/api-extractor': specifier: ^7.47.9 version: 7.47.9(@types/node@22.5.5) - artalk: - specifier: workspace:^ - version: link:../artalk picocolors: specifier: ^1.1.0 version: 1.1.0 @@ -367,6 +357,9 @@ importers: specifier: '*' version: 5.4.2(@types/node@22.5.5)(sass@1.79.1)(terser@5.33.0) devDependencies: + artalk: + specifier: workspace:^ + version: link:../artalk esbuild-plugin-raw: specifier: ^0.1.8 version: 0.1.8(esbuild@0.23.1) @@ -375,14 +368,10 @@ importers: version: 8.3.0(@microsoft/api-extractor@7.47.9(@types/node@22.5.5))(@swc/core@1.7.26(@swc/helpers@0.5.13))(postcss@8.4.47)(tsx@4.19.1)(typescript@5.6.2)(yaml@2.5.1) ui/plugin-lightbox: - dependencies: + devDependencies: artalk: specifier: workspace:^ version: link:../artalk - devDependencies: - '@artalk/plugin-kit': - specifier: workspace:^ - version: link:../plugin-kit fancybox: specifier: ^3.0.1 version: 3.0.1 @@ -497,6 +486,13 @@ packages: artalk: ^2.9.0 katex: ^0.16.11 + '@artalk/plugin-kit@1.0.6': + resolution: {integrity: sha512-ejbzkYmlGFPrHS9kzbMDU612fDXPmx1iN+jzNyF5I44K5B50zr4LcGRD3RevB9ohtdLxPV7C2nMwex33ok0tfA==} + peerDependencies: + artalk: ^2.9.0 + typescript: '*' + vite: '*' + '@artalk/plugin-lightbox@0.2.3': resolution: {integrity: sha512-avmW2pu5rrWnDjRrPj4CM9QrnGJQNMqaY/o5+nH1d/eo7HURlRPiy5/yZFAk7ccbvH6t5c/PtcygGLbRft2M2A==} peerDependencies: @@ -1942,6 +1938,11 @@ packages: resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} engines: {node: '>= 0.4'} + artalk@2.9.1: + resolution: {integrity: sha512-IFo9XqWDalsHy8BsmMA5SSB9bozBa/sBhTm/+O5KwA6DnC95lFKv7C6ScMx/Xa4ue5qSQ7VV5vxRgCh/raohkQ==} + peerDependencies: + marked: ^14.1.0 + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -2467,6 +2468,11 @@ packages: eslint-import-resolver-webpack: optional: true + eslint-plugin-artalk@1.0.1: + resolution: {integrity: sha512-mEgJj6kqfgDqHHmHVH6O06s3bhINyBb6TItYkbsASsO3+2WCB8CGHqFxz7vqoyymFH5n6x1GwevfPWlbOg3Kgw==} + peerDependencies: + eslint: '>=9' + eslint-plugin-compat@6.0.1: resolution: {integrity: sha512-0MeIEuoy8kWkOhW38kK8hU4vkb6l/VvyjpuYDymYOXmUY9NvTgyErF16lYuX+HPS5hkmym7lfA+XpYZiWYWmYA==} engines: {node: '>=18.x'} @@ -5057,6 +5063,16 @@ snapshots: artalk: link:ui/artalk katex: 0.16.11 + '@artalk/plugin-kit@1.0.6(@types/node@22.5.5)(artalk@2.9.1(marked@14.1.2))(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass@1.78.0)(terser@5.33.0))': + dependencies: + '@microsoft/api-extractor': 7.47.9(@types/node@22.5.5) + artalk: 2.9.1(marked@14.1.2) + picocolors: 1.1.0 + typescript: 5.6.2 + vite: 5.4.6(@types/node@22.5.5)(sass@1.78.0)(terser@5.33.0) + transitivePeerDependencies: + - '@types/node' + '@artalk/plugin-lightbox@0.2.3(artalk@ui+artalk)(fancybox@3.0.1)(lightbox2@2.11.4)(lightgallery@2.7.2)(photoswipe@5.4.4)': dependencies: artalk: link:ui/artalk @@ -6580,6 +6596,10 @@ snapshots: is-array-buffer: 3.0.4 is-shared-array-buffer: 1.0.3 + artalk@2.9.1(marked@14.1.2): + dependencies: + marked: 14.1.2 + assertion-error@2.0.1: {} assignment@2.0.0: {} @@ -7228,6 +7248,14 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-plugin-artalk@1.0.1(eslint@9.10.0)(typescript@5.6.2): + dependencies: + '@typescript-eslint/utils': 8.8.0(eslint@9.10.0)(typescript@5.6.2) + eslint: 9.10.0 + transitivePeerDependencies: + - supports-color + - typescript + eslint-plugin-compat@6.0.1(eslint@9.10.0): dependencies: '@mdn/browser-compat-data': 5.6.0 @@ -7242,7 +7270,7 @@ snapshots: eslint-plugin-import-x@4.2.1(eslint@9.10.0)(typescript@5.6.2): dependencies: - '@typescript-eslint/utils': 8.6.0(eslint@9.10.0)(typescript@5.6.2) + '@typescript-eslint/utils': 8.8.0(eslint@9.10.0)(typescript@5.6.2) debug: 4.3.7 doctrine: 3.0.0 eslint: 9.10.0 diff --git a/scripts/setup-ui-dev-env.mjs b/scripts/setup-ui-dev-env.mjs deleted file mode 100644 index 064204f2..00000000 --- a/scripts/setup-ui-dev-env.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import { exec } from 'child_process' -import { accessSync } from 'fs' -import { resolve } from 'path' - -const __dirname = new URL('.', import.meta.url).pathname -const forceBuild = process.env.ATK_DEV_TOOLCHAIN_FORCE_BUILD === '1' - -function runCommand(command) { - return new Promise((resolve, reject) => { - exec(command, (error, stdout, stderr) => { - if (error) { - reject(stderr || stdout) - } else { - resolve(stdout) - } - }) - }) -} - -function checkFolderExists(pathname) { - if (forceBuild) return false - try { - accessSync(resolve(__dirname, '../', pathname)) - return true - } catch (error) { - return false - } -} - -const green = '\x1b[32m' - -async function build() { - try { - // Build Artalk Plugin Kit for plugin development - if (!checkFolderExists('ui/plugin-kit/dist')) { - await runCommand('pnpm build:plugin-kit') - console.log(green, '[ArtalkDev] build @artalk/plugin-kit success') - } - // Build Artalk eslint plugin for lint checking - if (!checkFolderExists('ui/eslint-plugin-artalk/dist')) { - await runCommand('pnpm build:eslint-plugin') - console.log(green, '[ArtalkDev] build eslint-plugin-artalk success') - } - } catch (error) { - console.error('[ArtalkDev] Artalk UI development environment setup failed:', error) - } -} - -build() diff --git a/test/lightbox/package.json b/test/lightbox/package.json index dfc606c4..c5e39914 100644 --- a/test/lightbox/package.json +++ b/test/lightbox/package.json @@ -8,7 +8,7 @@ "build": "tsc && vite build", "preview": "vite preview" }, - "dependencies": { + "devDependencies": { "jquery": "^3.7.1", "@artalk/plugin-lightbox": "workspace:^", "artalk": "workspace:^", diff --git a/test/vue-test/package.json b/test/vue-test/package.json index ae868aea..5d388973 100644 --- a/test/vue-test/package.json +++ b/test/vue-test/package.json @@ -8,12 +8,10 @@ "build": "vue-tsc && vite build", "preview": "vite preview" }, - "dependencies": { - "artalk": "workspace:*", - "vue": "^3.5.6", - "vue-router": "^4.4.5" - }, "devDependencies": { + "artalk": "workspace:^", + "vue": "^3.5.6", + "vue-router": "^4.4.5", "@tsconfig/node18": "^18.2.4", "@types/node": "^22.5.5", "@vitejs/plugin-vue": "^5.1.4", diff --git a/ui/artalk/package.json b/ui/artalk/package.json index c585b9b2..75f07f6a 100644 --- a/ui/artalk/package.json +++ b/ui/artalk/package.json @@ -153,6 +153,6 @@ "marked": "^14.1.2" }, "peerDependencies": { - "marked": "^14.1.0" + "marked": "^14.1.2" } } diff --git a/ui/eslint-plugin-artalk/package.json b/ui/eslint-plugin-artalk/package.json index e76d6571..ac7c0696 100644 --- a/ui/eslint-plugin-artalk/package.json +++ b/ui/eslint-plugin-artalk/package.json @@ -1,12 +1,11 @@ { "name": "eslint-plugin-artalk", - "version": "1.0.0", + "version": "1.0.1", "type": "module", "license": "MIT", "homepage": "https://github.com/ArtalkJS/Artalk/tree/master/ui/eslint-plugin-artalk", "files": [ - "dist", - "README.md" + "dist" ], "main": "dist/main.js", "types": "dist/main.d.ts", @@ -27,12 +26,14 @@ "build": "tsup", "test": "vitest" }, + "dependencies": { + "@typescript-eslint/utils": "^8.8.0" + }, "devDependencies": { "@typescript-eslint/rule-tester": "^8.8.0", "tsup": "^8.3.0" }, "peerDependencies": { - "@typescript-eslint/utils": ">=8", "eslint": ">=9" } } diff --git a/ui/plugin-katex/package.json b/ui/plugin-katex/package.json index 14dd5663..7a8a654d 100644 --- a/ui/plugin-katex/package.json +++ b/ui/plugin-katex/package.json @@ -1,7 +1,6 @@ { "name": "@artalk/plugin-katex", - "version": "0.2.3", - "minAppVersion": "2.8.6", + "version": "0.2.4", "license": "MIT", "description": "The katex plugin for artalk", "type": "module", @@ -18,11 +17,10 @@ }, "dependencies": { "@types/katex": "^0.16.7", - "artalk": "workspace:^", "katex": "^0.16.11" }, "devDependencies": { - "@artalk/plugin-kit": "workspace:^", + "artalk": "workspace:^", "marked": "^14.1.2" }, "peerDependencies": { diff --git a/ui/plugin-kit/package.json b/ui/plugin-kit/package.json index 15f8203a..7fea4bf4 100644 --- a/ui/plugin-kit/package.json +++ b/ui/plugin-kit/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-kit", - "version": "1.0.6", + "version": "1.0.7", "description": "The plugin kit for Artalk", "type": "module", "main": "dist/main.js", @@ -27,10 +27,10 @@ "license": "MIT", "dependencies": { "@microsoft/api-extractor": "^7.47.9", - "artalk": "workspace:^", "picocolors": "^1.1.0" }, "devDependencies": { + "artalk": "workspace:^", "esbuild-plugin-raw": "^0.1.8", "tsup": "^8.3.0" }, diff --git a/ui/plugin-lightbox/package.json b/ui/plugin-lightbox/package.json index c242d76c..4e79cab7 100644 --- a/ui/plugin-lightbox/package.json +++ b/ui/plugin-lightbox/package.json @@ -1,6 +1,6 @@ { "name": "@artalk/plugin-lightbox", - "version": "0.2.3", + "version": "0.2.4", "license": "MIT", "description": "The image lightbox plugin for artalk", "type": "module", @@ -15,11 +15,8 @@ "build": "vite build", "serve": "vite preview" }, - "dependencies": { - "artalk": "workspace:^" - }, "devDependencies": { - "@artalk/plugin-kit": "workspace:^", + "artalk": "workspace:^", "lightgallery": "^2.7.2", "lightbox2": "^2.11.4", "photoswipe": "^5.4.4",