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
6 changes: 3 additions & 3 deletions .depcheckrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ignores:
# monorepo
- '@metamask/kernel-shims'
- '@ocap/cli'
- '@metamask/kernel-cli'
- '@ocap/repo-tools'

# eslint and prettier
Expand Down Expand Up @@ -47,11 +47,11 @@ ignores:
- 'typedoc'
- 'typescript'

# Used by @ocap/nodejs to build the sqlite3 bindings
# Used by @metamask/kernel-node-runtime to build the sqlite3 bindings
- 'node-gyp'

# Peer dependency of @metamask/kernel-shims due to its /endoify-node
# export, used by @ocap/nodejs
# export, used by @metamask/kernel-node-runtime
- '@libp2p/webrtc'

# These are peer dependencies of various modules we actually do
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/lint-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,19 @@ jobs:
strategy:
matrix:
node-version: [24.x]
package: [omnium-gatherum, nodejs, extension]
package:
[
'@metamask/kernel-node-runtime',
'@ocap/extension',
'@ocap/omnium-gatherum',
]
include:
- package: '@metamask/kernel-node-runtime'
directory: kernel-node-runtime
- package: '@ocap/extension'
directory: extension
- package: '@ocap/omnium-gatherum'
directory: omnium-gatherum
steps:
- name: Checkout and setup environment
uses: MetaMask/action-checkout-and-setup@v3
Expand All @@ -156,13 +168,13 @@ jobs:
- run: VITE_DB_FOLDER=e2e yarn build
- name: Run E2E tests
id: e2e
run: yarn workspace @ocap/${{ matrix.package }} test:e2e:ci
run: yarn workspace ${{ matrix.package }} test:e2e:ci
- name: Upload test artifacts
if: ${{ failure() && steps.e2e.conclusion == 'failure' }}
uses: actions/upload-artifact@v7
with:
name: playwright-traces-${{ matrix.package }}
path: packages/${{ matrix.package }}/test-results
name: playwright-traces-${{ matrix.directory }}
path: packages/${{ matrix.directory }}/test-results
if-no-files-found: ignore
- name: Require clean working directory
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ await kernel.initRemoteComms(relays);
For Node.js environments, you can use the provided utility function:

```typescript
import { makeKernel } from '@ocap/nodejs';
import { makeKernel } from '@metamask/kernel-node-runtime';
import { MessageChannel } from 'node:worker_threads';

// Create a message channel for kernel communication
Expand All @@ -100,7 +100,7 @@ Alternatively, you can manually set up the Node.js components:
```typescript
import { Kernel } from '@metamask/ocap-kernel';
import { makeSQLKernelDatabase } from '@metamask/kernel-store/sqlite/nodejs';
import { NodejsPlatformServices } from '@ocap/nodejs';
import { NodejsPlatformServices } from '@metamask/kernel-node-runtime';

