Skip to content

Commit

Permalink
chore: upgrade to [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Dec 13, 2023
1 parent 2ffe4e7 commit 0d59366
Show file tree
Hide file tree
Showing 47 changed files with 137 additions and 93 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"ajv": "^8.12.0",
"codemirror-wrapped-line-indent": "^1.0.0",
"diff-sequences": "^29.6.3",
"immutable-json-patch": "^5.1.3",
"immutable-json-patch": "6.0.0",
"jmespath": "^0.16.0",
"json-source-map": "^0.6.1",
"jsonrepair": "^3.4.1",
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/controls/JSONPreview.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<script lang="ts">
import type { JSONParser } from '$lib/types'
import type { JSONParser, JSONValue } from '$lib/types'
import { truncate } from '$lib/utils/stringUtils.js'
import { getText } from '$lib/utils/jsonUtils.js'
import { MAX_CHARACTERS_TEXT_PREVIEW } from '$lib/constants.js'
import type { JSONValue } from 'immutable-json-patch'
export let text: string | undefined
export let json: JSONValue | undefined
Expand Down
10 changes: 8 additions & 2 deletions src/lib/components/controls/navigationBar/NavigationBar.svelte
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<svelte:options immutable={true} />

<script lang="ts">
import type { JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPath } from 'immutable-json-patch'
import { existsIn, getIn } from 'immutable-json-patch'
import { range } from 'lodash-es'
import { isObject, isObjectOrArray } from '$lib/utils/typeUtils.js'
import { createMultiSelection, getFocusPath } from '$lib/logic/selection.js'
import { createDebug } from '$lib/utils/debug.js'
import { caseInsensitiveNaturalCompare } from '$lib/logic/sort.js'
import type { JSONPathParser, JSONSelection, OnError, OnJSONSelect } from '$lib/types.js'
import type {
JSONPathParser,
JSONSelection,
JSONValue,
OnError,
OnJSONSelect
} from '$lib/types.js'
import Icon from 'svelte-awesome'
import { faClose, faEdit } from '@fortawesome/free-solid-svg-icons'
import NavigationBarItem from './NavigationBarItem.svelte'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/modals/SortModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import { pathToOption, stringifyJSONPath } from '../../utils/pathUtils.js'
import { sortJson } from '$lib/logic/sort.js'
import { sortModalStates } from './sortModalStates'
import type { JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPath } from 'immutable-json-patch'
import { compileJSONPointer, getIn } from 'immutable-json-patch'
import { createDebug } from '$lib/utils/debug.js'
import type { OnSort } from '$lib/types.js'
import type { JSONValue, OnSort } from '$lib/types.js'
import { onEscape } from '$lib/actions/onEscape.js'
import type { Context } from 'svelte-simple-modal'
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modals/TransformModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { getContext } from 'svelte'
import Icon from 'svelte-awesome'
import { DEBOUNCE_DELAY } from '../../constants.js'
import type { JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPath } from 'immutable-json-patch'
import { compileJSONPointer, getIn } from 'immutable-json-patch'
import { stringifyJSONPath } from '$lib/utils/pathUtils.js'
import { transformModalStates, transformModalStateShared } from './transformModalStates.js'
Expand All @@ -20,6 +20,7 @@
Content,
JSONParser,
JSONPathParser,
JSONValue,
OnChangeQueryLanguage,
OnClassName,
OnPatch,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/modals/TransformWizard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { pathToOption } from '$lib/utils/pathUtils.js'
import { createDebug } from '$lib/utils/debug.js'
import { isEqual } from 'lodash-es'
import type { JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPath } from 'immutable-json-patch'
import { setIn } from 'immutable-json-patch'
import type { QueryLanguageOptions } from '$lib/types.js'
import type { JSONValue, QueryLanguageOptions } from '$lib/types.js'
const debug = createDebug('jsoneditor:TransformWizard')
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modes/tablemode/JSONValue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
AfterPatchCallback,
JSONEditorContext,
JSONSelection,
JSONValue,
SearchResultItem
} from '$lib/types'
import type { JSONPatchDocument, JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPatchDocument, JSONPath } from 'immutable-json-patch'
import { isEditingSelection, isValueSelection } from '$lib/logic/selection.js'
import { createNestedValueOperations } from '$lib/logic/operations.js'
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modes/tablemode/TableMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
JSONParser,
JSONPatchResult,
JSONSelection,
JSONValue,
OnBlur,
OnChange,
OnChangeMode,
Expand All @@ -36,7 +37,7 @@
} from '$lib/types'
import { Mode, SortDirection, ValidationSeverity } from '$lib/types.js'
import TableMenu from './menu/TableMenu.svelte'
import type { JSONPatchDocument, JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPatchDocument, JSONPath } from 'immutable-json-patch'
import {
compileJSONPointer,
existsIn,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/modes/tablemode/TableModeWelcome.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<svelte:options immutable={true} />

<script lang="ts">
import type { JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPath } from 'immutable-json-patch'
import { getIn, isJSONArray, isJSONObject } from 'immutable-json-patch'
import type { JSONParser, OnChangeMode } from '$lib/types.js'
import type { JSONParser, JSONValue, OnChangeMode } from '$lib/types.js'
import { Mode } from '$lib/types.js'
import { valueType } from '$lib/utils/typeUtils.js'
import { findNestedArrays } from '$lib/logic/table.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
faPlus,
faTrashCan
} from '@fortawesome/free-solid-svg-icons'
import type { JSONValue } from 'immutable-json-patch'
import { compileJSONPointer, getIn } from 'immutable-json-patch'
import {
getFocusPath,
Expand All @@ -25,6 +24,7 @@
ContextMenuItem,
DocumentState,
JSONParser,
JSONValue,
OnRenderContextMenuInternal
} from '$lib/types'
import { getEnforceString } from '$lib/logic/documentState.js'
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/modes/tablemode/menu/TableMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<svelte:options immutable={true} />

