Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 1, 2025

This PR removes the local src/json-pointer/ folder and replaces it with the official @jsonjoy.com/json-pointer package to reduce code duplication and maintenance overhead.

Changes Made

  • Removed the local src/json-pointer/ folder containing basic type definitions
  • Added @jsonjoy.com/[email protected] as a dependency
  • Updated import statements in 5 files across msgpack and cbor modules to use the external package

Why This Change?

The local json-pointer implementation only provided basic type definitions (PathStep and Path), which are now available from the official @jsonjoy.com/json-pointer package. This package provides:

  • The exact same type definitions we were using locally
  • Additional utilities and functions for JSON Pointer operations
  • Consistent maintenance and updates from the jsonjoy team
  • Better alignment with the broader jsonjoy ecosystem

Files Changed

  • src/cbor/CborDecoder.ts - Updated import statement
  • src/cbor/__tests__/shallow-read.genShallowRead.spec.ts - Updated import statement
  • src/msgpack/MsgPackDecoder.ts - Updated import statement
  • src/msgpack/__tests__/shallow-read.genShallowRead.spec.ts - Updated import statement
  • src/msgpack/shallow-read.ts - Updated import statement
  • src/json-pointer/index.ts - Removed
  • src/json-pointer/types.ts - Removed

Verification

  • All existing tests continue to pass (2833 tests)
  • Build completes successfully
  • Linting passes without issues
  • The Path and PathStep types work identically to the previous implementation

This change maintains full backward compatibility while reducing the codebase size and leveraging the official json-pointer implementation.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Remove src/json-pointer/ folder. Install @jsonjoy.com/json-pointer package, and use the necessary types/code from there. Replace local json-pointer implementation with @jsonjoy.com/json-pointer package Aug 1, 2025
Copilot AI requested a review from streamich August 1, 2025 21:58
@streamich streamich marked this pull request as ready for review August 1, 2025 21:59
import {genShallowReader} from '../../msgpack/shallow-read';
import {CborEncoder} from '../CborEncoder';
import {CborDecoder} from '../CborDecoder';
import {Path} from '../../json-pointer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import as type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use type import in commit 2a00fb5.

import {CONST, ERROR, MAJOR} from './constants';
import {CborDecoderBase} from './CborDecoderBase';
import {JsonPackValue} from '../JsonPackValue';
import type {Path} from '../json-pointer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import as type.

import {genShallowReader} from '../shallow-read';
import {MsgPackEncoder} from '../MsgPackEncoder';
import {MsgPackDecoder} from '../MsgPackDecoder';
import {Path} from '../../json-pointer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import as type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use type import in commit 2a00fb5.

@@ -1,6 +1,6 @@
import {JsonPackValue} from '.';
import {MsgPackDecoderFast} from './MsgPackDecoderFast';
import type {Path} from '../json-pointer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import as type.

@@ -1,4 +1,4 @@
import {Path} from '../json-pointer';
Copy link
Collaborator

Choose a reason for hiding this comment

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

Import as type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use type import in commit 2a00fb5.

Copilot AI requested a review from streamich August 1, 2025 22:06
@streamich streamich merged commit 585b4b7 into master Aug 1, 2025
2 checks passed
@streamich streamich deleted the copilot/fix-bf37fcf9-c5ab-4c1e-bb7a-51083e43e305 branch August 1, 2025 22:09
@github-actions
Copy link

github-actions bot commented Aug 1, 2025

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants