Skip to content

Commit

Permalink
feat: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Feb 16, 2024
1 parent b49fa68 commit 835da05
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 199 deletions.
32 changes: 5 additions & 27 deletions apps/docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { defineConfigWithTheme } from "vitepress";
import type { Config as ThemeConfig } from "vitepress-shopware-docs";
import baseConfig from "vitepress-shopware-docs/config";
import { TsFunctionDescription, TsFunctionsList } from "@shopware-pwa/typer";
import nav from "./navigation";
import { TsFunctionDescription, TsFunctionsList } from "@shopware-docs/typer";
import { resolve } from "node:path";
import { SearchPlugin } from "vitepress-plugin-search";
import {sidebar} from "./sidebar";
Expand All @@ -21,7 +20,6 @@ export default defineConfigWithTheme<ThemeConfigExtended>({
srcDir: "src",
// srcExclude: ["tutorial/**/description.md"], In case we need something to be excluded
scrollOffset: "header",
ignoreDeadLinks: true, // remove once MR #294 is merged

head: [
[
Expand Down Expand Up @@ -84,7 +82,6 @@ export default defineConfigWithTheme<ThemeConfigExtended>({
],

themeConfig: {
nav,
sidebar,
algolia: {
indexName: "",
Expand All @@ -97,31 +94,15 @@ export default defineConfigWithTheme<ThemeConfigExtended>({
ai: {
endpoint: "",
},
// TODO: temporarily disabled; change to actual repository pattern once vitepress is upgraded to have editLink.pattern: https://vitepress.dev/reference/default-theme-edit-link#site-level-config
editLink: false as any,
},

vite: {
define: {
__VUE_OPTIONS_API__: false,
},
server: {
host: true,
fs: {
// for when developing with locally linked theme
allow: ["../.."],
},
},
build: {
minify: "terser",
chunkSizeWarningLimit: Infinity,
},
json: {
stringify: true,
},
plugins: [
SearchPlugin(),
TsFunctionsList(),
TsFunctionsList({
rootDir: resolve(__dirname, "../../../"),
prefix: '/',
}),
TsFunctionDescription({
rootDir: resolve(__dirname, "../../../"),
dirs: [
Expand Down Expand Up @@ -154,7 +135,4 @@ export default defineConfigWithTheme<ThemeConfigExtended>({
}),
],
},
vue: {
reactivityTransform: true,
},
});
26 changes: 11 additions & 15 deletions apps/docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
// import './styles/index.css'
import { h, App } from "vue";
import { VPTheme } from "vitepress-shopware-docs";
import PageRef from "./components/PageRef.vue";
import {SWAGTheme} from "vitepress-shopware-docs";
// Ai component
// import AI from "./components/AI.vue";
import "./custom.css";

export default Object.assign({}, VPTheme, {
Layout: () => {
// @ts-ignore
return h(VPTheme.Layout, null, {
export default {
...SWAGTheme({
slots: {
// banner: () => h(Banner),
// "content-top": () => h("h1", "We have important Announcement!"),
// 'sidebar-top': () => h(PreferenceSwitch),
// 'aside-mid': () => h(SponsorsAside),
// 'aside-bottom': () => h(VueJobs)
});
},
enhanceApp({ app }: { app: App }) {
app.component("PageRef", PageRef);
// app.component("AI", AI);
// app.provide('some-injection-key-if-needed', VALUE)
},
});
},
enhanceApp({app}) {
// app.component("AI", AI);
// app.provide('some-injection-key-if-needed', VALUE)
}
})
}
2 changes: 2 additions & 0 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "1.6.1",
"description": "",
"type": "module",
"scripts": {
"dev": "vitepress",
"build": "vitepress build",
Expand All @@ -25,6 +26,7 @@
"@types/markdown-it": "^13.0.7",
"@types/node": "^20.11.17",
"@vitejs/plugin-vue": "^5.0.4",
"sass": "^1.70.0",
"typescript": "^5.3.3"
},
"pnpm": {
Expand Down
Loading

0 comments on commit 835da05

Please sign in to comment.