Skip to content

Commit 381cb19

Browse files
committed
Refactor manifest files for consistency and update versioning script to handle errors
1 parent 9da2f7d commit 381cb19

File tree

5 files changed

+118
-141
lines changed

5 files changed

+118
-141
lines changed

manifest.firefox.json

Lines changed: 39 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
{
2-
"manifest_version": 2,
3-
"name": "Save to Are.na",
4-
"version": "0.1.1",
5-
"description": "Hover‑click any image to save it to Are.na",
6-
"icons": { "48": "icon48.png", "128": "icon128.png" },
7-
"permissions": [
8-
"storage",
9-
"activeTab",
10-
"identity",
11-
"https://api.are.na/*",
12-
"https://dev.are.na/*"
13-
],
14-
"background": {
15-
"scripts": [
16-
"src/background.js"
17-
]
18-
},
19-
"content_scripts": [
20-
{
21-
"matches": ["<all_urls>"],
22-
"js": [
23-
"src/content/core-overlay.js"
24-
]
25-
}
26-
],
27-
"browser_specific_settings": {
28-
"gecko": {
29-
30-
"strict_min_version": "109.0"
31-
}
32-
},
33-
"web_accessible_resources": [
34-
"arena-logo.svg"
2+
"manifest_version": 2,
3+
"name": "Save to Are.na",
4+
"version": "0.1.1",
5+
"description": "Hover‑click any image to save it to Are.na",
6+
"icons": {
7+
"48": "icon48.png",
8+
"128": "icon128.png"
9+
},
10+
"permissions": [
11+
"storage",
12+
"activeTab",
13+
"identity",
14+
"https://api.are.na/*",
15+
"https://dev.are.na/*"
16+
],
17+
"background": {
18+
"scripts": [
19+
"src/background.js"
3520
]
36-
}
21+
},
22+
"content_scripts": [
23+
{
24+
"matches": [
25+
"<all_urls>"
26+
],
27+
"js": [
28+
"src/content/core-overlay.js"
29+
]
30+
}
31+
],
32+
"browser_specific_settings": {
33+
"gecko": {
34+
35+
"strict_min_version": "109.0"
36+
}
37+
},
38+
"web_accessible_resources": [
39+
"arena-logo.svg"
40+
]
41+
}

manifest.json

