Skip to content

Commit fa8fd50

Browse files
darkwebdevclaude
andcommitted
Release v1.4.0
- Update version to 1.4.0 - Dual badge injection in two locations on product pages - Amazon-native badge implementation with exact HTML structure - Firefox popover width fix for better readability - Performance optimizations (100ms polling, 2s timeout) - Update tests to match new FREE Returns detection behavior - Improve release skill with intelligent version suggestion Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e483baa commit fa8fd50

4 files changed

Lines changed: 160 additions & 63 deletions

File tree

.claude/skills/release/SKILL.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Release Skill
2+
3+
IMPORTANT: This skill MUST execute all steps automatically using tools. DO NOT just describe what to do.
4+
5+
## Activation
6+
7+
User types: "release", "create a release", "prepare release", "publish", or "release new version"
8+
9+
## Execution Steps
10+
11+
Execute IN ORDER:
12+
13+
### Step 1: Read Current Version
14+
15+
```bash
16+
# Read package.json
17+
Read tool on package.json
18+
Parse "version" field
19+
```
20+
21+
### Step 2: Analyze Changes Since Last Release
22+
23+
```bash
24+
# Get latest tag
25+
git describe --tags --abbrev=0
26+
27+
# Get commits since last tag
28+
git log <last-tag>..HEAD --oneline
29+
30+
# Get full commit messages for analysis
31+
git log <last-tag>..HEAD --pretty=format:"%s%n%b"
32+
```
33+
34+
Analyze the commits to determine change type:
35+
- **Patch** (bug fixes): Commits with "fix", "bug", "patch", "optimize", performance improvements
36+
- **Minor** (new features): Commits with "add", "implement", "feature", "update" (non-breaking)
37+
- **Major** (breaking changes): Commits with "breaking", "remove", major refactors
38+
39+
Based on analysis, suggest the recommended version.
40+
41+
### Step 3: Ask for New Version
42+
43+
Use AskUserQuestion tool with recommendation.
44+
45+
IMPORTANT: Put the RECOMMENDED option FIRST in the options list.
46+
47+
Example for Minor release recommendation:
48+
```json
49+
{
50+
"questions": [{
51+
"question": "What version would you like to release?\n\nCurrent: {CURRENT}\nRecommended: {MINOR} based on {REASON}",
52+
"header": "Version",
53+
"multiSelect": false,
54+
"options": [
55+
{"label": "{MINOR} (Minor) - Recommended", "description": "New features: {FEATURE_COMMITS}"},
56+
{"label": "{PATCH} (Patch)", "description": "Bug fixes: {PATCH_COMMITS}"},
57+
{"label": "{MAJOR} (Major)", "description": "Breaking changes: {BREAKING_COMMITS}"},
58+
{"label": "Custom", "description": "Enter custom version"}
59+
]
60+
}]
61+
}
62+
```
63+
64+
Add "- Recommended" suffix to the suggested option label and place it FIRST.
65+
66+
If user selects "Custom", ask again for the custom version number.
67+
68+
### Step 4: Update Version Files
69+
70+
Use Edit tool to update:
71+
1. `package.json` - change "version" field
72+
2. `src/manifest.json` - change "version" field
73+
74+
### Step 5: Run Tests
75+
76+
```bash
77+
yarn test
78+
```
79+
80+
If tests fail, ABORT and show errors.
81+
82+
### Step 6: Build Packages
83+
84+
```bash
85+
# Build Chrome and Firefox packages
86+
yarn package:all
87+
88+
# Create source package
89+
zip -r amazon-returns-source.zip src/ tests/ package.json yarn.lock tsconfig.json jest.config.js webpack.config.js generate-icons.js BUILD.md ICON-ATTRIBUTION.md README.md -x "*.DS_Store"
90+
```
91+
92+
### Step 7: Commit and Tag
93+
94+
```bash
95+
# Stage files
96+
git add package.json src/manifest.json
97+
98+
# Commit
99+
git commit -m "Release v{VERSION}
100+
101+
- Update version to {VERSION}
102+
- Build browser store packages
103+
104+
Co-Authored-By: Claude <noreply@anthropic.com>"
105+
106+
# Create tag
107+
git tag v{VERSION} -m "Release v{VERSION}"
108+
```
109+
110+
### Step 8: Push to Remote
111+
112+
```bash
113+
git push
114+
git push --tags
115+
```
116+
117+
### Step 9: Verify and Report
118+
119+
```bash
120+
ls -lh amazon-returns-*.zip
121+
```
122+
123+
Display summary:
124+
```
125+
✅ Release v{VERSION} complete!
126+
127+
Created packages:
128+
- amazon-returns-chrome.zip ({SIZE})
129+
- amazon-returns-firefox.zip ({SIZE})
130+
- amazon-returns-source.zip ({SIZE})
131+
132+
Next steps:
133+
1. Upload amazon-returns-chrome.zip to Chrome Web Store
134+
2. Upload amazon-returns-firefox.zip to Firefox Add-ons
135+
3. Upload amazon-returns-source.zip when Mozilla requests source
136+
137+
Git tag v{VERSION} pushed to GitHub
138+
```
139+
140+
## Error Handling
141+
142+
- Tests fail → Abort, show output
143+
- Version invalid → Ask again
144+
- Git fails → Show error, provide manual steps
145+
- Build fails → Show errors

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amazon-returns-extension",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "Browser extension that displays return cost information on Amazon product pages (Chrome, Edge, Firefox)",
55
"packageManager": "yarn@4.6.0",
66
"scripts": {
@@ -40,7 +40,7 @@
4040
"jest-environment-jsdom": "^30.2.0",
4141
"jest-util": "^30.2.0",
4242
"jsdom": "^27.4.0",
43-
"puppeteer": "^24.36.0",
43+
"puppeteer": "^24.36.1",
4444
"style-loader": "^4.0.0",
4545
"ts-jest": "^29.4.6",
4646
"ts-loader": "^9.5.4",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Amazon Returns Cost Information",
4-
"version": "1.3.0",
4+
"version": "1.4.0",
55
"description": "Displays return cost information on Amazon product pages for US and Germany",
66
"browser_specific_settings": {
77
"gecko": {

tests/policyScraper.test.ts

Lines changed: 12 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,11 @@ describe('Policy Scraper', () => {
2828
loadFixture('amazon-com-free-returns.html');
2929
});
3030

31-
it('should detect free returns', async () => {
31+
it('should return null when Amazon shows FREE Returns', async () => {
3232
const result = await scrapeProductPagePolicy(US_REGION, 'en');
3333

34-
expect(result).not.toBeNull();
35-
expect(result!.isFreeReturn).toBe(true);
36-
expect(result!.returnCost).toBeNull();
37-
});
38-
39-
it('should detect 30-day return window', async () => {
40-
const result = await scrapeProductPagePolicy(US_REGION, 'en');
41-
42-
expect(result).not.toBeNull();
43-
expect(result!.returnWindow).toBe(30);
44-
});
45-
46-
it('should set regular return policy correctly', async () => {
47-
const result = await scrapeProductPagePolicy(US_REGION, 'en');
48-
49-
expect(result).not.toBeNull();
50-
expect(result!.regularReturnPolicy.isFree).toBe(true);
51-
expect(result!.regularReturnPolicy.cost).toBeNull();
52-
expect(result!.regularReturnPolicy.window).toBe(30);
53-
});
54-
55-
it('should set defective policy as free', async () => {
56-
const result = await scrapeProductPagePolicy(US_REGION, 'en');
57-
58-
expect(result).not.toBeNull();
59-
expect(result!.defectivePolicy.isFree).toBe(true);
60-
expect(result!.defectivePolicy.cost).toBeNull();
34+
// When Amazon displays FREE Returns badge, extension should not show anything
35+
expect(result).toBeNull();
6136
});
6237
});
6338

@@ -66,19 +41,11 @@ describe('Policy Scraper', () => {
6641
loadFixture('amazon-de-free-returns.html');
6742
});
6843

69-
it('should detect kostenlose rücksendung', async () => {
44+
it('should return null when Amazon shows FREE Returns', async () => {
7045
const result = await scrapeProductPagePolicy(DE_REGION, 'de');
7146

72-
expect(result).not.toBeNull();
73-
expect(result!.isFreeReturn).toBe(true);
74-
expect(result!.returnCost).toBeNull();
75-
});
76-
77-
it('should detect 14-day return window', async () => {
78-
const result = await scrapeProductPagePolicy(DE_REGION, 'de');
79-
80-
expect(result).not.toBeNull();
81-
expect(result!.returnWindow).toBe(14);
47+
// When Amazon displays FREE Returns badge, extension should not show anything
48+
expect(result).toBeNull();
8249
});
8350
});
8451

@@ -161,18 +128,11 @@ describe('Policy Scraper', () => {
161128
loadFixture('amazon-com-third-party-free.html');
162129
});
163130

164-
it('should detect free returns from third party', async () => {
131+
it('should return null when Amazon shows FREE Returns', async () => {
165132
const result = await scrapeProductPagePolicy(US_REGION, 'en');
166133

167-
expect(result).not.toBeNull();
168-
expect(result!.isFreeReturn).toBe(true);
169-
});
170-
171-
it('should detect extended return window (60 days)', async () => {
172-
const result = await scrapeProductPagePolicy(US_REGION, 'en');
173-
174-
expect(result).not.toBeNull();
175-
expect(result!.returnWindow).toBe(60);
134+
// When Amazon displays FREE Returns badge, extension should not show anything
135+
expect(result).toBeNull();
176136
});
177137
});
178138

@@ -237,19 +197,11 @@ describe('Policy Scraper', () => {
237197
loadFixture('amazon-com-extended-holiday.html');
238198
});
239199

240-
it('should detect free returns with extended window', async () => {
241-
const result = await scrapeProductPagePolicy(US_REGION, 'en');
242-
243-
expect(result).not.toBeNull();
244-
expect(result!.isFreeReturn).toBe(true);
245-
expect(result!.returnCost).toBeNull();
246-
});
247-
248-
it('should detect 90-day extended holiday return window', async () => {
200+
it('should return null when Amazon shows FREE Returns', async () => {
249201
const result = await scrapeProductPagePolicy(US_REGION, 'en');
250202

251-
expect(result).not.toBeNull();
252-
expect(result!.returnWindow).toBe(90);
203+
// When Amazon displays FREE Returns badge, extension should not show anything
204+
expect(result).toBeNull();
253205
});
254206
});
255207

0 commit comments

Comments
 (0)