There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
chore: add build flag for change log (#1792)
JimmFly196b9f2dbb07
diff --git a/apps/web/.env.local.template b/apps/web/.env.local.templateindex 637a28b6e4..682dfc1757 100644--- a/apps/web/.env.local.template+++ b/apps/web/.env.local.template@@ -16,6 +16,7 @@ ENABLE_BC_PROVIDER=1EXPOSE_INTERNAL=1ENABLE_DEBUG_PAGE=ENABLE_SUBPAGE=+ENABLE_CHANGELOG=# SentrySENTRY_AUTH_TOKEN=diff --git a/apps/web/preset.config.mjs b/apps/web/preset.config.mjsindex a2203168e8..1930e9f9b6 100644--- a/apps/web/preset.config.mjs+++ b/apps/web/preset.config.mjs@@ -11,5 +11,6 @@ const config = {process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development'),enableSubpage: Boolean(process.env.ENABLE_SUBPAGE),+ enableChangeLog: Boolean(process.env.ENABLE_CHANGELOG),};export default config;diff --git a/apps/web/src/components/pure/help-island/index.tsx b/apps/web/src/components/pure/help-island/index.tsxindex f853a71842..2b29876d67 100644--- a/apps/web/src/components/pure/help-island/index.tsx+++ b/apps/web/src/components/pure/help-island/index.tsx@@ -1,4 +1,5 @@import { MuiFade, Tooltip } from '@affine/component';+import { config } from '@affine/env';import { useTranslation } from '@affine/i18n';import { CloseIcon, DoneIcon } from '@blocksuite/icons';import dynamic from 'next/dynamic';@@ -12,7 +13,6 @@ import {StyledIsland,StyledTriggerWrapper,} from './style';-const ContactModal = dynamic(() =>import('@affine/component/contact-modal').then(({ ContactModal }) => ({@@ -25,7 +25,9 @@ const ContactModal = dynamic(export type IslandItemNames = 'whatNew' | 'contact' | 'shortcuts';export const HelpIsland = ({- showList = ['whatNew', 'contact', 'shortcuts'],+ showList = config.enableChangeLog+ ? ['whatNew', 'contact', 'shortcuts']+ : ['contact', 'shortcuts'],}: {showList?: IslandItemNames[];}) => {diff --git a/apps/web/src/components/pure/workspace-slider-bar/index.tsx b/apps/web/src/components/pure/workspace-slider-bar/index.tsxindex 86aa5648b2..a6081db388 100644--- a/apps/web/src/components/pure/workspace-slider-bar/index.tsx+++ b/apps/web/src/components/pure/workspace-slider-bar/index.tsx@@ -109,7 +109,7 @@ export const WorkSpaceSliderBar: React.FC<WorkSpaceSliderBarProps> = ({currentWorkspace={currentWorkspace}onClick={onOpenWorkspaceListModal}/>- <ChangeLog />+ {config.enableChangeLog && <ChangeLog />}<StyledListItemdata-testid="slider-bar-quick-search-button"onClick={useCallback(() => {diff --git a/apps/web/src/layouts/index.tsx b/apps/web/src/layouts/index.tsxindex e7141ec722..75e65a07e7 100644--- a/apps/web/src/layouts/index.tsx+++ b/apps/web/src/layouts/index.tsx@@ -1,4 +1,5 @@import { DebugLogger } from '@affine/debug';+import { config } from '@affine/env';import { setUpLanguage, useTranslation } from '@affine/i18n';import { createAffineGlobalChannel } from '@affine/workspace/affine/sync';import { jotaiWorkspacesAtom } from '@affine/workspace/atom';@@ -339,7 +340,11 @@ export const WorkspaceLayoutInner: React.FC<React.PropsWithChildren> = ({{!isPublicWorkspace && (<HelpIslandshowList={- router.query.pageId ? undefined : ['whatNew', 'contact']+ router.query.pageId+ ? undefined+ : config.enableChangeLog+ ? ['whatNew', 'contact']+ : ['contact']}/>)}diff --git a/packages/env/src/index.ts b/packages/env/src/index.tsindex 13bb3bd4ee..5044970442 100644--- a/packages/env/src/index.ts+++ b/packages/env/src/index.ts@@ -111,6 +111,7 @@ export const publicRuntimeConfigSchema = z.object({// expose internal api to globalThis, **development only**exposeInternal: z.boolean(),enableSubpage: z.boolean(),+ enableChangeLog: z.boolean(),});export type PublicRuntimeConfig = z.infer<typeof publicRuntimeConfigSchema>;diff --git a/playwright.config.ts b/playwright.config.tsindex 4a4e7ea128..a5278de593 100644--- a/playwright.config.ts+++ b/playwright.config.ts@@ -74,6 +74,8 @@ const config: PlaywrightTestConfig = {env: {COVERAGE: process.env.COVERAGE || 'false',ENABLE_DEBUG_PAGE: '1',+ ENABLE_SUBPAGE: '1',+ ENABLE_CHANGELOG: '1',NODE_API_SERVER: 'local',},},diff --git a/scripts/vitest/next-config-mock.ts b/scripts/vitest/next-config-mock.tsindex ab9f3b0cc9..4f60e7aeba 100644--- a/scripts/vitest/next-config-mock.ts+++ b/scripts/vitest/next-config-mock.ts@@ -13,6 +13,7 @@ export default function getConfig() {prefetchWorkspace: false,exposeInternal: true,enableSubpage: true,+ enableChangeLog: true,},};}