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: 2 additions & 4 deletions code/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';

import { defineMain } from '@storybook/react-vite/node';
import type { Options } from 'storybook/internal/types';

import react from '@vitejs/plugin-react';
import type { InlineConfig } from 'vite';

import { BROWSER_TARGETS } from '../core/src/shared/constants/environments-support.ts';

Expand Down Expand Up @@ -120,7 +118,6 @@ const config = defineMain({
'@storybook/addon-mcp',
'storybook-addon-pseudo-states',
'@chromatic-com/storybook',
'./services-preset.ts',
],
previewAnnotations: [
'./core/template/stories/preview.ts',
Expand Down Expand Up @@ -155,7 +152,7 @@ const config = defineMain({
changeDetection: true,
},
staticDirs: [{ from: './bench/bundle-analyzer', to: '/bundle-analyzer' }],
viteFinal: async (viteConfig: InlineConfig, { configType }: Options) => {
viteFinal: async (viteConfig, { configType }) => {
const { mergeConfig } = await import('vite');

return mergeConfig(viteConfig, {
Expand Down Expand Up @@ -187,6 +184,7 @@ const config = defineMain({
},
} satisfies typeof viteConfig);
},
// logLevel: 'debug',
});

export default config;
194 changes: 0 additions & 194 deletions code/.storybook/open-service-debug-service.ts

This file was deleted.

20 changes: 0 additions & 20 deletions code/.storybook/services-preset.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/core/src/core-server/build-dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ export async function buildDevStandalone(

const features = await presets.apply('features');
global.FEATURES = features;
await presets.apply('services');
await presets.apply('experimental_serverChannel', channel);

const fullOptions: Options = {
Expand Down
3 changes: 0 additions & 3 deletions code/core/src/core-server/build-static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { global } from '@storybook/global';
import { join, relative, resolve } from 'pathe';
import picocolors from 'picocolors';

import { writeOpenServiceStaticFiles } from '../shared/open-service/server.ts';
import { resolvePackageDir } from '../shared/utils/module.ts';
import type { StoryIndexGenerator } from './utils/StoryIndexGenerator.ts';
import { buildOrThrow } from './utils/build-or-throw.ts';
Expand Down Expand Up @@ -130,7 +129,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
const effects: Promise<void>[] = [];

global.FEATURES = features;
await presets.apply('services');

if (!options.previewOnly) {
await buildOrThrow(async () =>
Expand All @@ -146,7 +144,6 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption

const coreServerPublicDir = join(resolvePackageDir('storybook'), 'assets/browser');
effects.push(cp(coreServerPublicDir, options.outputDir, { recursive: true, force: true }));
effects.push(writeOpenServiceStaticFiles(options.outputDir));

let storyIndexGeneratorPromise: Promise<StoryIndexGenerator | undefined> =
Promise.resolve(undefined);
Expand Down
24 changes: 0 additions & 24 deletions code/core/src/core-server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,6 @@ export { loadStorybook as experimental_loadStorybook } from './load.ts';

export { Tag } from '../shared/constants/tags.ts';
export { analyzeMdx } from './utils/analyze-mdx.ts';
export { defineService as experimental_defineService } from '../shared/open-service/index.ts';
export type {
Command,
CommandCtx,
CommandDefinition,
OperationDescriptor,
Query,
QueryCtx,
QueryDefinition,
RuntimeService,
SchemaDescriptor,
ServiceDefinition,
ServiceDescriptor,
ServiceInstance,
ServiceRegistrationOptions,
ServiceSummary,
ServerServiceRegistration,
} from '../shared/open-service/index.ts';
export {
describeService,
getService,
listServices,
registerService as experimental_registerService,
} from '../shared/open-service/server.ts';

export { UniversalStore as experimental_UniversalStore } from '../shared/universal-store/index.ts';
export { MockUniversalStore as experimental_MockUniversalStore } from '../shared/universal-store/mock.ts';
Expand Down
7 changes: 0 additions & 7 deletions code/core/src/core-server/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import { dirname, isAbsolute, join, relative, resolve } from 'pathe';

import { resolvePackageDir } from '../shared/utils/module.ts';

globalThis.STORYBOOK_SERVICES_LOADED = globalThis.STORYBOOK_SERVICES_LOADED ?? false;

export async function loadStorybook(
options: CLIOptions &
LoadOptions &
Expand Down Expand Up @@ -97,11 +95,6 @@ export async function loadStorybook(
const features = await presets.apply('features');
global.FEATURES = features;

if (!globalThis.STORYBOOK_SERVICES_LOADED) {
await presets.apply('services');
globalThis.STORYBOOK_SERVICES_LOADED = true;
}

return {
...options,
presets,
Expand Down
10 changes: 0 additions & 10 deletions code/core/src/core-server/presets/common-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,16 +310,6 @@ export const managerEntries = async (existing: any) => {
];
};

globalThis.STORYBOOK_SERVICES_LOADED = globalThis.STORYBOOK_SERVICES_LOADED ?? false;
export const services = async () => {
if (globalThis.STORYBOOK_SERVICES_LOADED) {
throw new Error(
'The "services" preset property was applied twice, but should only be applied once. Multiple code paths applying it will cause service registration to fail.'
);
}
globalThis.STORYBOOK_SERVICES_LOADED = true;
};

// Store the promise (not the result) to prevent race conditions.
// The promise is assigned synchronously, so concurrent calls will share the same initialization.
// This is essentially an async singleton pattern.
Expand Down
1 change: 0 additions & 1 deletion code/core/src/core-server/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ declare module 'watchpack';

declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features'];
declare var TAGS_OPTIONS: import('storybook/internal/types').TagsOptions;
declare var STORYBOOK_SERVICES_LOADED: boolean;
Loading