From 90f69bdd9378e9fecc7d32f1f308c231b24ecac9 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 9 Feb 2023 16:19:08 +0100 Subject: [PATCH] Move webmanifest files into 'public' directory --- .gitignore | 2 ++ scripts/generateLayouts.ts | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 6770a760a..3eea34f06 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ service-worker.js # Built Visual Studio Code Extensions *.vsix +public/*.webmanifest +public/assets/generated/ diff --git a/scripts/generateLayouts.ts b/scripts/generateLayouts.ts index 0655ee029..3d4bf282e 100644 --- a/scripts/generateLayouts.ts +++ b/scripts/generateLayouts.ts @@ -23,7 +23,7 @@ async function createIcon(iconPath: string, size: number, alreadyWritten: string name = name.substr(2) } - const newname = `assets/generated/images/${name.replace(/\//g, "_")}${size}.png` + const newname = `public/assets/generated/images/${name.replace(/\//g, "_")}${size}.png` if (alreadyWritten.indexOf(newname) >= 0) { return newname @@ -60,7 +60,7 @@ async function createSocialImage(layout: LayoutConfig, template: "" | "Wide"): P ) return undefined } - const path = `./assets/generated/images/social_image_${layout.id}_${template}.svg` + const path = `./public/assets/generated/images/social_image_${layout.id}_${template}.svg` if (existsSync(path)) { return path } @@ -121,7 +121,7 @@ async function createManifest( // This is an svg. Lets create the needed pngs and do some checkes! const whiteBackgroundPath = - "./assets/generated/images/theme_" + layout.id + "_white_background.svg" + "./public/assets/generated/images/theme_" + layout.id + "_white_background.svg" { const svg = await ScriptUtils.ReadSvg(icon) const width: string = svg.$.width @@ -136,7 +136,7 @@ async function createManifest( let path = layout.icon if (layout.icon.startsWith("<")) { // THis is already the svg - path = "./assets/generated/images/" + layout.id + "_logo.svg" + path = "./public/assets/generated/images/" + layout.id + "_logo.svg" writeFileSync(path, layout.icon) } @@ -235,7 +235,7 @@ async function createLandingPage(layout: LayoutConfig, manifest, whiteIcons, alr let icon = layout.icon if (icon.startsWith(" { createDir("./assets/generated") createDir("./assets/generated/layers") createDir("./assets/generated/themes") - createDir("./assets/generated/images") + createDir("./public/assets/") + createDir("./public/assets/generated") + createDir("./public/assets/generated/images") const blacklist = [ "",