diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba821e97..0ea22cf16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,12 +57,12 @@ jobs: - run: pnpm dev:prepare - - name: ๐Ÿงช Test project - run: pnpm test - - name: ๐Ÿ›  Build project run: pnpm build + - name: ๐Ÿงช Test project + run: pnpm test + - name: ๐Ÿ’ช Type check run: pnpm test:types diff --git a/docs/content/4.advanced/1.custom-provider.md b/docs/content/4.advanced/1.custom-provider.md index 2ed3bc7ca..998d7c9eb 100644 --- a/docs/content/4.advanced/1.custom-provider.md +++ b/docs/content/4.advanced/1.custom-provider.md @@ -9,7 +9,7 @@ The runtime will receive a source, image modifiers and its provider options. It ```ts [providers/my-provider.ts] import { joinURL } from 'ufo' -import { createOperationsGenerator, defineProvider } from '#image' +import { createOperationsGenerator, defineProvider } from '@nuxt/image/runtime' const operationsGenerator = createOperationsGenerator() @@ -66,7 +66,7 @@ export default defineNuxtConfig({ }) ``` -There are plenty of useful utilities that can be used to write providers by importing from `#image`. See [src/runtime/providers](https://github.com/nuxt/image/tree/main/src/runtime/providers) for more info. +There are plenty of useful utilities that can be used to write providers by importing from `@nuxt/image/runtime`. See [src/runtime/providers](https://github.com/nuxt/image/tree/main/src/runtime/providers) for more info. ### Usage Set attribute `provider` as your custom provider name. diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 4b34df157..6ae5970c7 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,3 +1,17 @@ { - "extends": "./.nuxt/tsconfig.json" + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] } diff --git a/eslint.config.mjs b/eslint.config.mjs index d1d48ea81..bdc1c69b8 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -8,7 +8,7 @@ export default createConfigForNuxt({ }, dirs: { src: [ - './playground', + './playground/app', './docs', './example', ], diff --git a/example/tsconfig.json b/example/tsconfig.json index 4b34df157..6ae5970c7 100755 --- a/example/tsconfig.json +++ b/example/tsconfig.json @@ -1,3 +1,17 @@ { - "extends": "./.nuxt/tsconfig.json" + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] } diff --git a/knip.json b/knip.json index 5c228ab6b..6e71f48ee 100644 --- a/knip.json +++ b/knip.json @@ -43,9 +43,9 @@ }, "playground": { "entry": [ - "providers/custom/index.ts", - "{components,layouts,pages,plugins,server}/**", - "{app,error}.vue", + "app/providers/custom/index.ts", + "app/{components,layouts,pages,plugins,server}/**", + "app/{app,error}.vue", "layers/**", "*.ts" ] diff --git a/package.json b/package.json index 94fcc9641..9c1b0f148 100755 --- a/package.json +++ b/package.json @@ -11,13 +11,18 @@ "sideEffects": false, "type": "module", "exports": { - ".": "./dist/module.js" + ".": "./dist/module.js", + "./runtime": "./dist/runtime/index.js", + "./runtime/providers/*": "./dist/runtime/providers/*.js" }, "main": "./dist/module.js", "typesVersions": { "*": { ".": [ "./dist/module.d.ts" + ], + "./runtime": [ + "./dist/runtime/index.d.ts" ] } }, diff --git a/playground/assets/nuxt-white.svg b/playground/app/assets/nuxt-white.svg similarity index 100% rename from playground/assets/nuxt-white.svg rename to playground/app/assets/nuxt-white.svg diff --git a/playground/components/provider-selector.vue b/playground/app/components/provider-selector.vue similarity index 100% rename from playground/components/provider-selector.vue rename to playground/app/components/provider-selector.vue diff --git a/playground/layouts/default.vue b/playground/app/layouts/default.vue similarity index 100% rename from playground/layouts/default.vue rename to playground/app/layouts/default.vue diff --git a/playground/pages/bg.vue b/playground/app/pages/bg.vue similarity index 100% rename from playground/pages/bg.vue rename to playground/app/pages/bg.vue diff --git a/playground/pages/events.vue b/playground/app/pages/events.vue similarity index 100% rename from playground/pages/events.vue rename to playground/app/pages/events.vue diff --git a/playground/pages/img.vue b/playground/app/pages/img.vue similarity index 100% rename from playground/pages/img.vue rename to playground/app/pages/img.vue diff --git a/playground/pages/index.vue b/playground/app/pages/index.vue similarity index 100% rename from playground/pages/index.vue rename to playground/app/pages/index.vue diff --git a/playground/pages/ipx-layers.vue b/playground/app/pages/ipx-layers.vue similarity index 100% rename from playground/pages/ipx-layers.vue rename to playground/app/pages/ipx-layers.vue diff --git a/playground/pages/picture.vue b/playground/app/pages/picture.vue similarity index 100% rename from playground/pages/picture.vue rename to playground/app/pages/picture.vue diff --git a/playground/pages/provider/[provider].vue b/playground/app/pages/provider/[provider].vue similarity index 100% rename from playground/pages/provider/[provider].vue rename to playground/app/pages/provider/[provider].vue diff --git a/playground/pages/responsive.vue b/playground/app/pages/responsive.vue similarity index 100% rename from playground/pages/responsive.vue rename to playground/app/pages/responsive.vue diff --git a/playground/plugins/injection.ts b/playground/app/plugins/injection.ts similarity index 100% rename from playground/plugins/injection.ts rename to playground/app/plugins/injection.ts diff --git a/playground/providers.ts b/playground/app/providers.ts similarity index 99% rename from playground/providers.ts rename to playground/app/providers.ts index 1d5ae4e6b..0eee2db34 100644 --- a/playground/providers.ts +++ b/playground/app/providers.ts @@ -1,6 +1,6 @@ import type { ImageProviders } from '@nuxt/image' -export interface Provider { +interface Provider { name: keyof ImageProviders samples: { src: string diff --git a/playground/providers/custom/index.ts b/playground/app/providers/custom/index.ts similarity index 55% rename from playground/providers/custom/index.ts rename to playground/app/providers/custom/index.ts index 2d1c9258e..8526b09dd 100644 --- a/playground/providers/custom/index.ts +++ b/playground/app/providers/custom/index.ts @@ -1,5 +1,8 @@ import { joinURL } from 'ufo' -import { defineProvider } from '#image' +// this should normally be imported from '@nuxt/image/runtime' +// but we want to run this without building the package, +// which means supporting the stubbed `.ts` extension +import { defineProvider } from '../../../../dist/runtime' export default defineProvider<{ baseURL?: string }>({ getImage: (src, { modifiers, baseURL = '/' }) => { diff --git a/playground/tsconfig.json b/playground/tsconfig.json index 4b34df157..6ae5970c7 100644 --- a/playground/tsconfig.json +++ b/playground/tsconfig.json @@ -1,3 +1,17 @@ { - "extends": "./.nuxt/tsconfig.json" + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b356a055..cdb718dd5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4110,9 +4110,6 @@ packages: resolution: {integrity: sha512-O1Ld7Dr+nqPnmGpdhzLmMTQ4vAsD+rHwMm1NLUmoUFFymBOMKxCCrtDxqdBRYXdeEPEi3SyoR4TizJLQrnKBNA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - h3@1.15.3: - resolution: {integrity: sha512-z6GknHqyX0h9aQaTx22VZDf6QyZn+0Nh+Ym8O/u0SGSkyF5cuTJYKlc8MkzW3Nzf9LE1ivcpmYC3FUGpywhuUQ==} - h3@1.15.4: resolution: {integrity: sha512-z5cFQWDffyOe4vQ9xIqNfCZdV4p//vy6fBnr8Q1AWnVZ0teurKMG66rLj++TKwKPUP3u7iMUvrvKaEUiQw2QWQ==} @@ -5115,9 +5112,6 @@ packages: resolution: {integrity: sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==} hasBin: true - node-mock-http@1.0.1: - resolution: {integrity: sha512-0gJJgENizp4ghds/Ywu2FCmcRsgBTmRQzYPZm61wy+Em2sBarSka0OhQS5huLBg6od1zkNpnWMCZloQDFVvOMQ==} - node-mock-http@1.0.2: resolution: {integrity: sha512-zWaamgDUdo9SSLw47we78+zYw/bDr5gH8pH7oRRs8V3KmBtu8GLgGIbV2p/gRPd3LWpEOpjQj7X1FOU3VFMJ8g==} @@ -8281,7 +8275,7 @@ snapshots: local-pkg: 1.1.1 magic-string: 0.30.17 node-fetch-native: 1.6.6 - node-mock-http: 1.0.1 + node-mock-http: 1.0.2 ofetch: 1.4.1 pathe: 2.0.3 perfect-debounce: 1.0.0 @@ -11444,18 +11438,6 @@ snapshots: dependencies: duplexer: 0.1.2 - h3@1.15.3: - dependencies: - cookie-es: 1.2.2 - crossws: 0.3.5 - defu: 6.1.4 - destr: 2.0.5 - iron-webcrypto: 1.2.1 - node-mock-http: 1.0.1 - radix3: 1.1.2 - ufo: 1.6.1 - uncrypto: 0.1.3 - h3@1.15.4: dependencies: cookie-es: 1.2.2 @@ -12693,7 +12675,7 @@ snapshots: mime: 4.0.7 mlly: 1.7.4 node-fetch-native: 1.6.6 - node-mock-http: 1.0.1 + node-mock-http: 1.0.2 ofetch: 1.4.1 ohash: 2.0.11 pathe: 2.0.3 @@ -12779,8 +12761,6 @@ snapshots: node-gyp-build@4.8.4: {} - node-mock-http@1.0.1: {} - node-mock-http@1.0.2: {} node-releases@2.0.19: {} @@ -12936,7 +12916,7 @@ snapshots: escape-string-regexp: 5.0.0 estree-walker: 3.0.3 exsolve: 1.0.7 - h3: 1.15.3 + h3: 1.15.4 hookable: 5.5.3 ignore: 7.0.5 impound: 1.0.0 diff --git a/src/module.ts b/src/module.ts index f16d5b63b..b7ec7bcac 100644 --- a/src/module.ts +++ b/src/module.ts @@ -107,7 +107,7 @@ ${BuiltInProviders.map(p => ` ${JSON.stringify(p)}: ReturnType ` ${JSON.stringify(p)}: ReturnType { export const operationsGenerator = createOperationsGenerator({ keyMap: { format: 'f', - fit: 'fit', width: 'w', height: 'h', resize: 's', quality: 'q', background: 'b', + position: 'pos', }, formatter: (key, val: string | number | boolean) => encodeParam(key) + '_' + encodeParam(val.toString()), }) diff --git a/src/runtime/providers/ipxStatic.ts b/src/runtime/providers/ipxStatic.ts index 716938146..309de87e2 100644 --- a/src/runtime/providers/ipxStatic.ts +++ b/src/runtime/providers/ipxStatic.ts @@ -1,7 +1,7 @@ import { joinURL, encodePath } from 'ufo' import { operationsGenerator } from './ipx' import type { IPXOptions } from './ipx' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' export default defineProvider>({ validateDomains: true, diff --git a/src/runtime/providers/netlifyImageCdn.ts b/src/runtime/providers/netlifyImageCdn.ts index 1beb5bfd9..c644cf4b0 100644 --- a/src/runtime/providers/netlifyImageCdn.ts +++ b/src/runtime/providers/netlifyImageCdn.ts @@ -1,4 +1,5 @@ -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' // https://docs.netlify.com/image-cdn/overview/ const operationsGenerator = createOperationsGenerator({ diff --git a/src/runtime/providers/netlifyLargeMedia.ts b/src/runtime/providers/netlifyLargeMedia.ts index b31753a96..c75429046 100644 --- a/src/runtime/providers/netlifyLargeMedia.ts +++ b/src/runtime/providers/netlifyLargeMedia.ts @@ -1,5 +1,6 @@ import { joinURL } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' const operationsGenerator = createOperationsGenerator({ keyMap: { diff --git a/src/runtime/providers/none.ts b/src/runtime/providers/none.ts index 666f2a2d5..17b11ffc7 100644 --- a/src/runtime/providers/none.ts +++ b/src/runtime/providers/none.ts @@ -1,4 +1,4 @@ -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' export default defineProvider({ getImage: url => ({ url }), diff --git a/src/runtime/providers/prepr.ts b/src/runtime/providers/prepr.ts index fb8d27bcd..dcb963fac 100644 --- a/src/runtime/providers/prepr.ts +++ b/src/runtime/providers/prepr.ts @@ -1,6 +1,7 @@ import { joinURL } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' interface PreprImageOptions { projectName: string diff --git a/src/runtime/providers/prismic.ts b/src/runtime/providers/prismic.ts index e97911bef..0f12409d9 100644 --- a/src/runtime/providers/prismic.ts +++ b/src/runtime/providers/prismic.ts @@ -1,7 +1,7 @@ import { getQuery, withBase, withQuery } from 'ufo' import { operationsGenerator } from './imgix' import unsplashProvider, { unsplashCDN } from './unsplash' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' const prismicCDN = 'https://images.prismic.io/' diff --git a/src/runtime/providers/sanity.ts b/src/runtime/providers/sanity.ts index 54067c46b..2860220b9 100644 --- a/src/runtime/providers/sanity.ts +++ b/src/runtime/providers/sanity.ts @@ -1,5 +1,6 @@ import { joinURL, encodePath } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' const sanityCDN = 'https://cdn.sanity.io/images' diff --git a/src/runtime/providers/shopify.ts b/src/runtime/providers/shopify.ts index ab91f28ad..d55ccf376 100644 --- a/src/runtime/providers/shopify.ts +++ b/src/runtime/providers/shopify.ts @@ -1,5 +1,6 @@ import { joinURL, withBase } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' const operationsGenerator = createOperationsGenerator({ keyMap: { diff --git a/src/runtime/providers/sirv.ts b/src/runtime/providers/sirv.ts index bf0c99e26..70579fbdb 100644 --- a/src/runtime/providers/sirv.ts +++ b/src/runtime/providers/sirv.ts @@ -1,5 +1,6 @@ import { joinURL } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' const deleteHash = (value: string) => value.startsWith('#') ? value.replace('#', '') : value const generateColorKeys = () => { diff --git a/src/runtime/providers/storyblok.ts b/src/runtime/providers/storyblok.ts index 9aff7fc41..bd925cbc3 100644 --- a/src/runtime/providers/storyblok.ts +++ b/src/runtime/providers/storyblok.ts @@ -1,5 +1,5 @@ import { withBase, joinURL, parseURL } from 'ufo' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' // https://www.storyblok.com/docs/image-service const storyblockCDN = 'https://a.storyblok.com' diff --git a/src/runtime/providers/strapi5.ts b/src/runtime/providers/strapi5.ts index 22ab1eedf..393c5d0d0 100644 --- a/src/runtime/providers/strapi5.ts +++ b/src/runtime/providers/strapi5.ts @@ -1,5 +1,5 @@ import { withBase } from 'ufo' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' interface StrapiOptions { baseURL?: string diff --git a/src/runtime/providers/twicpics.ts b/src/runtime/providers/twicpics.ts index e52ecdf78..63bee8f83 100644 --- a/src/runtime/providers/twicpics.ts +++ b/src/runtime/providers/twicpics.ts @@ -1,6 +1,7 @@ import { encodeQueryItem, joinURL } from 'ufo' -import { defineProvider, createMapper, createOperationsGenerator } from '#image' -import type { InferModifiers } from '#image/utils/index' +import { defineProvider } from '../utils/provider' +import { createMapper, createOperationsGenerator } from '../utils/index' +import type { InferModifiers } from '../utils/index' const fits = createMapper({ fill: 'resize', diff --git a/src/runtime/providers/unsplash.ts b/src/runtime/providers/unsplash.ts index 3997b7798..d03c2da33 100644 --- a/src/runtime/providers/unsplash.ts +++ b/src/runtime/providers/unsplash.ts @@ -2,7 +2,7 @@ import { getQuery, withBase, withQuery } from 'ufo' import { operationsGenerator } from './imgix' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' export const unsplashCDN = 'https://images.unsplash.com/' diff --git a/src/runtime/providers/uploadcare.ts b/src/runtime/providers/uploadcare.ts index ebaf7454e..e194f40a8 100644 --- a/src/runtime/providers/uploadcare.ts +++ b/src/runtime/providers/uploadcare.ts @@ -20,7 +20,8 @@ import { joinURL, hasProtocol, withTrailingSlash } from 'ufo' import type { ImageModifiers } from '@nuxt/image' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' export interface UploadcareModifiers extends ImageModifiers { // Image Compression diff --git a/src/runtime/providers/vercel.ts b/src/runtime/providers/vercel.ts index 1c768572f..366a0d64c 100644 --- a/src/runtime/providers/vercel.ts +++ b/src/runtime/providers/vercel.ts @@ -1,5 +1,5 @@ import { stringifyQuery } from 'ufo' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' // https://vercel.com/docs/build-output-api/v3/configuration#images diff --git a/src/runtime/providers/wagtail.ts b/src/runtime/providers/wagtail.ts index 50d39f3f5..204c7feae 100644 --- a/src/runtime/providers/wagtail.ts +++ b/src/runtime/providers/wagtail.ts @@ -1,5 +1,5 @@ import { withBase, joinURL } from 'ufo' -import { defineProvider } from '#image' +import { defineProvider } from '../utils/provider' // https://docs.wagtail.org/en/v4.2.1/topics/images.html diff --git a/src/runtime/providers/weserv.ts b/src/runtime/providers/weserv.ts index e0fd60112..576fb2191 100644 --- a/src/runtime/providers/weserv.ts +++ b/src/runtime/providers/weserv.ts @@ -1,5 +1,6 @@ import { withBase } from 'ufo' -import { defineProvider, createOperationsGenerator } from '#image' +import { createOperationsGenerator } from '../utils/index' +import { defineProvider } from '../utils/provider' import { createError } from '#imports' const operationsGenerator = createOperationsGenerator({ diff --git a/test/e2e/bundle.test.ts b/test/e2e/bundle.test.ts index 3243e9763..8d14f48f7 100644 --- a/test/e2e/bundle.test.ts +++ b/test/e2e/bundle.test.ts @@ -22,7 +22,7 @@ describe.skipIf(process.env.ECOSYSTEM_CI || isWindows)('nuxt image bundle size', }), ]) - expect(roundToKilobytes(withImage.totalBytes - withoutImage.totalBytes)).toMatchInlineSnapshot(`"12.2k"`) + expect(roundToKilobytes(withImage.totalBytes - withoutImage.totalBytes)).toMatchInlineSnapshot(`"12.5k"`) }) }) diff --git a/test/e2e/no-ssr.test.ts b/test/e2e/no-ssr.test.ts index f889bc936..ded8b4827 100644 --- a/test/e2e/no-ssr.test.ts +++ b/test/e2e/no-ssr.test.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url' import { describe, it, expect } from 'vitest' import { setup, createPage, url } from '@nuxt/test-utils' -import { providers } from '../../playground/providers' +import { providers } from '../../playground/app/providers' await setup({ rootDir: fileURLToPath(new URL('../../playground', import.meta.url)), diff --git a/test/e2e/ssr.test.ts b/test/e2e/ssr.test.ts index 05261da87..cab6c08de 100644 --- a/test/e2e/ssr.test.ts +++ b/test/e2e/ssr.test.ts @@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url' import { describe, it, expect } from 'vitest' import { $fetch, setup, createPage, url, fetch } from '@nuxt/test-utils' -import { providers } from '../../playground/providers' +import { providers } from '../../playground/app/providers' await setup({ rootDir: fileURLToPath(new URL('../../playground', import.meta.url)), diff --git a/test/nuxt/image.test.ts b/test/nuxt/image.test.ts index c5e46609d..8d0da374a 100644 --- a/test/nuxt/image.test.ts +++ b/test/nuxt/image.test.ts @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils' import type { ComponentMountingOptions, VueWrapper } from '@vue/test-utils' import { imageOptions } from '#build/image-options.mjs' import { NuxtImg } from '#components' -import { createImage } from '#image' +import { createImage } from '@nuxt/image/runtime' import { h, nextTick, useNuxtApp, useRuntimeConfig } from '#imports' describe('Renders simple image', () => { diff --git a/test/nuxt/picture.test.ts b/test/nuxt/picture.test.ts index 5303a2d18..b495c6c49 100644 --- a/test/nuxt/picture.test.ts +++ b/test/nuxt/picture.test.ts @@ -4,7 +4,7 @@ import { beforeEach, describe, expect, it } from 'vitest' import { NuxtPicture } from '#components' import { useNuxtApp, useRuntimeConfig, nextTick } from '#imports' import { imageOptions } from '#build/image-options.mjs' -import { createImage } from '#image' +import { createImage } from '@nuxt/image/runtime' describe('Renders simple image', () => { let wrapper: VueWrapper diff --git a/test/nuxt/providers.test.ts b/test/nuxt/providers.test.ts index 082795e07..06ca372a9 100644 --- a/test/nuxt/providers.test.ts +++ b/test/nuxt/providers.test.ts @@ -3,37 +3,37 @@ import { describe, it, expect } from 'vitest' import { images } from '../providers' import { useNuxtApp } from '#imports' -import ipx from '#image/providers/ipx' -import none from '#image/providers/none' -import weserv from '#image/providers/weserv' -import aliyun from '#image/providers/aliyun' -import awsAmplify from '#image/providers/awsAmplify' -import cloudflare from '#image/providers/cloudflare' -import cloudinary from '#image/providers/cloudinary' -import twicpics from '#image/providers/twicpics' -import fastly from '#image/providers/fastly' -import prepr from '#image/providers/prepr' -import glide from '#image/providers/glide' -import imgix from '#image/providers/imgix' -import gumlet from '#image/providers/gumlet' -import imageengine from '#image/providers/imageengine' -import unsplash from '#image/providers/unsplash' -import imagekit from '#image/providers/imagekit' -import netlifyImageCdn from '#image/providers/netlifyImageCdn' -import netlifyLargeMedia from '#image/providers/netlifyLargeMedia' -import prismic from '#image/providers/prismic' -import sanity from '#image/providers/sanity' -import shopify from '#image/providers/shopify' -import contentful from '#image/providers/contentful' -import cloudimage from '#image/providers/cloudimage' -import storyblok from '#image/providers/storyblok' -import strapi from '#image/providers/strapi' -import strapi5 from '#image/providers/strapi5' -import vercel from '#image/providers/vercel' -import wagtail from '#image/providers/wagtail' -import uploadcare from '#image/providers/uploadcare' -import sirv from '#image/providers/sirv' -import hygraph from '#image/providers/hygraph' +import ipx from '../../dist/runtime/providers/ipx' +import none from '../../dist/runtime/providers/none' +import weserv from '../../dist/runtime/providers/weserv' +import aliyun from '../../dist/runtime/providers/aliyun' +import awsAmplify from '../../dist/runtime/providers/awsAmplify' +import cloudflare from '../../dist/runtime/providers/cloudflare' +import cloudinary from '../../dist/runtime/providers/cloudinary' +import twicpics from '../../dist/runtime/providers/twicpics' +import fastly from '../../dist/runtime/providers/fastly' +import prepr from '../../dist/runtime/providers/prepr' +import glide from '../../dist/runtime/providers/glide' +import imgix from '../../dist/runtime/providers/imgix' +import gumlet from '../../dist/runtime/providers/gumlet' +import imageengine from '../../dist/runtime/providers/imageengine' +import unsplash from '../../dist/runtime/providers/unsplash' +import imagekit from '../../dist/runtime/providers/imagekit' +import netlifyImageCdn from '../../dist/runtime/providers/netlifyImageCdn' +import netlifyLargeMedia from '../../dist/runtime/providers/netlifyLargeMedia' +import prismic from '../../dist/runtime/providers/prismic' +import sanity from '../../dist/runtime/providers/sanity' +import shopify from '../../dist/runtime/providers/shopify' +import contentful from '../../dist/runtime/providers/contentful' +import cloudimage from '../../dist/runtime/providers/cloudimage' +import storyblok from '../../dist/runtime/providers/storyblok' +import strapi from '../../dist/runtime/providers/strapi' +import strapi5 from '../../dist/runtime/providers/strapi5' +import vercel from '../../dist/runtime/providers/vercel' +import wagtail from '../../dist/runtime/providers/wagtail' +import uploadcare from '../../dist/runtime/providers/uploadcare' +import sirv from '../../dist/runtime/providers/sirv' +import hygraph from '../../dist/runtime/providers/hygraph' const emptyContext = { options: { diff --git a/test/unit/provider-coverage.test.ts b/test/unit/provider-coverage.test.ts index 04deef69e..4535135c6 100644 --- a/test/unit/provider-coverage.test.ts +++ b/test/unit/provider-coverage.test.ts @@ -2,7 +2,7 @@ import { readdir } from 'node:fs/promises' import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { images } from '../providers' -import { providers as playgroundProviders } from '../../playground/providers' +import { providers as playgroundProviders } from '../../playground/app/providers' const missingProviderTests = [ 'ipxStatic', // build-time-only alias for ipx