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

Add --api Flag to Create Headless API App with create-next-app #68130

Merged
merged 74 commits into from
Jan 10, 2025

Conversation

Arindam200
Copy link
Contributor

@Arindam200 Arindam200 commented Jul 24, 2024

What?

Added a new option for create-next-app to create a headless API app. This includes:

  • Adding a --api flag for create-next-app to create a headless app.
  • Modifying the template to include only the required assets (no public/, app/page.*, etc.).
  • Ensuring the app includes only the required dependencies (no @types/react, react, etc.).

Why?

This feature allows users to initialize projects with headless API templates, making it easier to set up projects that require backend functionality without frontend components.

How?

  • Added the --api flag to the create-next-app command.
  • Modified the template to exclude unnecessary assets and dependencies.

Closes #68118
Closes NEXT-3633
Closes NDX-120

Signed-off-by: Arindam Majumder <[email protected]>
@ijjk ijjk added the create-next-app Related to our CLI tool for quickly starting a new Next.js application. label Jul 24, 2024
@Arindam200 Arindam200 changed the title add: headless-api Add --api Flag to Create Headless API App with create-next-app Jul 24, 2024
@ijjk
Copy link
Member

ijjk commented Jul 24, 2024

Allow CI Workflow Run

  • approve CI run for commit: 513d424

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Jul 24, 2024

Allow CI Workflow Run

  • approve CI run for commit: 60d1651

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Member

@devjiwonchoi devjiwonchoi left a comment

Choose a reason for hiding this comment

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

Let's add a few tests at test/integration/create-next-app.

@ephraimduncan
Copy link
Contributor

I tried pushing to this but looks like I don't have access. @Arindam200

@Arindam200
Copy link
Contributor Author

Sure, I'm giving you the access

@Arindam200
Copy link
Contributor Author

I tried pushing to this but looks like I don't have access. @Arindam200

I've invited you, can you please accept that?

devjiwonchoi and others added 2 commits July 30, 2024 13:55
@Arindam200
Copy link
Contributor Author

@Arindam200 No need to update branch unless need change, as it will rerun the CI. 😉🙏

Sure. I won't do that. Thanks

return true; // For now, always return true
}

export function requestHandler<T = Record<string, string | string[]>>(
Copy link
Member

Choose a reason for hiding this comment

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

need better name & comments, maybe structure as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @devjiwonchoi ,

I've added some comments. Let me know if that works.

@prashantchothani
Copy link

Is this going to be released soon ? --api would be really helpful

@prashantchothani
Copy link

Any timeline for the release of this?

@Arindam200
Copy link
Contributor Author

Hi @devjiwonchoi, It's been a while.

Did you get a chance to check this PR?

@Arindam200 Arindam200 requested a review from huozhi January 4, 2025 18:02
@ztanner ztanner dismissed huozhi’s stale review January 10, 2025 01:07

updates were made

@ztanner ztanner enabled auto-merge (squash) January 10, 2025 02:41
@ztanner ztanner merged commit 846b46f into vercel:canary Jan 10, 2025
103 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
create-next-app Related to our CLI tool for quickly starting a new Next.js application. examples Issue was opened via the examples template. locked tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an option for create-next-app to create a headless API app.