mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
several bug fixes
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import path from "node:path";
|
||||
import fs from "fs-extra";
|
||||
import { PKG_ROOT } from "../constants";
|
||||
import type { PackageManager, ProjectAddons } from "../types";
|
||||
import type { PackageManager, ProjectAddons, ProjectFrontend } from "../types";
|
||||
import { addPackageDependency } from "../utils/add-package-deps";
|
||||
import { setupTauri } from "./tauri-setup";
|
||||
|
||||
@@ -9,14 +9,17 @@ export async function setupAddons(
|
||||
projectDir: string,
|
||||
addons: ProjectAddons[],
|
||||
packageManager: PackageManager,
|
||||
frontends: ProjectFrontend[],
|
||||
) {
|
||||
const hasWebFrontend = frontends.includes("web");
|
||||
|
||||
// if (addons.includes("docker")) {
|
||||
// await setupDocker(projectDir);
|
||||
// }
|
||||
if (addons.includes("pwa")) {
|
||||
if (addons.includes("pwa") && hasWebFrontend) {
|
||||
await setupPwa(projectDir);
|
||||
}
|
||||
if (addons.includes("tauri")) {
|
||||
if (addons.includes("tauri") && hasWebFrontend) {
|
||||
await setupTauri(projectDir, packageManager);
|
||||
}
|
||||
if (addons.includes("biome")) {
|
||||
@@ -89,6 +92,10 @@ async function setupPwa(projectDir: string) {
|
||||
|
||||
const clientPackageDir = path.join(projectDir, "apps/web");
|
||||
|
||||
if (!(await fs.pathExists(clientPackageDir))) {
|
||||
return;
|
||||
}
|
||||
|
||||
addPackageDependency({
|
||||
dependencies: ["vite-plugin-pwa"],
|
||||
devDependencies: ["@vite-pwa/assets-generator"],
|
||||
|
||||
Reference in New Issue
Block a user