Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix data mate import copy #3727

Merged
merged 8 commits into from
Aug 22, 2024
Merged

Fix data mate import copy #3727

merged 8 commits into from
Aug 22, 2024

Conversation

busma13
Copy link
Contributor

@busma13 busma13 commented Aug 22, 2024

This PR makes the following changes:

  • Modify packages/data-mate/src/index.ts to copy each property from the FTransform and RTransform imports to a new object instead of using cloneDeep. This avoids a type error that occurs when teraslice-cli assets build tries to build an ESM asset that imports data-mate
  • Bump data-mate from 1.0.2 to 1.0.3, elasticsearch-store from 1.0.2 to 1.0.3, terafoundation from 1.2.2 to 1.2.3, ts-transforms from 1.0.2 to 1.0.3

See here for details: #3725

@busma13 busma13 marked this pull request as ready for review August 22, 2024 21:57
@busma13 busma13 requested a review from jsnoble August 22, 2024 21:57

FieldTransform.repository.extract = extractConfig;
FieldTransform.extract = extract;
const tmpFieldTransform = {};
Copy link
Member

Choose a reason for hiding this comment

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

You are creating an empty object and trying to force a type on it, hence all the type additions which would be burdensome to mantain or know to add to it when we add another function.

This should be a simple

const FieldTransforms = {
    ...FTransfom
}

This copies the types over for you and still maintains the types

decodeHex: typeof FieldTransform.decodeHex;
decodeURL: typeof FieldTransform.decodeURL;
encodeBase64: typeof FieldTransform.encodeBase64;
encodeHex: typeof FieldTransform.encodeHex;
Copy link
Member

Choose a reason for hiding this comment

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

this should not be needed

Copy link
Member

@jsnoble jsnoble left a comment

Choose a reason for hiding this comment

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

LGTM

@godber godber merged commit f4c1d11 into master Aug 22, 2024
67 checks passed
@godber godber deleted the fix-data-mate-import-copy branch August 22, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants