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
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/coverage-istanbul": "^3.0.5",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/coverage-istanbul": "^3.1.1",
"@vitest/eslint-plugin": "^1.1.39",
"@yarnpkg/types": "^4.0.0",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
Expand All @@ -96,10 +96,10 @@
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vite": "^6.2.5",
"vite-tsconfig-paths": "^5.1.4",
"vitest": "^3.0.5",
"vitest-fetch-mock": "^0.4.3"
"vitest": "^3.1.1",
"vitest-fetch-mock": "^0.4.5"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -70,15 +70,15 @@
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"jsdom": "^24.1.1",
"jsdom": "^26.0.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"ses": "^1.9.0",
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
6 changes: 3 additions & 3 deletions packages/create-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -75,8 +75,8 @@
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5",
"vite": "^6.2.5",
"vitest": "^3.1.1",
"yargs": "^17.7.2"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/errors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -68,15 +68,15 @@
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"jsdom": "^24.1.1",
"jsdom": "^26.0.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"ses": "^1.9.0",
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
24 changes: 12 additions & 12 deletions packages/extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@ocap/store": "workspace:^",
"@ocap/streams": "workspace:^",
"@ocap/utils": "workspace:^",
"nanoid": "^3.3.8",
"nanoid": "^5.1.5",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"ses": "^1.9.0"
Expand All @@ -70,17 +70,17 @@
"@playwright/test": "^1.51.1",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/chrome": "^0.0.293",
"@types/chrome": "^0.0.313",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitejs/plugin-react": "^4.3.4",
"@vitest/eslint-plugin": "^1.1.25",
"cheerio": "^1.0.0-rc.12",
"@vitest/eslint-plugin": "^1.1.39",
"cheerio": "^1.0.0",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -90,20 +90,20 @@
"eslint-plugin-n": "^17.11.1",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"jsdom": "^24.1.1",
"jsdom": "^26.0.0",
"playwright": "^1.51.1",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rollup": "^4.34.4",
"rollup-plugin-sourcemaps2": "^0.4.3",
"rollup": "^4.39.0",
"rollup-plugin-sourcemaps2": "^0.5.0",
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"typescript-plugin-css-modules": "^5.1.0",
"vite": "^6.0.11",
"vite-plugin-checker": "^0.8.0",
"vite-plugin-static-copy": "^2.2.0",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vite-plugin-checker": "^0.9.1",
"vite-plugin-static-copy": "^2.3.0",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/src/ui/components/LoadingDots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styles from '../App.module.css';
/**
* @returns A component that displays a loading animation with dots.
*/
export const LoadingDots = (): JSX.Element => {
export const LoadingDots: React.FC = () => {
const [dots, setDots] = useState('.');

useEffect(() => {
Expand Down
8 changes: 4 additions & 4 deletions packages/kernel-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -71,14 +71,14 @@
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-promise": "^7.1.0",
"fast-deep-equal": "^3.1.3",
"jsdom": "^24.1.1",
"jsdom": "^26.0.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
6 changes: 3 additions & 3 deletions packages/kernel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"@ts-bridge/shims": "^0.1.1",
"@types/setimmediate": "^1.0.4",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -83,8 +83,8 @@
"rimraf": "^6.0.1",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
63 changes: 29 additions & 34 deletions packages/kernel/src/Kernel.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { VatNotFoundError } from '@ocap/errors';
import type { KernelDatabase } from '@ocap/store';
import type { DuplexStream } from '@ocap/streams';
import { TestDuplexStream } from '@ocap/test-utils/streams';
import type { Mocked, MockInstance } from 'vitest';
import { describe, it, expect, vi, beforeEach } from 'vitest';

Expand All @@ -20,6 +21,21 @@ import type {
import { VatHandle } from './VatHandle.ts';
import { makeMapKernelDatabase } from '../test/storage.ts';

const makeMockVatConfig = (): VatConfig => ({
sourceSpec: 'not-really-there.js',
});
const makeMockClusterConfig = (): ClusterConfig => ({
bootstrap: 'alice',
vats: {
alice: {
bundleSpec: 'http://localhost:3000/sample-vat.bundle',
parameters: {
name: 'Alice',
},
},
},
});

describe('Kernel', () => {
let mockStream: DuplexStream<KernelCommand, KernelCommandReply>;
let mockWorkerService: VatWorkerService;
Expand All @@ -29,33 +45,15 @@ describe('Kernel', () => {
let vatHandles: Mocked<VatHandle>[];
let mockKernelDatabase: KernelDatabase;

const makeMockVatConfig = (): VatConfig => ({
sourceSpec: 'not-really-there.js',
});
const makeMockClusterConfig = (): ClusterConfig => ({
bootstrap: 'alice',
vats: {
alice: {
bundleSpec: 'http://localhost:3000/sample-vat.bundle',
parameters: {
name: 'Alice',
},
},
},
});

beforeEach(() => {
mockStream = {
write: vi.fn(),
next: vi.fn(),
return: vi.fn(),
drain: vi.fn(),
throw: vi.fn(),
[Symbol.asyncIterator]: vi.fn(() => mockStream),
} as unknown as DuplexStream<KernelCommand, KernelCommandReply>;
beforeEach(async () => {
const dummyDispatch = vi.fn();
mockStream = await TestDuplexStream.make<KernelCommand, KernelCommandReply>(
dummyDispatch,
);

mockWorkerService = {
launch: async () => ({}),
launch: async () =>
({}) as unknown as DuplexStream<VatCommandReply, VatCommand>,
terminate: async () => undefined,
terminateAll: async () => undefined,
} as unknown as VatWorkerService;
Expand Down Expand Up @@ -305,12 +303,11 @@ describe('Kernel', () => {
);
await kernel.launchVat(makeMockVatConfig());
vatHandles[0]?.sendVatCommand.mockResolvedValueOnce('test');
expect(
await kernel.sendVatCommand(
'v1',
'test' as unknown as VatCommand['payload'],
),
).toBe('test');
const result = await kernel.sendVatCommand(
'v1',
'test' as unknown as VatCommand['payload'],
);
expect(result).toBe('test');
});

it('throws an error when sending a message to the vat that does not exist in the kernel', async () => {
Expand Down Expand Up @@ -340,7 +337,7 @@ describe('Kernel', () => {
});

describe('constructor()', () => {
it('initializes the kernel without errors', () => {
it('initializes the kernel without errors', async () => {
expect(
async () =>
await Kernel.make(mockStream, mockWorkerService, mockKernelDatabase),
Expand All @@ -350,9 +347,7 @@ describe('Kernel', () => {

describe('init()', () => {
it.todo('initializes the kernel store');

it.todo('starts receiving messages');

it.todo('throws if the stream throws');
});

Expand Down
6 changes: 3 additions & 3 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -76,8 +76,8 @@
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
6 changes: 3 additions & 3 deletions packages/shims/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -65,8 +65,8 @@
"rimraf": "^6.0.1",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
6 changes: 3 additions & 3 deletions packages/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@typescript-eslint/eslint-plugin": "^8.26.1",
"@typescript-eslint/parser": "^8.26.1",
"@typescript-eslint/utils": "^8.26.1",
"@vitest/eslint-plugin": "^1.1.25",
"@vitest/eslint-plugin": "^1.1.39",
"depcheck": "^1.4.7",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -99,8 +99,8 @@
"typedoc": "^0.27.9",
"typescript": "~5.8.2",
"typescript-eslint": "^8.26.1",
"vite": "^6.0.11",
"vitest": "^3.0.5"
"vite": "^6.2.5",
"vitest": "^3.1.1"
},
"engines": {
"node": "^20 || >=22"
Expand Down
Loading
Loading