Skip to content

Commit

Permalink
chore: fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
crutchcorn committed Dec 26, 2024
1 parent 3ec12b6 commit f82f260
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 193 deletions.
4 changes: 4 additions & 0 deletions knip.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"ignoreDependencies": ["nx"]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"prepare": "playwright install chromium"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@types/node": "^18.15.3",
"@types/table": "^4.0.5",
"eslint": "^9.17.0",
Expand Down
15 changes: 5 additions & 10 deletions packages/node-vibrant/__tests__/common/helper.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
import { expect } from "vitest";
import * as util from "@vibrant/color";
import { getBorderCharacters, table } from "table";
import type { Builder } from "@vibrant/core";
import type { Palette, Swatch } from "@vibrant/color";
import type { ImageSource } from "@vibrant/image";
import type { Vibrant } from "@vibrant/core";
import type {
SamplePathKey,
TestSample,
} from "../../../../fixtures/sample/loader";

export interface VibrantStatic {
from(src: ImageSource): Builder;
}

const TABLE_OPTS = {
border: getBorderCharacters("void"),
};
Expand Down Expand Up @@ -73,18 +68,18 @@ const assertPalette = (reference: Palette, palette: Palette) => {

expect(
failCount,
`${failCount} colors are too diffrent from reference palettes`,
`${failCount} colors are too different from reference palettes`,
).to.equal(0);
};

export const testVibrant = (
Vibrant: VibrantStatic,
VibrantClass: typeof Vibrant,
sample: TestSample,
pathKey: SamplePathKey,
env: "node" | "browser"
env: "node" | "browser",
) => {
return async () => {
let builder = Vibrant.from(sample[pathKey]).quality(1);
const builder = VibrantClass.from(sample[pathKey]).quality(1);

const palette = await builder.getPalette();

Expand Down
5 changes: 1 addition & 4 deletions packages/node-vibrant/__tests__/vibrant.browser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ describe("Palette Extraction", async () => {
const SAMPLES = await commands.loadSamples();

SAMPLES.forEach((example) => {
it(
`${example.name}`,
testVibrant(Vibrant, example, "url", "browser"),
);
it(`${example.name}`, testVibrant(Vibrant, example, "url", "browser"));
});
});

Expand Down
10 changes: 2 additions & 8 deletions packages/node-vibrant/__tests__/vibrant.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,12 @@ afterAll(
describe("Palette Extraction", () => {
describe("process samples", () =>
SAMPLES.forEach((sample) => {
it(
`${sample.name}`,
testVibrant(Vibrant, sample, "filePath", "node"),
);
it(`${sample.name}`, testVibrant(Vibrant, sample, "filePath", "node"));
}));

describe("process remote images (http)", function () {
SAMPLES.forEach((sample) => {
it(
`${sample.url}`,
testVibrant(Vibrant, sample, "url", "node"),
);
it(`${sample.url}`, testVibrant(Vibrant, sample, "url", "node"));
});
});
});
3 changes: 1 addition & 2 deletions packages/node-vibrant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,8 @@
"@vibrant/quantizer-mmcq": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@vibrant/color": "^4.0.0-alpha.4",
"@vibrant/image": "^4.0.0-alpha.4",
"@vitest/browser": "^2.1.8",
"playwright": "^1.49.1",
"vite": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-color/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"homepage": "https://github.com/akfish/node-vibrant",
"license": "MIT",
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
3 changes: 1 addition & 2 deletions packages/vibrant-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@
"@vibrant/generator": "^4.0.0-alpha.4",
"@vibrant/image": "^4.0.0-alpha.4",
"@vibrant/quantizer": "^4.0.0-alpha.4",
"@vibrant/types": "^4.0.0-alpha.4",
"@vibrant/worker": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3",
"vitest": "^2.1.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-generator-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"homepage": "https://github.com/akfish/node-vibrant",
"license": "MIT",
"dependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@vibrant/color": "^4.0.0-alpha.4",
"@vibrant/generator": "^4.0.0-alpha.4",
"vite": "^6.0.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@vibrant/types": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-image-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@vibrant/image": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@types/node": "^18.15.3",
"jsdom": "^25.0.1",
"vite": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-image-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"@vibrant/image": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@types/node": "^18.15.3",
"vite": "^6.0.3"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/vibrant-image/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@
"homepage": "https://github.com/akfish/node-vibrant",
"license": "MIT",
"dependencies": {
"@vibrant/color": "^4.0.0-alpha.4",
"@vibrant/types": "^4.0.0-alpha.4"
"@vibrant/color": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"@types/node": "^18.15.3",
"vite": "^6.0.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-quantizer-mmcq/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@vibrant/quantizer": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-quantizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@vibrant/types": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"homepage": "https://github.com/akfish/node-vibrant",
"license": "MIT",
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vibrant-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"@vibrant/types": "^4.0.0-alpha.4"
},
"devDependencies": {
"@tanstack/config": "0.14.2",
"@tanstack/config": "^0.15.0",
"vite": "^6.0.3"
},
"publishConfig": {
Expand Down
Loading

0 comments on commit f82f260

Please sign in to comment.