Skip to content

Commit

Permalink
Update docusaurus and fix circular import
Browse files Browse the repository at this point in the history
  • Loading branch information
jg-rp committed May 3, 2024
1 parent 1f58a72 commit 106cf75
Show file tree
Hide file tree
Showing 10 changed files with 890 additions and 928 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

**Features**

- Added the non-standard _key_ selector.
- Added the non-standard _keys filter_ selector.
- Added the non-standard _key_ selector ([docs](https://jg-rp.github.io/json-p3/guides/jsonpath-extra#key-selector)).
- Added the non-standard _keys filter_ selector ([docs](https://jg-rp.github.io/json-p3/guides/jsonpath-extra#keys-filter-selector)).

## Version 1.2.1

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/guides/jsonpath-extra.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Non-standard features are subject to change if:
- an overwhelming consensus emerges from the JSONPath community that differs from our choices.
:::

The following definitions build on [RFC 9535](https://datatracker.ietf.org/doc/html/rfc9535) ([license info](https://trustee.ietf.org/license-info)), while trying to stay true to its JSONPath model. These non-standard selectors are known to break the definition of _location_ and _children_ from in RFC 9535.
The following definitions build on [RFC 9535](https://datatracker.ietf.org/doc/html/rfc9535) ([license info](https://trustee.ietf.org/license-info)), while trying to stay true to its JSONPath model. These non-standard selectors are known to break the definition of _location_ and _children_ from RFC 9535.

## Key selector

Expand Down
1,792 changes: 877 additions & 915 deletions docs/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"write-heading-ids": "docusaurus write-heading-ids"
},
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/preset-classic": "^3.1.1",
"@docusaurus/core": "^3.3.0",
"@docusaurus/preset-classic": "^3.3.0",
"@mdx-js/react": "^3.0.0",
"@monaco-editor/react": "^4.6.0",
"@tsconfig/docusaurus": "^2.0.2",
Expand All @@ -35,7 +35,7 @@
"typescript": "^5.3.3"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.1.1",
"@docusaurus/module-type-aliases": "^3.3.0",
"prettier": "^3.1.1",
"prettier-plugin-tailwindcss": "^0.5.10"
},
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/JSONPathPlayground/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function ResultTab({ fileName, file, setFileName }) {
"flex cursor-pointer items-center border-none px-4 py-1 text-sm font-medium",
fileName === file.name
? "bg-[#F8F8FF] text-slate-700 dark:bg-[#1E1E1E] dark:text-neutral-300"
: "bg-slate-200 text-slate-500 hover:bg-[#F8F8FF] hover:text-slate-700 dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-600",
: "bg-slate-200 text-slate-500 hover:bg-[#F8F8FF] hover:text-slate-700 dark:bg-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-600 dark:hover:text-neutral-300",
)}
onClick={() => setFileName(fileName)}
>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "json-p3",
"version": "1.2.2",
"version": "1.3.0",
"author": "James Prior",
"license": "MIT",
"description": "JSONPath, JSON Pointer and JSON Patch",
Expand Down
4 changes: 1 addition & 3 deletions src/path/extra/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import { LogicalExpression } from "../expression";
import { JSONPathNode } from "../node";
import { JSONPathSelector } from "../selectors";
import { Token } from "../token";
import { FilterContext, hasStringKey } from "../types";

export const KEY_MARK = "\x02";
import { FilterContext, KEY_MARK, hasStringKey } from "../types";

export class KeySelector extends JSONPathSelector {
constructor(
Expand Down
2 changes: 1 addition & 1 deletion src/path/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export {
JSONPathRecursionLimitError,
} from "./errors";

export { Nothing } from "./types";
export { Nothing, KEY_MARK } from "./types";
export type { JSONPathValue, FilterContext } from "./types";

export const DEFAULT_ENVIRONMENT = new JSONPathEnvironment();
Expand Down
2 changes: 1 addition & 1 deletion src/path/node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { JSONPointer } from "../pointer";
import { JSONValue, isString } from "../types";
import { KEY_MARK } from "./extra/selectors";
import { KEY_MARK } from "./types";

/**
* The pair of a JSON value and its location found in the target JSON value.
Expand Down
2 changes: 2 additions & 0 deletions src/path/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ export function hasStringKey(
): value is { [key: string]: unknown } {
return isObject(value) && Object.hasOwn(value, key);
}

export const KEY_MARK = "\x02";

0 comments on commit 106cf75

Please sign in to comment.