Skip to content

Commit

Permalink
Merge branch 'v2' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
vasfvitor authored May 1, 2024
2 parents 07f901e + 53c939f commit 70bb978
Show file tree
Hide file tree
Showing 219 changed files with 4,406 additions and 3,931 deletions.
9 changes: 3 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[submodule "packages/tauri-v2"]
path = packages/tauri-v2
url = https://github.com/tauri-apps/tauri.git
[submodule "packages/plugins-workspace"]
path = packages/plugins-workspace
url = https://github.com/tauri-apps/plugins-workspace.git
branch = v2
[submodule "packages/tauri-v1"]
path = packages/tauri-v1
url = https://github.com/tauri-apps/tauri.git
[submodule "packages/awesome-tauri"]
path = packages/awesome-tauri
url = https://github.com/tauri-apps/awesome-tauri
[submodule "packages/tauri"]
path = packages/tauri
url = https://github.com/tauri-apps/tauri.git
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Welcome to the home for Tauri 2.0 documentation - we're excited to have you! ✨

This repo is used to build the docs for the **prerelease** version of Tauri 2.0 at https://beta.tauri.app.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/tauri-apps/tauri-docs/tree/next)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/tauri-apps/tauri-docs/tree/next)
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/tauri-apps/tauri-docs/tree/v2)
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/tauri-apps/tauri-docs/tree/v2)

## Get Involved

Expand Down
136 changes: 41 additions & 95 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ const authors = {
title: 'Tauri Development Lead',
picture: '/authors/wusyong.png',
},
chip: {
name: 'Chip Reed',
title: 'Tauri Security',
picture: '/authors/chip.png',
},
};

