diff --git a/.eslintrc b/.eslintrc index 4902c1eb..812beeb4 100644 --- a/.eslintrc +++ b/.eslintrc @@ -32,6 +32,7 @@ // Disable vue2-specific rules (until https://github.com/nuxt/eslint-config/issues/216 is fixed) "vue/no-v-model-argument": "off" }, + "ignorePatterns": ["examples/**"], "overrides": [ { "files": ["*.ts", "*.vue"], diff --git a/.vscode/settings.json b/.vscode/settings.json index 12eab9d2..566213f8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "cSpell.words": ["Unplugin"] + "cSpell.words": ["nuxt", "Unplugin"] } diff --git a/package.json b/package.json index 6732cb92..c758c264 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,8 @@ "vue": "^3.2.45" }, "devDependencies": { - "@nuxtjs/eslint-config-typescript": "^12.0.0", + "@nuxt/schema": "^3.1.1", + "@js/eslint-config-typescript": "^12.0.0", "@types/node": "^18.11.18", "@types/prettier": "^2.7.2", "@vitest/coverage-c8": "^0.26.3", diff --git a/playground/Test.stories.vue b/playground/TestStory.stories.vue similarity index 100% rename from playground/Test.stories.vue rename to playground/TestStory.stories.vue diff --git a/playground/index.html b/playground/index.html index 68678677..25ad3964 100644 --- a/playground/index.html +++ b/playground/index.html @@ -14,14 +14,14 @@
visit /__inspect/ to inspect the intermediate state diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0c5abc3..8586a6da 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,7 @@ importers: .: specifiers: + '@nuxt/schema': ^3.1.1 '@nuxtjs/eslint-config-typescript': ^12.0.0 '@types/node': ^18.11.18 '@types/prettier': ^2.7.2 @@ -33,6 +34,7 @@ importers: prettier-plugin-organize-imports: 3.2.1_7zh76q2qrt7th5cvcxurl33jgy unplugin: 1.0.1 devDependencies: + '@nuxt/schema': 3.1.1_rollup@3.9.1 '@nuxtjs/eslint-config-typescript': 12.0.0_iukboom6ndih5an6iafl45j2fe '@types/node': 18.11.18 '@types/prettier': 2.7.2 @@ -1536,6 +1538,11 @@ packages: regenerator-runtime: 0.13.10 dev: true + /@babel/standalone/7.20.14: + resolution: {integrity: sha512-zxdQD6+eMQumJFPOLpOZE34JAAGrZPMXCKvHR7Mtat/l+nHDOxlit5u85HDk5WkBXmvN5PhUMeimiC95KXD9+A==} + engines: {node: '>=6.9.0'} + dev: true + /@babel/template/7.20.7: resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} engines: {node: '>=6.9.0'} @@ -2197,6 +2204,28 @@ packages: rimraf: 3.0.2 dev: true + /@nuxt/schema/3.1.1_rollup@3.9.1: + resolution: {integrity: sha512-/KuoCDVGrLD9W7vwuYhu4HbdT/BpbrhA4Pm9dGn7Jah40kHDGqUnJxugvMjt+4suq53rLQyTA0LRDWfFxfxAOQ==} + engines: {node: ^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0} + dependencies: + c12: 1.1.0 + create-require: 1.1.1 + defu: 6.1.2 + hookable: 5.4.2 + jiti: 1.16.2 + pathe: 1.1.0 + pkg-types: 1.0.1 + postcss-import-resolver: 2.0.0 + scule: 1.0.0 + std-env: 3.3.1 + ufo: 1.0.1 + unimport: 2.1.0_rollup@3.9.1 + untyped: 1.2.2 + transitivePeerDependencies: + - rollup + - supports-color + dev: true + /@nuxtjs/eslint-config-typescript/12.0.0_iukboom6ndih5an6iafl45j2fe: resolution: {integrity: sha512-HJR0ho5MYuOCFjkL+eMX/VXbUwy36J12DUMVy+dj3Qz1GYHwX92Saxap3urFzr8oPkzzFiuOknDivfCeRBWakg==} peerDependencies: @@ -2274,6 +2303,21 @@ packages: picomatch: 2.3.1 dev: true + /@rollup/pluginutils/5.0.2_rollup@3.9.1: + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.0 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 3.9.1 + dev: true + /@sinclair/typebox/0.24.51: resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} dev: true @@ -5027,6 +5071,15 @@ packages: engines: {node: '>= 10.0.0'} dev: true + /agent-base/6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + /aggregate-error/3.1.0: resolution: {integrity: sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==} engines: {node: '>=8'} @@ -5846,6 +5899,21 @@ packages: engines: {node: '>= 0.8'} dev: true + /c12/1.1.0: + resolution: {integrity: sha512-9KRFWEng+TH8sGST4NNdiKzZGw1Z1CHnPGAmNqAyVP7suluROmBjD8hsiR34f94DdlrvtGvvmiGDsoFXlCBWIw==} + dependencies: + defu: 6.1.2 + dotenv: 16.0.3 + giget: 1.0.0 + jiti: 1.16.2 + mlly: 1.1.0 + pathe: 1.1.0 + pkg-types: 1.0.1 + rc9: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /c8/7.12.0: resolution: {integrity: sha512-CtgQrHOkyxr5koX1wEUmN/5cfDa2ckbHRA4Gy5LAL0zaCFtVWJS5++n+w4/sr2GWGerBxgTjpKeDclk/Qk6W/A==} engines: {node: '>=10.12.0'} @@ -6237,6 +6305,10 @@ packages: hasBin: true dev: true + /colorette/2.0.19: + resolution: {integrity: sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==} + dev: true + /combined-stream/1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -6462,6 +6534,10 @@ packages: sha.js: 2.4.11 dev: true + /create-require/1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + /cross-env/7.0.3: resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==} engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'} @@ -6715,6 +6791,10 @@ packages: isobject: 3.0.1 dev: true + /defu/6.1.2: + resolution: {integrity: sha512-+uO4+qr7msjNNWKYPHqN/3+Dx3NFkmIzayk2L1MyZQlvgZb/J1A0fo410dpKrN2SnqFjt8n4JL8fDJE0wIgjFQ==} + dev: true + /delayed-stream/1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -6736,6 +6816,10 @@ packages: minimalistic-assert: 1.0.1 dev: true + /destr/1.2.2: + resolution: {integrity: sha512-lrbCJwD9saUQrqUfXvl6qoM+QN3W7tLV5pAOs+OqOmopCCz/JkE05MHedJR1xfk4IAnZuJXPVuN5+7jNA2ZCiA==} + dev: true + /destroy/1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} @@ -6873,6 +6957,11 @@ packages: resolution: {integrity: sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==} dev: true + /dotenv/16.0.3: + resolution: {integrity: sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==} + engines: {node: '>=12'} + dev: true + /dotenv/8.6.0: resolution: {integrity: sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g==} engines: {node: '>=10'} @@ -7307,6 +7396,11 @@ packages: engines: {node: '>=10'} dev: true + /escape-string-regexp/5.0.0: + resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} + engines: {node: '>=12'} + dev: true + /eslint-config-prettier/8.6.0_eslint@8.31.0: resolution: {integrity: sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==} hasBin: true @@ -8107,6 +8201,11 @@ packages: rimraf: 3.0.2 dev: true + /flat/5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + dev: true + /flatted/3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} dev: true @@ -8414,6 +8513,21 @@ packages: engines: {node: '>=0.10.0'} dev: true + /giget/1.0.0: + resolution: {integrity: sha512-KWELZn3Nxq5+0So485poHrFriK9Bn3V/x9y+wgqrHkbmnGbjfLmZ685/SVA/ovW+ewoqW0gVI47pI4yW/VNobQ==} + hasBin: true + dependencies: + colorette: 2.0.19 + defu: 6.1.2 + https-proxy-agent: 5.0.1 + mri: 1.2.0 + node-fetch-native: 1.0.1 + pathe: 1.1.0 + tar: 6.1.12 + transitivePeerDependencies: + - supports-color + dev: true + /github-slugger/1.5.0: resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} dev: true @@ -8768,6 +8882,10 @@ packages: minimalistic-crypto-utils: 1.0.1 dev: true + /hookable/5.4.2: + resolution: {integrity: sha512-6rOvaUiNKy9lET1X0ECnyZ5O5kSV0PJbtA5yZUgdEF7fGJEVwSLSislltyt7nFwVVALYHQJtfGeAR2Y0A0uJkg==} + dev: true + /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true @@ -8852,6 +8970,16 @@ packages: resolution: {integrity: sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==} dev: true + /https-proxy-agent/5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + /human-signals/2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -9554,6 +9682,11 @@ packages: supports-color: 8.1.1 dev: true + /jiti/1.16.2: + resolution: {integrity: sha512-OKBOVWmU3FxDt/UH4zSwiKPuc1nihFZiOD722FuJlngvLz2glX1v2/TJIgoA4+mrpnXxHV6dSAoCvPcYQtoG5A==} + hasBin: true + dev: true + /joycon/3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -9826,6 +9959,11 @@ packages: engines: {node: '>=14'} dev: true + /local-pkg/0.4.3: + resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} + engines: {node: '>=14'} + dev: true + /locate-path/3.0.0: resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} engines: {node: '>=6'} @@ -9933,6 +10071,13 @@ packages: sourcemap-codec: 1.4.8 dev: true + /magic-string/0.27.0: + resolution: {integrity: sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + /make-dir/2.1.0: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} @@ -10282,6 +10427,15 @@ packages: ufo: 1.0.1 dev: true + /mlly/1.1.0: + resolution: {integrity: sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==} + dependencies: + acorn: 8.8.1 + pathe: 1.1.0 + pkg-types: 1.0.1 + ufo: 1.0.1 + dev: true + /move-concurrently/1.0.1: resolution: {integrity: sha512-hdrFxZOycD/g6A6SoI2bB5NA/5NEqD0569+S47WZhPvm46sD50ZHdYaFmnua5lndde9rCHGjmfK7Z8BuCt/PcQ==} dependencies: @@ -10293,6 +10447,11 @@ packages: run-queue: 1.0.3 dev: true + /mri/1.2.0: + resolution: {integrity: sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==} + engines: {node: '>=4'} + dev: true + /mrmime/1.0.1: resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} engines: {node: '>=10'} @@ -10395,6 +10554,10 @@ packages: minimatch: 3.1.2 dev: true + /node-fetch-native/1.0.1: + resolution: {integrity: sha512-VzW+TAk2wE4X9maiKMlT+GsPU4OMmR1U9CrHSmd3DFLn2IcZ9VJ6M6BBugGfYUnPCLSYxXdZy17M0BEJyhUTwg==} + dev: true + /node-fetch/2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} @@ -10963,6 +11126,10 @@ packages: resolution: {integrity: sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==} dev: true + /pathe/1.1.0: + resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + dev: true + /pathval/1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -11091,6 +11258,12 @@ packages: postcss: 7.0.39 dev: true + /postcss-import-resolver/2.0.0: + resolution: {integrity: sha512-y001XYgGvVwgxyxw9J1a5kqM/vtmIQGzx34g0A0Oy44MFcy/ZboZw1hu/iN3VYFjSTRzbvd7zZJJz0Kh0AGkTw==} + dependencies: + enhanced-resolve: 4.5.0 + dev: true + /postcss-load-config/3.1.4: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} @@ -11564,6 +11737,14 @@ packages: webpack: 4.46.0 dev: true + /rc9/2.0.1: + resolution: {integrity: sha512-9EfjLgNmzP9255YX8bGnILQcmdtOXKtUlFTu8bOZPJVtaUDZ2imswcUdpK51tMjTRQyB7r5RebNijrzuyGXcVA==} + dependencies: + defu: 6.1.2 + destr: 1.2.2 + flat: 5.0.2 + dev: true + /react-docgen-typescript/2.2.2_typescript@4.9.4: resolution: {integrity: sha512-tvg2ZtOpOi6QDwsb3GZhOjDkkX0h8Z2gipvTg6OVMUyoYoURhEiRNePT8NZItTVCDh39JJHnLdfCOkzoLbFnTg==} peerDependencies: @@ -12163,6 +12344,10 @@ packages: ajv-keywords: 5.1.0_ajv@8.12.0 dev: true + /scule/1.0.0: + resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} + dev: true + /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -12527,6 +12712,10 @@ packages: engines: {node: '>= 0.8'} dev: true + /std-env/3.3.1: + resolution: {integrity: sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==} + dev: true + /store2/2.14.2: resolution: {integrity: sha512-siT1RiqlfQnGqgT/YzXVUNsom9S0H1OX+dpdGN1xkyYATo4I6sep5NmsRD/40s3IIOvlCq6akxkqG82urIZW1w==} dev: true @@ -13318,6 +13507,24 @@ packages: vfile: 4.2.1 dev: true + /unimport/2.1.0_rollup@3.9.1: + resolution: {integrity: sha512-GDVIxATluUquX8EqelT6DtnmnZaXGID1jsO9IXwlnxb0OIEqKAxTOnTlnGmHbseoGTh+ZC9kcNDaO18HYQj9KA==} + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@3.9.1 + escape-string-regexp: 5.0.0 + fast-glob: 3.2.12 + local-pkg: 0.4.3 + magic-string: 0.27.0 + mlly: 1.1.0 + pathe: 1.1.0 + pkg-types: 1.0.1 + scule: 1.0.0 + strip-literal: 1.0.0 + unplugin: 1.0.1 + transitivePeerDependencies: + - rollup + dev: true + /union-value/1.0.1: resolution: {integrity: sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==} engines: {node: '>=0.10.0'} @@ -13406,7 +13613,6 @@ packages: chokidar: 3.5.3 webpack-sources: 3.2.3 webpack-virtual-modules: 0.5.0 - dev: false /unset-value/1.0.0: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} @@ -13424,6 +13630,17 @@ packages: dev: true optional: true + /untyped/1.2.2: + resolution: {integrity: sha512-EANYd5L6AdpgfldlgMcmvOOnj092nWhy0ybhc7uhEH12ipytDYz89EOegBQKj8qWL3u1wgYnmFjADhsuCJs5Aw==} + dependencies: + '@babel/core': 7.20.12 + '@babel/standalone': 7.20.14 + '@babel/types': 7.20.7 + scule: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /upath/1.2.0: resolution: {integrity: sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==} engines: {node: '>=4'} @@ -13978,7 +14195,6 @@ packages: /webpack-virtual-modules/0.5.0: resolution: {integrity: sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==} - dev: false /webpack/4.46.0: resolution: {integrity: sha512-6jJuJjg8znb/xRItk7bkT0+Q7AHCYjjFnvKIWQPkNIOyRqoCGvkOs0ipeQzrqz4l5FtN5ZI/ukEHroeX/o1/5Q==} diff --git a/scripts/postbuild.ts b/scripts/postbuild.ts index d495f2e8..527d03fb 100644 --- a/scripts/postbuild.ts +++ b/scripts/postbuild.ts @@ -20,4 +20,4 @@ async function run() { } } -run() +void run() diff --git a/src/nuxt.ts b/src/nuxt.ts index d3173b3f..2e7454a2 100644 --- a/src/nuxt.ts +++ b/src/nuxt.ts @@ -1,15 +1,18 @@ import type { Options } from './types' import unplugin from '.' +import { Nuxt } from '@nuxt/schema' -export default function (options: Options = {}, nuxt: any) { +export default function (options: Options = {}, nuxt: Nuxt) { // install webpack plugin - nuxt.hook('webpack:config', async (config: any) => { - config.plugins = config.plugins || [] - config.plugins.unshift(unplugin.webpack(options)) + nuxt.hook('webpack:config', (configs) => { + configs.forEach((config) => { + config.plugins = config.plugins || [] + config.plugins.unshift(unplugin.webpack(options)) + }) }) // install vite plugin - nuxt.hook('vite:extendConfig', async (config: any) => { + nuxt.hook('vite:extendConfig', (config) => { config.plugins = config.plugins || [] config.plugins.push(unplugin.vite(options)) }) diff --git a/src/types.ts b/src/types.ts index b0f09c87..e2e52d0a 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface Options { // define your plugin options here }