Skip to content

Commit 69cfcc1

Browse files
committed
Switch to esm and vitest, Thanks Claude Opus
1 parent e8270a2 commit 69cfcc1

File tree

13 files changed

+33
-21
lines changed

13 files changed

+33
-21
lines changed

.husky/post-checkout

Lines changed: 0 additions & 4 deletions
This file was deleted.

.husky/post-merge

Lines changed: 0 additions & 4 deletions
This file was deleted.

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx eslint --max-warnings 0 src test tools
4+
npx prettier --check 'src/**/*.ts' 'test/**/*.ts' 'tools/**/*.ts'

.husky/pre-push

Lines changed: 0 additions & 4 deletions
This file was deleted.

package-lock.json

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
"release": "echo 'You can make a release by updating the version number in package.json and push the changes'",
2626
"lint": "eslint src test tools",
2727
"lint:fix": "eslint src test tools --fix",
28+
"format": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\" \"tools/**/*.ts\"",
29+
"format:fix": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\" \"tools/**/*.ts\"",
2830
"clean": "rimraf dist build",
2931
"dist": "tsc -p ./src/tsconfig.json && tsc -p ./examples/tsconfig.json && rollup -c --bundleConfigAsCjs && uglifyjs ./dist/maquette.umd.js -c unsafe=true,unsafe_comps=true,unsafe_math=true,passes=3 -m -o ./dist/maquette.umd.min.js",
3032
"start": "npm -s run dist && npx http-server . -p 8080 -o",
@@ -44,6 +46,7 @@
4446
"globals": "^17.0.0",
4547
"husky": "^9.1.7",
4648
"jsdom": "^24.0.0",
49+
"prettier": "^3.7.4",
4750
"rimraf": "^6.1.2",
4851
"rollup": "4.9.6",
4952
"tsx": "^4.21.0",

src/cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { CalculationCache } from "./interfaces";
77
*
88
* @param <Result> The type of the value that is cached.
99
*/
10-
export let createCache = <Result,>(): CalculationCache<Result> => {
10+
export let createCache = <Result>(): CalculationCache<Result> => {
1111
let cachedInputs: unknown[] | undefined;
1212
let cachedOutcome: Result | undefined;
1313

test/dom/children-tests.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dom, h } from "../../src/index";
2-
import { expect, describe, it } from "../test-utilities";
2+
import { describe, expect, it } from "../test-utilities";
33

44
describe("dom", () => {
55
describe("children", () => {
@@ -146,7 +146,11 @@ describe("dom", () => {
146146

147147
it("can distinguish between falsy keys when deleting", () => {
148148
let projection = dom.create(
149-
h("div", [h("span", { key: 0 }), h("span", { key: false }), h("span", { key: null } as any)])
149+
h("div", [
150+
h("span", { key: 0 }),
151+
h("span", { key: false }),
152+
h("span", { key: null } as any),
153+
])
150154
);
151155

152156
let div = projection.domNode as HTMLDivElement;

test/dom/create-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { dom, h } from "../../src/index";
2-
import { expect, describe, it, vi } from "../test-utilities";
2+
import { describe, expect, it, vi } from "../test-utilities";
33

44
describe("dom", () => {
55
describe("create", () => {

test/dom/properties-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EventHandler, dom, h } from "../../src/index";
2-
import { expect, describe, it, vi } from "../test-utilities";
2+
import { describe, expect, it, vi } from "../test-utilities";
33

44
let noopEventHandlerInterceptor = (
55
propertyName: string,

0 commit comments

Comments
 (0)