const site = 'https://beta.tauri.app';
Expand Down Expand Up @@ -76,8 +81,6 @@ export default defineConfig({
components: {
SiteTitle: 'src/components/overrides/SiteTitle.astro',
Footer: 'src/components/overrides/Footer.astro',
MarkdownContent: 'starlight-blog/overrides/MarkdownContent.astro',
Sidebar: 'starlight-blog/overrides/Sidebar.astro',
Header: 'src/components/overrides/Header.astro',
ThemeSelect: 'src/components/overrides/ThemeSelect.astro',
},
Expand All @@ -90,6 +93,12 @@ export default defineConfig({
tag: 'meta',
attrs: { property: 'twitter:image', content: site + '/og.png?v=1' },
},
{
tag: 'script',
attrs: {
src: '/navigate.js',
},
},
],
// TODO: Be sure this is updated when the branch is switched
editLink: {
Expand All @@ -100,106 +109,43 @@ export default defineConfig({
{
label: 'Quick Start',
collapsed: true,
items: [
{ label: 'What is Tauri?', link: 'guides' },
{
label: 'Prerequisites',
translations: {
es: 'Prerrequisitos',
},
link: 'guides/prerequisites',
},
{
label: 'Create a Project',
link: 'guides/create',
},
{
label: 'Frontend Configuration',
translations: {
es: 'Configuración del Frontend',
},
link: 'guides/frontend',
},
{
label: 'Upgrade & Migrate',
link: 'guides/upgrade-migrate',
},
{
label: 'Core Concepts',
link: 'concepts',
},
{
label: 'Troubleshooting',
link: 'guides/troubleshoot',
},
],
autogenerate: { directory: 'start' },
},
{
label: 'Guides',
label: 'Core Concepts',
collapsed: true,
items: [
{
label: 'Develop',
link: 'guides/develop/',
},
{
label: 'Debug',
link: 'guides/debug/',
},
{
label: 'Test',
link: 'guides/test',
},
{
label: 'Build',
link: 'guides/build',
},
{
label: 'Distribute',
link: 'guides/distribute',
},
{
label: 'Plugin Development',
link: 'guides/plugins',
},
],
autogenerate: { directory: 'concepts' },
},
{
label: 'References',
label: 'Security',
collapsed: true,
autogenerate: { directory: 'security' },
},
{
label: 'Develop',
collapsed: true,
autogenerate: { directory: 'develop' },
},
{
label: 'Test',
collapsed: true,
autogenerate: { directory: 'test' },
},
{
label: 'Distribute',
collapsed: true,
items: [
{
label: 'List of References',
link: '/references',
},
{
label: 'Tauri Configuration',
link: '/references/v2/config',
},
{
label: 'Access Control List',
link: '/references/v2/acl',
},
{
label: 'Command Line Interface (CLI)',
link: '/references/v2/cli',
},
{
label: 'JavaScript API',
link: '/references/v2/js',
},
{
label: 'Rust API (via Docs.rs)',
// TODO: Is there a way to link this to the latest pre-released version?
link: 'https://docs.rs/tauri/~2.0.0-beta',
},
],
autogenerate: { directory: 'distribute' },
},
{
label: 'Features & Recipes',
collapsed: true,
autogenerate: { directory: 'features' },
},
{
label: 'References',
collapsed: true,
autogenerate: { directory: 'references' },
},
],
locales,
lastUpdated: true,
Expand Down Expand Up @@ -260,15 +206,15 @@ export default defineConfig({
...i18nRedirect('/v1/guides/testing/webdriver/introduction', '/guides/test/webdriver/'),
...i18nRedirect(
'/v1/guides/testing/webdriver/example/setup',
'/guides/test/webdriver/example/setup'
'/guides/test/webdriver/example/'
),
...i18nRedirect(
'/v1/guides/testing/webdriver/example/selenium',
'/guides/test/webdriver/example/selenium'
),
...i18nRedirect(
'/v1/guides/testing/webdriver/example/webdriverio',
'/guides/test/webdriver/example/webdriverio'
'/test/webdriver/example/webdriverio'
),

// v1 /references
Expand All @@ -292,9 +238,9 @@ export default defineConfig({
...i18nRedirect('/v1/references/configuration-files', '/references/configuration-files'),
...i18nRedirect('/v1/references/webview-versions', '/references/webview-versions'),

// Decommissioned locales
'/ko/[...slug]': '/[...slug]',
'/it/[...slug]': '/[...slug]',
// Decommissioned locales -> refer to /public/_redirects file
// '/ko/[...slug]': '/[...slug]',
// '/it/[...slug]': '/[...slug]',
},
//
});
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
"version": "0.0.1",
"scripts": {
"dev:setup:submodules": "git submodule update --init",
"dev:setup:tauri-v1": "yarn --cwd packages/tauri-v1/tooling/api",
"dev:setup:tauri-v2": "yarn --cwd packages/tauri-v2/tooling/api",
"dev:setup:tauri": "yarn --cwd packages/tauri/tooling/api",
"dev:setup:plugins-workspace": "pnpm --prefix packages/plugins-workspace install",
"dev:setup": "pnpm dev:setup:submodules && pnpm dev:setup:tauri-v1 && pnpm dev:setup:tauri-v2 && pnpm dev:setup:plugins-workspace",
"dev:setup": "pnpm dev:setup:submodules && pnpm dev:setup:tauri && pnpm dev:setup:plugins-workspace",
"dev": "astro dev",
"format": "prettier -w --cache --plugin prettier-plugin-astro .",
"build:references": "pnpm --filter js-api-generator run build",
Expand All @@ -21,8 +20,8 @@
"preview": "astro preview"
},
"dependencies": {
"@astrojs/markdown-remark": "^4.2.1",
"@astrojs/starlight": "^0.21.0",
"@astrojs/markdown-remark": "^5.0.0",
"@astrojs/starlight": "^0.22.0",
"@types/json-schema": "^7.0.15",
"astro": "^4.4.4",
"astro-feelback": "^0.3.4",
Expand All @@ -33,8 +32,8 @@
"semver": "^7.6.0",
"sharp": "^0.33.2",
"shiki": "^1.1.7",
"starlight-blog": "^0.5.0",
"starlight-links-validator": "^0.7.0"
"starlight-blog": "^0.6.0",
"starlight-links-validator": "^0.8.0"
},
"pnpm": {
"patchedDependencies": {
Expand Down
10 changes: 3 additions & 7 deletions packages/config-generator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@ import { existsSync, writeFileSync } from 'node:fs';
import { slug } from 'github-slugger';

buildConfig(
'../tauri-v1/core/tauri-config-schema/schema.json',
'../../src/content/docs/references/v1/config.md'
);
buildConfig(
'../tauri-v2/core/tauri-config-schema/schema.json',
'../../src/content/docs/references/v2/config.md'
'../tauri/core/tauri-config-schema/schema.json',
'../../src/content/docs/references/config.md'
);

async function buildConfig(schemaFile: string, outputFile: string) {
Expand All @@ -19,7 +15,7 @@ async function buildConfig(schemaFile: string, outputFile: string) {
let schema: JSONSchema7 = (await import(schemaFile)).default;

const output = [
'---\n# NOTE: This file is auto-generated in packages/config-generator/build.ts\n# For corrections please edit https://github.com/tauri-apps/tauri/blob/dev/core/tauri-utils/src/config.rs directly\n\ntitle: Configuration\n---',
'---\n# NOTE: This file is auto-generated in packages/config-generator/build.ts\n# For corrections please edit https://github.com/tauri-apps/tauri/blob/dev/core/tauri-utils/src/config.rs directly\n\ntitle: Configuration\nsidebar:\n order: 1\n---',
];

output.push(
Expand Down
34 changes: 11 additions & 23 deletions packages/js-api-generator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,28 +45,12 @@ const typeDocConfigBaseOptions: Partial<TypeDocOptions | PluginOptions> = {
};

async function generator() {
if (existsSync('../tauri-v1/tooling/api/node_modules')) {
if (existsSync('../tauri/tooling/api/node_modules')) {
const coreJsOptions: Partial<TypeDocOptions> = {
entryPoints: ['../tauri-v1/tooling/api/src/index.ts'],
tsconfig: '../tauri-v1/tooling/api/tsconfig.json',
gitRevision: '1.x',
baseUrl: '/references/v1/js/',
...typeDocConfigBaseOptions,
};

await generateDocs(coreJsOptions);
} else {
console.log(
'Tauri V1 submodule is not initialized, respective API routes will not be rendered.'
);
}

if (existsSync('../tauri-v2/tooling/api/node_modules')) {
const coreJsOptions: Partial<TypeDocOptions> = {
entryPoints: ['../tauri-v2/tooling/api/src/index.ts'],
tsconfig: '../tauri-v2/tooling/api/tsconfig.json',
entryPoints: ['../tauri/tooling/api/src/index.ts'],
tsconfig: '../tauri/tooling/api/tsconfig.json',
gitRevision: 'dev',
baseUrl: '/references/v2/js/core/',
baseUrl: '/references/javascript/api/',
...typeDocConfigBaseOptions,
};

Expand All @@ -81,6 +65,7 @@ async function generator() {
'authenticator',
'autostart',
'barcode-scanner',
'biometric',
'cli',
'clipboard-manager',
'deep-link',
Expand All @@ -89,6 +74,7 @@ async function generator() {
'global-shortcut',
'http',
'log',
'nfc',
'notification',
'os',
'positioner',
Expand All @@ -109,8 +95,10 @@ async function generator() {
entryPoints: [`../plugins-workspace/plugins/${plugin}/guest-js/index.ts`],
tsconfig: `../plugins-workspace/plugins/${plugin}/tsconfig.json`,
gitRevision: 'v2',
baseUrl: `/references/v2/js/${plugin}`,
baseUrl: `/references/javascript/`,
...typeDocConfigBaseOptions,
// Must go after to override base
entryFileName: `${plugin}.md`,
};

await generateDocs(pluginJsOptions);
Expand Down Expand Up @@ -151,8 +139,8 @@ function pageEventEnd(event: PageEvent<DeclarationReflection>) {
'---',
`title: "${event.model.name}"`,
'editUrl: false',
'prev: false',
'next: false',
'sidebar:',
` label: "${event.model.name.replace("@tauri-apps/plugin-", "")}"`,
'---',
'',
event.contents,
Expand Down
8 changes: 7 additions & 1 deletion packages/releases-generator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ async function generator() {
`slug: 'releases/${pkg.name}/v${thisVersion}'`,
`tableOfContents: false`,
`editUrl: 'https://github.com/tauri-apps/tauri-docs/packages/releases-generator/build.ts'`,
'pagefind: false',
];

const frontmatter = ['---', ...pageFrontmatter, ...navFrontmatter, '---'].join('\n');
Expand Down Expand Up @@ -150,6 +151,7 @@ async function generator() {
extraNote,
`title: 'Tauri Core Ecosystem Releases'`,
`editUrl: 'https://github.com/tauri-apps/tauri-docs/packages/releases-generator/build.ts'`,
'tableOfContents: false',
'---',
].join('\n');

Expand Down Expand Up @@ -188,4 +190,8 @@ function entitify(str: string): string {
.replace(/\$\{/g, '$\\{');
}

generator();
if (process.env.CONTEXT === 'production' || process.env.HEAD?.startsWith('release-pages')) {
generator();
} else {
console.info('Skipping `/release` pages build');
}
1 change: 1 addition & 0 deletions packages/tauri
Submodule tauri added at 198f11
1 change: 0 additions & 1 deletion packages/tauri-v1
Submodule tauri-v1 deleted from 596681
1 change: 0 additions & 1 deletion packages/tauri-v2
Submodule tauri-v2 deleted from 1b2d31
Loading

0 comments on commit 70bb978

Please sign in to comment.