Skip to content

Commit

Permalink
Merge pull request #77 from IgniteUI/dTsvetkov/update-typedoc-version
Browse files Browse the repository at this point in the history
Update typedoc version and migrato to ESM type
  • Loading branch information
simeonoff authored Jan 6, 2025
2 parents 4e8487f + 29baaff commit f20d1d1
Show file tree
Hide file tree
Showing 15 changed files with 140 additions and 101 deletions.
16 changes: 8 additions & 8 deletions components/convert-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import {
Converter,
ReflectionKind,
} from 'typedoc';
import { FileOperations } from '../utils/file-operations';
import { ClassFactory } from '../utils/factories/class-factory';
import { BaseFactory } from '../utils/factories/base-factory';
import { EnumFactory } from '../utils/factories/enum-factory';
import { Parser } from '../utils/parser';
import { Constants } from '../utils/constants';
import { InterfaceFactory } from '../utils/factories/interface-factory';
import { FunctionFactory } from '../utils/factories/function-factory';
import { FileOperations } from '../utils/file-operations.js';
import { ClassFactory } from '../utils/factories/class-factory.js';
import { BaseFactory } from '../utils/factories/base-factory.js';
import { EnumFactory } from '../utils/factories/enum-factory.js';
import { Parser } from '../utils/parser.js';
import { Constants } from '../utils/constants.js';
import { InterfaceFactory } from '../utils/factories/interface-factory.js';
import { FunctionFactory } from '../utils/factories/function-factory.js';

export class ConvertComponent {
/**
Expand Down
11 changes: 5 additions & 6 deletions components/render-component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as path from 'path';

import path from 'path';
import { ReflectionKind, RendererEvent, LogLevel, Application } from 'typedoc';
import { FileOperations } from '../utils/file-operations';
import { AttributeType } from '../utils/enums/json-keys';
import { Constants } from '../utils/constants';
import { Parser } from '../utils/parser';
import { FileOperations } from '../utils/file-operations.js';
import { AttributeType } from '../utils/enums/json-keys.js';
import { Constants } from '../utils/constants.js';
import { Parser } from '../utils/parser.js';

export class RenderComponenet {
private warns: boolean;
Expand Down
4 changes: 2 additions & 2 deletions components/theme-component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RendererEvent, ReflectionKind, Application } from "typedoc";
import { GlobalFuncs } from '../utils/global-funcs';
import { HardcodedStrings } from '../utils/template-strings';
import { GlobalFuncs } from '../utils/global-funcs.js';
import { HardcodedStrings } from '../utils/template-strings.js';

export class ThemeComponent {
public app: Application;
Expand Down
19 changes: 9 additions & 10 deletions index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import * as process from 'process';
import * as fs from 'fs-extra';

import process from 'process';
import fs from 'fs-extra';
import { Application, Converter, Renderer } from 'typedoc'
import { ConvertComponent } from './components/convert-component';
import { RenderComponenet } from './components/render-component';
import { Constants } from './utils/constants';
import { HardcodedStrings } from './utils/template-strings';
import { ThemeComponent } from './components/theme-component';
import { pluginOptions } from './utils/options';
import { ConvertComponent } from './components/convert-component.js';
import { RenderComponenet } from './components/render-component.js';
import { Constants } from './utils/constants.js';
import { HardcodedStrings } from './utils/template-strings.js';
import { ThemeComponent } from './components/theme-component.js';
import { pluginOptions } from './utils/options.js';

export * from './utils/helpers/localize';
export * from './utils/helpers/localize.js';

export function load(PluginHost: Application) {
const app = PluginHost.owner;
Expand Down
124 changes: 86 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Typedoc plugin which localize your documentation",
"author": "Infragistics",
"license": "MIT",
"type": "module",
"main": "dist/index.js",
"files": [
"dist/"
Expand All @@ -19,14 +20,15 @@
"typedoc",
"localizaiton",
"plugin",
"typedocplugin"
"typedocplugin",
"typedoc-plugin"
],
"dependencies": {
"fs-extra": "^11.2.0"
},
"devDependencies": {
"@types/node": "^18.11.0",
"typedoc": "^0.26.2",
"typescript": "^5.5.2"
"@types/node": "^20.17.6",
"typedoc": "^0.27.0",
"typescript": "^5.6.3"
}
}
31 changes: 11 additions & 20 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
{
"compilerOptions": {
/* Basic Options */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"target": "ES2022",
"module": "NodeNext",
"lib": [
"es2017",
"ES2022",
"dom"
], /* Concatenate and emit output to single file. */
"outDir": "./dist", /* Redirect output structure to the directory. */

/* Strict Type-Checking Options */
"strict": false, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */

/* Module Resolution Options */
"moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
],
"declaration": true,
"outDir": "./dist",
"strict": false,
"noImplicitAny": false,
"moduleResolution": "NodeNext",
"typeRoots": [
"node_modules/@types"
], /* List of folders to include type definitions from. */
],
"types": [
"node"
], /* Type declaration files to be included in compilation. */
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */

/* Experimental Options */
"experimentalDecorators": true /* Enables experimental support for ES7 decorators. */
],
}
}
2 changes: 1 addition & 1 deletion utils/factories/base-factory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AttributeType } from "../enums/json-keys";
import { AttributeType } from "../enums/json-keys.js";

export abstract class BaseFactory {
public name;
Expand Down
4 changes: 2 additions & 2 deletions utils/factories/class-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BaseFactory } from './base-factory';
import { AttributeType } from '../enums/json-keys';
import { BaseFactory } from './base-factory.js';
import { AttributeType } from '../enums/json-keys.js';

const PROPERTIES_KEY = AttributeType[AttributeType.properties];
const METHODS_KEY = AttributeType[AttributeType.methods];
Expand Down
4 changes: 2 additions & 2 deletions utils/factories/enum-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AttributeType } from "../enums/json-keys";
import { BaseFactory } from "./base-factory";
import { AttributeType } from "../enums/json-keys.js";
import { BaseFactory } from "./base-factory.js";

const ENUM_MEMBER_KEY = AttributeType[AttributeType.members];

Expand Down
2 changes: 1 addition & 1 deletion utils/factories/function-factory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseFactory } from "./base-factory";
import { BaseFactory } from "./base-factory.js";

export class FunctionFactory extends BaseFactory {

Expand Down
4 changes: 2 additions & 2 deletions utils/factories/interface-factory.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AttributeType } from "../enums/json-keys";
import { BaseFactory } from "./base-factory";
import { AttributeType } from "../enums/json-keys.js";
import { BaseFactory } from "./base-factory.js";

const PROPERTIES_KEY = AttributeType[AttributeType.properties];
const METHODS_KEY = AttributeType[AttributeType.methods];
Expand Down
4 changes: 2 additions & 2 deletions utils/file-operations.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import fs from 'fs-extra';
import path from 'path';
import { Logger } from 'typedoc';

export class FileOperations {
Expand Down
4 changes: 2 additions & 2 deletions utils/helpers/localize.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { GlobalFuncs } from '../global-funcs';
import { HardcodedStrings } from '../template-strings';
import { GlobalFuncs } from '../global-funcs.js';
import { HardcodedStrings } from '../template-strings.js';

/**
* Helper function which loclize the hardcoded template strings.
Expand Down
2 changes: 1 addition & 1 deletion utils/options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Options, ParameterType } from 'typedoc'
import { Constants } from './constants';
import { Constants } from './constants.js';

export function pluginOptions(options: Pick<Options, "addDeclaration">) {

Expand Down

0 comments on commit f20d1d1

Please sign in to comment.