Skip to content

Commit

Permalink
update project
Browse files Browse the repository at this point in the history
  • Loading branch information
magiclen committed May 24, 2022
1 parent d343296 commit 41e2fe0
Show file tree
Hide file tree
Showing 16 changed files with 1,279 additions and 910 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mprober"
version = "0.11.0-beta.11"
version = "0.11.0-beta.12"
authors = ["Magic Len <[email protected]>"]
edition = "2021"
repository = "https://github.com/magiclen/m-prober"
Expand Down
2 changes: 1 addition & 1 deletion front-end/css/bundle.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion front-end/css/font-roboto-mono.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified front-end/fonts/fa-solid-900.eot
Binary file not shown.
2,055 changes: 1,220 additions & 835 deletions front-end/fonts/fa-solid-900.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified front-end/fonts/fa-solid-900.ttf
Binary file not shown.
Binary file modified front-end/fonts/fa-solid-900.woff
Binary file not shown.
Binary file modified front-end/fonts/fa-solid-900.woff2
Binary file not shown.
3 changes: 1 addition & 2 deletions front-end/js/bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion magiclen-prober-webpack/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package-lock=false # to prevent `npm link` from being removed after `npm install whatever`
package-lock=false
6 changes: 4 additions & 2 deletions magiclen-prober-webpack/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
### Getting Start

```bash
sudo npm -g install git+ssh://[email protected]:magiclen/web-fonts.git
mkdir -p ~/TypeScriptProjects
cd ~/TypeScriptProjects
git clone --depth [email protected]:magiclen/web-fonts.git
```

```bash
npm link web-fonts
npm i file:~/TypeScriptProjects/web-fonts
```
37 changes: 18 additions & 19 deletions magiclen-prober-webpack/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "mprober",
"version": "0.10.1",
"version": "0.11.0-beta.12",
"description": "This program aims to collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces and block devices. It can be used not only as a normal CLI tool, but also a web application with a front-end webpage and useful HTTP APIs.",
"private": true,
"main": "src/app.js",
"scripts": {
"build": "webpack --mode production",
"dev": "webpack --mode development"
"build:dev": "webpack --mode development"
},
"repository": {
"type": "git",
Expand All @@ -29,27 +29,26 @@
"@babel/core": "^7.8.7",
"@babel/preset-env": "^7.8.7",
"@babel/register": "^7.8.6",
"@fortawesome/fontawesome-free": "^5.9.0",
"autoprefixer": "^9.7.4",
"@fortawesome/fontawesome-free": "^5.15.4",
"autoprefixer": "^10.4.7",
"babel-loader": "^8.0.6",
"bootstrap": "^4.3.1",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.0.0",
"cssnano": "^4.1.10",
"file-loader": "^6.0.0",
"glob": "^7.1.4",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.12.0",
"postcss-loader": "^3.0.0",
"purgecss-webpack-plugin": "^2.1.0",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^3.0.1",
"webpack": "^4.42.0",
"webpack-cli": "^3.3.4"
"bootstrap": "^4.6.1",
"css-loader": "^6.7.1",
"cssnano": "^5.1.9",
"glob": "^8.0.3",
"mini-css-extract-plugin": "^2.6.0",
"node-sass": "^7.0.1",
"postcss-loader": "^7.0.0",
"purgecss-webpack-plugin": "^4.1.3",
"sass-loader": "^13.0.0",
"terser-webpack-plugin": "^5.3.1",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2"
},
"dependencies": {
"jquery": "^3.4.1",
"popper.js": "^1.15.0",
"vue": "^2.6.10"
"vue": "^2.6.14",
"web-fonts": "file:~/TypeScriptProjects/web-fonts"
}
}
2 changes: 1 addition & 1 deletion magiclen-prober-webpack/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'bootstrap/js/dist/collapse';
import 'bootstrap/js/dist/modal';
import Vue from 'vue';

import {applyRobotoMono} from 'web-fonts/src/js/roboto-mono';
import {applyRobotoMono} from 'web-fonts/lib/roboto-mono';

import './app.scss';

Expand Down
1 change: 0 additions & 1 deletion magiclen-prober-webpack/src/font-roboto-mono.js

This file was deleted.

2 changes: 2 additions & 0 deletions magiclen-prober-webpack/src/font-roboto-mono.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$font-path: "~web-fonts/src/fonts/";
@import "node_modules/web-fonts/src/scss/roboto-mono";
75 changes: 29 additions & 46 deletions magiclen-prober-webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const {CleanWebpackPlugin} = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

const TerserPlugin = require('terser-webpack-plugin');
Expand All @@ -18,20 +17,26 @@ function collectWhitelist() {
module.exports = {
entry: {
'bundle': './src/app.js',
'font-roboto-mono': './src/font-roboto-mono.js',
'font-roboto-mono': './src/font-roboto-mono.scss',
},
output: {
filename: './js/[name].min.js',
libraryTarget: "umd",
clean: true,
},
plugins: [
new CleanWebpackPlugin(),
new MiniCssExtractPlugin({
filename: './css/[name].min.css',
}),
new PurgecssPlugin({
whitelist: collectWhitelist,
paths: glob.sync(`${PATHS.views}/**/*`, {nodir: true}),
safelist() {
return {
standard: collectWhitelist(),
deep: [],
greedy: []
}
}
})
],
module: {
Expand All @@ -48,61 +53,39 @@ module.exports = {
{
test: /\.(sa|sc|c)ss$/,
use: [
{ loader: MiniCssExtractPlugin.loader },
"css-loader",
{
loader: MiniCssExtractPlugin.loader,
},
'css-loader',
{
loader: 'postcss-loader',
loader: "postcss-loader",
options: {
plugins: function () {
return [
require('autoprefixer'),
require('cssnano')({preset: ['default', {discardComments: {removeAll: true}}]})
];
}
}
postcssOptions: {
plugins: [
require("autoprefixer"),
require("cssnano")({ preset: ["default", { discardComments: { removeAll: true } }] }),
],
},
},
},
'sass-loader',
"sass-loader",
],
},
{
test: /\.(eot|woff|woff2|[ot]tf)$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: './fonts/',
publicPath: '../fonts/'
}
}]
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]',
}
},
{
test: /.*font.*\.svg$/,
use: [{
loader: 'file-loader',
options: {
name: '[name].[ext]',
outputPath: './fonts/',
publicPath: '../fonts/'
}
}]
type: 'asset/resource',
generator: {
filename: 'fonts/[name][ext]',
}
}
]
},
optimization: {
minimizer: [
new TerserPlugin({
cache: true,
parallel: true,
terserOptions: {
output: {
comments: false,
}
}
})
],
},
optimization: { minimizer: [new TerserPlugin({ extractComments: false, terserOptions: { format: { comments: false } } })] },
resolve: {
alias: {
'vue$': 'vue/dist/vue.esm.js'
Expand Down

0 comments on commit 41e2fe0

Please sign in to comment.