Migrations
This page contains information about migrating from previous versions of NgDoc to the current version.
Migration to >= v18.0
NgDoc 18 contains several migrations that can help migrate your documentation to the new version. To perform the migration, execute the following command:
After migration you also need to update other
@ng-doc/*
packages to v17.0.0
ng update @ng-doc/builder
The migration should:
- move
keyword
fromng-doc.page.ts
to your page's markdown file - remove
# {{
from the markdown file since the title is now displayed by default.NgDocPage.title }}
Migration to >= v17.0
In v17.0.0, project was migrated to Angular v17, support of Webpack was removed, now it works only with Vite + Esbuild. To migrate automatically, you can run the following command:
After migration you also need to update other
@ng-doc/*
packages to v17.0.0
ng update @ng-doc/builder
Manual migration steps:
- replace
@ng-doc/builder:browser
builder for the build target with@ng-doc/builder:application
builder - rename
main
property inangular.json
tobrowser
- covert
polyfills
property inangular.json
topolyfills
array - remove
buildOptimizer
andvendorChunk
properties fromangular.json
- rename
buildTarget
properties inangular.json
tobuildTarget
Vite doesn't see changes in folders that start with a dot, so you need to rename .ng-doc
folder:
- rename assets
.ng-doc/ng-doc/assets
folder tong-doc/ng-doc/assets
inangular.json
- change
@ng-doc/generated
path.ng-doc/ng-doc/index.ts
intsconfig.json
tong-doc/ng-doc/index.ts
- replace
.ng-doc
folder name in.gitignore
file with/ng-doc
Migration to >= v16.13
In v16.13.0 all NgModules were removed. Application configuration was changed. This was done to simplify API and add more flexibility to the application, now Application will use only components that YOU provided and nothing else which will reduce the size of the final bundle for applications that don't use all features of NgDoc or want to customize it.
Now you can replace page components such as breadcrumbs, page navigation at the bottom of the page, or table of contents with your own components, or even remove them completely.
NgDoc's schematics now also support standalone applications.
NgDocSidebarModule
,NgDocNavbarModule
were removed, now you need to import
,NgDocSidebarComponent
.NgDocNavbarComponent NgDocModule
,NgDocUiKitRootModule
were removed, all configurations can be provided by using
function.provideNgDocApp NgDocGeneratedModule
was removed, now you need to useprovideNgDocContext
function to provide context of the generated documentation.
andprovideMainPageProcessor
functions were added, now you must use them to provide default or your own page processors and page skeleton components.providePageSkeleton
Please see updated
Migrating to >= v16.3
In v16.3.0, new standalone pages were introduced. Now you don't need ng-doc.dependencies.ts
file or
anymore, all dependencies can be imported directly in the ng-doc.page.ts
file.
To migrate from previous versions, you need to run the following command:
ng g @ng-doc/builder:standalone-pages-migration
This command will remove ng-doc.dependencies.ts
file and update all ng-doc.page.ts
files by importing all dependencies directly.