Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnguyen11 committed Nov 19, 2020
0 parents commit 6f607c3
Show file tree
Hide file tree
Showing 37 changed files with 12,760 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .githooks/pre-commit/prettier.sh
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

5 changes: 5 additions & 0 deletions .githooks/pre-push/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "Running unit test 🚀🚀"
npm test -- --coverage

3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

ko_fi: davidnguyen179
40 changes: 40 additions & 0 deletions .github/workflows/workflow-config.yml
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)
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist/
node_modules/
coverage/
.DS_Store
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5"
}
20 changes: 20 additions & 0 deletions LICENSE
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.
19 changes: 19 additions & 0 deletions PRIVACY_POLICY.txt
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.
82 changes: 82 additions & 0 deletions README.md
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/)

7 changes: 7 additions & 0 deletions babel.config.js
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',
],
};
30 changes: 30 additions & 0 deletions jest.config.js
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'],
};
1 change: 1 addition & 0 deletions jest.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('whatwg-fetch');
Loading

0 comments on commit 6f607c3

Please sign in to comment.