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(packaging): Don't advertise non-existent ESM entrypoints #2022

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

cpcallen
Copy link
Contributor

The basics

The details

Resolves

Fixes #1877.

Proposed Changes

Don't advertise module entrypoints on packages that are implemented in TypeScript as at the moment our webpack configuration does not generate any file called src/index.js.

Reason for Changes

For JS packages, we point bundlers looking for an ESM entrypoint at src/index.js, thereby letting them ingest the package source code, but TypeScript packages have an src/index.ts instead.

Some bundlers (webpack, notably, when suitably configured) might actually be quite happy to ingest that instead, but AFAIK it's not valid to have the package.json module entrypoint point to anything except an actual ES module.

We have discussed publishing either the TSC output (unbundled JS "sources" one-for-one translated from TS) or a bundled ESM, but we haven't quite figured out the best way to do that yet, so in the meantime let's at least remove the false advertising that is causing errors for certain developer's builds.

Test Coverage

I ran npm test but I don't think that actually tested this change in any meaningful way. :-(

Fixes google#1877.

Don't advertise module entrypoints on packages that are implemented
in TypeScript as at the moment our webpack configuration does not
generate any file called src/index.js.
@cpcallen cpcallen requested a review from a team as a code owner October 18, 2023 20:44
@cpcallen cpcallen requested review from NeilFraser and removed request for a team October 18, 2023 20:44
@maribethb maribethb merged commit d019198 into google:master Oct 20, 2023
9 checks passed
BeksOmega added a commit that referenced this pull request Oct 20, 2023
* fix: text join block warning when using block-plus-minus plugin

* Update package.json

* fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)

Fixes #1877.

Don't advertise module entrypoints on packages that are implemented
in TypeScript as at the moment our webpack configuration does not
generate any file called src/index.js.

* Revert "fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)"

This reverts commit 3382ac7.

* update package-lock

---------

Co-authored-by: Christopher Allen <[email protected]>
Co-authored-by: Beka Westberg <[email protected]>
BeksOmega added a commit that referenced this pull request Dec 7, 2023
* fix: text join block warning when using block-plus-minus plugin

* Update package.json

* fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)

Fixes #1877.

Don't advertise module entrypoints on packages that are implemented
in TypeScript as at the moment our webpack configuration does not
generate any file called src/index.js.

* Revert "fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)"

This reverts commit 3382ac7.

* update package-lock

---------

Co-authored-by: Christopher Allen <[email protected]>
Co-authored-by: Beka Westberg <[email protected]>
BeksOmega added a commit that referenced this pull request Dec 7, 2023
* fix: text join block warning when using block-plus-minus plugin

* Update package.json

* fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)

Fixes #1877.

Don't advertise module entrypoints on packages that are implemented
in TypeScript as at the moment our webpack configuration does not
generate any file called src/index.js.

* Revert "fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)"

This reverts commit 3382ac7.

* update package-lock

---------

Co-authored-by: Christopher Allen <[email protected]>
Co-authored-by: Beka Westberg <[email protected]>
BeksOmega added a commit that referenced this pull request Dec 7, 2023
* fix: text join block warning when using block-plus-minus plugin

* Update package.json

* fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)

Fixes #1877.

Don't advertise module entrypoints on packages that are implemented
in TypeScript as at the moment our webpack configuration does not
generate any file called src/index.js.

* Revert "fix(packaging): Don't advertise non-existent ESM entrypoints (#2022)"

This reverts commit 3382ac7.

* update package-lock

---------

Co-authored-by: Christopher Allen <[email protected]>
Co-authored-by: Beka Westberg <[email protected]>
@cpcallen cpcallen deleted the fix/1877 branch December 12, 2023 17:14
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.

Unable to import plugin-workspace-search 8.0.4 normally.
3 participants