Lines changed: 49 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,51 @@
11
{
2-
"manifest_version": 3,
3-
"name": "Save to Are.na",
4-
"version": "0.1.1",
5-
"description": "Hover‑click any image to add it to one of your Are.na boards.",
6-
"icons": { "48": "icon48.png", "128": "icon128.png" },
7-
8-
"permissions": [ "storage", "activeTab", "identity" ],
9-
"host_permissions": [ "https://api.are.na/*", "https://dev.are.na/*" ],
10-
11-
"background": { "service_worker": "src/background.ts" },
12-
13-
"content_scripts": [
14-
{
15-
"matches": ["<all_urls>"],
16-
"js": [
17-
"src/content/core-overlay.ts"
18-
]
19-
}
20-
],
21-
22-
"action": { "default_title": "Save to Are.na" },
23-
24-
"web_accessible_resources": [
25-
{
26-
"resources": [ "arena-logo.svg" ],
27-
"matches": [ "<all_urls>" ]
28-
}
29-
],
30-
31-
"browser_specific_settings": {
32-
"gecko": {
33-
34-
"strict_min_version": "109.0"
35-
}
2+
"manifest_version": 3,
3+
"name": "Save to Are.na",
4+
"version": "0.1.1",
5+
"description": "Hover‑click any image to add it to one of your Are.na boards.",
6+
"icons": {
7+
"48": "icon48.png",
8+
"128": "icon128.png"
9+
},
10+
"permissions": [
11+
"storage",
12+
"activeTab",
13+
"identity"
14+
],
15+
"host_permissions": [
16+
"https://api.are.na/*",
17+
"https://dev.are.na/*"
18+
],
19+
"background": {
20+
"service_worker": "src/background.ts"
21+
},
22+
"content_scripts": [
23+
{
24+
"matches": [
25+
"<all_urls>"
26+
],
27+
"js": [
28+
"src/content/core-overlay.ts"
29+
]
3630
}
37-
}
31+
],
32+
"action": {
33+
"default_title": "Save to Are.na"
34+
},
35+
"web_accessible_resources": [
36+
{
37+
"resources": [
38+
"arena-logo.svg"
39+
],
40+
"matches": [
41+
"<all_urls>"
42+
]
43+
}
44+
],
45+
"browser_specific_settings": {
46+
"gecko": {
47+
48+
"strict_min_version": "109.0"
49+
}
50+
}
51+
}

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"preview": "vite preview",
1010
"clean": "rm -rf dist",
1111
"update-version": "node scripts/update-version.js",
12-
"build:chrome": "pnpm clean && tsc && vite build && cd dist && zip -r -FS ../build/arena-clipper-chrome.zip . && cd ..",
13-
"build:firefox": "pnpm clean && tsc && BROWSER=firefox vite build && cd dist && zip -r -FS ../build/arena-clipper-firefox.zip . && cd .."
12+
"build:chrome": "pnpm clean && mkdir -p build && tsc && vite build && cd dist && zip -r -FS ../build/arena-clipper-chrome.zip . && cd ..",
13+
"build:firefox": "pnpm clean && mkdir -p build && tsc && BROWSER=firefox vite build && cd dist && zip -r -FS ../build/arena-clipper-firefox.zip . && cd .."
1414
},
1515
"devDependencies": {
1616
"@types/node": "^22.15.3",

release.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

scripts/update-version.js

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,31 @@ if (!newVersion) {
77
process.exit(1);
88
}
99

10-
// Update package.json
11-
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
12-
packageJson.version = newVersion;
13-
fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2) + '\n');
14-
15-
// Update manifest.json
16-
const manifestJson = JSON.parse(fs.readFileSync('./manifest.json', 'utf8'));
17-
manifestJson.version = newVersion;
18-
fs.writeFileSync('./manifest.json', JSON.stringify(manifestJson, null, 2) + '\n');
19-
20-
// Update manifest.firefox.json
21-
const manifestFirefoxJson = JSON.parse(fs.readFileSync('./manifest.firefox.json', 'utf8'));
22-
manifestFirefoxJson.version = newVersion;
23-
fs.writeFileSync('./manifest.firefox.json', JSON.stringify(manifestFirefoxJson, null, 2) + '\n');
24-
25-
console.log(`Version updated to ${newVersion} in all files`);
10+
try {
11+
// Update package.json
12+
const packagePath = './package.json';
13+
const packageContent = fs.readFileSync(packagePath, 'utf8');
14+
const packageJson = JSON.parse(packageContent);
15+
const oldVersion = packageJson.version;
16+
packageJson.version = newVersion;
17+
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2) + '\n');
18+
19+
// Update manifest.json
20+
const manifestPath = './manifest.json';
21+
const manifestContent = fs.readFileSync(manifestPath, 'utf8');
22+
const manifestJson = JSON.parse(manifestContent);
23+
manifestJson.version = newVersion;
24+
fs.writeFileSync(manifestPath, JSON.stringify(manifestJson, null, 2) + '\n');
25+
26+
// Update manifest.firefox.json
27+
const ffManifestPath = './manifest.firefox.json';
28+
const ffManifestContent = fs.readFileSync(ffManifestPath, 'utf8');
29+
const manifestFirefoxJson = JSON.parse(ffManifestContent);
30+
manifestFirefoxJson.version = newVersion;
31+
fs.writeFileSync(ffManifestPath, JSON.stringify(manifestFirefoxJson, null, 2) + '\n');
32+
33+
console.log(`✅ Version updated from ${oldVersion} to ${newVersion} in all files`);
34+
} catch (error) {
35+
console.error(`❌ Error updating version: ${error.message}`);
36+
process.exit(1);
37+
}

0 commit comments

Comments
 (0)