Skip to content

Commit

Permalink
Fix live demo (#359)
Browse files Browse the repository at this point in the history
* Add starter workflow

* Try building site

* Remove Jekyll

* Format

* Update links
  • Loading branch information
Methuselah96 authored Jan 5, 2024
1 parent 49af257 commit 916085b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ['master']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build jsondiffpatch
run: npm run build
working-directory: ./packages/jsondiffpatch
- name: Build HTML demo
run: npm run build
working-directory: ./demos/html-demo
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./demos/html-demo

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Diff & patch JavaScript objects

---

## **[Live Demo](http://benjamine.github.io/jsondiffpatch/demo/index.html)**
## **[Live Demo](http://benjamine.github.io/jsondiffpatch/index.html)**

- min+gzipped ~ 16KB
- browser and server (ESM-only)
Expand All @@ -22,7 +22,7 @@ Diff & patch JavaScript objects
- unpatch (eg. revert object to its original state using a delta)
- simplistic, pure JSON, low footprint [delta format](docs/deltas.md)
- multiple output formatters:
- html (check it at the [Live Demo](http://benjamine.github.io/jsondiffpatch/demo/index.html))
- html (check it at the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html))
- annotated json (html), makes the JSON delta format self-explained
- console (colored), try running `./node_modules/.bin/jsondiffpatch left.json right.json`
- JSON Patch format RFC 6902 support
Expand Down Expand Up @@ -270,7 +270,7 @@ const jsondiffpatchInstance = jsondiffpatch.create({
</html>
```

To see formatters in action check the [Live Demo](http://benjamine.github.io/jsondiffpatch/demo/index.html).
To see formatters in action check the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html).

For more details check [Formatters documentation](docs/formatters.md)

Expand Down
2 changes: 1 addition & 1 deletion docs/deltas.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This format was created with a balance between readability and low footprint in
- to represent changed parts, arrays and magic numbers are used to keep a low footprint (i.e. you won't see verbosity like `"type": "added"`)
- keep it pure JSON serializable

A great way to understand this format is using the "Annotated JSON" option in the [Live Demo](http://benjamine.github.io/jsondiffpatch/demo/index.html), and try the different left/right examples, or edit left/right JSON to see the annotated delta update as your type.
A great way to understand this format is using the "Annotated JSON" option in the [Live Demo](http://benjamine.github.io/jsondiffpatch/index.html), and try the different left/right examples, or edit left/right JSON to see the annotated delta update as your type.

Here's a complete reference of this format.

Expand Down
2 changes: 1 addition & 1 deletion docs/formatters.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Formatters

Some formatters are included that let you convert a JSON delta into other formats, you can see some of these used in the [Live Demo](https://benjamine.github.io/jsondiffpatch/demo/index.html)
Some formatters are included that let you convert a JSON delta into other formats, you can see some of these used in the [Live Demo](https://benjamine.github.io/jsondiffpatch/index.html)

## Html

Expand Down

0 comments on commit 916085b

Please sign in to comment.