diff --git a/README.md b/README.md index 9217aca..5050698 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ npm run write:latest 2. 打开 `chrome://extensions` 3. 打开右上角 `开发者模式` 4. 点击 `加载已解压的扩展程序` -5. 选择解压后的插件文件夹 +5. 选择解压后的 `dist/` 文件夹 安装后请确认扩展 ID 是: diff --git a/docs/internal-extension-distribution.md b/docs/internal-extension-distribution.md index b2f3cb9..ee34115 100644 --- a/docs/internal-extension-distribution.md +++ b/docs/internal-extension-distribution.md @@ -73,7 +73,7 @@ The pipeline uses the tag as the release version. Recommended format: `0.MMDD.N` 2. Open `chrome://extensions`. 3. Enable developer mode. 4. Click `Load unpacked`. -5. Select the unzipped folder. +5. Select the unzipped `dist/` folder. 6. Confirm the extension ID is `pkjopdibdnomhogjheclhnknmejccffg`. ## Notes diff --git a/docs/【超简单版】插件安装使用指南.md b/docs/【超简单版】插件安装使用指南.md index c4de7ce..cfd4689 100644 --- a/docs/【超简单版】插件安装使用指南.md +++ b/docs/【超简单版】插件安装使用指南.md @@ -18,9 +18,9 @@ 1. 在桌面上找到这个压缩包 2. **右键** → 选择"解压到当前文件夹"(或"Extract Here") -3. 会多出一个文件夹,名字类似 `star-chart-search-enhancer-internal` +3. 会多出一个文件夹,名字是 `dist` -⚠️ **重要**:这个文件夹要一直放在桌面,不要删、不要改名 +⚠️ **重要**:这个 `dist` 文件夹要一直放在桌面,不要删、不要改名 --- @@ -37,9 +37,9 @@ 4. 点击左上角出现的 **"加载已解压的扩展程序"** -5. 选择刚才解压出来的插件文件夹 +5. 选择刚才解压出来的 `dist` 文件夹 - ⚠️ **重要**:如果文件夹里能看到 `manifest.json`、`content`、`background`、`popup` 这些文件和文件夹,说明选对了。 + ⚠️ **重要**:如果 `dist` 文件夹里能看到 `manifest.json`、`content`、`background`、`popup` 这些文件和文件夹,说明选对了。 6. 看到绿色的插件卡片出现,就装好了! @@ -122,7 +122,7 @@ https://xingtu.cn/ad/creator/market - 解压下载到的新版本 zip - 打开 `chrome://extensions` - 找到 `Star Chart Search Enhancer` -- 点击 **"重新加载"**,或重新选择解压后的新插件文件夹 +- 点击 **"重新加载"**,或重新选择解压后的 `dist` 文件夹 --- @@ -138,7 +138,7 @@ https://xingtu.cn/ad/creator/market ⚠️ **如果重新加载后还是旧版本**: - 先点击插件卡片的 **"移除"** 删除旧版本 - 然后重新点击 **"加载已解压的扩展程序"** -- 再次选择新解压出来的插件文件夹 +- 再次选择新解压出来的 `dist` 文件夹 --- diff --git a/release/star-chart-search-enhancer-internal.zip b/release/star-chart-search-enhancer-internal.zip index 168e3fd..df5a270 100644 Binary files a/release/star-chart-search-enhancer-internal.zip and b/release/star-chart-search-enhancer-internal.zip differ diff --git a/scripts/package-release-archive.mjs b/scripts/package-release-archive.mjs index c426ca7..b359c19 100644 --- a/scripts/package-release-archive.mjs +++ b/scripts/package-release-archive.mjs @@ -6,7 +6,7 @@ import yazl from "yazl"; export async function createReleaseArchive({ archivePath, - rootDirName = "star-chart-search-enhancer-internal", + rootDirName = "dist", sourceDir }) { const zip = new yazl.ZipFile(); diff --git a/tests/package-release-archive.test.ts b/tests/package-release-archive.test.ts index 2411ae9..242b1a8 100644 --- a/tests/package-release-archive.test.ts +++ b/tests/package-release-archive.test.ts @@ -6,7 +6,7 @@ import { describe, expect, test } from "vitest"; import { createReleaseArchive } from "../scripts/package-release-archive.mjs"; describe("package-release-archive", () => { - test("creates a zip archive with a top-level release folder", async () => { + test("creates a zip archive with a top-level dist folder", async () => { const tempDir = await mkdtemp(path.join(os.tmpdir(), "release-archive-")); const sourceDir = path.join(tempDir, "source"); const archivePath = path.join(tempDir, "archive.zip"); @@ -21,8 +21,6 @@ describe("package-release-archive", () => { const archive = await readFile(archivePath); expect(archive.byteLength).toBeGreaterThan(0); - expect(archive.toString("utf8")).toContain( - "star-chart-search-enhancer-internal/hello.txt" - ); + expect(archive.toString("utf8")).toContain("dist/hello.txt"); }); });