diff --git a/packages/cli/src/__tests__/cli.test.ts b/packages/cli/src/__tests__/cli.test.ts index 3bd842b..1e80a7e 100644 --- a/packages/cli/src/__tests__/cli.test.ts +++ b/packages/cli/src/__tests__/cli.test.ts @@ -21,7 +21,7 @@ test('init, add actor, and configure write package-local SDK state', async () => const manifest = JSON.parse(await readFile(join(root, 'matrix.json'), 'utf8')); const packageJson = JSON.parse(await readFile(join(root, 'package.json'), 'utf8')); assert.equal(packageJson.private, undefined); - assert.equal(packageJson.dependencies['@open-matrix/core'], '^0.1.0'); + assert.equal(packageJson.dependencies['@open-matrix/sdk'], '^0.1.0'); assert.equal(manifest.name, 'demo-package'); assert.equal(manifest.runtime.entry, './dist/index.js'); assert.deepEqual(manifest.runtime.factory, { @@ -44,7 +44,7 @@ test('init, add actor, and configure write package-local SDK state', async () => }]); const actorSource = await readFile(join(root, 'src', 'GreeterActor.ts'), 'utf8'); - assert.match(actorSource, /from '@open-matrix\/core'/); + assert.match(actorSource, /from '@open-matrix\/sdk'/); const factorySource = await readFile(join(root, 'src', 'create-standalone-GreeterActor.ts'), 'utf8'); assert.match(factorySource, /createStandaloneGreeterActor/); assert.match(factorySource, /runtime\.createSupervised\(GreeterActor, mount\)/); diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index e6ced73..408cd0a 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -153,7 +153,7 @@ async function initCommand(options: CommandOptions, positional: string[]): Promi build: 'tsc -p tsconfig.json', }, dependencies: { - '@open-matrix/core': '^0.1.0', + '@open-matrix/sdk': '^0.1.0', }, devDependencies: { typescript: '^5.7.0', @@ -223,7 +223,7 @@ function runtimeIdToken(value: string): string { function actorFactoryTemplate(className: string, mount: string): string { const factoryName = `createStandalone${className}`; - return `import { InMemoryBroker, InMemoryTransport, MatrixRuntime } from '@open-matrix/core'; + return `import { InMemoryBroker, InMemoryTransport, MatrixRuntime } from '@open-matrix/sdk'; import { ${className} } from './${className}.js'; @@ -286,7 +286,7 @@ async function addActorCommand(options: CommandOptions, name: string): Promise [packageName, tarballDependencies[packageName]]) ); @@ -288,7 +291,7 @@ async function main() { const authorPackagePath = path.join(authorDir, 'package.json'); const authorPackage = JSON.parse(await readFile(authorPackagePath, 'utf8')); - authorPackage.dependencies['@open-matrix/core'] = tarballDependencies['@open-matrix/core']; + authorPackage.dependencies['@open-matrix/sdk'] = tarballDependencies['@open-matrix/sdk']; authorPackage.pnpm = { overrides: authorOverrides }; await writeFile(authorPackagePath, `${JSON.stringify(authorPackage, null, 2)}\n`); @@ -361,8 +364,8 @@ async function main() { ]; const foundForbidden = forbidden.find((needle) => combinedAuthorFiles.includes(needle)); if (foundForbidden) throw new Error(`Fresh author package contains forbidden dependency/path: ${foundForbidden}`); - if (!actorSource.includes("from '@open-matrix/core'")) { - throw new Error('Fresh actor source does not import @open-matrix/core'); + if (!actorSource.includes("from '@open-matrix/sdk'")) { + throw new Error('Fresh actor source does not import @open-matrix/sdk'); } if (!existsSync(path.join(authorDir, '.matrix', 'run.json'))) { throw new Error('matrix run did not write package-local .matrix/run.json'); @@ -443,8 +446,8 @@ async function main() { throw new Error('Generated author package is still private after package-manager install'); } const installedActorSource = await readFile(path.join(installedPackageDir, 'src', 'GreeterActor.ts'), 'utf8'); - if (!installedActorSource.includes("from '@open-matrix/core'")) { - throw new Error('Package-manager installed source does not keep @open-matrix/core import'); + if (!installedActorSource.includes("from '@open-matrix/sdk'")) { + throw new Error('Package-manager installed source does not keep @open-matrix/sdk import'); } packageRunner = spawn('pnpm', [ 'exec', 'matrix', 'run', @@ -482,8 +485,8 @@ async function main() { authorDir, cliInstalledSeparately: true, authorPackageDependsOnCli: false, - legacyMonorepoPathReferences: false, - actorImport: '@open-matrix/core', + monorepoPathReferences: false, + actorImport: '@open-matrix/sdk', configuredKeyStored: existsSync(path.join(authorDir, '.matrix', 'credentials', 'matrix-api-key.json')), validKeyConfigSupplied: Boolean(liveKeyConfig), liveKeyValidation,