Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Nov 2, 2023
1 parent 9d8a23e commit 2feefb6
Show file tree
Hide file tree
Showing 37 changed files with 1,066 additions and 898 deletions.
2 changes: 1 addition & 1 deletion @types/vite-env/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"vite": "^4.4.11",
"vitest": "^1.0.0-beta.1"
"vitest": "^1.0.0-beta.2"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.0"
Expand Down
33 changes: 15 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,32 @@
"test:workspace:lint": "turbo run lint --output-logs errors-only --log-prefix none",
"test:workspace:prod": "PROD=1 DEV= vitest --run",
"test:workspace:specs": "vitest --run",
"test:workspace:types": "tsc -b"
"test:workspace:types": "tsc -b",
"vitest": "vitest --pool forks"
},
"dependencies": {
"@starbeam/core-utils": "workspace:^"
},
"devDependencies": {
"@edge-runtime/vm": "^3.1.4",
"@nrr/pnpm-duplicate-cli": "^0.0.1",
"@starbeam-dev/compile": "^1.0.1",
"@starbeam-dev/core": "^1.0.0",
"@starbeam-dev/eslint-plugin": "^1.0.1",
"@types/eslint": "^8.44.4",
"@types/node": "^20.8.5",
"@vitest/ui": "^1.0.0-beta.1",
"eslint": "^8.51.0",
"@edge-runtime/vm": "^3.1.6",
"@starbeam-dev/compile": "^1.0.2",
"@starbeam-dev/core": "^1.0.2",
"@starbeam-dev/eslint-plugin": "^1.0.4",
"@types/eslint": "^8.44.6",
"@types/node": "^20.8.10",
"@vitest/ui": "^1.0.0-beta.3",
"eslint": "^8.52.0",
"esno": "^0.17.0",
"esyes": "^1.0.1",
"fast-glob": "^3.3.1",
"happy-dom": "^12.9.1",
"happy-dom": "^12.10.3",
"jsdom": "^22.1.0",
"knip": "^2.33.3",
"knip": "^2.38.6",
"prettier": "^3.0.3",
"turbo": "^1.10.15",
"turbo": "^1.10.16",
"typescript": "^5.2.2",
"vite": "^4.4.11",
"vitest": "^1.0.0-beta.1"
"vite": "^4.5.0",
"vitest": "^1.0.0-beta.3"
},
"license": "MIT",
"nodemonConfig": {
Expand All @@ -143,9 +143,6 @@
"vite": "$vite",
"vue": "3.3.4"
},
"patchedDependencies": {
"@nrr/[email protected]": "patches/@[email protected]"
},
"peerDependencyRules": {
"allowAny": [
"react",
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact-testing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/preact/preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/use-strict-lifecycle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"doc:readme": "node ./scripts/doc.js README",
"doc:theory": "node ./scripts/doc.js THEORY",
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/collections/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/core-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/reactive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/resource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/universal/resource/src/sync/high-level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export class DefineSync {
#finalize: Cleanup | undefined;

readonly on = {
sync: (handler: SyncHandler) => {
sync: (handler: SyncHandler): void => {
this.#sync = handler;
},

finalize: (handler: SyncHandler) => {
finalize: (handler: SyncHandler): void => {
this.#finalize = handler;
},
};
Expand Down
3 changes: 2 additions & 1 deletion packages/universal/resource/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"@starbeam/resource": "workspace:^",
"@starbeam/runtime": "workspace:^",
"@starbeam/shared": "workspace:^",
"@starbeam-workspace/test-utils": "workspace:^"
"@starbeam-workspace/test-utils": "workspace:^",
"inspect-utils": "^1.0.1"
},
"devDependencies": {
"@starbeam-dev/eslint-plugin": "^1.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { reactive } from "@starbeam/collections";
import { DisplayStruct } from "@starbeam/core-utils";
import { CachedFormula, Cell } from "@starbeam/reactive";
import {
Resource,
Expand All @@ -9,6 +9,7 @@ import {
import { pushingScope } from "@starbeam/runtime";
import { finalize } from "@starbeam/shared";
import { describe, expect, test } from "@starbeam-workspace/test-utils";
import { DisplayStruct } from "inspect-utils";

interface Item {
id: number;
Expand Down
10 changes: 6 additions & 4 deletions packages/universal/resource/tests/resource-list/syncing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { reactive } from "@starbeam/collections";
import { CachedFormula, Cell, Marker } from "@starbeam/reactive";
import { Resource, ResourceList } from "@starbeam/resource";
import { pushingScope } from "@starbeam/runtime";
import { finalize } from "@starbeam/shared";
import { hasLength, verified } from "@starbeam/verify";
import {
describe,
entryPoint,
Expand Down Expand Up @@ -44,7 +46,7 @@ describe("a ResourceList's children sync", () => {
const children = reactive.array([
{ id: "child1", value: Cell(0), invalidateSync: Marker() },
{ id: "child2", value: Cell(0), invalidateSync: Marker() },
] satisfies ChildState[]);
] satisfies [ChildState, ChildState]);

const List = ResourceList(children, {
key: (item) => item.id,
Expand Down Expand Up @@ -111,9 +113,9 @@ describe("a ResourceList's children sync", () => {
events.expect("child3:cleanup", "child3:finalize");
current.expect(UNCHANGED);

const [first, second] = children;
children[0] = second!;
children[1] = first!;
const [first, second] = verified(children, hasLength(2)<ChildState>);
children[0] = second;
children[1] = first;

current.expect(() => ["child2:0", "child1:1"]);
events.expect([]);
Expand Down
1 change: 1 addition & 0 deletions packages/universal/resource/tests/resource.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { Cell, Marker } from "@starbeam/reactive";
import type { ResourceBlueprint, SyncFn, SyncResult } from "@starbeam/resource";
import { Resource, SyncTo } from "@starbeam/resource";
Expand Down
5 changes: 3 additions & 2 deletions packages/universal/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand All @@ -36,6 +36,7 @@
"devDependencies": {
"@starbeam-dev/compile": "^1.0.0",
"@starbeam-dev/eslint-plugin": "^1.0.0",
"rollup": "^4.0.2"
"rollup": "^4.0.2",
"vite-env": "^1.0.0"
}
}
1 change: 1 addition & 0 deletions packages/universal/runtime/tests/lifetime.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-magic-numbers */
import { link } from "@starbeam/runtime";
import { finalize, onFinalize } from "@starbeam/shared";
import { describe, expect, test } from "vitest";
Expand Down
11 changes: 2 additions & 9 deletions packages/universal/runtime/tests/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,10 @@
"declaration": true,
"declarationDir": "../../../../dist/types",
"declarationMap": true,
"emitDeclarationOnly": true,
"jsx": "react-jsx",
"jsxImportSource": "react",
"types": [
"../../../env.d.ts",
"../../../env.d.ts",
"../../../env.d.ts",
"../../../env.d.ts",
"../../../env.d.ts",
"../../../env.d.ts"
],
"emitDeclarationOnly": true
"types": ["vite-env"]
},
"exclude": ["dist/**/*"]
}
2 changes: 1 addition & 1 deletion packages/universal/service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/universal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/verify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/verify/src/assertions/basic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ expected.associate(

interface HasLength<L extends number> {
<T>(value: T[]): value is FixedArray<T, L>;
<T>(value: readonly T[]): value is ReadonlyFixedArray<T, L>;
<T>(value: T[] | readonly T[]): value is ReadonlyFixedArray<T, L>;
}

export function hasLength<L extends number>(length: L): HasLength<L> {
Expand Down
2 changes: 1 addition & 1 deletion packages/universal/verify/src/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function verified<T, U extends T>(

verified.noop = <const T, const U extends T>(
value: T,
_check: (input: T) => input is U,
_check: <V extends T>(input: T) => input is U,
_error?: Expectation<T>,
): U => {
return value as U;
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue-testing-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/x/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"test:lint": "eslint . --max-warnings 0",
"test:specs": "vitest --run",
"test:specs": "vitest --run --pool forks",
"test:types": "tsc -b"
},
"dependencies": {
Expand Down
13 changes: 0 additions & 13 deletions patches/@[email protected]

This file was deleted.

Loading

0 comments on commit 2feefb6

Please sign in to comment.