From 399804648924139c6240351a76812a3071b51f65 Mon Sep 17 00:00:00 2001 From: Amr Bashir <48618675+amrbashir@users.noreply.github.com> Date: Thu, 15 Apr 2021 03:05:16 +0200 Subject: [PATCH] fix(cta): remove `tauri` dep from vanilla recipe (#1502) --- .changes/cta-remove-tauri-from-vanilla.md | 5 +++ .../create-tauri-app/src/recipes/vanilla.ts | 43 ++++++------------- .../src/templates/vanilla/_package.json | 3 -- 3 files changed, 19 insertions(+), 32 deletions(-) create mode 100644 .changes/cta-remove-tauri-from-vanilla.md diff --git a/.changes/cta-remove-tauri-from-vanilla.md b/.changes/cta-remove-tauri-from-vanilla.md new file mode 100644 index 000000000..20d9868a4 --- /dev/null +++ b/.changes/cta-remove-tauri-from-vanilla.md @@ -0,0 +1,5 @@ +--- +"create-tauri-app": patch +--- + +Remove `tauri` dependency from vanilla recipe diff --git a/tooling/create-tauri-app/src/recipes/vanilla.ts b/tooling/create-tauri-app/src/recipes/vanilla.ts index 326c7ec82..2e17fb197 100644 --- a/tooling/create-tauri-app/src/recipes/vanilla.ts +++ b/tooling/create-tauri-app/src/recipes/vanilla.ts @@ -3,11 +3,9 @@ // SPDX-License-Identifier: MIT import { Recipe } from ".."; -import { TauriBuildConfig } from "../types/config"; import { join } from "path"; //@ts-ignore import scaffe from "scaffe"; -import { shell } from "../shell"; export const vanillajs: Recipe = { descriptiveName: "Vanilla.js", @@ -24,11 +22,20 @@ export const vanillajs: Recipe = { extraNpmDevDependencies: [], extraNpmDependencies: [], preInit: async ({ cwd, cfg }) => { - const version = await shell("npm", ["view", "tauri", "version"], { - stdio: "pipe", - }); - const versionNumber = version.stdout.trim(); - await run(cfg, cwd, versionNumber); + const { appName } = cfg; + const templateDir = join(__dirname, "../src/templates/vanilla"); + const variables = { + name: appName, + }; + + try { + await scaffe.generate(templateDir, join(cwd, appName), { + overwrite: true, + variables, + }); + } catch (err) { + console.log(err); + } }, postInit: async ({ cfg, packageManager }) => { const setApp = @@ -53,25 +60,3 @@ run the app: `); }, }; - -export const run = async ( - args: TauriBuildConfig, - cwd: string, - version: string -) => { - const { appName } = args; - const templateDir = join(__dirname, "../src/templates/vanilla"); - const variables = { - name: appName, - tauri_version: version, - }; - - try { - await scaffe.generate(templateDir, join(cwd, appName), { - overwrite: true, - variables, - }); - } catch (err) { - console.log(err); - } -}; diff --git a/tooling/create-tauri-app/src/templates/vanilla/_package.json b/tooling/create-tauri-app/src/templates/vanilla/_package.json index 4059c5e4b..8e9baa17e 100644 --- a/tooling/create-tauri-app/src/templates/vanilla/_package.json +++ b/tooling/create-tauri-app/src/templates/vanilla/_package.json @@ -2,8 +2,5 @@ "name": "<%= name %>", "scripts": { "tauri": "tauri" - }, - "dependencies": { - "tauri": "<%= tauri_version %>" } }