no message

This commit is contained in:
yinjun.chen1
2026-09-18 09:41:27 +08:00
parent bca3006142
commit 46154cb8db
5 changed files with 39 additions and 12 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "__MSG_appTitle__",
"version": "1.0.0",
"version": "1.0.2",
"description": "__MSG_extDescription__",
"default_locale": "zh_CN",
"permissions": ["storage", "activeTab", "scripting", "sidePanel", "bookmarks"],
+13 -2
View File
@@ -1,15 +1,16 @@
{
"name": "auto-login",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "auto-login",
"version": "1.0.0",
"version": "1.0.1",
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/chrome": "^0.0.287",
"adm-zip": "^0.6.1",
"esbuild": "^0.28.2",
"eslint": "^10.10.0",
"globals": "^17.12.0",
@@ -1234,6 +1235,16 @@
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
}
},
"node_modules/adm-zip": {
"version": "0.6.1",
"resolved": "http://218.61.196.156:11691/adm-zip/-/adm-zip-0.6.1.tgz",
"integrity": "sha512-Xwrja8nx9e5o2N1my4DsKCeKpdrnACyr1wtbPxBDgGzKzKyE9kRtBFA8mWldI+RVlD7CBZNWY/wQ2+ydwOR6kQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=14.0"
}
},
"node_modules/ajv": {
"version": "6.15.0",
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.15.0.tgz",
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "auto-login",
"version": "1.0.0",
"version": "1.0.2",
"description": "Auto Login Manager Chrome Extension",
"private": true,
"scripts": {
@@ -20,6 +20,7 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/chrome": "^0.0.287",
"adm-zip": "^0.6.1",
"esbuild": "^0.28.2",
"eslint": "^10.10.0",
"globals": "^17.12.0",
+22 -7
View File
@@ -8,10 +8,10 @@
* node scripts/package.mjs 构建并打包
* node scripts/package.mjs --skip-build 仅打包(复用现有 dist)
*/
import { execFileSync } from "node:child_process";
import { mkdir, readFile, rm } from "node:fs/promises";
import { mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import AdmZip from "adm-zip";
import { buildAll } from "./build.mjs";
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
@@ -19,6 +19,19 @@ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
/** 扩展包内容:manifest 及其引用的所有运行时资源 */
const PACKAGE_FILES = ["manifest.json", "popup.html", "popup.css", "icons", "_locales", "dist"];
/** 递归收集待打包文件,zip 内条目路径统一用正斜杠(Chrome Web Store 要求) */
async function collectFiles(rel, out) {
const full = path.join(ROOT, rel);
const s = await stat(full);
if (s.isDirectory()) {
for (const name of await readdir(full)) {
await collectFiles(`${rel}/${name}`, out);
}
} else {
out.push(rel);
}
}
export async function packageExtension({ skipBuild = false } = {}) {
if (!skipBuild) await buildAll({ release: true });
@@ -29,13 +42,15 @@ export async function packageExtension({ skipBuild = false } = {}) {
const zipPath = path.join(outDir, `auto-login-v${manifest.version}.zip`);
await rm(zipPath, { force: true });
try {
execFileSync("zip", ["-r", "-q", zipPath, ...PACKAGE_FILES], { cwd: ROOT, stdio: "inherit" });
} catch (err) {
throw new Error(`打包失败(需要系统 zip 命令):${err.message}`, { cause: err });
const files = [];
for (const f of PACKAGE_FILES) await collectFiles(f, files);
const zip = new AdmZip();
for (const rel of files.sort()) {
zip.addFile(rel, await readFile(path.join(ROOT, rel)));
}
zip.writeZip(zipPath);
console.log(`[package] v${manifest.version} → ${path.relative(ROOT, zipPath)}`);
console.log(`[package] v${manifest.version} → ${path.relative(ROOT, zipPath)}(${files.length} 个文件)`);
return { version: manifest.version, zipPath };
}
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='dpcmpkmjkcenjpfcmkoohkcnhbomgmej'>
<updatecheck codebase='file:///E:/gitea/Chrome%20extension/auto-login.crx' version='1.0.0' />
<updatecheck codebase='file:///E:/gitea/Chrome%20extension/auto-login.crx' version='1.0.2' />
</app>
</gupdate>