// Initialize kernel database with Node.js SQLite implementation
const kernelDatabase = await makeSQLKernelDatabase({
Expand All @@ -121,7 +121,7 @@ const kernel = await Kernel.make(platformServices, kernelDatabase, {
Vats execute JavaScript code bundled into a specific format. To create a vat bundle:

1. Write your vat code with a root object that exports methods
2. Bundle the code using the `@ocap/cli` with `yarn ocap bundle ./path/to/vat.js`
2. Bundle the code using the `@metamask/kernel-cli` with `yarn ocap bundle ./path/to/vat.js`

Example vat code:

Expand Down Expand Up @@ -475,7 +475,7 @@ For a comprehensive overview of the API:

### CLI Tools

The `@ocap/cli` package provides tools for working with vat bundles:
The `@metamask/kernel-cli` package provides tools for working with vat bundles:

```bash
# Bundle a vat file
Expand All @@ -490,7 +490,7 @@ yarn ocap serve ./path/to/bundles
For testing vats and kernel integration, the project uses Vitest:

```typescript
import { makeKernel } from '@ocap/nodejs';
import { makeKernel } from '@metamask/kernel-node-runtime';
import { MessageChannel } from 'node:worker_threads';
import { describe, it, expect } from 'vitest';

Expand Down Expand Up @@ -619,7 +619,7 @@ async function run() {
### Node.js Implementation

```typescript
import { makeKernel } from '@ocap/nodejs';
import { makeKernel } from '@metamask/kernel-node-runtime';
import { ClusterConfigStruct } from '@metamask/ocap-kernel';
import { MessageChannel } from 'node:worker_threads';
import fs from 'node:fs/promises';
Expand Down
8 changes: 4 additions & 4 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ const config = createConfig([
files: [
'**/vite.config.ts',
'**/vitest.config.ts',
'packages/cli/**/*',
'packages/extension/**/*',
'packages/nodejs/**/*-worker.ts',
'packages/nodejs/test/workers/**/*',
'packages/kernel-cli/**/*',
'packages/kernel-node-runtime/**/*-worker.ts',
'packages/kernel-node-runtime/test/workers/**/*',
'packages/omnium-gatherum/**/*',
'packages/repo-tools/**/*',
],
Expand All @@ -273,7 +273,7 @@ const config = createConfig([
'packages/*/src/**/vats/**/*',
'packages/*/src/**/caplets/**/*.js',
'packages/*/test/**/vats/**/*',
'packages/nodejs/test/workers/**/*',
'packages/kernel-node-runtime/test/workers/**/*',
'packages/logger/test/workers/**/*',
],
rules: {
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@metamask/eslint-config-nodejs": "^15.0.0",
"@metamask/eslint-config-typescript": "^15.0.0",
"@metamask/eslint-config-vitest": "^15.0.0",
"@ocap/cli": "workspace:^",
"@metamask/kernel-cli": "workspace:^",
"@ts-bridge/cli": "^0.6.3",
"@ts-bridge/shims": "^0.1.1",
"@types/lodash": "^4.17.16",
Expand Down Expand Up @@ -112,7 +112,7 @@
"lavamoat": {
"allowScripts": {
"$root$": true,
"@ocap/cli>@metamask/logger>@metamask/streams": true,
"@metamask/kernel-cli>@metamask/logger>@metamask/streams": true,
"@lavamoat/preinstall-always-fail": false,
"eslint-import-resolver-typescript>unrs-resolver": false,
"eslint-plugin-import-x>unrs-resolver": false,
Expand All @@ -123,9 +123,10 @@
"vitest>@vitest/browser>webdriverio>@wdio/utils>edgedriver": false,
"vitest>@vitest/browser>webdriverio>@wdio/utils>geckodriver": false,
"vitest>@vitest/mocker>msw": false,
"@ocap/cli>@ocap/nodejs>@libp2p/webrtc>@ipshipyard/node-datachannel": false,
"@ocap/cli>@ocap/nodejs>@metamask/kernel-store>better-sqlite3": false,
"@ocap/cli>@ocap/nodejs>@metamask/streams": false
"@metamask/kernel-cli>@metamask/kernel-node-runtime>@libp2p/webrtc>@ipshipyard/node-datachannel": false,
"@metamask/kernel-cli>@metamask/kernel-node-runtime>@metamask/kernel-store>better-sqlite3": false,
"@metamask/kernel-cli>@metamask/kernel-node-runtime>@metamask/streams": false,
"@metamask/kernel-cli>@metamask/kernel-shims>@libp2p/webrtc>@ipshipyard/node-datachannel": false
}
},
"resolutions": {
Expand Down
2 changes: 1 addition & 1 deletion packages/extension/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// eslint-disable-next-line spaced-comment
/// <reference types="vitest" />

import { bundleVats } from '@metamask/kernel-utils/vite-plugins';
import {
getDefines,
getPackageDevAliases,
} from '@ocap/repo-tools/build-utils/vite';
import {
bundleVats,
deduplicateAssets,
extensionDev,
htmlTrustedPrelude,
Expand Down
16 changes: 16 additions & 0 deletions packages/kernel-cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- **BREAKING:** Rename package from `@ocap/cli` to `@metamask/kernel-cli` and make it public ([#875](https://github.com/MetaMask/ocap-kernel/pull/875))
- Replace `@ocap/repo-tools/vite-plugins` dependency with `@metamask/kernel-utils/vite-plugins` ([#875](https://github.com/MetaMask/ocap-kernel/pull/875))
- Replace `@ocap/nodejs` dependency with `@metamask/kernel-node-runtime` ([#875](https://github.com/MetaMask/ocap-kernel/pull/875))

[Unreleased]: https://github.com/MetaMask/ocap-kernel/
Loading
Loading