From 2fa5fecc7c97667b314a882ee8a16d5fc61f362b Mon Sep 17 00:00:00 2001 From: xyny Date: Mon, 13 May 2024 20:15:03 +0300 Subject: [PATCH] refactor: split into src-web and src-tsp folders --- buildWeb.js | 4 ++-- package.json | 2 +- main.tsp => src-tsp/main.tsp | 0 modules.tsp => src-tsp/modules.tsp | 0 _headers => src-web/_headers | 0 template-index.html => src-web/template-index.html | 0 6 files changed, 3 insertions(+), 3 deletions(-) rename main.tsp => src-tsp/main.tsp (100%) rename modules.tsp => src-tsp/modules.tsp (100%) rename _headers => src-web/_headers (100%) rename template-index.html => src-web/template-index.html (100%) diff --git a/buildWeb.js b/buildWeb.js index 522055a..e7efe29 100644 --- a/buildWeb.js +++ b/buildWeb.js @@ -10,7 +10,7 @@ fs.existsSync(buildDir) && fs.rmSync(buildDir, { recursive: true }); fs.mkdirSync(buildDir) fs.mkdirSync(`${buildDir}/modules`); -fs.copyFileSync('./_headers', `${buildDir}/_headers`); +fs.copyFileSync('./src-web/_headers', `${buildDir}/_headers`); const ids = [] @@ -26,7 +26,7 @@ fs.readdirSync(sourceDir).forEach((file) => { console.log("Files built: " + ids.join(', ')) console.log("Generating index.html...") -const template = fs.readFileSync('./template-index.html').toString() +const template = fs.readFileSync('./src-web/template-index.html').toString() const indexHtml = template.replace( '%DYNAMIC_SCHEMA_LIST%', ids.map( diff --git a/package.json b/package.json index 1a0dad1..5b54a0b 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "private": true, "scripts": { - "build": "rm -rf ./tsp-output && npx tsp compile .", + "build": "rm -rf ./tsp-output && npx tsp compile ./src-tsp", "build-web": "npm run build && node ./buildWeb.js" } } diff --git a/main.tsp b/src-tsp/main.tsp similarity index 100% rename from main.tsp rename to src-tsp/main.tsp diff --git a/modules.tsp b/src-tsp/modules.tsp similarity index 100% rename from modules.tsp rename to src-tsp/modules.tsp diff --git a/_headers b/src-web/_headers similarity index 100% rename from _headers rename to src-web/_headers diff --git a/template-index.html b/src-web/template-index.html similarity index 100% rename from template-index.html rename to src-web/template-index.html