Skip to content

Commit

Permalink
docs(add): add an explanation for the @ng-doc/generated path
Browse files Browse the repository at this point in the history
Closes ng-doc#112
  • Loading branch information
skoropadas committed Nov 21, 2023
1 parent 50f691a commit d935d60
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/ng-doc/docs/getting-started/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 4 additions & 0 deletions apps/ng-doc/docs/shared/generated-folder.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions libs/add/schematics/ng-add/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -54,5 +55,6 @@ export function ngAddSetupProject(options: Schema): Rule {
addTsconfigPaths(options),
updateAppTsConfig(options),
addGitIgnore(),
postInstall(),
]);
}
12 changes: 12 additions & 0 deletions libs/add/schematics/ng-add/steps/post-install.ts
Original file line number Diff line number Diff line change
@@ -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.`,
);
};
}

0 comments on commit d935d60

Please sign in to comment.