Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzolewis authored and tauri-bot committed Dec 21, 2023
1 parent 9c68fa1 commit 7a89aef
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
21 changes: 12 additions & 9 deletions packages/config-generator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,36 @@ import { JSONSchema7, JSONSchema7Definition, JSONSchema7TypeName } from 'json-sc
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')
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'
);

async function buildConfig(schemaFile: string, outputFile: string) {
if (!existsSync(schemaFile)) {
throw Error('Could not find the Tauri config schema. Is the Tauri submodule initialized?');
}

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---',
];

output.push(
...buildSchemaDefinition(schema, {
headingLevel: 2,
renderTitle: false,
})
);

writeFileSync(outputFile, output.join('\n\n'));
}




interface Options {
headingLevel: number;
renderTitle: boolean;
Expand Down
11 changes: 7 additions & 4 deletions packages/js-api-generator/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ async function generator() {

await generateDocs(coreJsOptions);
} else {
console.log('Tauri V1 submodule is not initialized, respective API routes will not be rendered.');
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'],
Expand All @@ -70,7 +72,9 @@ async function generator() {

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

const plugins = [
Expand Down Expand Up @@ -164,7 +168,6 @@ class TauriTheme extends MarkdownTheme {
}

class TauriThemeRenderContext extends MarkdownThemeRenderContext {

constructor(event: PageEvent<Reflection>, options: Options) {
super(event, options);
}
Expand Down
5 changes: 1 addition & 4 deletions src/content/docs/references/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components';
<LinkCard title="Tauri Configuration" href="/references/v1/config" />
<LinkCard title="Command Line Interface (CLI)" href="/references/v1/cli" />
<LinkCard title="JavaScript API" href="/references/v1/js" />
<LinkCard
title="Rust API (via Docs.rs)"
href="https://docs.rs/tauri/~1"
/>
<LinkCard title="Rust API (via Docs.rs)" href="https://docs.rs/tauri/~1" />
</CardGrid>

## Additional References
Expand Down
10 changes: 5 additions & 5 deletions src/content/docs/references/v1/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ Options:
-t, --target <TARGET>
Target triple to build against.
It must be one of the values outputted by `$rustc --print target-list` or `universal-apple-darwin` for an universal macOS application.
Note that compiling an universal macOS application requires both `aarch64-apple-darwin` and `x86_64-apple-darwin` targets to be installed.
-f, --features [<FEATURES>...]
Space or comma separated list of features to activate
-b, --bundles [<BUNDLES>...]
Space or comma separated list of bundles to package.
Each bundle must be one of `deb`, `appimage`, `msi`, `app` or `dmg` on MacOS and `updater` on all platforms. If `none` is specified, the bundler will be skipped.
Note that the `updater` bundle is not automatically added so you must specify it if the updater is enabled.
-c, --config <CONFIG>
Expand Down Expand Up @@ -399,4 +399,4 @@ This command will show the current version of Tauri.

## CLI usage

See more about the usage through this [complete guide](../guides/development/development-cycle).
See more about the usage through this [complete guide](../guides/development/development-cycle).

0 comments on commit 7a89aef

Please sign in to comment.