Skip to content

Commit

Permalink
feat: adds automation to pull down official translate icon for use in…
Browse files Browse the repository at this point in the history
… extension (#21)

feat: adds automation to pull down official translate icon for use in extension

Adds an automation script to cURL the official Amazon Translate icon and add it to the codebase
prior to build. This is done because of legal implications of including the icon with the project
because it is open source. Refactors some of the CSS and moves the Spinner component from the popup
folder to the components folder. Adds SVG import support to vite.

fix #14

docs(third-party-licenses.txt): updates third-party licenses file to include bootstrap icons

Adds attribution for bootstrap-icons to the third-party licenses file.
  • Loading branch information
AJStacy authored Feb 23, 2022
1 parent 7a1787d commit 0a3941f
Show file tree
Hide file tree
Showing 14 changed files with 456 additions and 42 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ extension/
.eslintcache
# directory with releases
release/
test/data/private
test/data/private
src/assets/logo.svg
src/assets/logo.png
9 changes: 9 additions & 0 deletions logo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Remove the current logo files
rm -f ./src/assets/logo.svg
rm -f ./src/assets/logo.png

# Get the Amazon Translate icon from the web and pipe it into an svg file
curl -XGET 'https://d2q66yyjeovezo.cloudfront.net/icon/fc46e26a907870744758b76166150f62-76c22bfd03882310f44da5a6a9590864.svg' > ./src/assets/logo.svg

# Convert the svg to a png for use as the extension icon
./node_modules/.bin/svg2png ./src/assets/logo.svg -o ./src/assets/logo.png
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,19 @@
"license": "Apache-2.0",
"scripts": {
"assets": "node ./copy-assets.js",
"predev": "yarn assets",
"logo": "./logo.sh",
"predev": "npm run assets",
"dev": "npm run clear && cross-env NODE_ENV=development run-p dev:*",
"dev:prepare": "esno scripts/prepare.ts",
"dev:web": "vite",
"dev:js": "npm run build:js -- --mode development",
"prebuild": "yarn assets",
"prebuild": "npm run assets",
"build": "cross-env NODE_ENV=production run-s clear build:web build:prepare build:js",
"build:prepare": "esno scripts/prepare.ts",
"build:web": "vite build",
"build:js": "vite build --config vite.config.content.ts",
"prepare": "husky install",
"prepack": "yarn assets",
"prepare": "husky install && npm run logo",
"prepack": "npm run assets",
"pack": "cross-env NODE_ENV=production run-p pack:*",
"pack:zip": "rimraf extension.zip && jszip-cli",
"pack:crx": "crx pack extension -o ./release/extension.crx",
Expand Down Expand Up @@ -67,13 +68,15 @@
"rimraf": "^3.0.2",
"sass": "^1.43.2",
"semantic-release": "^18.0.1",
"svg2png": "^4.1.1",
"ts-node": "^10.4.0",
"typescript": "^4.4.3",
"unplugin-auto-import": "^0.4.8",
"unplugin-icons": "^0.11.4",
"unplugin-vue-components": "^0.15.4",
"vite": "^2.6.2",
"vite-plugin-windicss": "^1.4.8",
"vite-svg-loader": "^3.1.2",
"vue": "^3.2.19",
"vue-demi": "^0.11.4",
"web-ext": "^6.4.0",
Expand Down
Loading

0 comments on commit 0a3941f

Please sign in to comment.