Skip to content

Commit b26dfa6

Browse files
committed
chore: enforce LF endings via .gitattributes/.editorconfig; bump 0.1.2; scripts+assets+permissions cleanup
1 parent 6994e40 commit b26dfa6

35 files changed

+3176
-1806
lines changed

.editorconfig

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# EditorConfig helps maintain consistent coding styles between different editors and IDEs
2+
# Docs: https://editorconfig.org/
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
indent_style = space
12+
indent_size = 2
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.{yml,yaml,json,json5}]
18+
indent_size = 2
19+
20+
[*.{js,ts,css,html}]
21+
indent_size = 2
22+
23+
[Makefile]
24+
indent_style = tab

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Normalize all text files to LF in the repository
2+
* text=auto eol=lf
3+
4+
# Mark common binary files to avoid line ending conversions
5+
*.png binary
6+
*.jpg binary
7+
*.jpeg binary
8+
*.gif binary
9+
*.webp binary
10+
*.ico binary
11+
*.zip binary
12+
*.pdf binary
13+
14+
# Keep minified assets as text (still LF via the global rule)
15+
*.min.js text
16+
*.min.css text
17+
18+
# Ensure shell scripts stay LF
19+
*.sh text eol=lf
20+
21+
# Windows scripts (none currently) could use CRLF if ever added
22+
# *.bat text eol=crlf

.github/copilot-instructions.md

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

.github/workflows/build.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,26 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@v4
1818

19-
- name: Setup Python
20-
uses: actions/setup-python@v4
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
2121
with:
22-
python-version: '3.x'
22+
node-version: '18'
23+
cache: 'npm'
2324

24-
- name: Setup Just
25-
uses: extractions/setup-just@v3
25+
- name: Install dependencies
26+
run: npm ci
2627

2728
- name: Build project
28-
run: |
29-
just build-new
29+
run: npm run build
3030

3131
- name: Run tests
32-
run: |
33-
just test-comments
32+
run: npm test
3433

3534
- name: Validate project
3635
run: |
37-
just check-all
36+
# Check if build artifacts exist
37+
ls -la *.zip
38+
ls -la dist/
3839
3940
- name: Upload build artifacts
4041
uses: actions/upload-artifact@v4
@@ -50,15 +51,26 @@ jobs:
5051
id: get_version
5152
run: echo "version=$(grep '"version"' package.json | head -1 | cut -d'"' -f4)" >> $GITHUB_OUTPUT
5253

53-
- name: Upload Extension ZIP to Release
54+
- name: Upload Chrome Extension ZIP to Release
55+
if: github.event_name == 'release'
56+
uses: actions/upload-release-asset@v1
57+
env:
58+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
with:
60+
upload_url: ${{ github.event.release.upload_url }}
61+
asset_path: ./json-format-converter-chrome.zip
62+
asset_name: json-format-converter-chrome-v${{ steps.get_version.outputs.version }}.zip
63+
asset_content_type: application/zip
64+
65+
- name: Upload Firefox Extension ZIP to Release
5466
if: github.event_name == 'release'
5567
uses: actions/upload-release-asset@v1
5668
env:
5769
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5870
with:
5971
upload_url: ${{ github.event.release.upload_url }}
60-
asset_path: ./json-format-converter-extension.zip
61-
asset_name: json-format-converter-extension-v${{ steps.get_version.outputs.version }}.zip
72+
asset_path: ./json-format-converter-firefox.zip
73+
asset_name: json-format-converter-firefox-v${{ steps.get_version.outputs.version }}.zip
6274
asset_content_type: application/zip
6375

6476
- name: Upload Standalone ZIP to Release

.github/workflows/deploy.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,17 @@ jobs:
2727
- name: Checkout
2828
uses: actions/checkout@v4
2929

30-
- name: Setup Just
31-
uses: extractions/setup-just@v3
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: '18'
34+
cache: 'npm'
35+
36+
- name: Install dependencies
37+
run: npm ci
3238

3339
- name: Build project
34-
run: |
35-
just build-new
40+
run: npm run build
3641

3742
- name: Prepare GitHub Pages content
3843
run: |

.github/workflows/quality.yml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616

