Refactor API Folder and Add Alias [skip percy] #943
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📝 Description
This pull request introduces two key changes to improve the organization and clarity of the project's folder structure.
api
folder has been renamed to_api
to align with the existing naming convention for internal namespaces, such as_components
,_utils
, etc.@/api/*
has been added to thetsconfig.json
file, pointing tosrc/app/_api/*
. This simplifies imports and maintains consistency across the codebase.Motivation
The change ensures that:
The folder structure remains consistent.
Developers can clearly identify internal namespaces.
Imports from the
_api
folder are easier to manage and understand.Type: Refactor
🛠️ Key Changes
api
folder to_api
in thesrc/app
directory.tsconfig.json
to include a new alias@/api/*
pointing tosrc/app/_api/*
.@/api/*
for consistency.Setup
refactor/folder-structure-api-alias
..env
).Steps to Test
npm run dev
) and ensure all API endpoints still function as expected.@/api/*
resolve correctly in the following locations:_api
._api
functions.next build
) and ensure no errors occur.Expected Results
🔖 Resources