Skip to content

Commit

Permalink
feat: Add Firefox support and update build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
KarimAziev committed Aug 17, 2024
1 parent 20006fd commit 7868317
Show file tree
Hide file tree
Showing 20 changed files with 3,040 additions and 106 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
branches:
- main
env:
DIRECTORY: app
DIRECTORY: chrome
PROJECT_NAME: chrome-emacs

jobs:
Expand Down Expand Up @@ -58,10 +58,10 @@ jobs:
VERSION_FILE=version.env
CURRENT_VERSION=$(jq -r '.version' $DIRECTORY/manifest.json)
echo "OLD_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT
MANUAL_VERSION_TYPE="${{ github.event.inputs.versionType }}"
MANUAL_NEW_VERSION="${{ github.event.inputs.newVersion }}"
if [[ -n "$MANUAL_NEW_VERSION" ]]; then
NEW_VERSION="$MANUAL_NEW_VERSION"
else
Expand All @@ -85,13 +85,13 @@ jobs:
fi
NEW_VERSION="${VERSION[0]}.${VERSION[1]}.${VERSION[2]}"
fi
echo "New version: $NEW_VERSION"
jq --arg v "$NEW_VERSION" '.version = $v' $DIRECTORY/manifest.json > temp.json && mv temp.json $DIRECTORY/manifest.json
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
echo "NEW_VERSION=$NEW_VERSION" >> $VERSION_FILE
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
# Check if there are any changes
if git diff --quiet --exit-code $DIRECTORY/manifest.json; then
echo "No changes in manifest.json. Skipping commit and push."
Expand All @@ -112,7 +112,7 @@ jobs:
zip -r "../${ZIP_NAME}" ./*
echo "ZIPPED_FILE=${ZIP_NAME}" >> $GITHUB_ENV
cd ..
- name: Upload zipped app as artifact
uses: actions/upload-artifact@v4
with:
Expand Down
47 changes: 41 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
app/scripts
node_modules/
app/atomic-chrome.zip
app/chrome-emacs.zip
app/options.html
/coverage/
# Chrome build artifacts
chrome/scripts/
chrome/images/
chrome/options.html
chrome/*.zip

# Firefox build artifacts
firefox/scripts/
firefox/images/
firefox/options.html
firefox/*.zip

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*


# Build
node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# Tests
/coverage/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<div align="center">

![](./app/images/icon.png)
![](./images/icon.png)

</div>

Expand Down
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions firefox/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"appName": {
"message": "Chrome Emacs",
"description": "The name of the application"
},
"appShortName": {
"message": "ChrEmacs",
"description": "The short name of the application"
},
"appDescription": {
"message": "Use Emacs to edit textareas and online editors",
"description": "The description of the application"
}
}
57 changes: 57 additions & 0 deletions firefox/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"version": "0.4.0",
"manifest_version": 3,
"minimum_chrome_version": "116",
"description": "__MSG_appDescription__",
"icons": {
"16": "images/icon-16.png",
"128": "images/icon-128.png",
"19": "images/icon-19.png"
},
"default_locale": "en",
"background": {
"scripts": ["scripts/service-worker.js"]
},
"action": {
"default_icon": {
"19": "images/icon-19-inactive.png",
"38": "images/icon-38-inactive.png"
},
"default_title": "Chrome Emacs"
},
"commands": {
"_execute_action": {
"suggested_key": {
"default": "Ctrl+Period",
"mac": "Command+Period",
"linux": "Ctrl+Period"
},
"description": "Edit currently focused element"
},
"query-edit": {
"suggested_key": {
"default": "Ctrl+Shift+Period",
"mac": "Command+Shift+Period",
"linux": "Ctrl+Shift+Period"
},
"description": "Select and edit element"
}
},
"permissions": ["activeTab", "scripting", "storage", "tabs"],
"host_permissions": ["http://*/*", "https://*/*"],
"web_accessible_resources": [
{
"resources": ["scripts/injected.js"],
"matches": ["http://*/*", "https://*/*"]
}
],
"options_ui": {
"page": "options.html",
"open_in_tab": false
},
"content_security_policy": {
"extension_pages": "default-src 'self'; connect-src http://localhost:64292 ws://localhost:64292;"
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 7868317

Please sign in to comment.