<script lang="ts">
import type { MenuItem, OnRenderMenuInternal } from '$lib/types'
import type { JSONValue, MenuItem, OnRenderMenuInternal } from '$lib/types'
import Menu from '../../../controls/Menu.svelte'
import {
faEllipsisV,
Expand All @@ -10,7 +10,6 @@
faSortAmountDownAlt,
faUndo
} from '@fortawesome/free-solid-svg-icons'
import type { JSONValue } from 'immutable-json-patch'
import type { HistoryState } from '$lib/logic/history'
import { CONTEXT_MENU_EXPLANATION } from '$lib/constants.js'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/modes/treemode/JSONValue.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<svelte:options immutable={true} />

<script lang="ts">
import type { JSONEditorContext, JSONSelection, SearchResultItem } from '$lib/types.js'
import type { JSONValue, JSONPath } from 'immutable-json-patch'
import type { JSONEditorContext, JSONSelection, JSONValue, SearchResultItem } from '$lib/types.js'
import type { JSONPath } from 'immutable-json-patch'
import { isEditingSelection, isValueSelection } from '$lib/logic/selection.js'
export let path: JSONPath
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modes/treemode/TreeMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import { createAutoScrollHandler } from '../../controls/createAutoScrollHandler.js'
import { faCheck, faCode, faWrench } from '@fortawesome/free-solid-svg-icons'
import { createDebug } from '$lib/utils/debug.js'
import type { JSONPatchDocument, JSONPath, JSONValue } from 'immutable-json-patch'
import type { JSONPatchDocument, JSONPath } from 'immutable-json-patch'
import { compileJSONPointer, existsIn, getIn, immutableJSONPatch } from 'immutable-json-patch'
import { jsonrepair } from 'jsonrepair'
import { initial, isEmpty, isEqual, noop, throttle, uniqueId } from 'lodash-es'
Expand Down Expand Up @@ -121,6 +121,7 @@
JSONPathParser,
JSONPointerMap,
JSONSelection,
JSONValue,
NestedValidationError,
OnBlur,
OnChange,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
faSortAmountDownAlt,
faTrashCan
} from '@fortawesome/free-solid-svg-icons'
import type { JSONValue } from 'immutable-json-patch'
import { compileJSONPointer, getIn } from 'immutable-json-patch'
import { initial, isEmpty } from 'lodash-es'
import {
Expand All @@ -34,6 +33,7 @@
DocumentState,
InsertType,
JSONParser,
JSONValue,
OnRenderContextMenuInternal
} from '$lib/types'
import { getEnforceString } from '$lib/logic/documentState.js'
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/modes/treemode/menu/TreeMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
import { faJSONEditorCollapse, faJSONEditorExpand } from '$lib/img/customFontawesomeIcons.js'
import { isObjectOrArray } from '$lib/utils/typeUtils.js'
import Menu from '../../../controls/Menu.svelte'
import type { JSONSelection, MenuItem, OnRenderMenuInternal } from '$lib/types'
import type { JSONValue } from 'immutable-json-patch'
import type { JSONSelection, JSONValue, MenuItem, OnRenderMenuInternal } from '$lib/types'
import { isKeySelection, isMultiSelection, isValueSelection } from '$lib/logic/selection.js'
import type { HistoryState } from '$lib/logic/history.js'
Expand Down
4 changes: 2 additions & 2 deletions src/lib/logic/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ import type {
AfterPatchCallback,
DocumentState,
InsertType,
JSONArray,
JSONParser,
JSONSelection,
JSONValue,
OnChange,
OnChangeText,
OnJSONSelect,
Expand All @@ -37,9 +39,7 @@ import {
isJSONObject,
isJSONPatchAdd,
isJSONPatchReplace,
type JSONArray,
type JSONPath,
type JSONValue,
parsePath
} from 'immutable-json-patch'
import { isObject, isObjectOrArray } from '$lib/utils/typeUtils.js'
Expand Down
7 changes: 5 additions & 2 deletions src/lib/logic/documentState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ import {
import {
CaretType,
type DocumentState,
type JSONArray,
type JSONObject,
type JSONPointerMap,
type JSONValue,
type VisibleSection
} from '../types.js'
import type { JSONArray, JSONObject, JSONPatchDocument, JSONValue } from 'immutable-json-patch'
} from '$lib/types.js'
import type { JSONPatchDocument } from 'immutable-json-patch'
import { compileJSONPointer, deleteIn, setIn } from 'immutable-json-patch'

describe('documentState', () => {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/logic/documentState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
isJSONPatchMove,
isJSONPatchRemove,
isJSONPatchReplace,
type JSONArray,
type JSONPatchAdd,
type JSONPatchCopy,
type JSONPatchDocument,
Expand All @@ -19,7 +18,6 @@ import {
type JSONPatchReplace,
type JSONPath,
type JSONPointer,
type JSONValue,
parseJSONPointer,
parsePath,
startsWithJSONPointer
Expand All @@ -37,9 +35,11 @@ import {
import type {
CaretPosition,
DocumentState,
JSONArray,
JSONParser,
JSONPointerMap,
JSONSelection,
JSONValue,
OnExpand,
Section,
VisibleSection
Expand Down Expand Up @@ -159,7 +159,7 @@ export function expandWithCallback(
): DocumentState {
const expandedMap = { ...documentState.expandedMap }

function recurse(value: JSONValue) {
function recurse(value: unknown) {
const pathIndex = currentPath.length

if (Array.isArray(value)) {
Expand Down Expand Up @@ -304,7 +304,7 @@ export function documentStatePatch(
documentState: DocumentState,
operations: JSONPatchDocument
): { json: JSONValue; documentState: DocumentState } {
const updatedJson = immutableJSONPatch(json, operations)
const updatedJson: JSONValue = immutableJSONPatch(json, operations)

const updatedDocumentState = operations.reduce((updatingState, operation) => {
if (isJSONPatchAdd(operation)) {
Expand Down Expand Up @@ -843,7 +843,7 @@ export function expandRecursive(
documentState: DocumentState,
path: JSONPath
): DocumentState {
const expandContents = getIn(json, path)
const expandContents: JSONValue | undefined = getIn(json, path)
if (expandContents === undefined) {
return documentState
}
Expand Down
3 changes: 2 additions & 1 deletion src/lib/logic/dragging.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { createMultiSelection, getEndPath, getStartPath } from './selection.js'
import { initial, isEqual } from 'lodash-es'
import type { JSONValue, JSONPatchDocument } from 'immutable-json-patch'
import type { JSONPatchDocument } from 'immutable-json-patch'
import { getIn } from 'immutable-json-patch'
import { moveInsideParent } from './operations.js'
import type {
DocumentState,
DragInsideAction,
DragInsideProps,
JSONSelection,
JSONValue,
MultiSelection,
RenderedItem
} from '$lib/types'
Expand Down
Loading

0 comments on commit 0d59366

Please sign in to comment.