From 7b9fa6607bdcf9161b097e95ad68651a8db0bcb6 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Mon, 18 Mar 2024 09:40:37 +0100 Subject: [PATCH] chore(template): Replace {{name}} with PLUGIN_NAME (#1088) fixes #1052 --- shared/template/Cargo.toml | 4 ++-- shared/template/README.md | 20 ++++++++++---------- shared/template/package.json | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/shared/template/Cargo.toml b/shared/template/Cargo.toml index be8472bc..1a2deb3f 100644 --- a/shared/template/Cargo.toml +++ b/shared/template/Cargo.toml @@ -1,10 +1,10 @@ [package] -name = "tauri-plugin-{{name}}" +name = "tauri-plugin-PLUGIN_NAME" version = "1.0.0" edition = { workspace = true } authors = { workspace = true } license = { workspace = true } -links = "tauri-plugin-{{name}}" +links = "tauri-plugin-PLUGIN_NAME" [package.metadata.docs.rs] rustc-args = [ "--cfg", "docsrs" ] diff --git a/shared/template/README.md b/shared/template/README.md index 920f5f8c..0bd82b56 100644 --- a/shared/template/README.md +++ b/shared/template/README.md @@ -1,4 +1,4 @@ -![{{plugin-name}}](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/{{plugin-name}}/banner.png) +![PLUGIN_NAME](https://github.com/tauri-apps/plugins-workspace/raw/v2/plugins/PLUGIN_NAME/banner.png) @@ -18,9 +18,9 @@ Install the Core plugin by adding the following to your `Cargo.toml` file: ```toml [dependencies] -tauri-plugin-{{plugin-name}} = "2.0.0-beta" +tauri-plugin-PLUGIN_NAME = "2.0.0-beta" # alternatively with Git: -tauri-plugin-{{plugin-name}} = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } +tauri-plugin-PLUGIN_NAME = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" } ``` You can install the JavaScript Guest bindings using your preferred JavaScript package manager: @@ -30,18 +30,18 @@ You can install the JavaScript Guest bindings using your preferred JavaScript pa ```sh -pnpm add @tauri-apps/plugin-{{plugin-name}} +pnpm add @tauri-apps/plugin-PLUGIN_NAME # or -npm add @tauri-apps/plugin-{{plugin-name}} +npm add @tauri-apps/plugin-PLUGIN_NAME # or -yarn add @tauri-apps/plugin-{{plugin-name}} +yarn add @tauri-apps/plugin-PLUGIN_NAME # alternatively with Git: -pnpm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +pnpm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -npm add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +npm add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 # or -yarn add https://github.com/tauri-apps/tauri-plugin-{{plugin-name}}#v2 +yarn add https://github.com/tauri-apps/tauri-plugin-PLUGIN_NAME#v2 ``` ## Usage @@ -53,7 +53,7 @@ First you need to register the core plugin with Tauri: ```rust fn main() { tauri::Builder::default() - .plugin(tauri_plugin_{{plugin-name}}::init()) + .plugin(tauri_plugin_PLUGIN_NAME::init()) .run(tauri::generate_context!()) .expect("error while running tauri application"); } diff --git a/shared/template/package.json b/shared/template/package.json index caf348a4..542a1cb6 100644 --- a/shared/template/package.json +++ b/shared/template/package.json @@ -1,5 +1,5 @@ { - "name": "@tauri-apps/plugin-{{name}}", + "name": "@tauri-apps/plugin-PLUGIN_NAME", "version": "1.0.0", "license": "MIT or APACHE-2.0", "authors": [