From 41b644a6970f459e4956f30223886c1dcf17a6cd Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Sun, 18 Feb 2024 10:39:19 +0100 Subject: [PATCH] Build CRX file --- .forgejo/workflows/build.yaml | 4 +- .gitignore | 5 +- build.sh | 5 +- package-lock.json | 93 +++++++++++++++++++++++++++++++++++ package.json | 1 + tsconfig.json | 1 + 6 files changed, 102 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 96da19d..94fc9e6 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -4,8 +4,6 @@ jobs: build: runs-on: debian-12 steps: - - name: Install zip - run: apt-get update && apt-get install zip - name: Checkout uses: actions/checkout@v4 - name: Install dependencies @@ -16,4 +14,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: Proxy Settings Extension - path: proxy-settings.zip + path: proxy-settings.crx diff --git a/.gitignore b/.gitignore index 54bcd51..6a3a306 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules -*.js -proxy-settings.zip +out +key.pem +proxy-settings.crx diff --git a/build.sh b/build.sh index f0ef4d1..7d38385 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,6 @@ #!/bin/sh set -e +rm -rf out proxy-settings.crx npx tsc -rm -f proxy-settings.zip -zip proxy-settings manifest.json *.html *.js +cp manifest.json *.html out +npx crx3 -p key.pem -o proxy-settings.crx out diff --git a/package-lock.json b/package-lock.json index 34d651a..34c26f5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.1", "devDependencies": { "@types/chrome": "^0.0.260", + "crx3": "^1.1.3", "typescript": "^5.3.3" } }, @@ -43,6 +44,89 @@ "integrity": "sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==", "dev": true }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/crx3": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/crx3/-/crx3-1.1.3.tgz", + "integrity": "sha512-E4c3y/2ak83wAGN4h9Q8j3A2ii4bpRVf2vxinYYy+wJs8pyscMfEnKGzhgngZcRfOhUMr7/sxzy+lTZmQ/4KpQ==", + "dev": true, + "dependencies": { + "mri": "^1.1.6", + "pbf": "^3.2.1", + "yazl": "^2.5.1" + }, + "bin": { + "crx3": "bin/crx3.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/pbf": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", + "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "dev": true, + "dependencies": { + "ieee754": "^1.1.12", + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" + } + }, + "node_modules/protocol-buffers-schema": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", + "integrity": "sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==", + "dev": true + }, + "node_modules/resolve-protobuf-schema": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/resolve-protobuf-schema/-/resolve-protobuf-schema-2.1.0.tgz", + "integrity": "sha512-kI5ffTiZWmJaS/huM8wZfEMer1eRd7oJQhDuxeCLe3t7N7mX3z94CN0xPxBQxFYQTSNz9T0i+v6inKqSdK8xrQ==", + "dev": true, + "dependencies": { + "protocol-buffers-schema": "^3.3.1" + } + }, "node_modules/typescript": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", @@ -55,6 +139,15 @@ "engines": { "node": ">=14.17" } + }, + "node_modules/yazl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yazl/-/yazl-2.5.1.tgz", + "integrity": "sha512-phENi2PLiHnHb6QBVot+dJnaAZ0xosj7p3fWl+znIjBDlnMI2PsZCJZ306BPTFOaHf5qdDEI8x5qFrSOBN5vrw==", + "dev": true, + "dependencies": { + "buffer-crc32": "~0.2.3" + } } } } diff --git a/package.json b/package.json index 37ac343..8675ef9 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "devDependencies": { "@types/chrome": "^0.0.260", + "crx3": "^1.1.3", "typescript": "^5.3.3" } } diff --git a/tsconfig.json b/tsconfig.json index a699872..b40a78a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "target": "es2022", + "outDir": "out", "strict": true } }