pixeli 1.0.4 → 1.0.6-beta.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 +17 -0
- package/dist/cli/commands/project/backend/dist/assets/Export-D0AicdAp.js +1 -0
- package/dist/cli/commands/project/backend/dist/assets/Merge-Dz2TnSs6.js +4 -0
- package/dist/cli/commands/project/backend/dist/assets/Toggle-Bw_sGges.js +1 -0
- package/dist/cli/commands/project/backend/dist/assets/index--iLQSLSH.css +1 -0
- package/dist/cli/commands/project/backend/dist/assets/index-7xq0SvzN.js +3 -0
- package/dist/cli/commands/project/backend/dist/assets/views-C-jtlP0g.js +1 -0
- package/dist/cli/commands/project/backend/dist/favicon.ico +0 -0
- package/dist/cli/commands/project/backend/dist/index.html +14 -0
- package/dist/cli/commands/project/backend/index.d.ts +171 -0
- package/dist/cli/commands/project/backend/index.js +28 -0
- package/dist/cli/commands/project/backend/routers/fs.d.ts +61 -0
- package/dist/cli/commands/project/backend/routers/fs.js +40 -0
- package/dist/cli/commands/project/backend/routers/index.d.ts +2 -0
- package/dist/cli/commands/project/backend/routers/index.js +3 -0
- package/dist/cli/commands/project/backend/routers/merge.d.ts +109 -0
- package/dist/cli/commands/project/backend/routers/merge.js +26 -0
- package/dist/cli/commands/project/backend/validators/fs.d.ts +11 -0
- package/dist/cli/commands/project/backend/validators/fs.js +8 -0
- package/dist/cli/commands/project/backend/validators/merge.d.ts +32 -0
- package/dist/cli/commands/project/backend/validators/merge.js +17 -0
- package/dist/cli/commands/project/index.d.ts +2 -0
- package/dist/cli/commands/project/index.js +64 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/schemas/project.d.ts +4 -0
- package/dist/cli/schemas/project.js +5 -0
- package/dist/core/jobs/types.d.ts +2 -2
- package/dist/core/jobs/types.js +1 -1
- package/dist/core/merges/grid/steps/createComposites.js +1 -1
- package/dist/core/merges/masonry/index.d.ts +2 -2
- package/dist/core/merges/masonry/index.js +1 -0
- package/dist/core/merges/masonry/steps/createComposites.js +1 -1
- package/dist/core/merges/shared-steps/exportCanvas.js +2 -1
- package/dist/core/merges/shared-steps/loadImages.js +1 -1
- package/dist/core/merges/types.d.ts +2 -2
- package/dist/core/merges/types.js +1 -1
- package/dist/core/pipeline/mergePipeline.d.ts +5 -5
- package/dist/core/pipeline/mergePipeline.js +1 -1
- package/dist/core/utils/images/addImageBorder.d.ts +2 -2
- package/dist/core/utils/images/addImageBorder.js +1 -1
- package/dist/core/utils/images/getImageHeights.d.ts +2 -2
- package/dist/core/utils/images/getImageHeights.js +1 -1
- package/dist/core/utils/images/getImageWidths.d.ts +2 -2
- package/dist/core/utils/images/getImageWidths.js +1 -1
- package/dist/core/utils/images/getSmallestImageDimensions.d.ts +2 -2
- package/dist/core/utils/images/getSmallestImageDimensions.js +1 -1
- package/dist/core/utils/images/handleImageEdges.d.ts +2 -2
- package/dist/core/utils/images/handleImageEdges.js +1 -1
- package/dist/core/utils/images/isActualImage.d.ts +2 -2
- package/dist/core/utils/images/isActualImage.js +1 -1
- package/dist/core/utils/images/roundImage.d.ts +2 -2
- package/dist/core/utils/images/roundImage.js +1 -1
- package/dist/core/utils/images/roundImages.d.ts +2 -2
- package/dist/core/utils/images/roundImages.js +1 -1
- package/dist/core/utils/images/scaleImage.d.ts +2 -2
- package/dist/core/utils/images/scaleImage.js +2 -2
- package/dist/core/utils/images/scaleImages.d.ts +2 -2
- package/dist/core/utils/images/scaleImages.js +2 -2
- package/package.json +21 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import sharp, {} from 'sharp';
|
|
2
2
|
import { rgbaToHex } from '../colors/rgbaToHex.js';
|
|
3
3
|
export const handleImageEdges = async (image, { borderWidth, borderHeight, borderColor, imageWidth, imageHeight, cornerRadius = 0, finalizePipeline = false }) => {
|
|
4
4
|
// Only change the image's edges if needed
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Sharp } from 'sharp';
|
|
2
2
|
interface RoundImageOptions {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
5
|
cornerRadius: number;
|
|
6
6
|
finalizePipeline?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export declare const roundImage: (image:
|
|
8
|
+
export declare const roundImage: (image: Sharp, { width, height, cornerRadius, finalizePipeline }: RoundImageOptions) => Promise<Sharp>;
|
|
9
9
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Sharp } from 'sharp';
|
|
2
2
|
interface RoundImagesOptions {
|
|
3
3
|
width: number;
|
|
4
4
|
height: number;
|
|
5
5
|
cornerRadius: number;
|
|
6
6
|
}
|
|
7
|
-
export declare const roundImages: (images:
|
|
7
|
+
export declare const roundImages: (images: Sharp[], { width, height, cornerRadius }: RoundImagesOptions) => Promise<Sharp[]>;
|
|
8
8
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Sharp } from 'sharp';
|
|
2
2
|
interface ScaleImageOptions {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
finalizePipeline?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const scaleImage: (image:
|
|
7
|
+
export declare const scaleImage: (image: Sharp, { width, height, finalizePipeline }: ScaleImageOptions) => Promise<Sharp>;
|
|
8
8
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import sharp, {} from 'sharp';
|
|
2
2
|
export const scaleImage = async (image, { width, height, finalizePipeline = false }) => {
|
|
3
3
|
// Ensure either width or height is provided
|
|
4
4
|
if (width == undefined && height === undefined) {
|
|
@@ -26,7 +26,7 @@ export const scaleImage = async (image, { width, height, finalizePipeline = fals
|
|
|
26
26
|
// Only finalize changes in the image pipeline if needed
|
|
27
27
|
if (finalizePipeline) {
|
|
28
28
|
// Use jpg format if possible for less memory usage
|
|
29
|
-
const formatPipe = meta.channels === 4 ? resizedImage.toFormat('png') : resizedImage.toFormat('
|
|
29
|
+
const formatPipe = meta.channels === 4 ? resizedImage.toFormat('png') : resizedImage.toFormat('jpeg');
|
|
30
30
|
const buffer = await formatPipe.toBuffer();
|
|
31
31
|
return sharp(buffer);
|
|
32
32
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type Sharp } from 'sharp';
|
|
2
2
|
interface ScaleImagesOptions {
|
|
3
3
|
width?: number;
|
|
4
4
|
height?: number;
|
|
5
5
|
finalizePipeline?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const scaleImages: (images:
|
|
7
|
+
export declare const scaleImages: (images: Sharp[], { width, height, finalizePipeline }?: ScaleImagesOptions) => Promise<Sharp[]>;
|
|
8
8
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import sharp from 'sharp';
|
|
1
|
+
import sharp, {} from 'sharp';
|
|
2
2
|
export const scaleImages = async (images, { width, height, finalizePipeline = false } = {}) => {
|
|
3
3
|
// Ensure either width or height is provided
|
|
4
4
|
if (width == undefined && height === undefined) {
|
|
@@ -26,7 +26,7 @@ export const scaleImages = async (images, { width, height, finalizePipeline = fa
|
|
|
26
26
|
// Only finalize changes in the image pipeline if needed
|
|
27
27
|
if (finalizePipeline) {
|
|
28
28
|
// Use jpg format if possible for less memory usage
|
|
29
|
-
const formatPipe = meta.channels === 4 ? newImage.toFormat('png') : newImage.toFormat('
|
|
29
|
+
const formatPipe = meta.channels === 4 ? newImage.toFormat('png') : newImage.toFormat('jpeg');
|
|
30
30
|
const buffer = await formatPipe.toBuffer();
|
|
31
31
|
return sharp(buffer);
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pixeli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6-beta.3",
|
|
4
4
|
"description": "A lightweight command-line tool for merging multiple images into customizable grid layouts.",
|
|
5
5
|
"homepage": "https://github.com/pakdad-mousavi/pixeli#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -35,26 +35,39 @@
|
|
|
35
35
|
"image-merge"
|
|
36
36
|
],
|
|
37
37
|
"scripts": {
|
|
38
|
-
"dev": "tsc --watch",
|
|
39
|
-
"
|
|
38
|
+
"dev:cli": "tsc --watch",
|
|
39
|
+
"dev:frontend": "npm run dev -w frontend",
|
|
40
|
+
"build": "tsc && npm run build -w frontend",
|
|
40
41
|
"test": "vitest",
|
|
41
42
|
"test:watch": "vitest --watch",
|
|
42
|
-
"test:coverage": "vitest run --coverage"
|
|
43
|
+
"test:coverage": "vitest run --coverage",
|
|
44
|
+
"cli": "node ./dist/cli/index.js"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
47
|
+
"@hono/node-server": "^2.1.1",
|
|
48
|
+
"@hono/zod-validator": "^0.9.1",
|
|
45
49
|
"chalk": "^5.6.2",
|
|
46
50
|
"cli-progress": "^3.12.0",
|
|
47
51
|
"commander": "^14.0.2",
|
|
48
|
-
"
|
|
52
|
+
"hono": "^4.13.7",
|
|
53
|
+
"sharp": "^0.35.4",
|
|
49
54
|
"zod": "^4.1.13"
|
|
50
55
|
},
|
|
51
56
|
"devDependencies": {
|
|
52
57
|
"@types/cli-progress": "^3.11.6",
|
|
53
58
|
"@types/node": "^25.0.0",
|
|
54
|
-
"@vitest/coverage-v8": "^
|
|
59
|
+
"@vitest/coverage-v8": "^5.0.0",
|
|
55
60
|
"prettier": "^3.8.0",
|
|
56
61
|
"tsx": "^4.21.0",
|
|
57
62
|
"typescript": "^5.9.3",
|
|
58
|
-
"vitest": "^
|
|
59
|
-
}
|
|
63
|
+
"vitest": "^5.0.0"
|
|
64
|
+
},
|
|
65
|
+
"allowScripts": {
|
|
66
|
+
"esbuild@0.27.2": true,
|
|
67
|
+
"fsevents@2.3.3": true,
|
|
68
|
+
"sharp@0.34.5": true
|
|
69
|
+
},
|
|
70
|
+
"workspaces": [
|
|
71
|
+
"src/cli/commands/project/frontend"
|
|
72
|
+
]
|
|
60
73
|
}
|