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: 6 additions & 0 deletions .changeset/drop-studio-dep-cli-plugin-dev.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@objectstack/cli": patch
"@objectstack/plugin-dev": patch
---

Drop the `@objectstack/studio` dependency from `cli` and `plugin-dev`. Since Studio is no longer default-loaded by `os dev` / `os start` / `os serve` (the console hosts it at `/_console/studio/...`), neither package imports it at runtime any more. The only remaining consumer was the ADR-0048 app-split test in `cli`, which now exercises the identical one-app-package code path via Setup + Account. The `@objectstack/studio` package itself is unchanged and still registerable explicitly.
1 change: 0 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
"@objectstack/service-storage": "workspace:*",
"@objectstack/setup": "workspace:*",
"@objectstack/spec": "workspace:*",
"@objectstack/studio": "workspace:*",
"@objectstack/trigger-api": "workspace:*",
"@objectstack/trigger-record-change": "workspace:*",
"@objectstack/trigger-schedule": "workspace:*",
Expand Down
23 changes: 11 additions & 12 deletions packages/cli/src/adr-0048-app-split.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
* Boots a real ObjectQL engine, runs each app package's plugin `start()` against
* a manifest service backed by `engine.registerApp` (exactly what the kernel
* wires — see objectql plugin.ts: `register(m) => ql.registerApp(m)`), and
* asserts each app resolves under `com.objectstack.{studio,setup,account}` and
* that all three coexist (the multi-app-package ambiguity is gone).
* asserts each app resolves under `com.objectstack.{setup,account}` and that
* they coexist (the multi-app-package ambiguity is gone).
*
* Studio is one of the same one-app packages but is no longer default-loaded
* (it now lives in the console at `/_console/studio/...`), so cli/plugin-dev no
* longer depend on `@objectstack/studio`. Setup + Account exercise the identical
* app-split code path; asserting them keeps this regression intact without cli
* re-taking a dependency purely for the test.
*/

import { describe, it, expect, beforeEach } from 'vitest';
import { ObjectQL } from '@objectstack/objectql';
import { createStudioAppPlugin } from '@objectstack/studio';
import { createSetupAppPlugin } from '@objectstack/setup';
import { createAccountAppPlugin } from '@objectstack/account';

Expand All @@ -35,16 +40,13 @@ describe('ADR-0048 — platform apps as one-app packages', () => {
engine = new ObjectQL();
engine.registry.logLevel = 'silent';
const ctx = makeCtx(engine);
for (const plugin of [createSetupAppPlugin(), createStudioAppPlugin(), createAccountAppPlugin()]) {
for (const plugin of [createSetupAppPlugin(), createAccountAppPlugin()]) {
await plugin.init?.(ctx);
await plugin.start(ctx);
}
});

it('registers each app under its OWN package id', () => {
expect(engine.registry.getItem<any>('app', 'studio', 'com.objectstack.studio')?._packageId).toBe(
'com.objectstack.studio',
);
expect(engine.registry.getItem<any>('app', 'setup', 'com.objectstack.setup')?._packageId).toBe(
'com.objectstack.setup',
);
Expand All @@ -53,23 +55,20 @@ describe('ADR-0048 — platform apps as one-app packages', () => {
);
});

it('all three apps coexist and resolve by name (getApp)', () => {
expect(engine.registry.getApp('studio')?.name).toBe('studio');
it('the apps coexist and resolve by name (getApp)', () => {
expect(engine.registry.getApp('setup')?.name).toBe('setup');
expect(engine.registry.getApp('account')?.name).toBe('account');
});

it('each app package owns a distinct namespace (no install-gate conflict)', () => {
expect(engine.registry.getNamespaceOwners('studio')).toEqual(['com.objectstack.studio']);
expect(engine.registry.getNamespaceOwners('setup')).toEqual(['com.objectstack.setup']);
expect(engine.registry.getNamespaceOwners('account')).toEqual(['com.objectstack.account']);
});

it('records all three as installed packages', () => {
it('records the app packages as installed', () => {
const ids = engine.registry.getAllPackages().map((p: any) => p.manifest.id);
expect(ids).toEqual(
expect.arrayContaining([
'com.objectstack.studio',
'com.objectstack.setup',
'com.objectstack.account',
]),
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/plugin-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"@objectstack/service-i18n": "workspace:^",
"@objectstack/setup": "workspace:^",
"@objectstack/spec": "workspace:*",
"@objectstack/studio": "workspace:^",
"@objectstack/types": "workspace:*"
},
"devDependencies": {
Expand Down
6 changes: 0 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.