mirror of
https://github.com/aljazceru/pear-docs.git
synced 2025-12-18 06:54:22 +01:00
added standard, ci and format fixes (#76)
Co-authored-by: rafapaezbas <rafa@holepunch.com>
This commit is contained in:
23
.github/workflows/ci.yml
vendored
Normal file
23
.github/workflows/ci.yml
vendored
Normal 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
|
||||
@@ -236,7 +236,6 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
||||
this.initServer()
|
||||
})
|
||||
|
||||
|
||||
const shouldLoadApp = Pear.config.linkData?.startsWith('devtools/')
|
||||
if (shouldLoadApp) {
|
||||
this.addApp(Pear.config.linkData)
|
||||
@@ -327,7 +326,9 @@ customElements.define('developer-tooling', class extends HTMLElement {
|
||||
this.render()
|
||||
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) => {
|
||||
if (req.url !== '/json/list') {
|
||||
res.writeHead(404)
|
||||
|
||||
@@ -111,7 +111,7 @@ customElements.define('docs-viewer', class extends HTMLElement {
|
||||
|
||||
patchSyntax (input) {
|
||||
// remove backticks inside link, example: [`hypercore`] -> [hypercore]
|
||||
let output = input.replace(/\[`([^`]+)`\]/g, "[$1]")
|
||||
let output = input.replace(/\[`([^`]+)`\]/g, '[$1]')
|
||||
|
||||
// remove gitbook embed syntax
|
||||
output = output.replace(/{% embed url="([^"]+)" %}\s*(.*?)\s*{% embeded %}/g, '> [$2]($1)')
|
||||
|
||||
11
package.json
11
package.json
@@ -3,6 +3,9 @@
|
||||
"version": "1.0.0",
|
||||
"main": "index.html",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "standard --fix"
|
||||
},
|
||||
"pear": {
|
||||
"gui": {
|
||||
"backgroundColor": "#151517",
|
||||
@@ -10,11 +13,19 @@
|
||||
"width": 1120
|
||||
}
|
||||
},
|
||||
"standard": {
|
||||
"globals": [
|
||||
"Pear"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"b4a": "^1.6.4",
|
||||
"bare-path": "^2.1.0",
|
||||
"pear-inspect": "^1.0.3",
|
||||
"redhat-overpass-font": "^1.0.0",
|
||||
"ws": "^8.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"standard": "^17.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user