Skip to content

Commit ba67a09

Browse files
committed
Merge branch 'main' into docs/ui
2 parents 1c31a48 + c3e9d83 commit ba67a09

File tree

583 files changed

+666897
-5111
lines changed

Some content is hidden

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

583 files changed

+666897
-5111
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ jobs:
2121
cache: 'npm'
2222
- run: npm ci
2323
- run: npm run lint:check --if-present
24-
continue-on-error: true
25-
- run: npm run build --if-present
24+
- run: npm run build --if-present
25+
env:
26+
NODE_OPTIONS: "--max_old_space_size=4096"

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
node_modules
2-
content/api/**/*
2+
# we'll be generating api docs on CI/during the build in the future
3+
# however, for now, we'll just manually include the generated apiref
4+
# content/api/**/*
35
.vitepress/dist
46
.vitepress/cache
57

.vitepress/config.mts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import { defineConfig } from 'vitepress'
2+
import apiSidebar from '../content/api/sidebar.json'
3+
import mainSidebar from '../content/sidebar'
4+
import nav from './nav'
5+
import './theme/cliLanguage'
6+
7+
export default defineConfig({
8+
srcDir: './content',
9+
lang: 'en-US',
10+
title: 'NativeScript',
11+
description: 'NativeScript docs',
12+
ignoreDeadLinks: true,
13+
cleanUrls: true,
14+
lastUpdated: true,
15+
appearance: false,
16+
themeConfig: {
17+
editLink: {
18+
// pattern:
19+
// 'https://github.com/NativeScript/docs/blob/main/content/:filePath',
20+
pattern:
21+
'https://pr.new/github.com/NativeScript/docs/edit/main/content/:filePath?initialPath=:path',
22+
},
23+
algolia: {
24+
appId: '',
25+
apiKey: '8d41b4ae92a02aea355e1dc8cfad1899',
26+
indexName: 'nativescript',
27+
},
28+
nav,
29+
sidebar: {
30+
'/api': apiSidebar,
31+
'/': mainSidebar,
32+
},
33+
},
34+
markdown: {
35+
headers: true,
36+
},
37+
async transformPageData(pageData, { siteConfig }) {
38+
// const contributors = await githubAuthors.getAuthorsForFilePath(
39+
// path.resolve(siteConfig.srcDir, pageData.relativePath)
40+
// )
41+
// pageData.frontmatter.contributors ??= contributors ?? []
42+
43+
pageData.frontmatter.contributors = transformContributors(
44+
pageData.frontmatter.contributors
45+
)
46+
},
47+
})
48+
49+
function transformContributors(contributors?: string[] | false) {
50+
// explicitly set to false to disable contributors list
51+
if (contributors === false) {
52+
return []
53+
}
54+
55+
// if not set, default to NativeScript
56+
if (!contributors) {
57+
return [
58+
{
59+
username: 'NativeScript',
60+
avatarURL: 'https://github.com/NativeScript.png?size=24',
61+
profileURL: 'https://github.com/NativeScript',
62+
},
63+
]
64+
}
65+
66+
// otherwise, transform the list of usernames into a list of objects
67+
return contributors.map((username: string) => {
68+
return {
69+
username,
70+
avatarURL: `https://github.com/${username}.png?size=24`,
71+
profileURL: `https://github.com/${username}`,
72+
}
73+
})
74+
}

.vitepress/config.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

.vitepress/nav.ts

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
11
export default [
2-
...(process.env.NODE_ENV !== "production"
2+
...(process.env.NODE_ENV !== 'production'
33
? [
44
{
5-
text: "[DEV] Reference",
6-
link: "/dev-reference",
7-
activeMatch: "^/dev-reference",
8-
icon: "CodeBracketIcon",
5+
text: '[DEV] Reference',
6+
link: '/dev-reference',
7+
activeMatch: '^/dev-reference',
8+
icon: 'CodeBracketIcon',
99
},
1010
]
1111
: []),
1212
{
13-
text: "Docs",
14-
link: "/",
15-
activeMatch: "^/(?!plugins|best-practices|api|dev-reference)",
16-
icon: "AcademicCapIcon",
13+
text: 'Docs',
14+
link: '/',
15+
activeMatch: '^/(?!plugins|best-practices|api|dev-reference|tutorials)',
16+
icon: 'BookOpenIcon',
1717
},
1818
{
19-
text: "Preview",
20-
link: "/soon",
21-
icon: "DevicePhoneMobileIcon",
19+
text: 'Preview',
20+
link: 'https://preview.nativescript.org',
21+
icon: 'DevicePhoneMobileIcon',
22+
target: '_blank',
2223
},
2324
{
24-
text: "Plugins",
25-
link: "/soon",
26-
activeMatch: "^/plugins",
27-
icon: "CubeTransparentIcon",
25+
text: 'Tutorials',
26+
link: '/tutorials/',
27+
activeMatch: '^/tutorials',
28+
icon: 'AcademicCapIcon',
2829
},
2930
{
30-
text: "Best Practices",
31-
link: "/soon",
32-
activeMatch: "^/best-practices",
33-
icon: "CheckIcon",
31+
text: 'Plugins',
32+
link: '/soon',
33+
activeMatch: '^/plugins',
34+
icon: 'CubeTransparentIcon',
3435
},
36+
// {
37+
// text: 'Best Practices',
38+
// link: '/soon',
39+
// activeMatch: '^/best-practices',
40+
// icon: 'CheckIcon',
41+
// },
3542
{
36-
text: "Integrations",
37-
link: "/soon",
38-
icon: "CpuChipIcon",
43+
text: 'Integrations',
44+
link: '/soon',
45+
icon: 'CpuChipIcon',
3946
},
4047
{
41-
text: "API Reference",
42-
link: "/api/",
43-
activeMatch: "^/api",
44-
icon: "CodeBracketIcon",
48+
text: 'API Reference',
49+
link: '/api/',
50+
activeMatch: '^/api',
51+
icon: 'CodeBracketIcon',
4552
},
46-
];
53+
]

.vitepress/theme/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { DefaultTheme } from 'vitepress';
2+
import { Theme } from 'vitepress';
3+
4+
export declare type NSNavItem = DefaultTheme.NavItem & {
5+
icon?: string;
6+
};
7+
8+
export declare type NSSidebarGroup = DefaultTheme.SidebarItem & {
9+
items?: NSSidebarItem[];
10+
};
11+
12+
export declare type NSSidebarItem = DefaultTheme.SidebarItem & {
13+
icon?: string;
14+
hidden?: boolean;
15+
collapsible?: boolean;
16+
hideChildren?: boolean;
17+
type?: string;
18+
};
19+
20+
export declare type NSThemeConfig = DefaultTheme.Config & {
21+
mainURL?: string;
22+
sidebar?: NSSidebarGroup[];
23+
nav?: NSNavItem[];
24+
};
25+
26+
declare const theme: (enhanceApp: Theme['enhanceApp']) => Theme;
27+
export default theme;
28+
29+
export { }

0 commit comments

Comments
 (0)