Skip to content

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)

🦦

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.

@fgnass
Copy link
Contributor Author

fgnass commented Feb 25, 2025

Update: I updated the PR to include a fix for #7415 since this is closely related.

@fgnass fgnass changed the title fix(#7401): move stega.ts to core package Fix(#7401, #7415): resolve visual editing issues Feb 25, 2025
@alexwilson
Copy link

alexwilson commented Apr 29, 2025

Hey @eoneill - could you please re-review this PR? This fixes a big circular-dependency blocker with builds. 🙏🙏🙏

@martinjagodic martinjagodic enabled auto-merge (squash) June 19, 2025 09:24
@martinjagodic martinjagodic merged commit 2173a38 into decaporg:main Jun 19, 2025
7 checks passed
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'

4 participants