Skip to content

Commit

Permalink
release: v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
surunzi committed Nov 26, 2022
1 parent ea4479f commit a2e219f
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 31 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

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:
push:
branches:
- 'master'
paths:
- 'src/**/*'

jobs:
ci:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.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
npm run ci
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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: '14.x'
registry-url: 'https://registry.npmjs.org'
- name: Build eruda
run: |
npm i
npm run build
- name: Publish package on NPM
working-directory: dist
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
11 changes: 0 additions & 11 deletions .npmignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
src/util.js
eruda-timing.js
eruda-timing.min.js
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.0.1 (26 Nov 2022)

* fix: unable to load in eruda 2.5.0

## v2.0.0 (6 Jan 2019)

* feat: theme support
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# eruda-timing

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

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

Eruda plugin for performance and resource timing.
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{
"name": "eruda-timing",
"version": "2.0.0",
"version": "2.0.1",
"main": "eruda-timing.js",
"description": "Eruda plugin for performance and resource timing",
"scripts": {
"dev": "webpack-dev-server --host 0.0.0.0",
"build": "webpack -p",
"format": "prettier src/index.js src/style.scss *.js index.html --write",
"format": "prettier 'src/*.js' 'src/style.scss' '*.js' 'index.html' --write",
"ci": "npm run lint && npm run build",
"lint": "eslint src/**/*.js"
},
"files": [
"eruda-timing*"
],
"repository": {
"type": "git",
"url": "git+https://github.com/liriliri/eruda-timing.git"
Expand All @@ -33,7 +36,7 @@
"autoprefixer": "^9.7.1",
"babel-loader": "^8.0.6",
"css-loader": "^3.2.0",
"eruda": "^2.0.0",
"eruda": "^2.6.0",
"eslint": "^6.6.0",
"handlebars": "^4.5.1",
"handlebars-loader": "^1.7.1",
Expand Down
2 changes: 1 addition & 1 deletion src/timing.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ export default function(eruda) {
if (!renderData.timing && !renderData.entries) {
renderData.notSupported = true
}

this._renderHtml(this._tpl(renderData))
}
_renderHtml(html) {
Expand Down
21 changes: 10 additions & 11 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ import trim from 'licia/trim'
import Url from 'licia/Url'

export function getFileName(url) {
let ret = last(url.split('/'))

if (ret.indexOf('?') > -1) ret = trim(ret.split('?')[0])

if (ret === '') {
url = new Url(url)
ret = url.hostname
}

return ret
let ret = last(url.split('/'))

if (ret.indexOf('?') > -1) ret = trim(ret.split('?')[0])

if (ret === '') {
url = new Url(url)
ret = url.hostname
}


return ret
}

0 comments on commit a2e219f

Please sign in to comment.