mirror of
https://github.com/tauri-apps/tauri.git
synced 2025-01-01 23:42:33 +03:00
fix(cta): remove tauri
dep from vanilla recipe (#1502)
This commit is contained in:
parent
345f2dbfc5
commit
3998046489
5
.changes/cta-remove-tauri-from-vanilla.md
Normal file
5
.changes/cta-remove-tauri-from-vanilla.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"create-tauri-app": patch
|
||||
---
|
||||
|
||||
Remove `tauri` dependency from vanilla recipe
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -2,8 +2,5 @@
|
||||
"name": "<%= name %>",
|
||||
"scripts": {
|
||||
"tauri": "tauri"
|
||||
},
|
||||
"dependencies": {
|
||||
"tauri": "<%= tauri_version %>"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user