Skip to content

chore: refactor rename-project.js to use ES modules #743

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Gokulmlk
Copy link

What does this PR do?

  • Refactors .freeCodeCamp/tooling/rename-project.js to use ES module syntax in compliance with "type": "module" in package.json.
  • Fixes hardcoded path to projects.json to reflect current folder structure: now located at self/config/projects.json.

Why is this needed?

  • Node throws require is not defined error in ES module projects. Converting to import resolves this.
  • Ensures script runs successfully for users working with current repo structure.

How to test:

  1. Run the script using:

    node .freeCodeCamp/tooling/rename-project.js
    
  2. Follow the prompts:

    Choose a project by ID or dashedName

    Enter new dashedName and title

  3. Confirms:

    Updated project in projects.json

    Renamed boilerplate folder (if it exists)

    Updated locale files (if applicable)

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.

1 participant