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

feat: testing branch for ESM-only packages [] #1526

Draft
wants to merge 16 commits into
base: feat/esm-only
Choose a base branch
from

Conversation

aodhagan-cf
Copy link
Contributor

@aodhagan-cf aodhagan-cf commented Oct 27, 2023

Strategy

  • attempt to migrate all field editors in this branch
  • create a separate PR for each package to an ESM-only branch
  • merge ESM-only branch to master (having 1 commit per package) after a testing session

@aodhagan-cf aodhagan-cf requested a review from a team as a code owner October 27, 2023 11:41

const baseConfig = require('../../baseJestConfig');
const packageJSON = require('./package.json');
const packageName = packageJSON.name.split('@contentful/')[1];
Copy link
Contributor

@chrishelgert chrishelgert Oct 27, 2023

Choose a reason for hiding this comment

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

NIT: depending on your preference

Suggested change
const packageName = packageJSON.name.split('@contentful/')[1];
const packageName = packageJSON.name.replace('@contentful/', '');

"types": "dist/types/index.d.ts",
"exports": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need them or not?
I saw some post where it was mentioned that it was required for pure esm
other post are not mentioning them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andipaetzold going to tag you on this comment if that's okay? I don't think we need it, I've tested this in the web app and it works, but have also seen some articles recommending to have it in

Copy link
Contributor

Choose a reason for hiding this comment

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

No, we don't need it

@@ -4,10 +4,10 @@ import { json } from '@codemirror/lang-json';
import { indentUnit } from '@codemirror/language';
import { EditorView } from '@codemirror/view';
import tokens from '@contentful/f36-tokens';
import CodeMirror from '@uiw/react-codemirror';
import CodeMirror from '@uiw/react-codemirror/esm/index.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ why do we need to import from esm
Shouldn't be automatically detected?

"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
"type": "module",
"main": "dist/esm/index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

This package stores the files in dist/esm while boolean stores them in dist directly. Can we align the setups?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense will do!

@aodhagan-cf aodhagan-cf marked this pull request as draft October 31, 2023 14:39
@aodhagan-cf aodhagan-cf changed the title feat: moving the json editor to esm only [] feat: testing branch for ESM-only packages [] Oct 31, 2023
Copy link

github-actions bot commented Dec 1, 2023

Marking pull request as stale since there was no activity for 30 days

@github-actions github-actions bot added the stale Used to mark when there was no activity for a set period of time label Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants