Skip to content

Refactoring schematics for standalone migration #22645

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 27 commits into
base: rel-9.2
Choose a base branch
from

Conversation

erdemcaygor
Copy link
Contributor

@erdemcaygor erdemcaygor commented Apr 14, 2025

Description

Resolves https://github.com/volosoft/volo/issues/19594

βœ… Test Cases

πŸ“¦ create-lib

  • Create library using --packageName
  • Generates correct structure for --templateType=module
  • Generates correct structure for --templateType=standalone
  • Works with --isSecondaryEntrypoint=true (nested entrypoint)
  • Generated files are exported from public-api.ts
  • Output is valid TypeScript with no syntax errors
  • Respects --override=false to skip existing files
  • Supports both standalone and module-based apps
  • Import generated library correctly into main application
  • No duplicate imports or providers on repeated runs

🎨 change-theme

  • Removes previous theme imports from app.module.ts or main.ts
  • Removes previous theme providers from providers: [...]
  • Adds new theme module imports (e.g. ThemeXModule.forRoot())
  • Adds new theme providers (e.g. provideThemeXConfig())
  • Supports both standalone and module-based apps
  • No duplicate imports or providers on repeated runs

How To Test

1. Build the Schematics Package

Navigate to the npm/ng-packs folder and run the following command:

yarn run build:schematics

This will generate the dist/packages/schematics folder under npm/ng-packs.


2. Link the Built Package Locally

Navigate to the generated schematics folder and link it to your local environment:

cd dist/packages/schematics
yarn link

3. Link the Package to Your Angular Project

In your Angular project's root directory (where package.json is located), run the following command to create a local reference:

yarn link "@abp/ng.schematics"

4. Generate a New Library

Use the following schematic command to generate a new library named Book:

npx ng g @abp/ng.schematics:create-lib --package-name "Book"

Follow the interactive prompts to complete the setup.


5. Change the Default Theme

To replace the theme, run:

npx ng g @abp/ng.schematics:change-theme

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@erdemcaygor erdemcaygor added this to the 9.2-final milestone Apr 17, 2025
@erdemcaygor erdemcaygor marked this pull request as ready for review April 21, 2025 10:35
@erdemcaygor erdemcaygor requested a review from oykuermann April 24, 2025 07:36
@gizemmutukurt gizemmutukurt requested review from gizemmutukurt and removed request for oykuermann April 25, 2025 10:19
@@ -52,7 +52,8 @@ export async function resolveProject<T = any>(
// @typescript-eslint/no-explicit-any
notFoundValue: T = NOT_FOUND_VALUE as unknown as any,
): Promise<Project | T> {
name = name || readWorkspaceSchema(tree).defaultProject || getFirstApplication(tree).name!;
// name = name || readWorkspaceSchema(tree).defaultProject || getFirstApplication(tree).name!;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we can directly remove this comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed b8996b9

Copy link
Contributor

@gizemmutukurt gizemmutukurt left a comment

Choose a reason for hiding this comment

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

  • Getting an error with the HttpErrorComponent parameter when switching tothe basic theme.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants