chore: adjust prettier config, .gitignore and use taplo to format toml files (#1728)

* chore: adjust prettier config, .gitignore and use taplo to format toml files

This brings the plugins-workspace repository to the same code style of the main tauri repo

* format toml

* ignore examples gen dir

* add .vscode/extensions.json

* remove packageManager field

* fmt

* fix audit

* taplo ignore permissions autogenerated files

* remove create dummy dist

* fix prettier workflow

* install fmt in prettier workflow

---------

Co-authored-by: Lucas Nogueira <lucas@tauri.app>
This commit is contained in:
Amr Bashir
2024-09-04 14:54:23 +03:00
committed by GitHub
parent 72c2ce82c1
commit cf4d7d4e6c
227 changed files with 2534 additions and 2505 deletions
+3 -3
View File
@@ -10,11 +10,11 @@ repository = { workspace = true }
links = "tauri-plugin-cli"
[package.metadata.docs.rs]
rustc-args = [ "--cfg", "docsrs" ]
rustdoc-args = [ "--cfg", "docsrs" ]
rustc-args = ["--cfg", "docsrs"]
rustdoc-args = ["--cfg", "docsrs"]
[build-dependencies]
tauri-plugin = { workspace = true, features = [ "build" ] }
tauri-plugin = { workspace = true, features = ["build"] }
[dependencies]
serde = { workspace = true }
+6 -6
View File
@@ -67,16 +67,16 @@ fn main() {
Afterwards all the plugin's APIs are available through the JavaScript guest bindings:
```javascript
import { getMatches } from "@tauri-apps/plugin-cli";
const matches = await getMatches();
if (matches.subcommand?.name === "run") {
import { getMatches } from '@tauri-apps/plugin-cli'
const matches = await getMatches()
if (matches.subcommand?.name === 'run') {
// `./your-app run $ARGS` was executed
const args = matches.subcommand?.matches.args;
if ("debug" in args) {
const args = matches.subcommand?.matches.args
if ('debug' in args) {
// `./your-app run --debug` was executed
}
} else {
const args = matches.args;
const args = matches.args
// `./your-app $ARGS` was executed
}
```
+1 -1
View File
@@ -20,4 +20,4 @@ We prefer to receive reports in English.
Please disclose a vulnerability or security relevant issue here: [https://github.com/tauri-apps/plugins-workspace/security/advisories/new](https://github.com/tauri-apps/plugins-workspace/security/advisories/new).
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
Alternatively, you can also contact us by email via [security@tauri.app](mailto:security@tauri.app).
+10 -10
View File
@@ -8,7 +8,7 @@
* @module
*/
import { invoke } from "@tauri-apps/api/core";
import { invoke } from '@tauri-apps/api/core'
/**
* @since 2.0.0
@@ -19,27 +19,27 @@ interface ArgMatch {
* boolean if flag
* string[] or null if takes multiple values
*/
value: string | boolean | string[] | null;
value: string | boolean | string[] | null
/**
* Number of occurrences
*/
occurrences: number;
occurrences: number
}
/**
* @since 2.0.0
*/
interface SubcommandMatch {
name: string;
matches: CliMatches;
name: string
matches: CliMatches
}
/**
* @since 2.0.0
*/
interface CliMatches {
args: Record<string, ArgMatch>;
subcommand: SubcommandMatch | null;
args: Record<string, ArgMatch>
subcommand: SubcommandMatch | null
}
/**
@@ -64,9 +64,9 @@ interface CliMatches {
* @since 2.0.0
*/
async function getMatches(): Promise<CliMatches> {
return await invoke("plugin:cli|cli_matches");
return await invoke('plugin:cli|cli_matches')
}
export type { ArgMatch, SubcommandMatch, CliMatches };
export type { ArgMatch, SubcommandMatch, CliMatches }
export { getMatches };
export { getMatches }
+2 -2
View File
@@ -2,6 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
import { createConfig } from "../../shared/rollup.config.js";
import { createConfig } from '../../shared/rollup.config.js'
export default createConfig();
export default createConfig()