Switch to v2 ocean logo, archive v1, update icons, remove key for CWS upload, and add zip script
1
.gitignore
vendored
@@ -2,3 +2,4 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.log
|
*.log
|
||||||
|
*.zip
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4nOxfn7Uh3jqdKvTpngmPIzOsCvbQRamThIRxw6fswMRDflfyx2Bspxc1Aq/lQEm3ataP3GoTRCwz0h3bGJvGBu8B5Uw49AAdR6jwp5ZThAfbkBxRQmtXU8+xduji5OT2KyQKsHOj2oSjg6E05WN1vMNOdS+ehwNNCDkc/MjKBLSOdwwOpkDX0BoeC4uAmFTWFzSl/ObFSl7ViJwZVPVkvPc6F0Fxn3OTZN3uFgnT/alsHVqwojnbfC91N+oxVW/3ha869l23PhvoK68zH8Iobs+vgf8TgQOgL1x5eq9Uakn810xVaNbhJVL2I3072r1qpsAYA5ELCjSBLoi5ypLuwIDAQAB",
|
|
||||||
"name": "OpenScript",
|
"name": "OpenScript",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "A lightweight user script manager for modern browsers",
|
"description": "A lightweight user script manager for modern browsers",
|
||||||
@@ -8,6 +7,7 @@
|
|||||||
"default_popup": "src/popup.html",
|
"default_popup": "src/popup.html",
|
||||||
"default_icon": {
|
"default_icon": {
|
||||||
"16": "icons/icon-16.png",
|
"16": "icons/icon-16.png",
|
||||||
|
"32": "icons/icon-32.png",
|
||||||
"48": "icons/icon-48.png",
|
"48": "icons/icon-48.png",
|
||||||
"128": "icons/icon-128.png"
|
"128": "icons/icon-128.png"
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,7 @@
|
|||||||
],
|
],
|
||||||
"icons": {
|
"icons": {
|
||||||
"16": "icons/icon-16.png",
|
"16": "icons/icon-16.png",
|
||||||
|
"32": "icons/icon-32.png",
|
||||||
"48": "icons/icon-48.png",
|
"48": "icons/icon-48.png",
|
||||||
"128": "icons/icon-128.png"
|
"128": "icons/icon-128.png"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
"build:icons": "node scripts/generate-icons.js",
|
||||||
|
"zip": "node scripts/build-zip.js",
|
||||||
"test": "node --test"
|
"test": "node --test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lucide": "^0.475.0"
|
"lucide": "^0.475.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"adm-zip": "^0.5.18",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"postcss": "^8.4.49",
|
"postcss": "^8.4.49",
|
||||||
"sharp": "^0.33.5",
|
"sharp": "^0.33.5",
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 470 KiB After Width: | Height: | Size: 470 KiB |
BIN
public/icons/OpenScript_v2.png
Normal file
|
After Width: | Height: | Size: 1.0 MiB |
5
public/icons/README.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# OpenScript Icon Assets
|
||||||
|
|
||||||
|
- `OpenScript_v1.png`: Original monochrome terminal prompt (`> _`) concept.
|
||||||
|
- `OpenScript_v2.png`: Ocean wave terminal monogram (`>_ O`) master logo introduced for Chrome Web Store release.
|
||||||
|
- `icon-{16,32,48,128}.png`: Production extension icons generated from v2 master via `npm run build:icons`.
|
||||||
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 234 B After Width: | Height: | Size: 549 B |
BIN
public/icons/icon-32.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 553 B After Width: | Height: | Size: 2.2 KiB |
42
scripts/build-zip.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
import { execSync } from 'child_process';
|
||||||
|
import fs from 'fs';
|
||||||
|
import AdmZip from 'adm-zip';
|
||||||
|
|
||||||
|
console.log('Building OpenScript extension...');
|
||||||
|
fs.rmSync('dist', { recursive: true, force: true });
|
||||||
|
execSync('npx vite build', { stdio: 'inherit' });
|
||||||
|
|
||||||
|
// Remove unneeded master images from dist package
|
||||||
|
['dist/icons/OpenScript_v1.png', 'dist/icons/OpenScript_v2.png', 'dist/icons/logo.png'].forEach(f => {
|
||||||
|
if (fs.existsSync(f)) fs.unlinkSync(f);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Verify required files
|
||||||
|
const manifest = JSON.parse(fs.readFileSync('dist/manifest.json', 'utf8'));
|
||||||
|
const required = [
|
||||||
|
'dist/manifest.json',
|
||||||
|
`dist/${manifest.action?.default_popup || 'src/popup.html'}`,
|
||||||
|
`dist/${manifest.background?.service_worker || 'src/background.js'}`,
|
||||||
|
'dist/icons/icon-16.png',
|
||||||
|
'dist/icons/icon-32.png',
|
||||||
|
'dist/icons/icon-48.png',
|
||||||
|
'dist/icons/icon-128.png'
|
||||||
|
];
|
||||||
|
|
||||||
|
for (const path of required) {
|
||||||
|
if (!fs.existsSync(path)) throw new Error(`Missing required build file: ${path}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Package into openscript.zip
|
||||||
|
const zip = new AdmZip();
|
||||||
|
zip.addLocalFolder('dist');
|
||||||
|
zip.writeZip('openscript.zip');
|
||||||
|
|
||||||
|
const stat = fs.statSync('openscript.zip');
|
||||||
|
console.log(`\n✓ Successfully created openscript.zip (${(stat.size / 1024).toFixed(1)} KB)`);
|
||||||
|
console.log('Manifest ready:', {
|
||||||
|
name: manifest.name,
|
||||||
|
version: manifest.version,
|
||||||
|
manifest_version: manifest.manifest_version,
|
||||||
|
icons: manifest.icons
|
||||||
|
});
|
||||||
13
scripts/generate-icons.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import sharp from 'sharp';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
const src = 'public/icons/OpenScript_v2.png';
|
||||||
|
const sizes = [16, 32, 48, 128];
|
||||||
|
|
||||||
|
for (const s of sizes) {
|
||||||
|
await sharp(src)
|
||||||
|
.resize(s, s, { fit: 'contain' })
|
||||||
|
.png()
|
||||||
|
.toFile(`public/icons/icon-${s}.png`);
|
||||||
|
console.log(`✓ Generated icon-${s}.png`);
|
||||||
|
}
|
||||||