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

refactor(api): Add conditional exports to package.json #11307

Merged
merged 10 commits into from
Aug 18, 2024

Conversation

Josh-Walker-GM
Copy link
Collaborator

@Josh-Walker-GM Josh-Walker-GM commented Aug 18, 2024

This removes the need to have the top level files which then proxy to a file in dist by using the exports field of the package.json.

In adding the exports field this PR becomes a breaking change. I did not see any usage within the framework repo of this package which isn't covered by the exports I have added here.

In doing this PR I run into the same issue @Tobbe experienced. I wanted to run ATTW against the package but accept that node10 resolution won't work. There's currently no built in way to do this with that tool itself. Tobbe created a nice little script to handle this logic. What I do here is copy that script into the framework tools package in a way that can hopefully be used more easily by other packages as we go forward.

@Josh-Walker-GM Josh-Walker-GM added the release:breaking This PR is a breaking change label Aug 18, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the next-release-major milestone Aug 18, 2024
@Josh-Walker-GM Josh-Walker-GM self-assigned this Aug 18, 2024
const originalExtraPlugins: Plugin<any>[] =
graphqlOptions.extraPlugins ?? []
const originalExtraPlugins = graphqlOptions.extraPlugins ?? []
// @ts-expect-error TODO(jgmw): Fix this type issue introduced after switching to Node16 module resolution
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Reminder to self

@Josh-Walker-GM Josh-Walker-GM force-pushed the jgmw/api-add-conditional-exports branch 2 times, most recently from c6b9e9d to c3a14f8 Compare August 18, 2024 18:42
@Josh-Walker-GM Josh-Walker-GM force-pushed the jgmw/api-add-conditional-exports branch from 5367ec7 to 9d455c9 Compare August 18, 2024 22:28
@Josh-Walker-GM Josh-Walker-GM merged commit fb8acb3 into main Aug 18, 2024
46 checks passed
@Josh-Walker-GM Josh-Walker-GM deleted the jgmw/api-add-conditional-exports branch August 18, 2024 23:35
dac09 added a commit to dac09/redwood that referenced this pull request Aug 19, 2024
…pload-link

* 'main' of github.com:redwoodjs/redwood: (52 commits)
  linting: enable 'typescript-eslint/await-thenable' rule (redwoodjs#11311)
  refactor(api): Add conditional exports to package.json (redwoodjs#11307)
  chore(readme): Add my middle initials (redwoodjs#11310)
  chore(README): Fix formatting. One row (redwoodjs#11309)
  chore(README): Move Kris from Maintainer to Alumni (redwoodjs#11308)
  fix(codemods): Move away from babel for building package (redwoodjs#11306)
  fix(api): Move away from babel for building package (redwoodjs#11305)
  fix(internal): Move away from babel for building package (redwoodjs#11304)
  fix(auth-providers): Move away from babel for building 'api' packages (redwoodjs#11301)
  fix(auth-providers): Move away from babel for building 'setup' packages  (redwoodjs#11303)
  chore(deps): Remove webpack related dependencies (redwoodjs#11299)
  chore(build): build core with esbuild (redwoodjs#11298)
  chore(exec test): Clean up (redwoodjs#11302)
  Detect/resolve ambiguous script names (redwoodjs#9848)
  chore(lint): tidy up the prettier ignore (redwoodjs#11297)
  feat(context): Build and publish package as dual esm/cjs (redwoodjs#11294)
  chore(lint): fix prettier configs and ignores (redwoodjs#11295)
  chore(docs): update prettier config and format docs content (redwoodjs#11293)
  chore(check): Refactor 'yarn check' away from being a standalone node script  (redwoodjs#11292)
  chore: delete crowdin config file (redwoodjs#11291)
  ...
dac09 added a commit to dac09/redwood that referenced this pull request Aug 19, 2024
…ads-extension

* 'main' of github.com:redwoodjs/redwood: (52 commits)
  linting: enable 'typescript-eslint/await-thenable' rule (redwoodjs#11311)
  refactor(api): Add conditional exports to package.json (redwoodjs#11307)
  chore(readme): Add my middle initials (redwoodjs#11310)
  chore(README): Fix formatting. One row (redwoodjs#11309)
  chore(README): Move Kris from Maintainer to Alumni (redwoodjs#11308)
  fix(codemods): Move away from babel for building package (redwoodjs#11306)
  fix(api): Move away from babel for building package (redwoodjs#11305)
  fix(internal): Move away from babel for building package (redwoodjs#11304)
  fix(auth-providers): Move away from babel for building 'api' packages (redwoodjs#11301)
  fix(auth-providers): Move away from babel for building 'setup' packages  (redwoodjs#11303)
  chore(deps): Remove webpack related dependencies (redwoodjs#11299)
  chore(build): build core with esbuild (redwoodjs#11298)
  chore(exec test): Clean up (redwoodjs#11302)
  Detect/resolve ambiguous script names (redwoodjs#9848)
  chore(lint): tidy up the prettier ignore (redwoodjs#11297)
  feat(context): Build and publish package as dual esm/cjs (redwoodjs#11294)
  chore(lint): fix prettier configs and ignores (redwoodjs#11295)
  chore(docs): update prettier config and format docs content (redwoodjs#11293)
  chore(check): Refactor 'yarn check' away from being a standalone node script  (redwoodjs#11292)
  chore: delete crowdin config file (redwoodjs#11291)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:breaking This PR is a breaking change
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant