pixeli 1.0.5 → 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.
Files changed (59) hide show
  1. package/README.md +17 -0
  2. package/dist/cli/commands/project/backend/dist/assets/Export-D0AicdAp.js +1 -0
  3. package/dist/cli/commands/project/backend/dist/assets/Merge-Dz2TnSs6.js +4 -0
  4. package/dist/cli/commands/project/backend/dist/assets/Toggle-Bw_sGges.js +1 -0
  5. package/dist/cli/commands/project/backend/dist/assets/index--iLQSLSH.css +1 -0
  6. package/dist/cli/commands/project/backend/dist/assets/index-7xq0SvzN.js +3 -0
  7. package/dist/cli/commands/project/backend/dist/assets/views-C-jtlP0g.js +1 -0
  8. package/dist/cli/commands/project/backend/dist/favicon.ico +0 -0
  9. package/dist/cli/commands/project/backend/dist/index.html +14 -0
  10. package/dist/cli/commands/project/backend/index.d.ts +171 -0
  11. package/dist/cli/commands/project/backend/index.js +28 -0
  12. package/dist/cli/commands/project/backend/routers/fs.d.ts +61 -0
  13. package/dist/cli/commands/project/backend/routers/fs.js +40 -0
  14. package/dist/cli/commands/project/backend/routers/index.d.ts +2 -0
  15. package/dist/cli/commands/project/backend/routers/index.js +3 -0
  16. package/dist/cli/commands/project/backend/routers/merge.d.ts +109 -0
  17. package/dist/cli/commands/project/backend/routers/merge.js +26 -0
  18. package/dist/cli/commands/project/backend/validators/fs.d.ts +11 -0
  19. package/dist/cli/commands/project/backend/validators/fs.js +8 -0
  20. package/dist/cli/commands/project/backend/validators/merge.d.ts +32 -0
  21. package/dist/cli/commands/project/backend/validators/merge.js +17 -0
  22. package/dist/cli/commands/project/index.d.ts +2 -0
  23. package/dist/cli/commands/project/index.js +64 -0
  24. package/dist/cli/index.js +2 -0
  25. package/dist/cli/schemas/project.d.ts +4 -0
  26. package/dist/cli/schemas/project.js +5 -0
  27. package/dist/core/jobs/types.d.ts +2 -2
  28. package/dist/core/jobs/types.js +1 -1
  29. package/dist/core/merges/grid/steps/createComposites.js +1 -1
  30. package/dist/core/merges/masonry/index.d.ts +2 -2
  31. package/dist/core/merges/masonry/index.js +1 -0
  32. package/dist/core/merges/masonry/steps/createComposites.js +1 -1
  33. package/dist/core/merges/shared-steps/exportCanvas.js +2 -1
  34. package/dist/core/merges/shared-steps/loadImages.js +1 -1
  35. package/dist/core/merges/types.d.ts +2 -2
  36. package/dist/core/merges/types.js +1 -1
  37. package/dist/core/pipeline/mergePipeline.d.ts +5 -5
  38. package/dist/core/pipeline/mergePipeline.js +1 -1
  39. package/dist/core/utils/images/addImageBorder.d.ts +2 -2
  40. package/dist/core/utils/images/addImageBorder.js +1 -1
  41. package/dist/core/utils/images/getImageHeights.d.ts +2 -2
  42. package/dist/core/utils/images/getImageHeights.js +1 -1
  43. package/dist/core/utils/images/getImageWidths.d.ts +2 -2
  44. package/dist/core/utils/images/getImageWidths.js +1 -1
  45. package/dist/core/utils/images/getSmallestImageDimensions.d.ts +2 -2
  46. package/dist/core/utils/images/getSmallestImageDimensions.js +1 -1
  47. package/dist/core/utils/images/handleImageEdges.d.ts +2 -2
  48. package/dist/core/utils/images/handleImageEdges.js +1 -1
  49. package/dist/core/utils/images/isActualImage.d.ts +2 -2
  50. package/dist/core/utils/images/isActualImage.js +1 -1
  51. package/dist/core/utils/images/roundImage.d.ts +2 -2
  52. package/dist/core/utils/images/roundImage.js +1 -1
  53. package/dist/core/utils/images/roundImages.d.ts +2 -2
  54. package/dist/core/utils/images/roundImages.js +1 -1
  55. package/dist/core/utils/images/scaleImage.d.ts +2 -2
  56. package/dist/core/utils/images/scaleImage.js +2 -2
  57. package/dist/core/utils/images/scaleImages.d.ts +2 -2
  58. package/dist/core/utils/images/scaleImages.js +2 -2
  59. package/package.json +16 -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,5 +1,5 @@
1
- import sharp from 'sharp';
2
- export declare const isActualImage: (input: sharp.SharpInput) => Promise<{
1
+ import { type SharpInput } from 'sharp';
2
+ export declare const isActualImage: (input: SharpInput) => Promise<{
3
3
  isImage: boolean;
4
4
  reason: string;
5
5
  }>;
@@ -1,4 +1,4 @@
1
- import sharp from 'sharp';
1
+ import sharp, {} from 'sharp';
2
2
  export const isActualImage = async (input) => {
3
3
  try {
4
4
  // Try to get metadata
@@ -1,9 +1,9 @@
1
- import sharp from 'sharp';
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: sharp.Sharp, { width, height, cornerRadius, finalizePipeline }: RoundImageOptions) => Promise<sharp.Sharp>;
8
+ export declare const roundImage: (image: Sharp, { width, height, cornerRadius, finalizePipeline }: RoundImageOptions) => Promise<Sharp>;
9
9
  export {};
@@ -1,4 +1,4 @@
1
- import sharp from 'sharp';
1
+ import sharp, {} from 'sharp';
2
2
  export const roundImage = async (image, { width, height, cornerRadius, finalizePipeline = false }) => {
3
3
  // Skip if the cornerRadius = zero
4
4
  if (!cornerRadius)
@@ -1,8 +1,8 @@
1
- import sharp from 'sharp';
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: sharp.Sharp[], { width, height, cornerRadius }: RoundImagesOptions) => Promise<sharp.Sharp[]>;
7
+ export declare const roundImages: (images: Sharp[], { width, height, cornerRadius }: RoundImagesOptions) => Promise<Sharp[]>;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import sharp from 'sharp';
1
+ import sharp, {} from 'sharp';
2
2
  export const roundImages = async (images, { width, height, cornerRadius }) => {
3
3
  // Skip if the cornerRadius = zero
4
4
  if (!cornerRadius)
@@ -1,8 +1,8 @@
1
- import sharp from 'sharp';
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: sharp.Sharp, { width, height, finalizePipeline }: ScaleImageOptions) => Promise<sharp.Sharp>;
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('jpg');
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 sharp from 'sharp';
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: sharp.Sharp[], { width, height, finalizePipeline }?: ScaleImagesOptions) => Promise<sharp.Sharp[]>;
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('jpg');
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.5",
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,31 +35,39 @@
35
35
  "image-merge"
36
36
  ],
37
37
  "scripts": {
38
- "dev": "tsc --watch",
39
- "build": "tsc",
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
- "sharp": "^0.34.5",
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": "^3.2.4",
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": "^3.2.4"
63
+ "vitest": "^5.0.0"
59
64
  },
60
65
  "allowScripts": {
61
66
  "esbuild@0.27.2": true,
62
67
  "fsevents@2.3.3": true,
63
68
  "sharp@0.34.5": true
64
- }
69
+ },
70
+ "workspaces": [
71
+ "src/cli/commands/project/frontend"
72
+ ]
65
73
  }