added standard, ci and format fixes (#76)

Co-authored-by: rafapaezbas <rafa@holepunch.com>
This commit is contained in:
rafapaezbas
2024-02-26 17:44:19 +01:00
committed by GitHub
parent 308705982b
commit 4230a61c13
5 changed files with 41 additions and 6 deletions

23
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Build Status
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
strategy:
matrix:
node-version: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test

View File

@@ -236,7 +236,6 @@ customElements.define('developer-tooling', class extends HTMLElement {
this.initServer() this.initServer()
}) })
const shouldLoadApp = Pear.config.linkData?.startsWith('devtools/') const shouldLoadApp = Pear.config.linkData?.startsWith('devtools/')
if (shouldLoadApp) { if (shouldLoadApp) {
this.addApp(Pear.config.linkData) this.addApp(Pear.config.linkData)
@@ -327,7 +326,9 @@ customElements.define('developer-tooling', class extends HTMLElement {
this.render() this.render()
this.changePortFormElem.classList.add('hidden') this.changePortFormElem.classList.add('hidden')
}) })
this.devtoolsHttpServer.on('error', err => this.changePortErrorElem.textContent = err?.message) this.devtoolsHttpServer.on('error', err => {
this.changePortErrorElem.textContent = err?.message
})
this.devtoolsHttpServer.on('request', (req, res) => { this.devtoolsHttpServer.on('request', (req, res) => {
if (req.url !== '/json/list') { if (req.url !== '/json/list') {
res.writeHead(404) res.writeHead(404)

View File

@@ -111,7 +111,7 @@ customElements.define('docs-viewer', class extends HTMLElement {
patchSyntax (input) { patchSyntax (input) {
// remove backticks inside link, example: [`hypercore`] -> [hypercore] // remove backticks inside link, example: [`hypercore`] -> [hypercore]
let output = input.replace(/\[`([^`]+)`\]/g, "[$1]") let output = input.replace(/\[`([^`]+)`\]/g, '[$1]')
// remove gitbook embed syntax // remove gitbook embed syntax
output = output.replace(/{% embed url="([^"]+)" %}\s*(.*?)\s*{% embeded %}/g, '> [$2]($1)') output = output.replace(/{% embed url="([^"]+)" %}\s*(.*?)\s*{% embeded %}/g, '> [$2]($1)')

View File

@@ -3,6 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"main": "index.html", "main": "index.html",
"type": "module", "type": "module",
"scripts": {
"test": "standard --fix"
},
"pear": { "pear": {
"gui": { "gui": {
"backgroundColor": "#151517", "backgroundColor": "#151517",
@@ -10,11 +13,19 @@
"width": 1120 "width": 1120
} }
}, },
"standard": {
"globals": [
"Pear"
]
},
"dependencies": { "dependencies": {
"b4a": "^1.6.4", "b4a": "^1.6.4",
"bare-path": "^2.1.0", "bare-path": "^2.1.0",
"pear-inspect": "^1.0.3", "pear-inspect": "^1.0.3",
"redhat-overpass-font": "^1.0.0", "redhat-overpass-font": "^1.0.0",
"ws": "^8.16.0" "ws": "^8.16.0"
},
"devDependencies": {
"standard": "^17.1.0"
} }
} }