Skip to content

Commit

Permalink
🚧[docs] Updates vitepress and fixes vitepress build pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
N0W0RK committed Mar 26, 2024
1 parent bd220f0 commit d36ef87
Show file tree
Hide file tree
Showing 13 changed files with 497 additions and 101 deletions.
2 changes: 1 addition & 1 deletion docsvite/.vitepress/.temp/.modules.json

Large diffs are not rendered by default.

11 changes: 2 additions & 9 deletions docsvite/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ const versions: Versions = JSON.parse(fs.readFileSync(versionsFile).toString());
// Generate modules

const modulesFile = path.join(DOCS_TEMP_PATH, '.modules.json');
run(
'generate/modules',
modulesFile,
MODULES_PATH,
DOCS_PATH,
JSON.stringify(LANGS),
JSON.stringify(MODULES)
);

// Generate i18n

Expand Down Expand Up @@ -120,5 +112,6 @@ export default defineConfig({
{ icon: 'discord', link: `https://discord.gg/${config.discord.invite}` }
]
},
locales: localeConfigs.siteConfigs
locales: localeConfigs.siteConfigs ,
srcDir: 'src'
})
14 changes: 0 additions & 14 deletions docsvite/.vitepress/package.json

This file was deleted.

1 change: 0 additions & 1 deletion docsvite/.vitepress/theme/custom.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.VPHome .VPHero.has-image .actions {
justify-content: center;
gap: 0.5rem 1rem;

.action:nth-last-child(2),
.action:nth-child(4) {
Expand Down
8 changes: 4 additions & 4 deletions docsvite/.vitepress/utils/generate/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ ${Object.entries(vars)
.readFileSync(MODULE_DOCS_FILE)
.toString();
frontMatterVars.empty = docsContent.trim() === '';
fs.writeFileSync(
/*fs.writeFileSync(
DOCS_MODULE_FILE,
getHead(frontMatterVars) + docsContent
);
);*/
if (!frontMatterVars.empty) modulesFile[module].docs.push(lang);
const MODULE_DOCS_ASSETS = path.join(
MODULE_DOCS_FOLDER,
Expand Down Expand Up @@ -197,9 +197,9 @@ ${Object.entries(vars)
}
} else {
frontMatterVars.empty = true;
fs.writeFileSync(DOCS_MODULE_FILE, getHead(frontMatterVars));
//fs.writeFileSync(DOCS_MODULE_FILE, getHead(frontMatterVars));
}
}
}
fs.writeFileSync(file, JSON.stringify(modulesFile));
//fs.writeFileSync(file, JSON.stringify(modulesFile));
})();
2 changes: 1 addition & 1 deletion docsvite/.vitepress/utils/getConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const VITEPRESS_PATH = path.join(__dirname, '../');
const ROOT_PATH = path.join(VITEPRESS_PATH, '../../');
const MODULES_PATH = path.join(ROOT_PATH, 'src/modules');
const DIST_PATH = path.join(ROOT_PATH, 'dist');
const DOCS_PATH = path.join(ROOT_PATH, 'docsvite');
const DOCS_PATH = path.join(ROOT_PATH, 'docsvite/src');
const DOCS_DIST_PATH = path.join(VITEPRESS_PATH, 'dist');
const DOCS_TEMP_PATH = path.join(VITEPRESS_PATH, '.temp');
const DOCS_I18N_PATH = path.join(VITEPRESS_PATH, 'i18n');
Expand Down
14 changes: 14 additions & 0 deletions docsvite/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "lss-manager-v4-vite",
"devDependencies": {
"ts-node": "10.9.2",
"typescript": "5.4.3",
"vitepress": "^1.0.1",
"vue": "^3.4.21"
},
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
"docs:preview": "vitepress preview"
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../../tsconfig.json",
"extends": "../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"module": "CommonJS",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"packageManager": "[email protected]",
"workspaces": [
"./docs/.vuepress/",
"./docsvite/.vitepress/"
"./docsvite/"
],
"prettier": {
"arrowParens": "avoid",
Expand Down
Loading

0 comments on commit d36ef87

Please sign in to comment.