chore: init workflow

This commit is contained in:
DIYgod 2019-07-17 01:01:03 +08:00
commit 16dda13ede
12 changed files with 5565 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
node_modules
dist

21
LICENSE Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 DIYgod
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.

20
README.md Normal file
View File

@ -0,0 +1,20 @@
# RSSHub-radar
> Browser extension that detects available RSS and [RSSHub](https://github.com/DIYgod/RSSHub) in current page
## 介绍
探测当前页面可用的 RSS 和 [RSSHub](https://github.com/DIYgod/RSSHub) 的浏览器扩展
[Telegram 群](https://t.me/rsshub)
## 相关项目
- [RSSHub](https://github.com/DIYgod/RSSHub)
## Author
**RSSHub-radar** © [DIYgod](https://github.com/DIYgod), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by DIYgod with help from contributors ([list](https://github.com/DIYgod/RSSHub-radar/contributors)).
> Blog [@DIYgod](https://diygod.me) · GitHub [@DIYgod](https://github.com/DIYgod) · Twitter [@DIYgod](https://twitter.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod)

42
package.json Normal file
View File

@ -0,0 +1,42 @@
{
"name": "rsshub-radar",
"version": "0.0.1",
"description": "Browser extension that detects available RSS and RSSHub",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w --mode=production --progress --display-error-details --colors",
"build": "webpack --mode=production --progress --display-error-details --colors"
},
"repository": {
"type": "git",
"url": "git+https://github.com/DIYgod/RSSHub-radar.git"
},
"keywords": [
"rsshub",
"rss"
],
"author": "DIYgod",
"license": "MIT",
"bugs": {
"url": "https://github.com/DIYgod/RSSHub-radar/issues"
},
"homepage": "https://github.com/DIYgod/RSSHub-radar#readme",
"devDependencies": {
"@babel/core": "^7.5.4",
"@babel/preset-env": "^7.5.4",
"autoprefixer": "^9.6.1",
"babel-loader": "^8.0.6",
"copy-webpack-plugin": "^5.0.3",
"css-loader": "^3.0.0",
"cssnano": "^4.1.10",
"eslint-loader": "^2.2.1",
"less": "^3.9.0",
"less-loader": "^5.0.0",
"mini-css-extract-plugin": "^0.7.0",
"postcss-loader": "^3.0.0",
"svg-inline-loader": "^0.8.0",
"url-loader": "^2.0.1",
"webpack": "^4.35.3",
"webpack-cli": "^3.3.6"
}
}

6
postcss.config.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
plugins: {
'autoprefixer': {},
'cssnano': {}
}
};

15
src/assets/manifest.json Normal file
View File

@ -0,0 +1,15 @@
{
"manifest_version": 2,
"name": "RSSHub radar",
"description": "Detects available RSS and RSSHub",
"version": "1.0",
"browser_action": {
"default_icon": "rsshub.png",
"default_popup": "rsshub-radar.html"
},
"permissions": [
"activeTab"
]
}

View File

@ -0,0 +1,10 @@
<html>
<head>
<title>RSSHub radar</title>
<style href="./dist/rsshub-radar.css"></style>
</head>
<body>
<h1>RSSHub radar</h1>
<script src="./dist/rsshub-radar.js"></script>
</body>
</html>

BIN
src/assets/rsshub.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

0
src/css/index.less Normal file
View File

1
src/js/index.js Normal file
View File

@ -0,0 +1 @@
import '../css/index.less';

106
webpack.config.js Normal file
View File

@ -0,0 +1,106 @@
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyPlugin = require('copy-webpack-plugin');
module.exports = {
mode: 'production',
bail: true,
devtool: 'source-map',
entry: {
'rsshub-radar': './src/js/index.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
publicPath: '/',
},
resolve: {
modules: ['node_modules'],
extensions: ['.js', '.less'],
},
module: {
strictExportPresence: true,
rules: [
{
test: /\.js$/,
enforce: 'pre',
loader: 'eslint-loader',
include: path.resolve(__dirname, '../src/js'),
},
{
test: /\.js$/,
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true,
presets: ['@babel/preset-env']
}
}
]
},
{
test: /\.less$/,
use: [
MiniCssExtractPlugin.loader,
{
loader: 'css-loader',
options: {
importLoaders: 2,
},
},
{
loader: 'postcss-loader',
options: {
config: {
path: path.join(__dirname, 'postcss.config.js')
}
}
},
{
loader: 'less-loader',
},
],
},
{
test: /\.(png|jpg)$/,
loader: 'url-loader',
options: {
'limit': 40000
}
},
{
test: /\.svg$/,
loader: 'svg-inline-loader'
},
]
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new CopyPlugin([
{
from: 'src/assets',
to: '',
copyUnmodified: true,
},
]),
],
node: {
dgram: 'empty',
fs: 'empty',
net: 'empty',
tls: 'empty',
},
};

5342
yarn.lock Normal file

File diff suppressed because it is too large Load Diff