diff --git a/.env b/.env index 4e56cc8e..4b9e1dad 100644 --- a/.env +++ b/.env @@ -1,4 +1,6 @@ ENABLE_INJECT_ANALYTICS=false BASE_URL=app -PPD_HEADER_JUMP_URL=https://github.com/power-playground/app + +PPD_HEADER_TITLE_JUMP_LINK='https://github.com/Power-Playground/app#power-playground' +PPD_GITHUB_URL=https://github.com/power-playground/app diff --git a/.env.dev b/.env.dev index 1e748945..47f40932 100644 --- a/.env.dev +++ b/.env.dev @@ -1,2 +1 @@ -# Define to control vite PPD_CONFIGURE_PATH=mock/.ppd.client.configure.ts diff --git a/.env.pro b/.env.pro index e69de29b..4839c0b8 100644 --- a/.env.pro +++ b/.env.pro @@ -0,0 +1 @@ +PPD_CONFIGURE_PATH=.ppd.client.configure.ts diff --git a/.ppd.client.configure.ts b/.ppd.client.configure.ts new file mode 100644 index 00000000..4343a892 --- /dev/null +++ b/.ppd.client.configure.ts @@ -0,0 +1,4 @@ +import { defineConfigure } from '@power-playground/core' + +export default defineConfigure({ +}) diff --git a/core/src/configure.ts b/core/src/configure.ts index e0e30fea..848baa46 100644 --- a/core/src/configure.ts +++ b/core/src/configure.ts @@ -1,6 +1,9 @@ import type { PluginConfigures } from './plugins' export interface Configure { + headerTitle?: React.ReactNode + headerTitleJumpLink?: string + githubUrl?: string plugins?: Partial } diff --git a/src/App.tsx b/src/App.tsx index 4687958c..8f8bb2d7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -60,6 +60,11 @@ if (import.meta.hot) { window.__PPD_PLUGINS__ = plugins } +const { + headerTitleJumpLink, + githubUrl +} = __PPD_CONFIGURES__ + export function App() { useEffect(() => onThemeChange(theme => elBridgeP.send('update:localStorage', ['uiTheme', { light: 'default', dark: 'dark' @@ -76,10 +81,7 @@ export function App() { <>

- + Power Playground Icon  
({ plugins: [ replacer({ define: { + PPD_HEADER_TITLE_JUMP_LINK: JSON.stringify(process.env.PPD_HEADER_TITLE_JUMP_LINK), + PPD_GITHUB_URL: JSON.stringify(process.env.PPD_GITHUB_URL), + __PPD_PLUGINS_GLOB_PATHS__: JSON.stringify(__PPD_PLUGINS_GLOB_PATHS__.map(relativeSrc)), __CLIENT_CONFIGURE_PATH__: JSON.stringify(relativeSrc(__CLIENT_CONFIGURE_PATH__)) }