Skip to content

Commit

Permalink
docs: ng19 typedoc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
droshev committed Dec 27, 2024
1 parent d5ed28f commit 847f3a0
Show file tree
Hide file tree
Showing 16 changed files with 1,960 additions and 603 deletions.
1 change: 0 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@
"types": "prefer-import"
}
],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unified-signatures": "error",
"arrow-body-style": "error",
"arrow-parens": ["off", "always"],
Expand Down
3 changes: 2 additions & 1 deletion libs/core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"compile-typedoc": {
"executor": "@fundamental-ngx/nx-plugin:compile-typedoc",
"options": {
"outputPath": "libs/docs/typedoc/core"
"outputPath": "libs/docs/typedoc/core",
"tsConfig": "libs/core/tsconfig.typedoc.json"
},
"outputs": ["{options.outputPath}"]
},
Expand Down
3 changes: 3 additions & 0 deletions libs/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.typedoc.json"
},
{
"path": "./tsconfig.lib.json"
},
Expand Down
21 changes: 21 additions & 0 deletions libs/core/tsconfig.typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"target": "ES2022",
"declaration": true,
"declarationMap": true,
"types": [],
"lib": ["dom", "es2018"],
"useDefineForClassFields": false,
"jsx": "react",
"jsxFactory": "JSX.createElement",
"jsxFragmentFactory": "JSX.Fragment"
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"files": ["./index.ts"]
}
3 changes: 2 additions & 1 deletion libs/cx/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"compile-typedoc": {
"executor": "@fundamental-ngx/nx-plugin:compile-typedoc",
"options": {
"outputPath": "libs/docs/typedoc/cx"
"outputPath": "libs/docs/typedoc/cx",
"tsConfig": "libs/cx/tsconfig.typedoc.json"
},
"outputs": ["{options.outputPath}"]
},
Expand Down
3 changes: 3 additions & 0 deletions libs/cx/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.typedoc.json"
},
{
"path": "./tsconfig.lib.json"
},
Expand Down
21 changes: 21 additions & 0 deletions libs/cx/tsconfig.typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"target": "ES2022",
"declaration": true,
"declarationMap": true,
"types": [],
"lib": ["dom", "es2018"],
"useDefineForClassFields": false,
"jsx": "react",
"jsxFactory": "JSX.createElement",
"jsxFragmentFactory": "JSX.Fragment"
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"files": ["./index.ts"]
}
9 changes: 2 additions & 7 deletions libs/nx-plugin/src/executors/compile-typedoc/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default async function compileTypedocs(_options: CompileTypedocExecutorSc
},
context
);
const { tsConfig } = readTargetOptions({ project: context.projectName as string, target: 'build' }, context);
const tsConfig: string = _options.tsConfig || readTargetOptions({ project: context.projectName as string, target: 'build' }, context).tsConfig;
const ngPackageJsonFiles = fastGlobSync(projectPath + '/**/*/ng-package.json');
const entryPoints = ngPackageJsonFiles.map((f) => {
const json = JSON.parse(readFileSync(f, 'utf-8'));
Expand All @@ -44,16 +44,11 @@ export default async function compileTypedocs(_options: CompileTypedocExecutorSc
plugin: ['typedoc-plugin-merge-modules'],
mergeModulesRenameDefaults: true,
mergeModulesMergeMode: 'project',
compilerOptions: {
jsx: 'react',
jsxFactory: 'JSX.createElement',
jsxFragmentFactory: 'JSX.Fragment'
},
theme: 'fd-typedoc'
} as unknown as Partial<TypeDocOptions>);
app.options.addReader(new TSConfigReader());

app.renderer.defineTheme('fd-typedoc', FdTheme);
app.renderer.defineTheme('fd-typedoc', DefaultTheme);

const project = await app.convert();

Expand Down
1 change: 1 addition & 0 deletions libs/nx-plugin/src/executors/compile-typedoc/schema.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export interface CompileTypedocExecutorSchema {
outputPath: string;
tsConfig?: string;
}
4 changes: 4 additions & 0 deletions libs/nx-plugin/src/executors/compile-typedoc/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"outputPath": {
"type": "string",
"description": "Path to the output directory"
},
"tsConfig": {
"type": "string",
"description": "Path to the tsconfig file. If not provided, the executor will pick the 'build' target's tsConfig"
}
},
"required": []
Expand Down
Loading

0 comments on commit 847f3a0

Please sign in to comment.