diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8b30a1e3..a776c70d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - run: pnpm dev:prepare - run: pnpm lint - run: pnpm prepack + - run: pnpm typecheck - run: pnpm test - name: Publish run: pnpx pkg-pr-new publish --compact --no-template --pnpm diff --git a/package.json b/package.json index 67ccf36b8..e6cf970ae 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ ], "scripts": { "prepack": "nuxt-module-build build", + "typecheck": "nuxi typecheck", "example": "run () { nuxi dev examples/$*; }; run", "docs": "nuxi dev docs", "docs:build": "nuxi build docs", @@ -105,6 +106,7 @@ "@release-it/conventional-changelog": "^9.0.3", "@types/better-sqlite3": "^7.6.12", "@types/micromatch": "^4.0.9", + "@types/minimatch": "^5.1.2", "@types/node": "^22.9.1", "@types/pg": "^8.11.10", "@types/ws": "^8.5.13", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90fac74a1..4c1979d15 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,10 +17,10 @@ importers: version: 0.14.0 '@nuxt/kit': specifier: ^3.14.1592 - version: 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + version: 3.14.1592(magicast@0.3.5)(rollup@4.27.3) '@nuxtjs/mdc': specifier: ^0.9.5 - version: 0.9.5(magicast@0.3.5)(rollup@3.29.5) + version: 0.9.5(magicast@0.3.5)(rollup@4.27.3) '@sqlite.org/sqlite-wasm': specifier: 3.47.0-build1 version: 3.47.0-build1 @@ -86,7 +86,7 @@ importers: version: 10.0.1 nuxt-component-meta: specifier: ^0.9.0 - version: 0.9.0(magicast@0.3.5)(rollup@3.29.5) + version: 0.9.0(magicast@0.3.5)(rollup@4.27.3) ohash: specifier: ^1.1.4 version: 1.1.4 @@ -156,19 +156,19 @@ importers: version: 'link:' '@nuxt/devtools': specifier: ^1.6.1 - version: 1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) + version: 1.6.1(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) '@nuxt/eslint-config': specifier: ^0.7.1 version: 0.7.1(@vue/compiler-sfc@3.5.13)(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3) '@nuxt/module-builder': specifier: ^0.8.4 - version: 0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3)) + version: 0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.3))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3)) '@nuxt/schema': specifier: ^3.14.1592 - version: 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + version: 3.14.1592(magicast@0.3.5)(rollup@4.27.3) '@nuxt/test-utils': specifier: ^3.14.4 - version: 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) + version: 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) '@release-it/conventional-changelog': specifier: ^9.0.3 version: 9.0.3(conventional-commits-filter@5.0.0)(conventional-commits-parser@6.0.0)(release-it@17.10.0(typescript@5.6.3)) @@ -178,6 +178,9 @@ importers: '@types/micromatch': specifier: ^4.0.9 version: 4.0.9 + '@types/minimatch': + specifier: ^5.1.2 + version: 5.1.2 '@types/node': specifier: ^22.9.1 version: 22.9.1 @@ -198,7 +201,7 @@ importers: version: 2.0.1 nuxt: specifier: ^3.14.1592 - version: 3.14.1592(@libsql/client@0.14.0)(@parcel/watcher@2.5.0)(@types/node@22.9.1)(better-sqlite3@11.5.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)) + version: 3.14.1592(@libsql/client@0.14.0)(@parcel/watcher@2.5.0)(@types/node@22.9.1)(better-sqlite3@11.5.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.3)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)) release-it: specifier: ^17.10.0 version: 17.10.0(typescript@5.6.3) @@ -2326,6 +2329,9 @@ packages: '@types/micromatch@4.0.9': resolution: {integrity: sha512-7V+8ncr22h4UoYRLnLXSpTxjQrNUXtWHGeMPRJt1nULXI57G9bIcpyrHlmrQ7QK24EyyuXvYcSSWAM8GA9nqCg==} + '@types/minimatch@5.1.2': + resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} + '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} @@ -4660,6 +4666,7 @@ packages: libsql@0.4.7: resolution: {integrity: sha512-T9eIRCs6b0J1SHKYIvD8+KCJMcWZ900iZyxdnSCdqxN12Z1ijzT+jY5nrk72Jw4B0HGzms2NgpryArlJqvc3Lw==} + cpu: [x64, arm64, wasm32] os: [darwin, linux, win32] lighthouse-logger@2.0.1: @@ -8318,17 +8325,6 @@ snapshots: '@nuxt/devalue@2.0.2': {} - '@nuxt/devtools-kit@1.6.1(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))': - dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - execa: 7.2.0 - vite: 5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - transitivePeerDependencies: - - magicast - - rollup - - supports-color - '@nuxt/devtools-kit@1.6.1(magicast@0.3.5)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))': dependencies: '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) @@ -8353,53 +8349,6 @@ snapshots: rc9: 2.1.2 semver: 7.6.3 - '@nuxt/devtools@1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))': - dependencies: - '@antfu/utils': 0.7.10 - '@nuxt/devtools-kit': 1.6.1(magicast@0.3.5)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0)) - '@nuxt/devtools-wizard': 1.6.1 - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@vue/devtools-core': 7.6.4(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) - '@vue/devtools-kit': 7.6.4 - birpc: 0.2.19 - consola: 3.2.3 - cronstrue: 2.52.0 - destr: 2.0.3 - error-stack-parser-es: 0.1.5 - execa: 7.2.0 - fast-npm-meta: 0.2.2 - flatted: 3.3.2 - get-port-please: 3.1.2 - hookable: 5.5.3 - image-meta: 0.2.1 - is-installed-globally: 1.0.0 - launch-editor: 2.9.1 - local-pkg: 0.5.1 - magicast: 0.3.5 - nypm: 0.3.12 - ohash: 1.1.4 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.2.1 - rc9: 2.1.2 - scule: 1.3.0 - semver: 7.6.3 - simple-git: 3.27.0 - sirv: 2.0.4 - tinyglobby: 0.2.10 - unimport: 3.13.2(rollup@3.29.5) - vite: 5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - vite-plugin-inspect: 0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0)) - vite-plugin-vue-inspector: 5.1.3(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0)) - which: 3.0.1 - ws: 8.18.0 - transitivePeerDependencies: - - bufferutil - - rollup - - supports-color - - utf-8-validate - - vue - '@nuxt/devtools@1.6.1(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3))': dependencies: '@antfu/utils': 0.7.10 @@ -8607,33 +8556,6 @@ snapshots: - rollup - supports-color - '@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5)': - dependencies: - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - c12: 2.0.1(magicast@0.3.5) - consola: 3.2.3 - defu: 6.1.4 - destr: 2.0.3 - globby: 14.0.2 - hash-sum: 2.0.0 - ignore: 6.0.2 - jiti: 2.4.0 - klona: 2.0.6 - knitwork: 1.1.0 - mlly: 1.7.3 - pathe: 1.1.2 - pkg-types: 1.2.1 - scule: 1.3.0 - semver: 7.6.3 - ufo: 1.5.4 - unctx: 2.3.1 - unimport: 3.13.2(rollup@3.29.5) - untyped: 1.5.1 - transitivePeerDependencies: - - magicast - - rollup - - supports-color - '@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.3)': dependencies: '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) @@ -8661,9 +8583,9 @@ snapshots: - rollup - supports-color - '@nuxt/module-builder@0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))': + '@nuxt/module-builder@0.8.4(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.3))(nuxi@3.15.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))': dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) citty: 0.1.6 consola: 3.2.3 defu: 6.1.4 @@ -8700,26 +8622,6 @@ snapshots: - rollup - supports-color - '@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@3.29.5)': - dependencies: - c12: 2.0.1(magicast@0.3.5) - compatx: 0.1.8 - consola: 3.2.3 - defu: 6.1.4 - hookable: 5.5.3 - pathe: 1.1.2 - pkg-types: 1.2.1 - scule: 1.3.0 - std-env: 3.8.0 - ufo: 1.5.4 - uncrypto: 0.1.3 - unimport: 3.13.2(rollup@3.29.5) - untyped: 1.5.1 - transitivePeerDependencies: - - magicast - - rollup - - supports-color - '@nuxt/schema@3.14.1592(magicast@0.3.5)(rollup@4.27.3)': dependencies: c12: 2.0.1(magicast@0.3.5) @@ -8740,31 +8642,6 @@ snapshots: - rollup - supports-color - '@nuxt/telemetry@2.6.0(magicast@0.3.5)(rollup@3.29.5)': - dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - ci-info: 4.1.0 - consola: 3.2.3 - create-require: 1.1.1 - defu: 6.1.4 - destr: 2.0.3 - dotenv: 16.4.5 - git-url-parse: 15.0.0 - is-docker: 3.0.0 - jiti: 1.21.6 - mri: 1.2.0 - nanoid: 5.0.8 - ofetch: 1.4.1 - package-manager-detector: 0.2.4 - parse-git-config: 3.0.0 - pathe: 1.1.2 - rc9: 2.1.2 - std-env: 3.8.0 - transitivePeerDependencies: - - magicast - - rollup - - supports-color - '@nuxt/telemetry@2.6.0(magicast@0.3.5)(rollup@4.27.3)': dependencies: '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) @@ -8790,10 +8667,10 @@ snapshots: - rollup - supports-color - '@nuxt/test-utils@3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))': + '@nuxt/test-utils@3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3))': dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) + '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) c12: 2.0.1(magicast@0.3.5) consola: 3.2.3 defu: 6.1.4 @@ -8817,7 +8694,7 @@ snapshots: unenv: 1.10.0 unplugin: 1.16.0 vite: 5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - vitest-environment-nuxt: 1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) + vitest-environment-nuxt: 1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) vue: 3.5.13(typescript@5.6.3) vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3)) optionalDependencies: @@ -9032,65 +8909,6 @@ snapshots: - vti - vue-tsc - '@nuxt/vite-builder@3.14.1592(@types/node@22.9.1)(eslint@9.15.0(jiti@2.4.0))(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3))': - dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@rollup/plugin-replace': 6.0.1(rollup@3.29.5) - '@vitejs/plugin-vue': 5.2.0(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) - '@vitejs/plugin-vue-jsx': 4.1.0(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) - autoprefixer: 10.4.20(postcss@8.4.49) - clear: 0.1.0 - consola: 3.2.3 - cssnano: 7.0.6(postcss@8.4.49) - defu: 6.1.4 - esbuild: 0.24.0 - escape-string-regexp: 5.0.0 - estree-walker: 3.0.3 - externality: 1.0.2 - get-port-please: 3.1.2 - h3: 1.13.0 - jiti: 2.4.0 - knitwork: 1.1.0 - magic-string: 0.30.13 - mlly: 1.7.3 - ohash: 1.1.4 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.2.1 - postcss: 8.4.49 - rollup-plugin-visualizer: 5.12.0(rollup@3.29.5) - std-env: 3.8.0 - strip-literal: 2.1.0 - ufo: 1.5.4 - unenv: 1.10.0 - unplugin: 1.16.0 - vite: 5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - vite-node: 2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - vite-plugin-checker: 0.8.0(eslint@9.15.0(jiti@2.4.0))(optionator@0.9.4)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)) - vue: 3.5.13(typescript@5.6.3) - vue-bundle-renderer: 2.1.1 - transitivePeerDependencies: - - '@biomejs/biome' - - '@types/node' - - eslint - - less - - lightningcss - - magicast - - meow - - optionator - - rollup - - sass - - sass-embedded - - stylelint - - stylus - - sugarss - - supports-color - - terser - - typescript - - vls - - vti - - vue-tsc - '@nuxt/vite-builder@3.14.1592(@types/node@22.9.1)(eslint@9.15.0(jiti@2.4.0))(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.3)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3))': dependencies: '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) @@ -9236,9 +9054,9 @@ snapshots: - typescript - vue - '@nuxtjs/mdc@0.9.5(magicast@0.3.5)(rollup@3.29.5)': + '@nuxtjs/mdc@0.9.5(magicast@0.3.5)(rollup@4.27.3)': dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) '@shikijs/transformers': 1.23.1 '@types/hast': 3.0.4 '@types/mdast': 4.0.4 @@ -9660,13 +9478,6 @@ snapshots: optionalDependencies: rollup: 3.29.5 - '@rollup/plugin-replace@6.0.1(rollup@3.29.5)': - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - magic-string: 0.30.13 - optionalDependencies: - rollup: 3.29.5 - '@rollup/plugin-replace@6.0.1(rollup@4.27.3)': dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.27.3) @@ -9967,6 +9778,8 @@ snapshots: dependencies: '@types/braces': 3.0.4 + '@types/minimatch@5.1.2': {} + '@types/ms@0.7.34': {} '@types/node-forge@1.3.11': @@ -10223,19 +10036,6 @@ snapshots: path-browserify: 1.0.1 vscode-uri: 3.0.8 - '@vue-macros/common@1.15.0(rollup@3.29.5)(vue@3.5.13(typescript@5.6.3))': - dependencies: - '@babel/types': 7.26.0 - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - '@vue/compiler-sfc': 3.5.13 - ast-kit: 1.3.1 - local-pkg: 0.5.1 - magic-string-ast: 0.6.3 - optionalDependencies: - vue: 3.5.13(typescript@5.6.3) - transitivePeerDependencies: - - rollup - '@vue-macros/common@1.15.0(rollup@4.27.3)(vue@3.5.13(typescript@5.6.3))': dependencies: '@babel/types': 7.26.0 @@ -12338,16 +12138,6 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - impound@0.2.0(rollup@3.29.5): - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - mlly: 1.7.3 - pathe: 1.1.2 - unenv: 1.10.0 - unplugin: 1.16.0 - transitivePeerDependencies: - - rollup - impound@0.2.0(rollup@4.27.3): dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.27.3) @@ -13515,9 +13305,9 @@ snapshots: nuxi@3.15.0: {} - nuxt-component-meta@0.9.0(magicast@0.3.5)(rollup@3.29.5): + nuxt-component-meta@0.9.0(magicast@0.3.5)(rollup@4.27.3): dependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) + '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@4.27.3) citty: 0.1.6 mlly: 1.7.3 scule: 1.3.0 @@ -13712,119 +13502,6 @@ snapshots: - vue-tsc - xml2js - nuxt@3.14.1592(@libsql/client@0.14.0)(@parcel/watcher@2.5.0)(@types/node@22.9.1)(better-sqlite3@11.5.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)): - dependencies: - '@nuxt/devalue': 2.0.2 - '@nuxt/devtools': 1.6.1(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue@3.5.13(typescript@5.6.3)) - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/schema': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/telemetry': 2.6.0(magicast@0.3.5)(rollup@3.29.5) - '@nuxt/vite-builder': 3.14.1592(@types/node@22.9.1)(eslint@9.15.0(jiti@2.4.0))(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@3.29.5)(terser@5.36.0)(typescript@5.6.3)(vue-tsc@2.1.10(typescript@5.6.3))(vue@3.5.13(typescript@5.6.3)) - '@unhead/dom': 1.11.11 - '@unhead/shared': 1.11.11 - '@unhead/ssr': 1.11.11 - '@unhead/vue': 1.11.11(vue@3.5.13(typescript@5.6.3)) - '@vue/shared': 3.5.13 - acorn: 8.14.0 - c12: 2.0.1(magicast@0.3.5) - chokidar: 4.0.1 - compatx: 0.1.8 - consola: 3.2.3 - cookie-es: 1.2.2 - defu: 6.1.4 - destr: 2.0.3 - devalue: 5.1.1 - errx: 0.1.0 - esbuild: 0.24.0 - escape-string-regexp: 5.0.0 - estree-walker: 3.0.3 - globby: 14.0.2 - h3: 1.13.0 - hookable: 5.5.3 - ignore: 6.0.2 - impound: 0.2.0(rollup@3.29.5) - jiti: 2.4.0 - klona: 2.0.6 - knitwork: 1.1.0 - magic-string: 0.30.13 - mlly: 1.7.3 - nanotar: 0.1.1 - nitropack: 2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3) - nuxi: 3.15.0 - nypm: 0.3.12 - ofetch: 1.4.1 - ohash: 1.1.4 - pathe: 1.1.2 - perfect-debounce: 1.0.0 - pkg-types: 1.2.1 - radix3: 1.1.2 - scule: 1.3.0 - semver: 7.6.3 - std-env: 3.8.0 - strip-literal: 2.1.0 - tinyglobby: 0.2.10 - ufo: 1.5.4 - ultrahtml: 1.5.3 - uncrypto: 0.1.3 - unctx: 2.3.1 - unenv: 1.10.0 - unhead: 1.11.11 - unimport: 3.13.2(rollup@3.29.5) - unplugin: 1.16.0 - unplugin-vue-router: 0.10.8(rollup@3.29.5)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) - unstorage: 1.13.1(ioredis@5.4.1) - untyped: 1.5.1 - vue: 3.5.13(typescript@5.6.3) - vue-bundle-renderer: 2.1.1 - vue-devtools-stub: 0.1.0 - vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3)) - optionalDependencies: - '@parcel/watcher': 2.5.0 - '@types/node': 22.9.1 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@biomejs/biome' - - '@capacitor/preferences' - - '@electric-sql/pglite' - - '@libsql/client' - - '@netlify/blobs' - - '@planetscale/database' - - '@upstash/redis' - - '@vercel/kv' - - better-sqlite3 - - bufferutil - - drizzle-orm - - encoding - - eslint - - idb-keyval - - ioredis - - less - - lightningcss - - magicast - - meow - - mysql2 - - optionator - - rollup - - sass - - sass-embedded - - stylelint - - stylus - - sugarss - - supports-color - - terser - - typescript - - utf-8-validate - - vite - - vls - - vti - - vue-tsc - - xml2js - nuxt@3.14.1592(@libsql/client@0.14.0)(@parcel/watcher@2.5.0)(@types/node@22.9.1)(better-sqlite3@11.5.0)(eslint@9.15.0(jiti@2.4.0))(ioredis@5.4.1)(lightningcss@1.28.1)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.27.3)(terser@5.36.0)(typescript@5.6.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-tsc@2.1.10(typescript@5.6.3)): dependencies: '@nuxt/devalue': 2.0.2 @@ -14858,15 +14535,6 @@ snapshots: dependencies: rollup-plugin-inject: 3.0.2 - rollup-plugin-visualizer@5.12.0(rollup@3.29.5): - dependencies: - open: 8.4.2 - picomatch: 2.3.1 - source-map: 0.7.4 - yargs: 17.7.2 - optionalDependencies: - rollup: 3.29.5 - rollup-plugin-visualizer@5.12.0(rollup@4.27.3): dependencies: open: 8.4.2 @@ -15604,24 +15272,6 @@ snapshots: css-tree: 3.0.1 ohash: 1.1.4 - unimport@3.13.2(rollup@3.29.5): - dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - acorn: 8.14.0 - escape-string-regexp: 5.0.0 - estree-walker: 3.0.3 - fast-glob: 3.3.2 - local-pkg: 0.5.1 - magic-string: 0.30.13 - mlly: 1.7.3 - pathe: 1.1.2 - pkg-types: 1.2.1 - scule: 1.3.0 - strip-literal: 2.1.0 - unplugin: 1.16.0 - transitivePeerDependencies: - - rollup - unimport@3.13.2(rollup@4.27.3): dependencies: '@rollup/pluginutils': 5.1.3(rollup@4.27.3) @@ -15709,28 +15359,6 @@ snapshots: - rollup - supports-color - unplugin-vue-router@0.10.8(rollup@3.29.5)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)): - dependencies: - '@babel/types': 7.26.0 - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - '@vue-macros/common': 1.15.0(rollup@3.29.5)(vue@3.5.13(typescript@5.6.3)) - ast-walker-scope: 0.6.2 - chokidar: 3.6.0 - fast-glob: 3.3.2 - json5: 2.2.3 - local-pkg: 0.5.1 - magic-string: 0.30.13 - mlly: 1.7.3 - pathe: 1.1.2 - scule: 1.3.0 - unplugin: 1.16.0 - yaml: 2.6.1 - optionalDependencies: - vue-router: 4.4.5(vue@3.5.13(typescript@5.6.3)) - transitivePeerDependencies: - - rollup - - vue - unplugin-vue-router@0.10.8(rollup@4.27.3)(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)): dependencies: '@babel/types': 7.26.0 @@ -15910,24 +15538,6 @@ snapshots: typescript: 5.6.3 vue-tsc: 2.1.10(typescript@5.6.3) - vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@3.29.5))(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0)): - dependencies: - '@antfu/utils': 0.7.10 - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) - debug: 4.3.7(supports-color@9.4.0) - error-stack-parser-es: 0.1.5 - fs-extra: 11.2.0 - open: 10.1.0 - perfect-debounce: 1.0.0 - picocolors: 1.1.1 - sirv: 3.0.0 - vite: 5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0) - optionalDependencies: - '@nuxt/kit': 3.14.1592(magicast@0.3.5)(rollup@3.29.5) - transitivePeerDependencies: - - rollup - - supports-color - vite-plugin-inspect@0.8.8(@nuxt/kit@3.14.1592(magicast@0.3.5)(rollup@4.27.3))(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0)): dependencies: '@antfu/utils': 0.7.10 @@ -15972,9 +15582,9 @@ snapshots: lightningcss: 1.28.1 terser: 5.36.0 - vitest-environment-nuxt@1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)): + vitest-environment-nuxt@1.0.1(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)): dependencies: - '@nuxt/test-utils': 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@3.29.5)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) + '@nuxt/test-utils': 3.14.4(h3@1.13.0)(magicast@0.3.5)(nitropack@2.10.4(@libsql/client@0.14.0)(better-sqlite3@11.5.0)(typescript@5.6.3))(playwright-core@1.49.0)(rollup@4.27.3)(vite@5.4.11(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vitest@2.1.5(@types/node@22.9.1)(lightningcss@1.28.1)(terser@5.36.0))(vue-router@4.4.5(vue@3.5.13(typescript@5.6.3)))(vue@3.5.13(typescript@5.6.3)) transitivePeerDependencies: - '@cucumber/cucumber' - '@jest/globals' diff --git a/src/runtime/adapters/sqlite.ts b/src/runtime/adapters/sqlite.ts index 36ff09411..178332fb5 100644 --- a/src/runtime/adapters/sqlite.ts +++ b/src/runtime/adapters/sqlite.ts @@ -7,8 +7,7 @@ export default createDatabaseAdapter<{ filename: string }>((opts) => { if (!db) { const filename = !opts || isAbsolute(opts?.filename || '') ? opts?.filename - // @ts-expect-error - `_importMeta_` is defined in nitro runtime - : new URL(opts.filename, globalThis._importMeta_.url).pathname + : new URL(opts.filename, (globalThis as unknown as { _importMeta_: { url: string } })._importMeta_.url).pathname db = new Database(filename) } diff --git a/src/runtime/internal/navigation.ts b/src/runtime/internal/navigation.ts index 15602ffff..fa602b906 100644 --- a/src/runtime/internal/navigation.ts +++ b/src/runtime/internal/navigation.ts @@ -54,7 +54,7 @@ export async function generateNavigationTree(q stem: content.stem, children: [], ...pickNavigationFields(content), - }) + } as ContentNavigationItem) // Create navigation item from content const navItem: ContentNavigationItem = getNavItem(content) diff --git a/src/runtime/internal/query.ts b/src/runtime/internal/query.ts index e0091dc58..d1c5843ae 100644 --- a/src/runtime/internal/query.ts +++ b/src/runtime/internal/query.ts @@ -87,7 +87,7 @@ export const collectionQureyBuilder = (collection: async count(field: keyof Collections[T] | '*' = '*', distinct: boolean = false) { return fetch(collection, buildQuery({ count: { field: String(field), distinct }, - })).then(m => m[0].count) + })).then(m => (m[0] as { count: number }).count) }, } diff --git a/src/runtime/internal/studio/collection.ts b/src/runtime/internal/studio/collection.ts index ccd681e3c..fd9b686d1 100644 --- a/src/runtime/internal/studio/collection.ts +++ b/src/runtime/internal/studio/collection.ts @@ -1,13 +1,14 @@ import { minimatch } from 'minimatch' import type { CollectionInfo } from '@nuxt/content' // import { joinURL, withoutLeadingSlash } from 'ufo' +import type { JsonSchema7ObjectType } from 'zod-to-json-schema' import { getOrderedSchemaKeys } from '../schema' // import { parseSourceBase } from './utils' import { withoutRoot } from './files' export const getCollectionByPath = (path: string, collections: Record): CollectionInfo => { return Object.values(collections).find((collection) => { - if (!collection.source) { + if (!collection.source || collection.source.length === 0) { return } @@ -26,7 +27,7 @@ export const getCollectionByPath = (path: string, collections: Record { - return minimatch(p, collection.source.include) + return collection.source.some(source => minimatch(p, source.include)) }) }) } @@ -59,13 +60,13 @@ export function generateRecordSelectByColumn(collection: CollectionInfo, column: function computeValuesBasedOnCollectionSchema(collection: CollectionInfo, data: Record) { const fields: string[] = [] const values: Array = [] - const properties = collection.schema.definitions[collection.name].properties + const properties = (collection.schema.definitions[collection.name] as JsonSchema7ObjectType).properties const sortedKeys = getOrderedSchemaKeys(properties) sortedKeys.forEach((key) => { const value = (properties)[key] // const underlyingType = getUnderlyingType(value as ZodType) - const underlyingType = value.type + const underlyingType = (value as JsonSchema7ObjectType).type const defaultValue = value.default ? value.default : 'NULL' const valueToInsert = typeof data[key] !== 'undefined' ? data[key] : defaultValue diff --git a/src/runtime/internal/studio/compatibility.ts b/src/runtime/internal/studio/compatibility.ts index 751f9770e..a519421c5 100644 --- a/src/runtime/internal/studio/compatibility.ts +++ b/src/runtime/internal/studio/compatibility.ts @@ -1,4 +1,5 @@ import type { CollectionInfo, DraftSyncFile } from '@nuxt/content' +import type { JsonSchema7ObjectType } from 'zod-to-json-schema' export const v2ToV3ParsedFile = (file: DraftSyncFile, collection: CollectionInfo) => { const mappedFile: Record = { @@ -9,7 +10,7 @@ export const v2ToV3ParsedFile = (file: DraftSyncFile, collection: CollectionInfo path: file.parsed._path, } - const properties = collection.schema.definitions[collection.name].properties + const properties = (collection.schema.definitions[collection.name] as JsonSchema7ObjectType).properties // Map parsed content to collection schema Object.keys(file.parsed).forEach((key) => { diff --git a/src/runtime/internal/studio/index.ts b/src/runtime/internal/studio/index.ts index 6f0708a6b..32f37cf42 100644 --- a/src/runtime/internal/studio/index.ts +++ b/src/runtime/internal/studio/index.ts @@ -1,6 +1,6 @@ import { createApp } from 'vue' import type { AppConfig } from 'nuxt/schema' -import type { CollectionInfo, FileChangeMessagePayload, FileMessageData, FileSelectMessagePayload, DraftSyncData, PreviewFile, DraftSyncFile } from '@nuxt/content' +import type { PublicRuntimeConfig, CollectionInfo, FileChangeMessagePayload, FileMessageData, FileSelectMessagePayload, DraftSyncData, PreviewFile, DraftSyncFile } from '@nuxt/content' import { withLeadingSlash } from 'ufo' import StudioPreviewMode from '../../components/StudioPreviewMode.vue' import { loadDatabaseAdapter } from '../database.client' @@ -70,12 +70,13 @@ const syncDraftAppConfig = (appConfig?: Record) => { // Reset app config to initial state if no appConfig is provided // Makes sure that app config does not contain any preview data if (!appConfig) { + // @ts-expect-error -- TODO fix type deepDelete(_appConfig, initialAppConfig) } } export function mountPreviewUI() { - const { studio } = useRuntimeConfig().public + const studio: PublicRuntimeConfig['studio'] = useRuntimeConfig().public.studio || {} const previewToken = window.sessionStorage.getItem('previewToken') // Show loading @@ -91,7 +92,7 @@ export function mountPreviewUI() { export function initIframeCommunication() { const nuxtApp = useNuxtApp() - const { studio } = useRuntimeConfig().public + const studio: PublicRuntimeConfig['studio'] = useRuntimeConfig().public.studio // Not in an iframe if (!window.parent || window.self === window.parent) { @@ -116,7 +117,7 @@ export function initIframeCommunication() { } }) - window.addEventListener('message', async (e: { data: FileMessageData }) => { + window.addEventListener('message', async (e: { origin: string, data: FileMessageData }) => { if (!dbReady.value) { return } diff --git a/src/runtime/plugins/studio/preview.client.ts b/src/runtime/plugins/studio/preview.client.ts index 464049adf..a923bfa5a 100644 --- a/src/runtime/plugins/studio/preview.client.ts +++ b/src/runtime/plugins/studio/preview.client.ts @@ -1,7 +1,8 @@ +import type { PublicRuntimeConfig } from '@nuxt/content' import { defineNuxtPlugin, useCookie, useRoute, useRuntimeConfig } from '#imports' export default defineNuxtPlugin(async (nuxtApp) => { - const studioConfig = useRuntimeConfig().public.studio || {} + const studioConfig: PublicRuntimeConfig['studio'] = useRuntimeConfig().public.studio || {} const route = useRoute() const previewToken = useCookie('previewToken', { sameSite: 'none', secure: true }) diff --git a/src/runtime/plugins/websocket.dev.ts b/src/runtime/plugins/websocket.dev.ts index 654731108..50b7e0044 100644 --- a/src/runtime/plugins/websocket.dev.ts +++ b/src/runtime/plugins/websocket.dev.ts @@ -2,9 +2,9 @@ import { defineNuxtPlugin } from 'nuxt/app' import { useRuntimeConfig } from '#imports' export default defineNuxtPlugin(() => { - const publicConfig = useRuntimeConfig().public as { content: { wsUrl: string } } + const publicConfig = useRuntimeConfig().public.content as { wsUrl: string } - if (import.meta.client && publicConfig.content.wsUrl) { + if (import.meta.client && publicConfig.wsUrl) { // Connect to websocket import('../internal/websocket').then(({ useContentWebSocket }) => useContentWebSocket()) } diff --git a/src/types/global.d.ts b/src/types/global.d.ts index 769c3380d..d76958193 100644 --- a/src/types/global.d.ts +++ b/src/types/global.d.ts @@ -1,3 +1,44 @@ interface Window { openFileInStudio: (path: string) => void } + +declare module '#content/manifest' { + const manifest: Record + const checksums: Record + const tables: Record + + export { manifest as default, checksums, tables } +} + +declare module '#content/components' { + export const globalComponents: string[] + export const localComponents: string[] +} + +declare module '#content/dump' { + export const dump: string +} + +declare module '#content/adapter' { + import type { DatabaseAdapter } from './database' + + const adapter: DatabaseAdapter + + export { adapter as default } +} + +declare module '#content/collections' { + export const collections: Record +} + +declare module '#content/studio' { + import type { CollectionInfo } from './collection' + + export const collections: Record + export const gitInfo: GitInfo + export const appConfigSchema: Record +} + +declare module '#content/dump' { + export const dump: string +} diff --git a/src/types/shims.d.ts b/src/types/shims.d.ts deleted file mode 100644 index bd86268ab..000000000 --- a/src/types/shims.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -import type { CollectionInfo } from './collection' -import type { DatabaseAdapter } from './database' - -declare module '#content/manifest' { - const manifest: Record - const checksums: Record - const tables: Record - - export { manifest as default, checksums, tables } -} - -declare module '#content/components' { - export const globalComponents: string[] - export const localComponents: string[] -} - -declare module '#content/dump' { - export const dump: string -} - -declare module '#content/adapter' { - const adapter: DatabaseAdapter - - export { adapter as default } -} - -declare module '#content/collections' { - export const collections: Record -} - -declare module '#content/studio' { - export const collections: Record - export const gitInfo: GitInfo - export const appConfigSchema: Record -} diff --git a/src/utils/templates.ts b/src/utils/templates.ts index 2b4b31482..ff8cf39b2 100644 --- a/src/utils/templates.ts +++ b/src/utils/templates.ts @@ -183,7 +183,7 @@ export const studioTemplate = (collections: ResolvedCollection[], gitInfo: GitIn pascalName: pascalCase(collection.name), tableName: collection.tableName, // Remove source from collection meta if it's a remote collection - source: collection.source?.repository ? undefined : collection.source, + source: collection.source?.filter(source => source.repository ? undefined : collection.source), type: collection.type, jsonFields: collection.jsonFields, schema: zodToJsonSchema(collection.extendedSchema, collection.name), diff --git a/tsconfig.json b/tsconfig.json index f62fbdb97..ee4831888 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,9 +3,15 @@ "exclude": [ "dist", "node_modules", - "docs" + "docs", + "playground", + "examples" + ], + "include": [ + "src", + "src/types/shim.d.ts" ], "compilerOptions": { - "strictNullChecks": false - } + "strictNullChecks": false, + }, }