-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6f607c3
Showing
37 changed files
with
12,760 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACMR "*.js" "*.jsx" "*.ts" "*.tsx" | sed 's| |\\ |g') | ||
|
||
[[ -z "$CHANGED_FILES" ]] && exit 0 | ||
|
||
echo "Running prettier 🚀🚀" | ||
echo "$CHANGED_FILES" | xargs ./node_modules/.bin/prettier --write | ||
|
||
echo "$CHANGED_FILES" | xargs git add | ||
echo "Done prettier ✨✨" | ||
|
||
exit 0 | ||
|
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,5 @@ | ||
#!/bin/bash | ||
|
||
echo "Running unit test 🚀🚀" | ||
npm test -- --coverage | ||
|
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,3 @@ | ||
# These are supported funding model platforms | ||
|
||
ko_fi: davidnguyen179 |
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,40 @@ | ||
name: 'ci/cd' | ||
# This workflow is triggered on pushes to the repository. | ||
on: [push] | ||
|
||
jobs: | ||
test: | ||
# Job name | ||
name: test | ||
# This job runs on Linux | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
id: checkout | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node_modules | ||
uses: actions/cache@v2 | ||
id: cache | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
# npm cache files are stored in `~/.npm` on Linux/macOS | ||
path: | | ||
**/node_modules | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
- name: Install Packages | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: npm ci | ||
- name: Run Test | ||
run: npm test -- --coverage | ||
- name: Trigger Codecov | ||
run: bash <(curl -s https://codecov.io/bash) |
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 @@ | ||
dist/ | ||
node_modules/ | ||
coverage/ | ||
.DS_Store |
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 @@ | ||
node_modules/ |
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,5 @@ | ||
{ | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
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,20 @@ | ||
The MIT License (MIT) | ||
Copyright 2020 davidnguyen179 | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,19 @@ | ||
Spotify Player Chrome Web Store & Mozilla Add-on Store & Microsoft Edge Add-on Store Privacy Policies. | ||
====================================================================================================== | ||
|
||
Introduction | ||
============ | ||
|
||
This is a mini Spotify player that allows the user seamlessly play/pause/like or jump to previous or next track while surfing the web without having to navigate to the Spotify user interface. | ||
|
||
Information We Collect | ||
====================== | ||
|
||
- It does not collect your data. | ||
- It stores data only locally on your hard drive using localStorage API. | ||
- It does not store anything on servers on the Internet. | ||
|
||
How it uses your cookies | ||
======================== | ||
|
||
It uses your cookies data to get song information to display in the extension and allow you to control your music player via Spotify API. |
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,82 @@ | ||
# Web Extension Boilerplate | ||
|
||
Web Extension Boilerplate provide the skeleton to start developing web extension | ||
|
||
## Development | ||
|
||
```bash | ||
npm i | ||
``` | ||
|
||
**Chrome** | ||
|
||
```bash | ||
npm run dev-chrome | ||
``` | ||
|
||
**Edge** | ||
|
||
```bash | ||
npm run dev-edge | ||
``` | ||
|
||
**Firefox** | ||
|
||
```bash | ||
npm run dev-firefox | ||
``` | ||
|
||
## Production | ||
|
||
```bash | ||
npm i | ||
``` | ||
|
||
**Chrome** | ||
|
||
```bash | ||
npm run chrome | ||
``` | ||
|
||
**Edge** | ||
|
||
```bash | ||
npm run edge | ||
``` | ||
|
||
**Firefox** | ||
|
||
```bash | ||
npm run firefox | ||
``` | ||
|
||
## Load package to Chrome | ||
|
||
1. On the browser's URL address bar | ||
2. Enter `chrome://extensions/` | ||
3. Switch to "**Developer mode**" | ||
4. Load extension by clicking "**Load unpacked**" | ||
5. Browse to `dist/` in source code | ||
6. Done! | ||
|
||
Check here for more detail: [https://developer.chrome.com/extensions/getstarted](https://developer.chrome.com/extensions/getstarted) | ||
|
||
## Load package to Edge | ||
|
||
1. On the browser's URL address bar | ||
2. Enter `edge://extensions/` | ||
3. Turn on `Developer mode` | ||
4. Load extension by clicking "**Load unpacked**" | ||
5. Browse to `dist/` in source code | ||
6. Done! | ||
|
||
## Load package to Firefox | ||
|
||
1. On the browser's URL address bar | ||
2. Enter `about:debugging#/runtime/this-firefox` | ||
3. Click **Load Temporary Add-on...** | ||
4. Browser to your `manifest.json` & click **Open** | ||
5. Done! | ||
|
||
Check here for more detail: [https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/](https://extensionworkshop.com/documentation/develop/temporary-installation-in-firefox/) | ||
|
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,7 @@ | ||
// babel.config.js | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', { targets: { node: 'current' } }], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
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,30 @@ | ||
const ignores = ['/node_modules/', '__mocks__']; | ||
|
||
module.exports = { | ||
collectCoverageFrom: [ | ||
'src/lib/parse.ts', | ||
'src/lib/spotify.ts', | ||
'src/lib/app.ts', | ||
'src/lib/utils.ts', | ||
'src/lib/storage.ts', | ||
], | ||
testMatch: ['**/test/**/*.spec.+(ts|tsx|js)'], | ||
testPathIgnorePatterns: [...ignores], | ||
coveragePathIgnorePatterns: [...ignores, 'src/(umd|cjs|esm)-entry.js$'], | ||
transformIgnorePatterns: ['[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$'], | ||
coverageDirectory: './coverage', | ||
coverageThreshold: { | ||
global: { | ||
branches: 80, | ||
functions: 100, | ||
lines: 100, | ||
statements: 100, | ||
}, | ||
}, | ||
moduleFileExtensions: ['ts', 'tsx', 'js'], | ||
transform: { | ||
'^.+\\.(ts|tsx)$': 'ts-jest', | ||
}, | ||
verbose: true, | ||
setupFiles: ['./jest.setup.js'], | ||
}; |
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 @@ | ||
require('whatwg-fetch'); |
Oops, something went wrong.