From 0a701e4d1372e347e79531d2ae1bc1ce05424b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=81=BC=E3=81=84=E3=82=93?= <50550561+Robot-Inventor@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:50:17 +0900 Subject: [PATCH] fix: convert changeManifestVersion.js to TypeScript #253 (#254) --- package.json | 4 ++-- ...geManifestVersion.js => changeManifestVersion.ts} | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) rename script/{changeManifestVersion.js => changeManifestVersion.ts} (72%) diff --git a/package.json b/package.json index ab85254a..b4ab4b12 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "npm run format && ts-node ./script/build.ts", "package": "ts-node ./script/package.ts", "version": "npm run build && npm run package && git add .", - "switchManifest": "node ./script/changeManifestVersion.js" + "switchManifest": "ts-node ./script/changeManifestVersion.ts" }, "repository": { "type": "git", @@ -56,4 +56,4 @@ "@types/webextension-polyfill": "^0.10.4", "knip": "^2.25.2" } -} +} \ No newline at end of file diff --git a/script/changeManifestVersion.js b/script/changeManifestVersion.ts similarity index 72% rename from script/changeManifestVersion.js rename to script/changeManifestVersion.ts index d681b914..ccccc52b 100644 --- a/script/changeManifestVersion.js +++ b/script/changeManifestVersion.ts @@ -1,18 +1,18 @@ -const fs = require("fs"); +import fs from "fs"; -const packageJson = require("../package.json"); -const manifestV2 = require("../manifest/v2.json"); -const manifestV3 = require("../manifest/v3.json"); +import packageJson from "../package.json"; +import manifestV2 from "../manifest/v2.json"; +import manifestV3 from "../manifest/v3.json"; const { version } = packageJson; const arg = process.argv[2]; -if (arg == 2) { +if (arg == "2") { manifestV2.version = version; const manifestText = JSON.stringify(manifestV2, null, 4); fs.writeFileSync("./manifest.json", manifestText); console.log(`Switched to manifest v${arg}.`); -} else if (arg == 3) { +} else if (arg == "3") { manifestV3.version = version; const manifestText = JSON.stringify(manifestV3, null, 4); fs.writeFileSync("./manifest.json", manifestText);