Skip to content

Fix docs deployment asset path and enable live bidirectional conversion in demo - #3

Merged
wmertens merged 2 commits into
masterfrom
copilot/copy-file-to-docs
Jun 8, 2026
Merged

Fix docs deployment asset path and enable live bidirectional conversion in demo#3
wmertens merged 2 commits into
masterfrom
copilot/copy-file-to-docs

Conversation

Copilot AI commented Jun 8, 2026

Copy link
Copy Markdown

Docs are now deployed from docs/, but the demo page still loaded JSURL from ../dist/index.js, which is absent in Pages artifacts. This updates deployment to publish the runtime into docs/ and makes JSON↔JSURL conversion run continuously while typing.

  • Docs deployment artifact

    • Update Pages workflow to build the library before upload.
    • Copy dist/index.js to docs/index.js so the demo has its runtime in deployed artifacts.
  • Demo page runtime + live editing

    • Change demo script source from ../dist/index.js to ./index.js.
    • Add oninput handlers on both textareas to perform immediate conversion in both directions.
    • Keep existing button-based conversion/beautify flows intact.
  • README cleanup

    • Remove stale Live editor: https://cv122s.csb.app/ entry.
  • Focused regression coverage

    • Add a docs-focused test that asserts:
      • the demo references ./index.js
      • both live oninput conversion hooks are present
<script src="./index.js" type="application/javascript"></script>

<textarea
  id="json"
  oninput="javascript:execute('json', 'jsurl', json2jsurl)"
></textarea>

<textarea
  id="jsurl"
  oninput="javascript:execute('jsurl', 'json', jsurl2json)"
></textarea>

Copilot AI linked an issue Jun 8, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix docs deployment to include index.js file Fix docs deployment asset path and enable live bidirectional conversion in demo Jun 8, 2026
Copilot AI requested a review from wmertens June 8, 2026 12:08
@wmertens
wmertens marked this pull request as ready for review June 8, 2026 12:16
Copilot AI review requested due to automatic review settings June 8, 2026 12:16
@wmertens
wmertens merged commit 239eb90 into master Jun 8, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the GitHub Pages docs deployment so the demo page can load the JSURL runtime from within the deployed docs/ artifact, and enhances the demo UX by running JSON↔JSURL conversion live while typing.

Changes:

  • Update the Pages workflow to build the library and publish the browser runtime into docs/.
  • Switch the demo page to load ./index.js and add oninput handlers for continuous bidirectional conversion.
  • Remove the stale “Live editor” link from the README and add a regression test covering the docs demo wiring.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/docs.test.ts Adds a docs regression test asserting the demo’s runtime path and live oninput conversion hooks.
README.md Removes an outdated “Live editor” link.
docs/index.html Loads runtime from ./index.js and enables live conversion via oninput handlers.
.github/workflows/static.yml Builds the library during Pages deploy and copies the runtime into docs/ before uploading.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/docs.test.ts
Comment on lines +1 to +10
import fs from 'node:fs'
import path from 'node:path'

import {describe, expect, test} from 'vitest'

describe('docs demo page', () => {
const docsIndex = fs.readFileSync(
path.resolve(__dirname, '../docs/index.html'),
'utf8',
)
Comment on lines +35 to +39
run: |
corepack enable
corepack pnpm install --frozen-lockfile
corepack pnpm build
cp dist/index.js docs/index.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs don't work

3 participants