mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-03-17 00:51:07 +08:00
chore(package): upgrate typedoc to 0.16
This commit is contained in:
parent
15ed431819
commit
82939763ee
16
package-lock.json
generated
16
package-lock.json
generated
@ -13589,21 +13589,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typedoc": {
|
"typedoc": {
|
||||||
"version": "0.15.8",
|
"version": "0.16.9",
|
||||||
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.15.8.tgz",
|
"resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.16.9.tgz",
|
||||||
"integrity": "sha512-a0zypcvfIFsS7Gqpf2MkC1+jNND3K1Om38pbDdy/gYWX01NuJZhC5+O0HkIp0oRIZOo7PWrA5+fC24zkANY28Q==",
|
"integrity": "sha512-UvOGoy76yqwCXwxPgatwgXWfsQ3FczyZ6ZNLjhCPK+TsDir6LiU3YB6N9XZmPv36E+7LA860mnc8a0v6YADKFw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/minimatch": "3.0.3",
|
"@types/minimatch": "3.0.3",
|
||||||
"fs-extra": "^8.1.0",
|
"fs-extra": "^8.1.0",
|
||||||
"handlebars": "^4.7.0",
|
"handlebars": "^4.7.2",
|
||||||
"highlight.js": "^9.17.1",
|
"highlight.js": "^9.17.1",
|
||||||
"lodash": "^4.17.15",
|
"lodash": "^4.17.15",
|
||||||
"marked": "^0.8.0",
|
"marked": "^0.8.0",
|
||||||
"minimatch": "^3.0.0",
|
"minimatch": "^3.0.0",
|
||||||
"progress": "^2.0.3",
|
"progress": "^2.0.3",
|
||||||
"shelljs": "^0.8.3",
|
"shelljs": "^0.8.3",
|
||||||
"typedoc-default-themes": "^0.6.3",
|
"typedoc-default-themes": "^0.7.2",
|
||||||
"typescript": "3.7.x"
|
"typescript": "3.7.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -13645,9 +13645,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"typedoc-default-themes": {
|
"typedoc-default-themes": {
|
||||||
"version": "0.6.3",
|
"version": "0.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.6.3.tgz",
|
"resolved": "https://registry.npmjs.org/typedoc-default-themes/-/typedoc-default-themes-0.7.2.tgz",
|
||||||
"integrity": "sha512-rouf0TcIA4M2nOQFfC7Zp4NEwoYiEX4vX/ZtudJWU9IHA29MPC+PPgSXYLPESkUo7FuB//GxigO3mk9Qe1xp3Q==",
|
"integrity": "sha512-fiFKlFO6VTqjcno8w6WpTsbCgXmfPHVjnLfYkmByZE7moaz+E2DSpAT+oHtDHv7E0BM5kAhPrHJELP2J2Y2T9A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"backbone": "^1.4.0",
|
"backbone": "^1.4.0",
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
"ts-node": "^8.6.2",
|
"ts-node": "^8.6.2",
|
||||||
"tslint": "^5.20.1",
|
"tslint": "^5.20.1",
|
||||||
"tslint-ionic-rules": "0.0.21",
|
"tslint-ionic-rules": "0.0.21",
|
||||||
"typedoc": "^0.15.8",
|
"typedoc": "^0.16.9",
|
||||||
"typescript": "~3.5.3",
|
"typescript": "~3.5.3",
|
||||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||||
"unminified-webpack-plugin": "^2.0.0",
|
"unminified-webpack-plugin": "^2.0.0",
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
import * as fs from 'fs-extra';
|
import * as fs from 'fs-extra';
|
||||||
import { Application } from 'typedoc';
|
|
||||||
import { basename, dirname, resolve } from 'path';
|
import { basename, dirname, resolve } from 'path';
|
||||||
|
import { Application } from 'typedoc';
|
||||||
import { runInNewContext } from 'vm';
|
import { runInNewContext } from 'vm';
|
||||||
|
|
||||||
|
import TypeDoc = require('typedoc');
|
||||||
|
|
||||||
interface Plugin {
|
interface Plugin {
|
||||||
packageName: string;
|
packageName: string;
|
||||||
displayName: string;
|
displayName: string;
|
||||||
@ -19,9 +21,13 @@ interface Plugin {
|
|||||||
const rootDir = resolve(__dirname, '../..');
|
const rootDir = resolve(__dirname, '../..');
|
||||||
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
|
const typedocTmp = resolve(__dirname, 'typedoc.tmp.json');
|
||||||
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
|
const pluginsDir = resolve(rootDir, 'src/@ionic-native/plugins');
|
||||||
const typedoc = new Application({
|
const typedoc = new Application();
|
||||||
|
|
||||||
|
typedoc.options.addReader(new TypeDoc.TSConfigReader());
|
||||||
|
typedoc.options.addReader(new TypeDoc.TypeDocReader());
|
||||||
|
|
||||||
|
typedoc.bootstrap({
|
||||||
mode: 'modules',
|
mode: 'modules',
|
||||||
tsconfig: resolve(rootDir, 'tsconfig.json'),
|
|
||||||
ignoreCompilerErrors: true
|
ignoreCompilerErrors: true
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,7 +52,9 @@ async function generateTypedoc(root: string, outputPath = typedocTmp) {
|
|||||||
function processPlugin(pluginModule): Plugin {
|
function processPlugin(pluginModule): Plugin {
|
||||||
const pluginClass = pluginModule.children.find(isPlugin);
|
const pluginClass = pluginModule.children.find(isPlugin);
|
||||||
const decorator = getPluginDecorator(pluginClass);
|
const decorator = getPluginDecorator(pluginClass);
|
||||||
const packageName = `@ionic-native/${basename(dirname(pluginModule.originalName))}`;
|
const packageName = `@ionic-native/${basename(
|
||||||
|
dirname(pluginModule.originalName)
|
||||||
|
)}`;
|
||||||
const displayName = getTag(pluginClass, 'name');
|
const displayName = getTag(pluginClass, 'name');
|
||||||
const usage = getTag(pluginClass, 'usage');
|
const usage = getTag(pluginClass, 'usage');
|
||||||
const description = getTag(pluginClass, 'description');
|
const description = getTag(pluginClass, 'description');
|
||||||
@ -85,17 +93,17 @@ const getTag = (child: any, tagName: string): string => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const isModule = (child: any): boolean =>
|
const isModule = (child: any): boolean => child.kind === 1;
|
||||||
child.kind === 1;
|
|
||||||
|
|
||||||
const isClass = (child: any): boolean =>
|
const isClass = (child: any): boolean => child.kind === 128;
|
||||||
child.kind === 128;
|
|
||||||
|
|
||||||
const isPlugin = (child: any): boolean =>
|
const isPlugin = (child: any): boolean =>
|
||||||
isClass(child) && hasTags(child) && Array.isArray(child.decorators) && child.decorators.some(d => d.name === 'Plugin');
|
isClass(child) &&
|
||||||
|
hasTags(child) &&
|
||||||
|
Array.isArray(child.decorators) &&
|
||||||
|
child.decorators.some(d => d.name === 'Plugin');
|
||||||
|
|
||||||
const hasPlugin = (child: any): boolean =>
|
const hasPlugin = (child: any): boolean => child.children.some(isPlugin);
|
||||||
child.children.some(isPlugin);
|
|
||||||
|
|
||||||
const hasTags = (child: any): boolean =>
|
const hasTags = (child: any): boolean =>
|
||||||
child.comment && Array.isArray(child.comment.tags);
|
child.comment && Array.isArray(child.comment.tags);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user