-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reformat, makefile, precommit hook, misc
- Loading branch information
Showing
25 changed files
with
14,846 additions
and
13,541 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
indent_size = 4 | ||
end_of_line = lf | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
# 2 spaces for JS, HTML and CSS/SASS | ||
[*.{ts,js,html,css,scss,sass,less}] | ||
indent_size = 2 | ||
|
||
# 4 spaces for markdown | ||
[*.md] | ||
indent_size = 4 | ||
trim_trailing_whitespace = false | ||
|
||
# Hard TAB for Makefile | ||
[Makefile] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "npm" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
|
||
- run: npm ci | ||
- run: npm ci | ||
|
||
- name: Build Firefox | ||
run: npm run build:firefox | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2-preview | ||
with: | ||
name: firefox | ||
path: dist.zip | ||
- name: Build Firefox | ||
run: npm run build:firefox | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2-preview | ||
with: | ||
name: firefox | ||
path: dist.zip | ||
|
||
- name: Build Chrome | ||
run: npm run build:chrome | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2-preview | ||
with: | ||
name: chrome | ||
path: dist.zip | ||
- name: Build Chrome | ||
run: npm run build:chrome | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2-preview | ||
with: | ||
name: chrome | ||
path: dist.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,39 @@ | ||
name: "CodeQL" | ||
name: 'CodeQL' | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
schedule: | ||
- cron: "25 4 * * 3" | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: ['master'] | ||
schedule: | ||
- cron: '25 4 * * 3' | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: javascript, typescript | ||
queries: +security-and-quality | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: javascript, typescript | ||
queries: +security-and-quality | ||
|
||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: "npm" | ||
- run: npm ci | ||
- run: npm run build:chrome | ||
- name: Use Node.js 18.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
- run: npm ci | ||
- run: npm run build:chrome | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,5 @@ | ||
node_modules | ||
dist | ||
build | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx prettier --write . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
{ | ||
"semi": false, | ||
"printWidth": 110, | ||
"singleQuote": true | ||
"singleQuote": true, | ||
"semi": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.PHONY: build install clean | ||
|
||
install: | ||
npm ci | ||
|
||
compile: | ||
npx tsc --noEmit | ||
|
||
clean: | ||
rm -rf node_modules build | ||
|
||
#--------- | ||
## Building | ||
|
||
dev: | ||
NODE_ENV=development npx vite build --mode development --watch | ||
|
||
# This is what Google wants us to upload when we release a new version to the Addon "store" | ||
build-chrome: install | ||
make update-chrome | ||
make zip-build | ||
|
||
update-chrome: | ||
VITE_TARGET_BROWSER=chrome npx vite build | ||
|
||
# This is what Mozilla wants us to upload when we release a new version to the Addon "store" | ||
build-firefox: install | ||
make update-firefox | ||
make zip-build | ||
|
||
update-firefox: | ||
VITE_TARGET_BROWSER=firefox npx vite build | ||
|
||
#--------- | ||
## Zipping | ||
|
||
# To build a zip archive for uploading to the Chrome Web Store or Mozilla Addons | ||
zip-build: | ||
cd build && zip ../build.zip -r * | ||
|
||
# To build a source archive, wanted by Mozilla reviewers. Include media subdir. | ||
zip-src: | ||
rm -rfv build | ||
mkdir -p build | ||
# archive the main repo | ||
git archive --prefix=aw-watcher-web/ -o build/aw-watcher-web.zip HEAD | ||
# archive the media subrepo | ||
(cd media/ && git archive --prefix=aw-watcher-web/media/ -o ../build/media.zip HEAD) | ||
# extract the archives into a single directory | ||
(cd build && unzip -q aw-watcher-web.zip) | ||
(cd build && unzip -q media.zip) | ||
# zip the whole thing | ||
(cd build && zip -r aw-watcher-web.zip aw-watcher-web) | ||
# clean up | ||
(cd build && rm -r media.zip aw-watcher-web) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.