Skip to content

Commit

Permalink
release: v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Jul 20, 2024
1 parent 893c6f9 commit dca77cd
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"parserOptions": {
"ecmaVersion": "latest"
},
"env": {
"browser": true,
"es6": true,
Expand Down
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ko_fi: surunzi
open_collective: eruda
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- 'master'
paths:
- 'src/**/*'

jobs:
ci:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm i
- run: npm run ci
28 changes: 28 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish to NPM

on:
workflow_dispatch:
release:
types: [created]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Build eruda-monitor
run: |
npm i
npm run build
- name: Publish package on NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"tabWidth": 2,
"semi": false
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## v1.0.2 (20 Jul 2024)

* fix: es5 check
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# eruda-monitor

[![NPM version][npm-image]][npm-url]
[![Build status][ci-image]][ci-url]
[![License][license-image]][npm-url]

[npm-image]: https://img.shields.io/npm/v/eruda-monitor.svg
[npm-url]: https://npmjs.org/package/eruda-monitor
[ci-image]: https://img.shields.io/github/actions/workflow/status/liriliri/eruda-monitor/main.yml?branch=master&style=flat-square
[ci-url]: https://github.com/liriliri/eruda-monitor/actions/workflows/main.yml
[license-image]: https://img.shields.io/npm/l/eruda-monitor.svg

Eruda plugin for fps and memory.

## Demo
Expand Down
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "eruda-monitor",
"version": "1.0.1",
"version": "1.0.2",
"main": "eruda-monitor.js",
"description": "Eruda plugin for fps and memory",
"browserslist": [
"> 0.25%",
"since 2015",
"not dead"
],
"files": [
Expand All @@ -13,33 +14,33 @@
"scripts": {
"dev": "webpack-dev-server --host 0.0.0.0 --mode development",
"build": "webpack --mode production",
"ci": "npm run lint && npm run build",
"ci": "npm run lint && npm run build && npm run es5",
"lint": "eslint src/**/*.js",
"format": "lsla prettier \"src/*.{js,scss}\" \"*.json\" --write",
"es5": "es-check es5 eruda-monitor.js"
},
"keywords": [
"eruda",
"plugin"
],
"author": "",
"author": "surunzi",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.21.3",
"@babel/plugin-transform-runtime": "^7.21.0",
"@babel/preset-env": "^7.20.2",
"autoprefixer": "^10.4.14",
"babel-loader": "^9.1.2",
"css-loader": "^3.4.2",
"eruda": "^3.1.0",
"es5": "^1.0.0",
"eslint": "^8.36.0",
"handlebars": "^4.7.7",
"handlebars-loader": "^1.7.3",
"eruda": "^3.2.0",
"es-check": "^7.2.1",
"eslint": "^8.57.0",
"licia": "^1.38.0",
"luna-performance-monitor": "^0.3.0",
"node-sass": "^8.0.0",
"postcss": "^8.4.21",
"postcss-class-prefix": "^0.3.0",
"postcss-loader": "^7.0.2",
"sass": "^1.77.8",
"sass-loader": "^13.2.0",
"webpack": "^5.76.2",
"webpack-cli": "^5.0.1",
Expand Down
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
const LunaPerformanceMonitor = require('luna-performance-monitor')
const raf = require('licia/raf')
const LunaPerformanceMonitor = require('luna-performance-monitor')
const now = require('licia/now')
const contain = require('licia/contain')

module.exports = function(eruda) {
module.exports = function (eruda) {
let { evalCss } = eruda.util

class Monitor extends eruda.Tool {
constructor() {
super()
this.name = 'monitor'
this._style = evalCss(require('./style.scss') + require('luna-performance-monitor/luna-performance-monitor.css'))
this._style = evalCss(
require('./style.scss') +
require('luna-performance-monitor/luna-performance-monitor.css')
)
}
init($el, container) {
super.init($el, container)
$el.html('<div class="eruda-fps"></div><div class="eruda-memory"></div>')

this._initFps($el.find('.eruda-fps').get(0))
if (performance.memory) {
this._initMemory($el.find('.eruda-memory').get(0))
Expand Down Expand Up @@ -93,7 +95,7 @@ module.exports = function(eruda) {
})
this._memoryMonitor = memoryMonitor
}
_onThemeChange = (name, val) => {
_onThemeChange = (name) => {
const fpsMonitor = this._fpsMonitor
const memoryMonitor = this._memoryMonitor
if (name === 'theme') {
Expand Down
2 changes: 1 addition & 1 deletion src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
.memory {
margin: 10px 0;
}
}
}

0 comments on commit dca77cd

Please sign in to comment.