Skip to content

update package name #2

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

Merged
merged 10 commits into from
Mar 31, 2024
Merged

update package name #2

merged 10 commits into from
Mar 31, 2024

Conversation

timlrx
Copy link
Owner

@timlrx timlrx commented Feb 4, 2024

Attempt at publishing a new package:

  • Package names
    • @contentlayer/* package becomes @contentlayer-temp/*
    • contentlayer renamed to contentlayer-temp
    • next-contentlayer renamed to next-contentlayer-temp
  • @contentlayer folder remains but path alias in tsconfig.base.json needs to be updated
  • Package resolutions updated to the temp packages
  • Generators in @contentlayer/source-files also need to be updated so the generated code uses the temp packages
  • All package imports updated to use the temp version
  • Examples updated to use contentlayer-temp, dependencies, CLI and contentlayer.config.ts imports (note: config file name remains the same)

All the tests seems to work, with snapshot updated and the examples work fine. To change the package name in the future, search and replace the following phrases:

  • @contentlayer-temp
  • next-contentlayer-temp
  • contentful-generator-temp
  • contentlayer-stackbit-yaml-generator-temp
  • contentlayer-temp

Other issues:

  • Fix prepack in next-contentlayer-temp to use awk instead of sed. No idea why the sed command was not working for me.
  • Upgraded to memfs 4, before downgrading back to 3.6.0, there are other dependencies and peer dependencies that I think are not worth to deal with. Updated mkdirp to use recursive which makes it compatible with memfs 4 if we are upgrading in the future.

Published contentlayer-temp and next-contentlayer-temp v0.4.3 and tested that they work using next-contentlayer-example without issues on both yarn and npm.

@rikvermeulen
Copy link

rikvermeulen commented Feb 4, 2024

Hey, I tried your newest version of next-contextlayer-temp packages only upon building my application it crashes because it searches for 'contentlayer/package.json' file in the check-constraints.js . There is a func called checkContentlayerVersionsMatch that checks the package.json, only it tries to check the file from original package. These two lines need to be updated to 'contentlayer-temp' and 'next-contentlayer-temp'

const contentlayerVersion = getPackageVersion('contentlayer');
const nextContentlayerVersion = getPackageVersion('next-contentlayer');

@timlrx
Copy link
Owner Author

timlrx commented Feb 5, 2024

@rikvermeulen thanks, good catch - I only tried it out in dev 😄. Updated those lines and it works for next build as well! Released as v0.4.4

@timlrx
Copy link
Owner Author

timlrx commented Mar 31, 2024

Changed package name from contentlayer-temp to contentlayer2

@timlrx timlrx merged commit 005c453 into update Mar 31, 2024
@timlrx timlrx deleted the contentlayer-temp branch July 13, 2024 07:11
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.

2 participants