17-
- name: Setup Python
18-
uses: actions/setup-python@v4
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
1919
with:
20-
python-version: '3.x'
20+
node-version: '18'
2121

22-
- name: Setup Just
23-
uses: extractions/setup-just@v3
24-
25-
- name: Check project structure
22+
- name: Install dependencies
23+
run: |
24+
npm ci
25+
26+
- name: Validate project (structure, files, outputs)
2627
run: |
27-
just check-structure
28+
node scripts/validate.js
2829
2930
- name: Validate file syntax
3031
run: |
@@ -34,13 +35,7 @@ jobs:
3435
# Check JavaScript files for basic syntax
3536
find src/js -name "*.js" | xargs -I {} sh -c 'echo "Checking {}" && node -c {}'
3637
37-
- name: Test comment preservation
38-
run: |
39-
just test-comments
40-
41-
- name: Run complete validation
42-
run: |
43-
just check-all
38+
# Additional checks can be added here (lint/tests) when available
4439

4540
- name: Check documentation
4641
run: |
@@ -56,32 +51,41 @@ jobs:
5651
5752
- name: Verify build artifacts
5853
run: |
59-
just build-new
60-
54+
npm run build
55+
6156
# Check that build produces expected files
62-
test -f json-format-converter-extension.zip || (echo "Extension ZIP not created" && exit 1)
57+
test -f json-format-converter-chrome.zip || (echo "Chrome ZIP not created" && exit 1)
58+
test -f json-format-converter-firefox.zip || (echo "Firefox ZIP not created" && exit 1)
6359
test -f json-format-converter-standalone.zip || (echo "Standalone ZIP not created" && exit 1)
64-
test -d dist/extension || (echo "Extension build directory missing" && exit 1)
60+
test -d dist/chrome || (echo "Chrome build directory missing" && exit 1)
61+
test -d dist/firefox || (echo "Firefox build directory missing" && exit 1)
6562
test -d dist/standalone || (echo "Standalone build directory missing" && exit 1)
66-
63+
6764
# Check ZIP file contents
68-
unzip -t json-format-converter-extension.zip > /dev/null || (echo "Extension ZIP is corrupted" && exit 1)
65+
unzip -t json-format-converter-chrome.zip > /dev/null || (echo "Chrome ZIP is corrupted" && exit 1)
66+
unzip -t json-format-converter-firefox.zip > /dev/null || (echo "Firefox ZIP is corrupted" && exit 1)
6967
unzip -t json-format-converter-standalone.zip > /dev/null || (echo "Standalone ZIP is corrupted" && exit 1)
7068
7169
- name: Check package sizes
7270
run: |
7371
echo "📊 Package Sizes:"
74-
echo "Extension: $(du -h json-format-converter-extension.zip | cut -f1)"
72+
echo "Chrome: $(du -h json-format-converter-chrome.zip | cut -f1)"
73+
echo "Firefox: $(du -h json-format-converter-firefox.zip | cut -f1)"
7574
echo "Standalone: $(du -h json-format-converter-standalone.zip | cut -f1)"
7675
7776
# Warn if packages are too large (>500KB)
78-
ext_size=$(stat -c%s json-format-converter-extension.zip)
77+
chrome_size=$(stat -c%s json-format-converter-chrome.zip)
78+
firefox_size=$(stat -c%s json-format-converter-firefox.zip)
7979
standalone_size=$(stat -c%s json-format-converter-standalone.zip)
8080
81-
if [ $ext_size -gt 512000 ]; then
82-
echo "⚠️ Warning: Extension package is larger than 500KB ($ext_size bytes)"
81+
if [ $chrome_size -gt 512000 ]; then
82+
echo "⚠️ Warning: Chrome package is larger than 500KB ($chrome_size bytes)"
8383
fi
8484
85+
if [ $firefox_size -gt 512000 ]; then
86+
echo "⚠️ Warning: Firefox package is larger than 500KB ($firefox_size bytes)"
87+
fi
88+
8589
if [ $standalone_size -gt 512000 ]; then
8690
echo "⚠️ Warning: Standalone package is larger than 500KB ($standalone_size bytes)"
8791
fi

0 commit comments

Comments
 (0)