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()
|
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)
|
||||||
|
|||||||
@@ -109,12 +109,12 @@ customElements.define('docs-viewer', class extends HTMLElement {
|
|||||||
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] })
|
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] })
|
||||||
}
|
}
|
||||||
|
|
||||||
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)')
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ customElements.define('system-status', class extends HTMLElement {
|
|||||||
</blockquote>
|
</blockquote>
|
||||||
<p>To finish installing Pear Runtime set your system path to</p>
|
<p>To finish installing Pear Runtime set your system path to</p>
|
||||||
<p><code>${BIN}</code></p>
|
<p><code>${BIN}</code></p>
|
||||||
<p>${!isWin? ' or click the button.' : ''}</p>
|
<p>${!isWin ? ' or click the button.' : ''}</p>
|
||||||
${!isWin ? '<p><button> Automatic Setup Completion </button><p>' : ''}
|
${!isWin ? '<p><button> Automatic Setup Completion </button><p>' : ''}
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|||||||
11
package.json
11
package.json
@@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user