Merge pull request #31 from Aenigma/feature/npm-project

npm style project setup
This commit is contained in:
kodxana 2020-10-08 12:39:29 +02:00 committed by GitHub
commit b08a6a210c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 13055 additions and 6 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
.cache
dist
node_modules
web-ext-artifacts

View file

@ -7,12 +7,28 @@ A plugin for web browsers that automatically checks whether a YouTube video or c
[![Get on Firefox](https://addons.cdn.mozilla.net/static/img/addons-buttons/AMO-button_1.png)](https://addons.mozilla.org/en/firefox/addon/watch-on-lbry/?src=search) [![Get on Chrome](https://developer.chrome.com/webstore/images/ChromeWebStore_BadgeWBorder_v2_206x58.png)](https://chrome.google.com/webstore/detail/watch-on-lbry/jjmbbhopnjdjnpceiecihldbhibchgek)
## For Chrome:
## Build
From the root of the project
```bash
$ npm install
$ npm run watch
```
Then, either manually install it for your browser or, from another terminal invoke:
```bash
$ npm run start:chrome
$ npm run start:firefox # or, if you'd prefer firefox
```
### Manual Install for Chrome:
Visit ```chrome://extensions``` (via omnibox or menu -> Tools -> Extensions).
Enable Developer mode by ticking the checkbox in the upper-right corner.
Click on the "Load unpacked extension..." button.
Select the directory containing your unpacked extension.
## For Firefox
### Manual Install for Firefox
To install an extension temporarily:
- open Firefox

13004
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

27
package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "watch-on-lbry",
"version": "1.5.4",
"license": "GPL-3.0",
"scripts": {
"build:assets": "cpx \"src/**/*.{json,png}\" dist/",
"watch:assets": "cpx --watch -v \"src/**/*.{json,png}\" dist/",
"build:parcel": "cross-env NODE_ENV=production parcel build --no-source-maps \"src/scripts/*.{js,ts}\" \"src/**/*.html\"",
"watch:parcel": "parcel watch --no-hmr --no-source-maps \"src/scripts/*.{js,ts}\" \"src/**/*.html\"",
"build": "npm-run-all -l -p build:parcel build:assets",
"watch": "npm-run-all -l -p watch:parcel watch:assets",
"start:chrome": "web-ext run -t chromium --source-dir ./dist",
"start:firefox": "web-ext run --source-dir ./dist"
},
"browserslist": [
">1%",
"not ie > 0"
],
"dependencies": {},
"devDependencies": {
"cpx": "^1.5.0",
"cross-env": "^7.0.2",
"npm-run-all": "^4.1.5",
"parcel-bundler": "^1.12.4",
"web-ext": "^5.2.0"
}
}

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View file

@ -17,8 +17,6 @@
<input type="button" id="go-button" value="Start Conversion!" class="goButton">
<ul id="lbry-channel-list">
</ul>
<script type="text/javascript" src="content.js"></script>
</div>
</body>
</html>