Skip to content

Commit

Permalink
chore: disable outline, copilot and hello world plugin (#4894)
Browse files Browse the repository at this point in the history
  • Loading branch information
joooye34 committed Nov 9, 2023
1 parent d0b0145 commit 15b0c12
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/common/env/src/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const blockSuiteFeatureFlags = z.object({

export const runtimeFlagsSchema = z.object({
enablePlugin: z.boolean(),
builtinPlugins: z.array(z.string()),
enableTestProperties: z.boolean(),
enableBroadcastChannelProvider: z.boolean(),
enableDebugPage: z.boolean(),
Expand Down
8 changes: 1 addition & 7 deletions packages/common/infra/src/__internal__/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,7 @@ import type { z } from 'zod';

import type { packageJsonOutputSchema } from '../type.js';

export const builtinPluginPaths = new Set([
'/plugins/copilot',
'/plugins/hello-world',
'/plugins/image-preview',
'/plugins/vue-hello-world',
'/plugins/outline',
]);
export const builtinPluginPaths = new Set(runtimeConfig.builtinPlugins);

const pluginCleanupMap = new Map<string, Set<() => void>>();

Expand Down
15 changes: 15 additions & 0 deletions packages/frontend/core/.webpack/runtime-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
const buildPreset: Record<BuildFlags['channel'], RuntimeConfig> = {
stable: {
enablePlugin: true,
builtinPlugins: ['/plugins/image-preview'],
enableTestProperties: false,
enableBroadcastChannelProvider: true,
enableDebugPage: true,
Expand Down Expand Up @@ -52,6 +53,13 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
// canary will be aggressive and enable all features
canary: {
enablePlugin: true,
builtinPlugins: [
'/plugins/copilot',
'/plugins/hello-world',
'/plugins/image-preview',
'/plugins/vue-hello-world',
'/plugins/outline',
],
enableTestProperties: true,
enableBroadcastChannelProvider: true,
enableDebugPage: true,
Expand Down Expand Up @@ -83,6 +91,13 @@ export function getRuntimeConfig(buildFlags: BuildFlags): RuntimeConfig {
const currentBuildPreset = buildPreset[currentBuild];

const environmentPreset = {
builtinPlugins: [
'/plugins/copilot',
'/plugins/hello-world',
'/plugins/image-preview',
'/plugins/vue-hello-world',
'/plugins/outline',
],
enablePlugin: process.env.ENABLE_PLUGIN
? process.env.ENABLE_PLUGIN === 'true'
: currentBuildPreset.enablePlugin,
Expand Down

0 comments on commit 15b0c12

Please sign in to comment.