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(#7401): move stega.ts to core package #7405

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fgnass
Copy link
Contributor

@fgnass fgnass commented Feb 13, 2025

Summary

This PR fixes #7401 by moving stega.ts to the core package, thereby getting rid of the circular dependency.

Additional changes:

  • Adds the new visualEditing prop to the type declarations
  • Allows running tests after a build by ignoring .nx and dist in jest

Test plan

Use decap-cms-app in an external project.

Checklist

Please add a x inside each checkbox:

A picture of a cute animal (not mandatory but encouraged)

🦦

@@ -1,6 +1,5 @@
import { vercelStegaEncode } from '@vercel/stega';

import { isImmutableMap, isImmutableList } from './types';
import { isImmutableMap, isImmutableList } from 'decap-cms-lib-util/src/types';
Copy link

Choose a reason for hiding this comment

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

Looking at this again, I think this will actually have a similar issue. In general, I don't think we should ever use imports that directly reach into <package>/src/.

Possible fixes...

  • import { ... } from 'decap-cms-lib-util/dist/esm/types'
  • re-export these methods in decap-cms-lib-util/src/index.ts and import { ... } from 'decap-cms-lib-util'
  • move these isImmutable* methods into decap-cms-core, as they aren't used anywhere else currently

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, good catch! I moved the type guards to types/immutable.ts in the core package – a file which was already there. I think this is a good fit.

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.

[decap-cms-app] Module not found: Can't resolve 'decap-cms-lib-util/src/stega'
2 participants