From 3035a763945c37bca2fe68d26340758995b0a7b9 Mon Sep 17 00:00:00 2001 From: terwer Date: Fri, 5 May 2023 21:43:11 +0800 Subject: [PATCH] feat(zhi-core): basic loading --- package.json | 5 +- packages/zhi-core/.eslintrc.json | 18 ++ packages/zhi-core/README.md | 11 ++ packages/zhi-core/package.json | 5 + packages/zhi-core/project.json | 43 +++++ packages/zhi-core/src/index.ts | 1 + packages/zhi-core/src/lib/zhi-core.spec.ts | 7 + packages/zhi-core/src/lib/zhi-core.ts | 10 ++ packages/zhi-core/src/lib/zhi.ts | 66 ++++++++ packages/zhi-core/tsconfig.json | 23 +++ packages/zhi-core/tsconfig.lib.json | 10 ++ packages/zhi-core/tsconfig.spec.json | 19 +++ packages/zhi-core/vite.config.ts | 57 +++++++ packages/zhi-loader/src/lib/zhi-loader.ts | 2 +- packages/zhi-loader/vite.config.ts | 2 +- pnpm-lock.yaml | 187 ++++++++++----------- tsconfig.base.json | 1 + 17 files changed, 369 insertions(+), 98 deletions(-) create mode 100644 packages/zhi-core/.eslintrc.json create mode 100644 packages/zhi-core/README.md create mode 100644 packages/zhi-core/package.json create mode 100644 packages/zhi-core/project.json create mode 100644 packages/zhi-core/src/index.ts create mode 100644 packages/zhi-core/src/lib/zhi-core.spec.ts create mode 100644 packages/zhi-core/src/lib/zhi-core.ts create mode 100644 packages/zhi-core/src/lib/zhi.ts create mode 100644 packages/zhi-core/tsconfig.json create mode 100644 packages/zhi-core/tsconfig.lib.json create mode 100644 packages/zhi-core/tsconfig.spec.json create mode 100644 packages/zhi-core/vite.config.ts diff --git a/package.json b/package.json index 7cd1aa77..48ac03b3 100644 --- a/package.json +++ b/package.json @@ -40,12 +40,13 @@ "stylus": "^0.59.0", "tslib": "^2.5.0", "typescript": "~5.0.4", - "vite": "^4.0.1", + "vite": "^4.3.4", "vite-plugin-dts": "~2.3.0", "vite-plugin-eslint": "^1.8.1", "vite-plugin-no-bundle": "^2.0.2", "vite-plugin-static-copy": "^0.14.0", "vite-tsconfig-paths": "^4.0.2", "vitest": "^0.31.0" - } + }, + "dependencies": {} } diff --git a/packages/zhi-core/.eslintrc.json b/packages/zhi-core/.eslintrc.json new file mode 100644 index 00000000..9d9c0db5 --- /dev/null +++ b/packages/zhi-core/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/packages/zhi-core/README.md b/packages/zhi-core/README.md new file mode 100644 index 00000000..e11ed4a3 --- /dev/null +++ b/packages/zhi-core/README.md @@ -0,0 +1,11 @@ +# zhi-core + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build zhi-core` to build the library. + +## Running unit tests + +Run `nx test zhi-core` to execute the unit tests via [Jest](https://jestjs.io). diff --git a/packages/zhi-core/package.json b/packages/zhi-core/package.json new file mode 100644 index 00000000..adc9e9f3 --- /dev/null +++ b/packages/zhi-core/package.json @@ -0,0 +1,5 @@ +{ + "name": "@zhi/zhi-core", + "version": "0.1.0", + "type": "module" +} diff --git a/packages/zhi-core/project.json b/packages/zhi-core/project.json new file mode 100644 index 00000000..53911e3a --- /dev/null +++ b/packages/zhi-core/project.json @@ -0,0 +1,43 @@ +{ + "name": "zhi-core", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/zhi-core/src", + "projectType": "library", + "targets": { + "dev": { + "executor": "nx:run-commands", + "options": { + "commands": ["cp -r dist/packages/zhi/core/* /Users/terwer/Documents/mydocs/SiYuanWorkspace/public/conf/appearance/themes/zhi/core"], + "parallel": false + }, + "dependsOn": [{ "projects": "self", "target": "build" }] + }, + "build": { + "executor": "@nx/vite:build", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/packages/zhi/core" + } + }, + "publish": { + "command": "node tools/scripts/publish.mjs zhi-core {args.ver} {args.tag}", + "dependsOn": ["build"] + }, + "test": { + "executor": "@nx/vite:test", + "outputs": ["coverage/packages/zhi-core"], + "options": { + "passWithNoTests": true, + "reportsDirectory": "../../coverage/packages/zhi-core" + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/zhi-core/**/*.ts"] + } + } + }, + "tags": [] +} diff --git a/packages/zhi-core/src/index.ts b/packages/zhi-core/src/index.ts new file mode 100644 index 00000000..f250302f --- /dev/null +++ b/packages/zhi-core/src/index.ts @@ -0,0 +1 @@ +export * from "./lib/zhi-core" diff --git a/packages/zhi-core/src/lib/zhi-core.spec.ts b/packages/zhi-core/src/lib/zhi-core.spec.ts new file mode 100644 index 00000000..bf11c882 --- /dev/null +++ b/packages/zhi-core/src/lib/zhi-core.spec.ts @@ -0,0 +1,7 @@ +import { zhiCore } from "./zhi-core" + +describe("zhiCore", () => { + it("should work", () => { + expect(zhiCore()).toEqual("zhi-core") + }) +}) diff --git a/packages/zhi-core/src/lib/zhi-core.ts b/packages/zhi-core/src/lib/zhi-core.ts new file mode 100644 index 00000000..84363bb9 --- /dev/null +++ b/packages/zhi-core/src/lib/zhi-core.ts @@ -0,0 +1,10 @@ +import Zhi from "./zhi" +import { DeviceDetection } from "@siyuan-community/zhi-device" + +/** + * 主题唯一入口 + */ +export async function zhiCore(): Promise { + const zhi = new Zhi(DeviceDetection.getDevice()) + await zhi.init() +} diff --git a/packages/zhi-core/src/lib/zhi.ts b/packages/zhi-core/src/lib/zhi.ts new file mode 100644 index 00000000..20b66109 --- /dev/null +++ b/packages/zhi-core/src/lib/zhi.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2023, Terwer . All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Terwer designates this + * particular file as subject to the "Classpath" exception as provided + * by Terwer in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com + * or visit www.terwer.space if you need additional information or have any + * questions. + */ + +import { DeviceTypeEnum } from "@siyuan-community/zhi-device" + +class Zhi { + private readonly runAs + + /** + * 主题样式最低支持版本 + * @private + */ + private readonly SUPPORTED_THEME_VERSION = "2.7.6" + + /** + * 内核最低支持版本 + * @private + */ + private readonly SUPPORTED_KERNEL_VERSION = "2.8.1" + + /** + * 主题初始化 + * + * @param runAs - 运行模式 + */ + constructor(runAs: DeviceTypeEnum) { + this.runAs = runAs ?? DeviceTypeEnum.DeviceType_Node + } + + /** + * 主流程加载 + */ + public async init(): Promise { + try { + console.info(`Zhi Theme runAs ${this.runAs}`) + + console.log("Zhi Theme inited") + } catch (e) { + console.error("Zhi Theme load error=>", e) + } + } +} + +export default Zhi diff --git a/packages/zhi-core/tsconfig.json b/packages/zhi-core/tsconfig.json new file mode 100644 index 00000000..bdf594cd --- /dev/null +++ b/packages/zhi-core/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "types": ["vitest"] + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} diff --git a/packages/zhi-core/tsconfig.lib.json b/packages/zhi-core/tsconfig.lib.json new file mode 100644 index 00000000..33eca2c2 --- /dev/null +++ b/packages/zhi-core/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "include": ["src/**/*.ts"], + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] +} diff --git a/packages/zhi-core/tsconfig.spec.json b/packages/zhi-core/tsconfig.spec.json new file mode 100644 index 00000000..6d3be742 --- /dev/null +++ b/packages/zhi-core/tsconfig.spec.json @@ -0,0 +1,19 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": ["vitest/globals", "vitest/importMeta", "vite/client", "node"] + }, + "include": [ + "vite.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.test.tsx", + "src/**/*.spec.tsx", + "src/**/*.test.js", + "src/**/*.spec.js", + "src/**/*.test.jsx", + "src/**/*.spec.jsx", + "src/**/*.d.ts" + ] +} diff --git a/packages/zhi-core/vite.config.ts b/packages/zhi-core/vite.config.ts new file mode 100644 index 00000000..700d8ce8 --- /dev/null +++ b/packages/zhi-core/vite.config.ts @@ -0,0 +1,57 @@ +/// +import { defineConfig } from "vite" + +import viteTsConfigPaths from "vite-tsconfig-paths" +import { join } from "path" +import noBundlePlugin from "vite-plugin-no-bundle" + +const isTest = process.env["npm_command"] === "test" +console.log("isTest=>", isTest) + +export default defineConfig({ + cacheDir: "../../node_modules/.vite/zhi-core", + + plugins: [ + viteTsConfigPaths({ + root: "../../", + }), + + !isTest && noBundlePlugin(), + ], + + // Uncomment this if you are using workers. + // worker: { + // plugins: [ + // viteTsConfigPaths({ + // root: '../../', + // }), + // ], + // }, + + // Configuration for building your library. + // See: https://vitejs.dev/guide/build.html#library-mode + build: { + lib: { + // Could also be a dictionary or array of multiple entry points. + entry: "src/index.ts", + name: "zhi-core", + fileName: "index", + // Change this to the formats you want to support. + // Don't forgot to update your package.json as well. + formats: ["es"], + }, + rollupOptions: { + // External packages that should not be bundled into your library. + external: [], + }, + }, + + test: { + globals: true, + cache: { + dir: "../../node_modules/.vitest", + }, + environment: "jsdom", + include: ["src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"], + }, +}) diff --git a/packages/zhi-loader/src/lib/zhi-loader.ts b/packages/zhi-loader/src/lib/zhi-loader.ts index 4c6e3216..e9a09195 100644 --- a/packages/zhi-loader/src/lib/zhi-loader.ts +++ b/packages/zhi-loader/src/lib/zhi-loader.ts @@ -24,6 +24,6 @@ */ export async function zhiLoader(): Promise { - const zhiCore = await import("/appearance/themes/zhi/core/index.js" as any) + const zhiCore = await import("/appearance/themes/zhi/core/zhi-core/src/index.js" as any) await zhiCore.zhiCore() } diff --git a/packages/zhi-loader/vite.config.ts b/packages/zhi-loader/vite.config.ts index 760c7631..90b528a4 100644 --- a/packages/zhi-loader/vite.config.ts +++ b/packages/zhi-loader/vite.config.ts @@ -36,7 +36,7 @@ export default defineConfig({ rollupOptions: { plugins: [...(isWatch ? [livereload(devOutDir)] : [])] as Plugin[], // External packages that should not be bundled into your library. - external: ["/appearance/themes/zhi/core/index.js"], + external: ["/appearance/themes/zhi/core/zhi-core/src/index.js"], output: { entryFileNames: "theme.js", assetFileNames: "theme.css", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3ef0d43c..710725cd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -18,7 +18,7 @@ devDependencies: version: 16.1.0(eslint@8.39.0)(nx@16.1.0)(typescript@5.0.4) '@nx/vite': specifier: 16.1.0 - version: 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.0.1)(vitest@0.31.0) + version: 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.3.4)(vitest@0.31.0) '@nx/workspace': specifier: 16.1.0 version: 16.1.0 @@ -77,23 +77,23 @@ devDependencies: specifier: ~5.0.4 version: 5.0.4 vite: - specifier: ^4.0.1 - version: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + specifier: ^4.3.4 + version: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) vite-plugin-dts: specifier: ~2.3.0 - version: 2.3.0(@types/node@18.16.3)(vite@4.0.1) + version: 2.3.0(@types/node@18.16.3)(vite@4.3.4) vite-plugin-eslint: specifier: ^1.8.1 - version: 1.8.1(eslint@8.39.0)(vite@4.0.1) + version: 1.8.1(eslint@8.39.0)(vite@4.3.4) vite-plugin-no-bundle: specifier: ^2.0.2 version: 2.0.2 vite-plugin-static-copy: specifier: ^0.14.0 - version: 0.14.0(vite@4.0.1) + version: 0.14.0(vite@4.3.4) vite-tsconfig-paths: specifier: ^4.0.2 - version: 4.0.2(typescript@5.0.4)(vite@4.0.1) + version: 4.0.2(typescript@5.0.4)(vite@4.3.4) vitest: specifier: ^0.31.0 version: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0)(stylus@0.59.0) @@ -1466,8 +1466,8 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@esbuild/android-arm64@0.16.17: - resolution: {integrity: sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==} + /@esbuild/android-arm64@0.17.18: + resolution: {integrity: sha512-/iq0aK0eeHgSC3z55ucMAHO05OIqmQehiGay8eP5l/5l+iEr4EIbh4/MI8xD9qRFjqzgkc0JkX0LculNC9mXBw==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -1475,8 +1475,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.16.17: - resolution: {integrity: sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==} + /@esbuild/android-arm@0.17.18: + resolution: {integrity: sha512-EmwL+vUBZJ7mhFCs5lA4ZimpUH3WMAoqvOIYhVQwdIgSpHC8ImHdsRyhHAVxpDYUSm0lWvd63z0XH1IlImS2Qw==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -1484,8 +1484,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.16.17: - resolution: {integrity: sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==} + /@esbuild/android-x64@0.17.18: + resolution: {integrity: sha512-x+0efYNBF3NPW2Xc5bFOSFW7tTXdAcpfEg2nXmxegm4mJuVeS+i109m/7HMiOQ6M12aVGGFlqJX3RhNdYM2lWg==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -1493,8 +1493,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.16.17: - resolution: {integrity: sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==} + /@esbuild/darwin-arm64@0.17.18: + resolution: {integrity: sha512-6tY+djEAdF48M1ONWnQb1C+6LiXrKjmqjzPNPWXhu/GzOHTHX2nh8Mo2ZAmBFg0kIodHhciEgUBtcYCAIjGbjQ==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -1502,8 +1502,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.16.17: - resolution: {integrity: sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==} + /@esbuild/darwin-x64@0.17.18: + resolution: {integrity: sha512-Qq84ykvLvya3dO49wVC9FFCNUfSrQJLbxhoQk/TE1r6MjHo3sFF2tlJCwMjhkBVq3/ahUisj7+EpRSz0/+8+9A==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -1511,8 +1511,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.16.17: - resolution: {integrity: sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==} + /@esbuild/freebsd-arm64@0.17.18: + resolution: {integrity: sha512-fw/ZfxfAzuHfaQeMDhbzxp9mc+mHn1Y94VDHFHjGvt2Uxl10mT4CDavHm+/L9KG441t1QdABqkVYwakMUeyLRA==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -1520,8 +1520,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.16.17: - resolution: {integrity: sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==} + /@esbuild/freebsd-x64@0.17.18: + resolution: {integrity: sha512-FQFbRtTaEi8ZBi/A6kxOC0V0E9B/97vPdYjY9NdawyLd4Qk5VD5g2pbWN2VR1c0xhzcJm74HWpObPszWC+qTew==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -1529,8 +1529,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.16.17: - resolution: {integrity: sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==} + /@esbuild/linux-arm64@0.17.18: + resolution: {integrity: sha512-R7pZvQZFOY2sxUG8P6A21eq6q+eBv7JPQYIybHVf1XkQYC+lT7nDBdC7wWKTrbvMXKRaGudp/dzZCwL/863mZQ==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -1538,8 +1538,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.16.17: - resolution: {integrity: sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==} + /@esbuild/linux-arm@0.17.18: + resolution: {integrity: sha512-jW+UCM40LzHcouIaqv3e/oRs0JM76JfhHjCavPxMUti7VAPh8CaGSlS7cmyrdpzSk7A+8f0hiedHqr/LMnfijg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -1547,8 +1547,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.16.17: - resolution: {integrity: sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==} + /@esbuild/linux-ia32@0.17.18: + resolution: {integrity: sha512-ygIMc3I7wxgXIxk6j3V00VlABIjq260i967Cp9BNAk5pOOpIXmd1RFQJQX9Io7KRsthDrQYrtcx7QCof4o3ZoQ==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -1556,8 +1556,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.16.17: - resolution: {integrity: sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==} + /@esbuild/linux-loong64@0.17.18: + resolution: {integrity: sha512-bvPG+MyFs5ZlwYclCG1D744oHk1Pv7j8psF5TfYx7otCVmcJsEXgFEhQkbhNW8otDHL1a2KDINW20cfCgnzgMQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -1565,8 +1565,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.16.17: - resolution: {integrity: sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==} + /@esbuild/linux-mips64el@0.17.18: + resolution: {integrity: sha512-oVqckATOAGuiUOa6wr8TXaVPSa+6IwVJrGidmNZS1cZVx0HqkTMkqFGD2HIx9H1RvOwFeWYdaYbdY6B89KUMxA==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -1574,8 +1574,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.16.17: - resolution: {integrity: sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==} + /@esbuild/linux-ppc64@0.17.18: + resolution: {integrity: sha512-3dLlQO+b/LnQNxgH4l9rqa2/IwRJVN9u/bK63FhOPB4xqiRqlQAU0qDU3JJuf0BmaH0yytTBdoSBHrb2jqc5qQ==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -1583,8 +1583,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.16.17: - resolution: {integrity: sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==} + /@esbuild/linux-riscv64@0.17.18: + resolution: {integrity: sha512-/x7leOyDPjZV3TcsdfrSI107zItVnsX1q2nho7hbbQoKnmoeUWjs+08rKKt4AUXju7+3aRZSsKrJtaRmsdL1xA==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -1592,8 +1592,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.16.17: - resolution: {integrity: sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==} + /@esbuild/linux-s390x@0.17.18: + resolution: {integrity: sha512-cX0I8Q9xQkL/6F5zWdYmVf5JSQt+ZfZD2bJudZrWD+4mnUvoZ3TDDXtDX2mUaq6upMFv9FlfIh4Gfun0tbGzuw==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -1601,8 +1601,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.16.17: - resolution: {integrity: sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==} + /@esbuild/linux-x64@0.17.18: + resolution: {integrity: sha512-66RmRsPlYy4jFl0vG80GcNRdirx4nVWAzJmXkevgphP1qf4dsLQCpSKGM3DUQCojwU1hnepI63gNZdrr02wHUA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -1610,8 +1610,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.16.17: - resolution: {integrity: sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==} + /@esbuild/netbsd-x64@0.17.18: + resolution: {integrity: sha512-95IRY7mI2yrkLlTLb1gpDxdC5WLC5mZDi+kA9dmM5XAGxCME0F8i4bYH4jZreaJ6lIZ0B8hTrweqG1fUyW7jbg==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -1619,8 +1619,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.16.17: - resolution: {integrity: sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==} + /@esbuild/openbsd-x64@0.17.18: + resolution: {integrity: sha512-WevVOgcng+8hSZ4Q3BKL3n1xTv5H6Nb53cBrtzzEjDbbnOmucEVcZeGCsCOi9bAOcDYEeBZbD2SJNBxlfP3qiA==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -1628,8 +1628,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.16.17: - resolution: {integrity: sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==} + /@esbuild/sunos-x64@0.17.18: + resolution: {integrity: sha512-Rzf4QfQagnwhQXVBS3BYUlxmEbcV7MY+BH5vfDZekU5eYpcffHSyjU8T0xucKVuOcdCsMo+Ur5wmgQJH2GfNrg==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -1637,8 +1637,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.16.17: - resolution: {integrity: sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==} + /@esbuild/win32-arm64@0.17.18: + resolution: {integrity: sha512-Kb3Ko/KKaWhjeAm2YoT/cNZaHaD1Yk/pa3FTsmqo9uFh1D1Rfco7BBLIPdDOozrObj2sahslFuAQGvWbgWldAg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -1646,8 +1646,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.16.17: - resolution: {integrity: sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==} + /@esbuild/win32-ia32@0.17.18: + resolution: {integrity: sha512-0/xUMIdkVHwkvxfbd5+lfG7mHOf2FRrxNbPiKWg9C4fFrB8H0guClmaM3BFiRUYrznVoyxTIyC/Ou2B7QQSwmw==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -1655,8 +1655,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.16.17: - resolution: {integrity: sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==} + /@esbuild/win32-x64@0.17.18: + resolution: {integrity: sha512-qU25Ma1I3NqTSHJUOKi9sAH1/Mzuvlke0ioMJRthLXKm7JiSKVwFghlGbDLOO2sARECGhja4xYfRAZNPAkooYg==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -1909,10 +1909,10 @@ packages: - debug dev: true - /@nrwl/vite@16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.0.1)(vitest@0.31.0): + /@nrwl/vite@16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.3.4)(vitest@0.31.0): resolution: {integrity: sha512-Iq4ONiR3jyPU1AfI+gIj4NaGqx2xMVuEcR5iyBUEHOnsL0V5hBDU+0k79w4jwkEaHU4yrRorl0VcHfBuIct+4Q==} dependencies: - '@nx/vite': 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.0.1)(vitest@0.31.0) + '@nx/vite': 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.3.4)(vitest@0.31.0) transitivePeerDependencies: - '@babel/traverse' - '@swc-node/register' @@ -2121,20 +2121,20 @@ packages: dev: true optional: true - /@nx/vite@16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.0.1)(vitest@0.31.0): + /@nx/vite@16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.3.4)(vitest@0.31.0): resolution: {integrity: sha512-nbsKUZiFoy0XdDOHzkInIOH2F9gZ01vYwifYCRbzs9PSYxP6jc0RzFJgB7WaBBB9yO7r9RAoEALGYdH9mrtshA==} peerDependencies: vite: ^4.3.4 vitest: '>=0.31.0 <1.0.0' dependencies: - '@nrwl/vite': 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.0.1)(vitest@0.31.0) + '@nrwl/vite': 16.1.0(nx@16.1.0)(typescript@5.0.4)(vite@4.3.4)(vitest@0.31.0) '@nx/devkit': 16.1.0(nx@16.1.0) '@nx/js': 16.1.0(nx@16.1.0)(typescript@5.0.4) '@phenomnomnominal/tsquery': 5.0.1(typescript@5.0.4) '@swc/helpers': 0.5.1 dotenv: 10.0.0 enquirer: 2.3.6 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) vitest: 0.31.0(@vitest/ui@0.31.0)(jsdom@22.0.0)(stylus@0.59.0) transitivePeerDependencies: - '@babel/traverse' @@ -3368,34 +3368,34 @@ packages: is-arrayish: 0.2.1 dev: true - /esbuild@0.16.17: - resolution: {integrity: sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==} + /esbuild@0.17.18: + resolution: {integrity: sha512-z1lix43jBs6UKjcZVKOw2xx69ffE2aG0PygLL5qJ9OS/gy0Ewd1gW/PUQIOIQGXBHWNywSc0floSKoMFF8aK2w==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.16.17 - '@esbuild/android-arm64': 0.16.17 - '@esbuild/android-x64': 0.16.17 - '@esbuild/darwin-arm64': 0.16.17 - '@esbuild/darwin-x64': 0.16.17 - '@esbuild/freebsd-arm64': 0.16.17 - '@esbuild/freebsd-x64': 0.16.17 - '@esbuild/linux-arm': 0.16.17 - '@esbuild/linux-arm64': 0.16.17 - '@esbuild/linux-ia32': 0.16.17 - '@esbuild/linux-loong64': 0.16.17 - '@esbuild/linux-mips64el': 0.16.17 - '@esbuild/linux-ppc64': 0.16.17 - '@esbuild/linux-riscv64': 0.16.17 - '@esbuild/linux-s390x': 0.16.17 - '@esbuild/linux-x64': 0.16.17 - '@esbuild/netbsd-x64': 0.16.17 - '@esbuild/openbsd-x64': 0.16.17 - '@esbuild/sunos-x64': 0.16.17 - '@esbuild/win32-arm64': 0.16.17 - '@esbuild/win32-ia32': 0.16.17 - '@esbuild/win32-x64': 0.16.17 + '@esbuild/android-arm': 0.17.18 + '@esbuild/android-arm64': 0.17.18 + '@esbuild/android-x64': 0.17.18 + '@esbuild/darwin-arm64': 0.17.18 + '@esbuild/darwin-x64': 0.17.18 + '@esbuild/freebsd-arm64': 0.17.18 + '@esbuild/freebsd-x64': 0.17.18 + '@esbuild/linux-arm': 0.17.18 + '@esbuild/linux-arm64': 0.17.18 + '@esbuild/linux-ia32': 0.17.18 + '@esbuild/linux-loong64': 0.17.18 + '@esbuild/linux-mips64el': 0.17.18 + '@esbuild/linux-ppc64': 0.17.18 + '@esbuild/linux-riscv64': 0.17.18 + '@esbuild/linux-s390x': 0.17.18 + '@esbuild/linux-x64': 0.17.18 + '@esbuild/netbsd-x64': 0.17.18 + '@esbuild/openbsd-x64': 0.17.18 + '@esbuild/sunos-x64': 0.17.18 + '@esbuild/win32-arm64': 0.17.18 + '@esbuild/win32-ia32': 0.17.18 + '@esbuild/win32-x64': 0.17.18 dev: true /escalade@3.1.1: @@ -5594,7 +5594,7 @@ packages: mlly: 1.2.0 pathe: 1.1.0 picocolors: 1.0.0 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) transitivePeerDependencies: - '@types/node' - less @@ -5605,7 +5605,7 @@ packages: - terser dev: true - /vite-plugin-dts@2.3.0(@types/node@18.16.3)(vite@4.0.1): + /vite-plugin-dts@2.3.0(@types/node@18.16.3)(vite@4.3.4): resolution: {integrity: sha512-WbJgGtsStgQhdm3EosYmIdTGbag5YQpZ3HXWUAPCDyoXI5qN6EY0V7NXq0lAmnv9hVQsvh0htbYcg0Or5Db9JQ==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -5621,14 +5621,14 @@ packages: kolorist: 1.8.0 magic-string: 0.29.0 ts-morph: 18.0.0 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) transitivePeerDependencies: - '@types/node' - rollup - supports-color dev: true - /vite-plugin-eslint@1.8.1(eslint@8.39.0)(vite@4.0.1): + /vite-plugin-eslint@1.8.1(eslint@8.39.0)(vite@4.3.4): resolution: {integrity: sha512-PqdMf3Y2fLO9FsNPmMX+//2BF5SF8nEWspZdgl4kSt7UvHDRHVVfHvxsD7ULYzZrJDGRxR81Nq7TOFgwMnUang==} peerDependencies: eslint: '>=7' @@ -5638,7 +5638,7 @@ packages: '@types/eslint': 8.37.0 eslint: 8.39.0 rollup: 2.79.1 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) dev: true /vite-plugin-no-bundle@2.0.2: @@ -5648,7 +5648,7 @@ packages: micromatch: 4.0.5 dev: true - /vite-plugin-static-copy@0.14.0(vite@4.0.1): + /vite-plugin-static-copy@0.14.0(vite@4.3.4): resolution: {integrity: sha512-RMFmb4czomcrsbQBiUZs9HcDGN3kxGvF+OrtkfTVocp12CuoUCuJQhcY26RK35A6KS4WasGzEwcYZqHMjkAvVw==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -5658,10 +5658,10 @@ packages: fast-glob: 3.2.12 fs-extra: 11.1.1 picocolors: 1.0.0 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) dev: true - /vite-tsconfig-paths@4.0.2(typescript@5.0.4)(vite@4.0.1): + /vite-tsconfig-paths@4.0.2(typescript@5.0.4)(vite@4.3.4): resolution: {integrity: sha512-UzU8zwbCQrdUkj/Z0tnh293n4ScRcjJLoS8nPme2iB2FHoU5q8rhilb7AbhLlUC1uv4t6jSzVWnENjPnyGseeQ==} peerDependencies: vite: '>2.0.0-0' @@ -5669,14 +5669,14 @@ packages: debug: 4.3.4 globrex: 0.1.2 tsconfck: 2.1.1(typescript@5.0.4) - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) transitivePeerDependencies: - supports-color - typescript dev: true - /vite@4.0.1(@types/node@18.16.3)(stylus@0.59.0): - resolution: {integrity: sha512-kZQPzbDau35iWOhy3CpkrRC7It+HIHtulAzBhMqzGHKRf/4+vmh8rPDDdv98SWQrFWo6//3ozwsRmwQIPZsK9g==} + /vite@4.3.4(@types/node@18.16.3)(stylus@0.59.0): + resolution: {integrity: sha512-f90aqGBoxSFxWph2b39ae2uHAxm5jFBBdnfueNxZAT1FTpM13ccFQExCaKbR2xFW5atowjleRniQ7onjJ22QEg==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true peerDependencies: @@ -5701,9 +5701,8 @@ packages: optional: true dependencies: '@types/node': 18.16.3 - esbuild: 0.16.17 + esbuild: 0.17.18 postcss: 8.4.23 - resolve: 1.22.2 rollup: 3.21.4 stylus: 0.59.0 optionalDependencies: @@ -5765,7 +5764,7 @@ packages: strip-literal: 1.0.1 tinybench: 2.5.0 tinypool: 0.5.0 - vite: 4.0.1(@types/node@18.16.3)(stylus@0.59.0) + vite: 4.3.4(@types/node@18.16.3)(stylus@0.59.0) vite-node: 0.31.0(@types/node@18.16.3)(stylus@0.59.0) why-is-node-running: 2.2.2 transitivePeerDependencies: diff --git a/tsconfig.base.json b/tsconfig.base.json index 13d6ee3d..ec945276 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -17,6 +17,7 @@ "baseUrl": ".", "paths": { "@siyuan-community/zhi-device": ["packages/zhi-lib-device/src/index.ts"], + "@zhi/zhi-core": ["packages/zhi-core/src/index.ts"], "@zhi/zhi-loader": ["packages/zhi-loader/src/index.ts"] } },