diff --git a/apps/ng-doc/docs/getting-started/installation/index.md b/apps/ng-doc/docs/getting-started/installation/index.md index 8113020b..7de51bc8 100644 --- a/apps/ng-doc/docs/getting-started/installation/index.md +++ b/apps/ng-doc/docs/getting-started/installation/index.md @@ -14,6 +14,8 @@ To install the NgDoc, you can use the command below. This command will automatically install and add the library to your project, and configure it. +{% include "../../shared/generated-folder.md" %} + ```bash group="install" name="Angular" icon="angular" ng add @ng-doc/add ``` @@ -185,6 +187,8 @@ application, NgDoc also uses synthetic imports that you need to enable, to do this, edit the tsconfig.json of the existing application by adding the path to the generated files and `allowSyntheticDefaultImports` option. +{% include "../../shared/generated-folder.md" %} + ```json name="tsconfig.json" { "compilerOptions": { diff --git a/apps/ng-doc/docs/shared/generated-folder.md b/apps/ng-doc/docs/shared/generated-folder.md new file mode 100644 index 00000000..2c5427ab --- /dev/null +++ b/apps/ng-doc/docs/shared/generated-folder.md @@ -0,0 +1,4 @@ +> **Warning** +> TypeScript may display an error for the `@ng-doc/generated` path in your code editor if you are +> using the library for the first time. Files for the `@ng-doc/generated` path will be generated +> automatically when you run your application, so please disregard any errors related to it. diff --git a/libs/add/schematics/ng-add/index.ts b/libs/add/schematics/ng-add/index.ts index 0778c636..714e7857 100644 --- a/libs/add/schematics/ng-add/index.ts +++ b/libs/add/schematics/ng-add/index.ts @@ -16,6 +16,7 @@ import { addLayout } from './steps/add-layout'; import { addNgDocAppConfig } from './steps/add-ng-doc-app-config'; import { addStyles } from './steps/add-styles'; import { addTsconfigPaths } from './steps/add-tsconfig-paths'; +import { postInstall } from './steps/post-install'; import { replaceBuilders } from './steps/replace-builders'; import { updateAppTsConfig } from './steps/update-app-ts-config'; @@ -54,5 +55,6 @@ export function ngAddSetupProject(options: Schema): Rule { addTsconfigPaths(options), updateAppTsConfig(options), addGitIgnore(), + postInstall(), ]); } diff --git a/libs/add/schematics/ng-add/steps/post-install.ts b/libs/add/schematics/ng-add/steps/post-install.ts new file mode 100644 index 00000000..f44f3799 --- /dev/null +++ b/libs/add/schematics/ng-add/steps/post-install.ts @@ -0,0 +1,12 @@ +import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics'; + +/** + * + */ +export function postInstall(): Rule { + return async (tree: Tree, context: SchematicContext) => { + context.logger.info( + `[INFO]: Everything is done! Files for the "@ng-doc/generated" path will be created when you start your application.`, + ); + }; +}