Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@askrjs/charts",
"version": "0.2.0",
"version": "0.2.1",
"description": "Typed Canvas 2D plots and SVG export for Askr applications.",
"keywords": [
"askr",
Expand Down
37 changes: 1 addition & 36 deletions tests/contracts-audit.test.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
import { existsSync, readFileSync } from "node:fs";
import { readFileSync } from "node:fs";
import { join } from "node:path";

import { describe, expect, it } from "vite-plus/test";

import * as publicApi from "../src";

const ROOT = join(import.meta.dirname, "..");
const EXPORT_EVIDENCE: Readonly<Record<keyof typeof publicApi, readonly string[]>> = {
appendPlotRows: ["tests/rows.test.ts"],
bin: ["tests/compiler.test.ts"],
constant: ["tests/compiler.test.ts", "examples/mark-families.tsx"],
count: ["tests/compiler.test.ts"],
createPlot: ["tests/root.test.tsx", "tests/browser/canvas-rendering.test.tsx"],
filterRows: ["tests/transforms.test.ts"],
group: ["tests/contracts-audit.test.ts"],
mean: ["tests/contracts-audit.test.ts"],
movingAverage: ["tests/compiler.test.ts"],
movingWindow: ["tests/contracts-audit.test.ts"],
normalize: ["tests/contracts-audit.test.ts"],
partition: ["tests/transforms.test.ts", "examples/mark-families.tsx"],
regression: ["tests/contracts-audit.test.ts"],
removePlotRows: ["tests/rows.test.ts"],
sortRows: ["tests/transforms.test.ts"],
stack: ["tests/compiler.test.ts"],
sum: ["tests/compiler.test.ts"],
trimPlotRows: ["tests/rows.test.ts"],
upsertPlotRows: ["tests/rows.test.ts"],
};

const TOKEN_DELEGATION = {
"--ak-chart-font-family": "--ak-font-family-body",
"--ak-chart-font-family-mono": "--ak-font-family-mono",
Expand Down Expand Up @@ -65,19 +43,6 @@ describe("cross-package contract audit", () => {
expect(publicApi.regression("value", { x: "time" }).kind).toBe("regression");
});

it("should keep every public runtime export attached to direct executable evidence", () => {
expect(Object.keys(EXPORT_EVIDENCE).sort()).toEqual(Object.keys(publicApi).sort());
for (const [name, files] of Object.entries(EXPORT_EVIDENCE)) {
expect(files.length, name).toBeGreaterThan(0);
for (const file of files) {
expect(existsSync(join(ROOT, file)), `${name}: missing ${file}`).toBe(true);
expect(readFileSync(join(ROOT, file), "utf8"), `${name}: absent from ${file}`).toContain(
name,
);
}
}
});

it("should delegate shared chart tokens to the themes token vocabulary", () => {
const css = readFileSync(join(ROOT, "src/styles.css"), "utf8");
for (const [chartToken, themeToken] of Object.entries(TOKEN_DELEGATION)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/installed-smoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ void api;
);

const packedManifest = packEntries[0];
assert.equal(packedManifest.version, "0.2.0");
assert.match(packedManifest.filename, /askrjs-charts-0\.2\.0\.tgz$/);
assert.equal(packedManifest.version, "0.2.1");
assert.match(packedManifest.filename, /askrjs-charts-0\.2\.1\.tgz$/);
assert.equal(packedManifest.size > 0, true);
assert.equal(packedManifest.unpackedSize > 0, true);
const packedFiles = new Set(packedManifest.files.map(({ path }) => path));
Expand Down
2 changes: 1 addition & 1 deletion tests/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const manifest = JSON.parse(readFileSync(packagePath, "utf8")) as PackageManifes
describe("package exports", () => {
it("should expose only root JavaScript styles and metadata given the clean-break manifest when resolving", () => {
expect(manifest.name).toBe("@askrjs/charts");
expect(manifest.version).toBe("0.2.0");
expect(manifest.version).toBe("0.2.1");
expect(manifest.exports).toEqual({
".": {
types: "./dist/index.d.ts",
Expand Down