Skip to content

Commit 8f23a27

Browse files
authored
docs: v3 docs structure (#479)
* docs: v3 docs structure * fix build * WIP * WIP * progress on ORM part * update * update embed mechanism * fix stackblitz embed * make code tabs sync * complete filter section * update docs * progress on delete * more progress on ORM API * ORM docs progress * query builder docs * computed fields * polymorphism * plugins part * update plugins part * add logging * add inferred types section * progress * progress * prisma migration guide * update broken links * update * copywriting * zmodel language reference * update * fix links * almost done * updates * update * update * update * add feature gap * update * use git submodules to implement code snippet loading * addressing review comments * update * v3 LP * update * update * update responsiveness * update * update * update * update * nav bar * update * update submodules
1 parent e723c9d commit 8f23a27

File tree

106 files changed

+4945
-17
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4945
-17
lines changed

.gitmodules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[submodule "code-repos/zenstackhq/v3-doc-orm"]
2+
path = code-repos/zenstackhq/v3-doc-orm
3+
url = https://github.com/zenstackhq/v3-doc-orm.git
4+
[submodule "code-repos/zenstackhq/v3-doc-orm-computed-fields"]
5+
path = code-repos/zenstackhq/v3-doc-orm-computed-fields
6+
url = https://github.com/zenstackhq/v3-doc-orm-computed-fields.git
7+
[submodule "code-repos/zenstackhq/v3-doc-orm-computed-polymorphism"]
8+
path = code-repos/zenstackhq/v3-doc-orm-computed-polymorphism
9+
url = https://github.com/zenstackhq/v3-doc-orm-polymorphism.git
10+
[submodule "code-repos/zenstackhq/v3-doc-orm-typed-json"]
11+
path = code-repos/zenstackhq/v3-doc-orm-typed-json
12+
url = https://github.com/zenstackhq/v3-doc-orm-typed-json.git
13+
[submodule "code-repos/zenstackhq/v3-doc-quick-start"]
14+
path = code-repos/zenstackhq/v3-doc-quick-start
15+
url = https://github.com/zenstackhq/v3-doc-quick-start.git
16+
[submodule "code-repos/zenstackhq/v3-doc-orm-polymorphism"]
17+
path = code-repos/zenstackhq/v3-doc-orm-polymorphism
18+
url = https://github.com/zenstackhq/v3-doc-orm-polymorphism.git

code-repos/zenstackhq/v3-doc-orm

Submodule v3-doc-orm added at bafb469
Submodule v3-doc-orm-polymorphism added at 74231c1
Submodule v3-doc-orm-typed-json added at 710d2ca
Submodule v3-doc-quick-start added at 0c87866

docusaurus.config.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const config = {
4444
label: '1.x',
4545
banner: 'none',
4646
},
47+
'3.x': {
48+
label: '3.0 Beta',
49+
banner: 'none',
50+
},
4751
},
4852
},
4953
blog: false,
@@ -63,6 +67,12 @@ const config = {
6367
themeConfig:
6468
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
6569
{
70+
announcementBar: {
71+
id: 'v3_beta',
72+
content:
73+
'ZenStack v3 Beta is released 🚀. The new version has replaced Prisma with a brand new query engine. <a href="/v3">Check it out</a>',
74+
isCloseable: true,
75+
},
6676
colorMode: {
6777
defaultMode: 'light',
6878
respectPrefersColorScheme: false,
@@ -99,6 +109,11 @@ const config = {
99109
position: 'left',
100110
label: 'Handbook',
101111
},
112+
{
113+
to: 'v3',
114+
position: 'left',
115+
label: 'V3 Beta 🚀',
116+
},
102117
{ to: '/blog', label: 'Blog', position: 'left' },
103118
{
104119
href: 'https://discord.gg/Ykhr738dUe',
@@ -193,6 +208,23 @@ const config = {
193208
},
194209
],
195210
},
211+
{
212+
title: 'FlatIcon Credits',
213+
items: [
214+
{
215+
label: 'Endure',
216+
href: 'https://www.flaticon.com/free-icons/endure',
217+
},
218+
{
219+
label: 'Diagram by Kiranshastry',
220+
href: 'https://www.flaticon.com/free-icons/diagram',
221+
},
222+
{
223+
href: 'https://www.flaticon.com/free-icons/database',
224+
label: 'Database by kerismaker',
225+
},
226+
],
227+
},
196228
],
197229
copyright: `Copyright © ${new Date().getFullYear()} ZenStack, Inc.`,
198230
},

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"serve": "docusaurus serve",
1313
"write-translations": "docusaurus write-translations",
1414
"write-heading-ids": "docusaurus write-heading-ids",
15-
"typecheck": "tsc"
15+
"typecheck": "tsc",
16+
"pull-submodules": "git submodule foreach git pull origin main"
1617
},
1718
"dependencies": {
1819
"@algolia/client-search": "^4.22.1",
@@ -22,12 +23,15 @@
2223
"@docusaurus/theme-mermaid": "3.4.0",
2324
"@giscus/react": "^2.4.0",
2425
"@mdx-js/react": "^3.0.1",
26+
"@stackblitz/sdk": "^1.11.0",
2527
"autoprefixer": "^10.4.13",
2628
"clsx": "^1.2.1",
29+
"is-mobile": "^5.0.0",
2730
"postcss": "^8.4.21",
2831
"prism-react-renderer": "^2.3.1",
2932
"prism-svelte": "^0.5.0",
3033
"prismjs": "^1.29.0",
34+
"raw-loader": "^4.0.2",
3135
"react": "^18.2.0",
3236
"react-dom": "^18.2.0",
3337
"react-icons": "^5.0.1",

pnpm-lock.yaml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/GithubCodeBlock.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import CodeBlock from '@theme/CodeBlock';
2+
3+
interface GithubCodeBlockProps {
4+
repoPath: string;
5+
file: string;
6+
}
7+
8+
const GithubCodeBlock: React.FC<GithubCodeBlockProps> = ({ repoPath, file }) => {
9+
const code = require(`!!raw-loader!@site/code-repos/${repoPath}/${file}`).default;
10+
11+
const getLanguage = (file: string): string => {
12+
if (file.endsWith('.ts')) {
13+
return 'typescript';
14+
} else if (file.endsWith('.zmodel')) {
15+
return 'zmodel';
16+
} else {
17+
return 'plaintext';
18+
}
19+
};
20+
return (
21+
<CodeBlock language={getLanguage(file)} title={file}>
22+
{code}
23+
</CodeBlock>
24+
);
25+
};
26+
27+
export default GithubCodeBlock;

0 commit comments

Comments
 (0)