diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..93d01c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/lib/devtools.js b/lib/devtools.js index 77f3915..e244f53 100644 --- a/lib/devtools.js +++ b/lib/devtools.js @@ -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) diff --git a/lib/docs-viewer.js b/lib/docs-viewer.js index 2b0d0ce..78cec9e 100644 --- a/lib/docs-viewer.js +++ b/lib/docs-viewer.js @@ -109,12 +109,12 @@ customElements.define('docs-viewer', class extends HTMLElement { observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] }) } - patchSyntax(input) { + 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)') + output = output.replace(/{% embed url="([^"]+)" %}\s*(.*?)\s*{% embeded %}/g, '> [$2]($1)') return output } diff --git a/lib/system-status.js b/lib/system-status.js index 6497771..7f2ee60 100644 --- a/lib/system-status.js +++ b/lib/system-status.js @@ -119,7 +119,7 @@ customElements.define('system-status', class extends HTMLElement {
To finish installing Pear Runtime set your system path to
${BIN}
${!isWin? ' or click the button.' : ''}
+${!isWin ? ' or click the button.' : ''}
${!isWin ? '' : ''} ` } diff --git a/package.json b/package.json index 0052274..0a147ad 100644 --- a/package.json +++ b/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" } }