@flightdev/image 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -13
- package/dist/components/vue.d.ts +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @flightdev/image
|
|
2
2
|
|
|
3
3
|
Image optimization package for Flight Framework with Sharp, Squoosh, and CDN adapters.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @
|
|
8
|
+
npm install @flightdev/image
|
|
9
9
|
|
|
10
10
|
# Install your preferred processor:
|
|
11
11
|
npm install sharp # For Node.js (fastest)
|
|
@@ -15,8 +15,8 @@ npm install sharp # For Node.js (fastest)
|
|
|
15
15
|
## Quick Start
|
|
16
16
|
|
|
17
17
|
```typescript
|
|
18
|
-
import { createImage } from '@
|
|
19
|
-
import { sharp } from '@
|
|
18
|
+
import { createImage } from '@flightdev/image';
|
|
19
|
+
import { sharp } from '@flightdev/image/sharp';
|
|
20
20
|
|
|
21
21
|
const image = createImage(sharp());
|
|
22
22
|
|
|
@@ -44,7 +44,7 @@ const responsive = await image.responsive('./hero.jpg', {
|
|
|
44
44
|
Fastest option for Node.js environments.
|
|
45
45
|
|
|
46
46
|
```typescript
|
|
47
|
-
import { sharp } from '@
|
|
47
|
+
import { sharp } from '@flightdev/image/sharp';
|
|
48
48
|
|
|
49
49
|
const adapter = sharp({
|
|
50
50
|
cache: true, // Enable internal cache
|
|
@@ -58,7 +58,7 @@ const adapter = sharp({
|
|
|
58
58
|
Works on Edge runtimes (Cloudflare Workers, Vercel Edge).
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
|
-
import { squoosh } from '@
|
|
61
|
+
import { squoosh } from '@flightdev/image/squoosh';
|
|
62
62
|
|
|
63
63
|
const adapter = squoosh();
|
|
64
64
|
```
|
|
@@ -68,7 +68,7 @@ const adapter = squoosh();
|
|
|
68
68
|
CDN-based optimization, no local processing.
|
|
69
69
|
|
|
70
70
|
```typescript
|
|
71
|
-
import { cloudinary } from '@
|
|
71
|
+
import { cloudinary } from '@flightdev/image/cloudinary';
|
|
72
72
|
|
|
73
73
|
const adapter = cloudinary({
|
|
74
74
|
cloudName: 'my-cloud',
|
|
@@ -80,7 +80,7 @@ const adapter = cloudinary({
|
|
|
80
80
|
### Imgix (CDN)
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
|
-
import { imgix } from '@
|
|
83
|
+
import { imgix } from '@flightdev/image/imgix';
|
|
84
84
|
|
|
85
85
|
const adapter = imgix({
|
|
86
86
|
domain: 'my-source.imgix.net',
|
|
@@ -93,7 +93,7 @@ const adapter = imgix({
|
|
|
93
93
|
### React
|
|
94
94
|
|
|
95
95
|
```tsx
|
|
96
|
-
import { Image } from '@
|
|
96
|
+
import { Image } from '@flightdev/image/react';
|
|
97
97
|
|
|
98
98
|
<Image
|
|
99
99
|
src="/hero.jpg"
|
|
@@ -110,7 +110,7 @@ import { Image } from '@flight-framework/image/react';
|
|
|
110
110
|
|
|
111
111
|
```vue
|
|
112
112
|
<script setup>
|
|
113
|
-
import { FlightImage } from '@
|
|
113
|
+
import { FlightImage } from '@flightdev/image/vue';
|
|
114
114
|
</script>
|
|
115
115
|
|
|
116
116
|
<template>
|
|
@@ -129,7 +129,7 @@ import { FlightImage } from '@flight-framework/image/vue';
|
|
|
129
129
|
|
|
130
130
|
```svelte
|
|
131
131
|
<script>
|
|
132
|
-
import { createImageProps, lazyImage } from '@
|
|
132
|
+
import { createImageProps, lazyImage } from '@flightdev/image/svelte';
|
|
133
133
|
|
|
134
134
|
const props = createImageProps({
|
|
135
135
|
src: '/hero.jpg',
|
|
@@ -145,7 +145,7 @@ import { FlightImage } from '@flight-framework/image/vue';
|
|
|
145
145
|
### Solid
|
|
146
146
|
|
|
147
147
|
```tsx
|
|
148
|
-
import { Image } from '@
|
|
148
|
+
import { Image } from '@flightdev/image/solid';
|
|
149
149
|
|
|
150
150
|
<Image
|
|
151
151
|
src="/hero.jpg"
|
|
@@ -185,7 +185,7 @@ import { Image } from '@flight-framework/image/solid';
|
|
|
185
185
|
Implement the `ImageAdapter` interface:
|
|
186
186
|
|
|
187
187
|
```typescript
|
|
188
|
-
import type { ImageAdapter } from '@
|
|
188
|
+
import type { ImageAdapter } from '@flightdev/image';
|
|
189
189
|
|
|
190
190
|
export function myAdapter(config: MyConfig): ImageAdapter {
|
|
191
191
|
return {
|
package/dist/components/vue.d.ts
CHANGED
|
@@ -124,10 +124,10 @@ declare const FlightImage: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
124
124
|
format: ImageFormat;
|
|
125
125
|
quality: number;
|
|
126
126
|
priority: boolean;
|
|
127
|
+
baseUrl: string;
|
|
127
128
|
placeholder: "blur" | "empty" | "none";
|
|
128
129
|
blurDataUrl: string;
|
|
129
130
|
sizes: string;
|
|
130
|
-
baseUrl: string;
|
|
131
131
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
132
132
|
|
|
133
133
|
export { FlightImage, type FlightImageProps, FlightImage as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flightdev/image",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Agnostic image optimization for Flight Framework. Choose your processor: Sharp, Squoosh, Cloudinary, or custom.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -87,6 +87,12 @@
|
|
|
87
87
|
],
|
|
88
88
|
"author": "Flight Contributors",
|
|
89
89
|
"license": "MIT",
|
|
90
|
+
"homepage": "https://github.com/EliosLT/FlightDev",
|
|
91
|
+
"repository": {
|
|
92
|
+
"url": "https://github.com/EliosLT/FlightDev.git",
|
|
93
|
+
"directory": "packages/image",
|
|
94
|
+
"type": "git"
|
|
95
|
+
},
|
|
90
96
|
"scripts": {
|
|
91
97
|
"build": "tsup",
|
|
92
98
|
"dev": "tsup --watch",
|