Skip to content

Commit

Permalink
Release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Jan 25, 2024
1 parent 5d1c4e9 commit 9e2fa73
Show file tree
Hide file tree
Showing 16 changed files with 25 additions and 37 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Load from the [jsdelivr.com CDN](https://www.jsdelivr.com/package/npm/pretty-pri
...
<script src=https://cdn.jsdelivr.net/npm/[email protected]/dist/pretty-print-json.min.js></script>
```
The minified JS file is 2 KB.

For **dark mode**, replace `pretty-print-json.css` with `pretty-print-json.dark-mode.css` in
the `<link>` tag.

Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.dark-mode.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.dark-mode.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.prefers.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.prefers.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/pretty-print-json.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License

export type FormatSettings = {
indent: number;
Expand Down
11 changes: 2 additions & 9 deletions dist/pretty-print-json.dev.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
//! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License

const prettyPrintJson = {
version: '2.1.2',
version: '3.0.0',
toHtml(data, options) {
if (!''.at)
String.prototype.at = function (i) { return this.charAt(i + (i < 0 ? this.length : 0)); };
const deprecatedTrailingComma = options?.['trailingComma'];
if (deprecatedTrailingComma !== undefined)
options.trailingCommas = deprecatedTrailingComma;
if (deprecatedTrailingComma !== undefined)
console.warn('pretty-print-json: Use "trailingCommas" option instead of "trailingComma".');
const defaults = {
indent: 3,
lineNumbers: false,
Expand Down
11 changes: 2 additions & 9 deletions dist/pretty-print-json.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
//! pretty-print-json v2.1.2 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v3.0.0 ~~ https://pretty-print-json.js.org ~~ MIT License

const prettyPrintJson = {
version: '2.1.2',
version: '3.0.0',
toHtml(data, options) {
if (!''.at)
String.prototype.at = function (i) { return this.charAt(i + (i < 0 ? this.length : 0)); };
const deprecatedTrailingComma = options?.['trailingComma'];
if (deprecatedTrailingComma !== undefined)
options.trailingCommas = deprecatedTrailingComma;
if (deprecatedTrailingComma !== undefined)
console.warn('pretty-print-json: Use "trailingCommas" option instead of "trailingComma".');
const defaults = {
indent: 3,
lineNumbers: false,
Expand Down
4 changes: 2 additions & 2 deletions dist/pretty-print-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/dynamic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna-engine.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/reset.min.css>
<style>
Expand Down Expand Up @@ -48,7 +48,7 @@
const app = {
loadModule(module) {
const buttonClicked = new Date();
const url = 'https://cdn.jsdelivr.net/npm/pretty-print-json@2.0/dist/pretty-print-json.js';
const url = 'https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.js';
globalThis.document.querySelector('main pre').classList.add('active');
const onModuleLoad = (module) => {
const pageLoaded = Number(globalThis.document.body.dataset.pageLoaded);
Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna-engine.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/reset.min.css>
<style>
Expand Down Expand Up @@ -169,8 +169,8 @@
[data-component=pretty-print] >section:last-child >div { min-height: 200px; }
}
</style>
<script defer src=https://cdn.jsdelivr.net/npm/pretty-print-json@2.1/dist/pretty-print-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna-engine.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/lib-x.min.js></script>
<script data-on-load=app.setup data-wait-for=libX>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pretty-print-json",
"version": "2.1.2",
"version": "3.0.0",
"description": "Pretty-print JSON data into HTML to indent and colorize (written in functional TypeScript)",
"license": "MIT",
"type": "module",
Expand Down Expand Up @@ -107,7 +107,7 @@
"dna-engine": "~3.1",
"eslint": "~8.56",
"esm-to-plain-js": "~1.1",
"fetch-json": "~3.2",
"fetch-json": "~3.3",
"jsdom": "~24.0",
"jshint": "~2.13",
"mocha": "~10.2",
Expand Down
4 changes: 2 additions & 2 deletions spec/dynamic.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna-engine.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/[email protected]/dist/reset.min.css>
<style>
Expand Down Expand Up @@ -48,7 +48,7 @@
const app = {
loadModule(module) {
const buttonClicked = new Date();
const url = 'https://cdn.jsdelivr.net/npm/pretty-print-json@2.0/dist/pretty-print-json.js';
const url = 'https://cdn.jsdelivr.net/npm/pretty-print-json@3.0/dist/pretty-print-json.js';
globalThis.document.querySelector('main pre').classList.add('active');
const onModuleLoad = (module) => {
const pageLoaded = Number(globalThis.document.body.dataset.pageLoaded);
Expand Down
2 changes: 1 addition & 1 deletion spec/interactive.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
}
</style>
<script defer src=../dist/pretty-print-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/fetch-json@3.2/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/fetch-json@3.3/dist/fetch-json.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/dna-engine.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/[email protected]/dist/lib-x.min.js></script>
<script data-on-load=app.setup data-wait-for=libX>
Expand Down

0 comments on commit 9e2fa73

Please sign in to comment.