no message
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "__MSG_appTitle__",
|
"name": "__MSG_appTitle__",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"description": "__MSG_extDescription__",
|
"description": "__MSG_extDescription__",
|
||||||
"default_locale": "zh_CN",
|
"default_locale": "zh_CN",
|
||||||
"permissions": ["storage", "activeTab", "scripting", "sidePanel", "bookmarks"],
|
"permissions": ["storage", "activeTab", "scripting", "sidePanel", "bookmarks"],
|
||||||
|
|||||||
Generated
+13
-2
@@ -1,15 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "auto-login",
|
"name": "auto-login",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "auto-login",
|
"name": "auto-login",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/chrome": "^0.0.287",
|
"@types/chrome": "^0.0.287",
|
||||||
|
"adm-zip": "^0.6.1",
|
||||||
"esbuild": "^0.28.2",
|
"esbuild": "^0.28.2",
|
||||||
"eslint": "^10.10.0",
|
"eslint": "^10.10.0",
|
||||||
"globals": "^17.12.0",
|
"globals": "^17.12.0",
|
||||||
@@ -1234,6 +1235,16 @@
|
|||||||
"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
"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": {
|
"node_modules/ajv": {
|
||||||
"version": "6.15.0",
|
"version": "6.15.0",
|
||||||
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.15.0.tgz",
|
"resolved": "https://registry.npmmirror.com/ajv/-/ajv-6.15.0.tgz",
|
||||||
|
|||||||
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "auto-login",
|
"name": "auto-login",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"description": "Auto Login Manager Chrome Extension",
|
"description": "Auto Login Manager Chrome Extension",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/chrome": "^0.0.287",
|
"@types/chrome": "^0.0.287",
|
||||||
|
"adm-zip": "^0.6.1",
|
||||||
"esbuild": "^0.28.2",
|
"esbuild": "^0.28.2",
|
||||||
"eslint": "^10.10.0",
|
"eslint": "^10.10.0",
|
||||||
"globals": "^17.12.0",
|
"globals": "^17.12.0",
|
||||||
|
|||||||
+22
-7
@@ -8,10 +8,10 @@
|
|||||||
* node scripts/package.mjs 构建并打包
|
* node scripts/package.mjs 构建并打包
|
||||||
* node scripts/package.mjs --skip-build 仅打包(复用现有 dist)
|
* node scripts/package.mjs --skip-build 仅打包(复用现有 dist)
|
||||||
*/
|
*/
|
||||||
import { execFileSync } from "node:child_process";
|
import { mkdir, readFile, readdir, rm, stat } from "node:fs/promises";
|
||||||
import { mkdir, readFile, rm } from "node:fs/promises";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import { fileURLToPath, pathToFileURL } from "node:url";
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
||||||
|
import AdmZip from "adm-zip";
|
||||||
import { buildAll } from "./build.mjs";
|
import { buildAll } from "./build.mjs";
|
||||||
|
|
||||||
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
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 及其引用的所有运行时资源 */
|
/** 扩展包内容:manifest 及其引用的所有运行时资源 */
|
||||||
const PACKAGE_FILES = ["manifest.json", "popup.html", "popup.css", "icons", "_locales", "dist"];
|
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 } = {}) {
|
export async function packageExtension({ skipBuild = false } = {}) {
|
||||||
if (!skipBuild) await buildAll({ release: true });
|
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`);
|
const zipPath = path.join(outDir, `auto-login-v${manifest.version}.zip`);
|
||||||
await rm(zipPath, { force: true });
|
await rm(zipPath, { force: true });
|
||||||
|
|
||||||
try {
|
const files = [];
|
||||||
execFileSync("zip", ["-r", "-q", zipPath, ...PACKAGE_FILES], { cwd: ROOT, stdio: "inherit" });
|
for (const f of PACKAGE_FILES) await collectFiles(f, files);
|
||||||
} catch (err) {
|
const zip = new AdmZip();
|
||||||
throw new Error(`打包失败(需要系统 zip 命令):${err.message}`, { cause: err });
|
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 };
|
return { version: manifest.version, zipPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
<?xml version='1.0' encoding='UTF-8'?>
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
|
||||||
<app appid='dpcmpkmjkcenjpfcmkoohkcnhbomgmej'>
|
<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>
|
</app>
|
||||||
</gupdate>
|
</gupdate>
|
||||||
|
|||||||
Reference in New Issue
Block a user