Skip to content

Remove missing package main entry#3286

Open
Jamil Ur Rehman Ahmadzai (jamilahmadzai) wants to merge 1 commit into
contentful:mainfrom
jamilahmadzai:fix/remove-missing-package-main
Open

Remove missing package main entry#3286
Jamil Ur Rehman Ahmadzai (jamilahmadzai) wants to merge 1 commit into
contentful:mainfrom
jamilahmadzai:fix/remove-missing-package-main

Conversation

@jamilahmadzai

Copy link
Copy Markdown

Summary

  • remove the package main entry that points to dist/contentful.js
  • keep the existing bin.contentful CLI entry unchanged

Why

contentful-cli is published as a CLI package, but its package metadata currently advertises dist/contentful.js as the package main. That file is not present in the repository or published package tarball, so consumers and package validators see a broken entry point.

The CLI entry remains bin/contentful.js, which loads dist/lib/cli.js after the package build.

Fixes #3285.

Validation

  • node -e "const p=require('./package.json'); console.log({hasMain:Object.prototype.hasOwnProperty.call(p,'main'), bin:p.bin})"
  • npm pack --dry-run --json .
  • packed tarball package/package.json inspection confirmed no main entry and unchanged bin.contentful
  • git diff --check

@jamilahmadzai Jamil Ur Rehman Ahmadzai (jamilahmadzai) marked this pull request as ready for review June 23, 2026 20:58
@ethan-ozelius-contentful

Copy link
Copy Markdown
Contributor

Hello Jamil Ur Rehman Ahmadzai (@jamilahmadzai), thank you for opening this PR. Sorry for the wall of text, but today I learned that our repos that run e2e tests require an env var called CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN to run, which will create/tear down spaces in a test org.  The problem is that that env var is set at the main contentful-cli repo level.  This is a problem for forked repos, because forked repos run the github actions in the context of the forked repo, not the target repo, where that env var is not set.

This is the reason that your PR is failing the main check with the message:

Error when evaluating 'secrets'. .github/workflows/main.yaml (Line: 26, Col: 11): Secret CONTENTFUL_INTEGRATION_TEST_CMA_TOKEN is required, but not provided while calling., .github/workflows/main.yaml (Line: 26, Col: 11): Secret CONTENTFUL_ORGANIZATION_ID is required, but not provided while calling.

This is not specific to the CLI, or your PR but it is blocking progress.

Would you mind opening up a PR in the main contentful-cli repo as a stop gap?  I'm investigating solutions with our team, but I don't want to yak shave on this.

Also, quick question that might inform that investigation, is there a specific reason that you opted for a forked strategy?

@jamilahmadzai

Copy link
Copy Markdown
Author

Thanks for digging into this and for explaining the CI failure.

I used the forked PR flow because I do not have push access to contentful/contentful-cli, so I cannot create a branch directly in the main repo myself.

Maintainer edits are enabled on this PR. If it helps as a stop gap, someone with write access can create an internal branch from jamilahmadzai:fix/remove-missing-package-main or cherry-pick commit fcc261f73f20240a4ee7253d99fc524b38f06760. I am happy to help with any follow-up needed.

@ethan-ozelius-contentful

Copy link
Copy Markdown
Contributor

Jamil Ur Rehman Ahmadzai (@jamilahmadzai)

Thanks for digging into this and for explaining the CI failure.

I used the forked PR flow because I do not have push access to contentful/contentful-cli, so I cannot create a branch directly in the main repo myself.

Maintainer edits are enabled on this PR. If it helps as a stop gap, someone with write access can create an internal branch from jamilahmadzai:fix/remove-missing-package-main or cherry-pick commit fcc261f73f20240a4ee7253d99fc524b38f06760. I am happy to help with any follow-up needed.

I see, thank you for this insight. I was not aware of that blocker, apologies. Let me raise this with the team and figure something out.

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.

package main points to missing dist/contentful.js

2 participants