@git.zone/tsdoc 1.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/assets/.gitkeep +0 -0
  2. package/cli.js +4 -0
  3. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  4. package/dist_ts/00_commitinfo_data.js +9 -0
  5. package/dist_ts/aidocs_classes/description.d.ts +7 -0
  6. package/dist_ts/aidocs_classes/description.js +49 -0
  7. package/dist_ts/aidocs_classes/index.d.ts +3 -0
  8. package/dist_ts/aidocs_classes/index.js +4 -0
  9. package/dist_ts/aidocs_classes/projectcontext.d.ts +16 -0
  10. package/dist_ts/aidocs_classes/projectcontext.js +50 -0
  11. package/dist_ts/aidocs_classes/readme.d.ts +7 -0
  12. package/dist_ts/aidocs_classes/readme.js +63 -0
  13. package/dist_ts/classes.aidoc.d.ts +14 -0
  14. package/dist_ts/classes.aidoc.js +65 -0
  15. package/dist_ts/classes.typedoc.d.ts +10 -0
  16. package/dist_ts/classes.typedoc.js +49 -0
  17. package/dist_ts/cli.d.ts +1 -0
  18. package/dist_ts/cli.js +36 -0
  19. package/dist_ts/index.d.ts +2 -0
  20. package/dist_ts/index.js +11 -0
  21. package/dist_ts/logging.d.ts +2 -0
  22. package/dist_ts/logging.js +14 -0
  23. package/dist_ts/paths.d.ts +8 -0
  24. package/dist_ts/paths.js +12 -0
  25. package/dist_ts/plugins.d.ts +17 -0
  26. package/dist_ts/plugins.js +20 -0
  27. package/dist_ts/tsdoc.classes.typedoc.d.ts +10 -0
  28. package/dist_ts/tsdoc.classes.typedoc.js +48 -0
  29. package/dist_ts/tsdoc.cli.d.ts +1 -0
  30. package/dist_ts/tsdoc.cli.js +32 -0
  31. package/dist_ts/tsdoc.logging.d.ts +2 -0
  32. package/dist_ts/tsdoc.logging.js +14 -0
  33. package/dist_ts/tsdoc.paths.d.ts +8 -0
  34. package/dist_ts/tsdoc.paths.js +12 -0
  35. package/dist_ts/tsdoc.plugins.d.ts +11 -0
  36. package/dist_ts/tsdoc.plugins.js +15 -0
  37. package/license +19 -0
  38. package/npmextra.json +34 -0
  39. package/package.json +68 -0
  40. package/readme.md +101 -0
  41. package/ts/00_commitinfo_data.ts +8 -0
  42. package/ts/aidocs_classes/description.ts +73 -0
  43. package/ts/aidocs_classes/index.ts +3 -0
  44. package/ts/aidocs_classes/projectcontext.ts +73 -0
  45. package/ts/aidocs_classes/readme.ts +84 -0
  46. package/ts/classes.aidoc.ts +80 -0
  47. package/ts/classes.typedoc.ts +58 -0
  48. package/ts/cli.ts +42 -0
  49. package/ts/index.ts +12 -0
  50. package/ts/logging.ts +15 -0
  51. package/ts/paths.ts +13 -0
  52. package/ts/plugins.ts +24 -0
@@ -0,0 +1,58 @@
1
+ import * as plugins from './plugins.js';
2
+ import * as paths from './paths.js';
3
+
4
+ export class TypeDoc {
5
+ public smartshellInstance = new plugins.smartshell.Smartshell({
6
+ executor: 'bash',
7
+ pathDirectories: [paths.binDir],
8
+ });
9
+
10
+ // Static
11
+ public static async isTypeDocDir(dirPathArg: string): Promise<boolean> {
12
+ return true;
13
+ }
14
+
15
+ // Instance
16
+ public typedocDirectory: string;
17
+ constructor(dirPathArg) {
18
+ this.typedocDirectory = dirPathArg;
19
+ }
20
+
21
+ public async compile(options?: { publicSubdir?: string }) {
22
+ const data = {
23
+ "compilerOptions": {
24
+ "experimentalDecorators": true,
25
+ "useDefineForClassFields": false,
26
+ "target": "ES2022",
27
+ "module": "NodeNext",
28
+ "moduleResolution": "NodeNext",
29
+ "esModuleInterop": true,
30
+ "verbatimModuleSyntax": true,
31
+ "skipLibCheck": true,
32
+ },
33
+ include: [],
34
+ };
35
+ let startDirectory = '';
36
+ if (plugins.smartfile.fs.isDirectory(plugins.path.join(paths.cwd, './ts'))) {
37
+ data.include.push(plugins.path.join(paths.cwd, './ts/**/*'));
38
+ startDirectory = 'ts';
39
+ }
40
+
41
+ if (plugins.smartfile.fs.isDirectory(plugins.path.join(paths.cwd, './ts_web'))) {
42
+ data.include.push(plugins.path.join(paths.cwd, './ts_web/**/*'));
43
+ if (!startDirectory) {
44
+ startDirectory = 'ts_web';
45
+ }
46
+ }
47
+
48
+ await plugins.smartfile.memory.toFs(JSON.stringify(data), paths.tsconfigFile);
49
+ let targetDir = paths.publicDir;
50
+ if (options?.publicSubdir) {
51
+ targetDir = plugins.path.join(targetDir, options.publicSubdir);
52
+ }
53
+ await this.smartshellInstance.exec(
54
+ `typedoc --tsconfig ${paths.tsconfigFile} --out ${targetDir} ${startDirectory}/index.ts`
55
+ );
56
+ plugins.smartfile.fs.remove(paths.tsconfigFile);
57
+ }
58
+ }
package/ts/cli.ts ADDED
@@ -0,0 +1,42 @@
1
+ import * as plugins from './plugins.js';
2
+ import * as paths from './paths.js';
3
+ import { logger } from './logging.js';
4
+
5
+ import { TypeDoc } from './classes.typedoc.js';
6
+ import { AiDoc } from './classes.aidoc.js';
7
+
8
+ export const run = async () => {
9
+ const tsdocCli = new plugins.smartcli.Smartcli();
10
+
11
+ tsdocCli.standardCommand().subscribe(async (argvArg) => {
12
+ logger.log('warn', `Auto detecting environment!`);
13
+ switch (true) {
14
+ case await TypeDoc.isTypeDocDir(paths.cwd):
15
+ logger.log('ok', `Detected TypeDoc compliant directory at ${paths.cwd}`);
16
+ tsdocCli.triggerCommand('typedoc', argvArg);
17
+ break;
18
+ default:
19
+ logger.log('error', `Cannot determine docs format at ${paths.cwd}`);
20
+ }
21
+ });
22
+
23
+ tsdocCli.addCommand('typedoc').subscribe(async (argvArg) => {
24
+ const typeDocInstance = new TypeDoc(paths.cwd);
25
+ await typeDocInstance.compile({
26
+ publicSubdir: argvArg.publicSubdir,
27
+ });
28
+ });
29
+
30
+ tsdocCli.addCommand('aidocs').subscribe(async (argvArg) => {
31
+ const aidocs = new AiDoc();
32
+ })
33
+
34
+ tsdocCli.addCommand('test').subscribe((argvArg) => {
35
+ tsdocCli.triggerCommand('typedoc', argvArg);
36
+ process.on('exit', async () => {
37
+ await plugins.smartfile.fs.remove(paths.publicDir);
38
+ });
39
+ });
40
+
41
+ tsdocCli.startParse();
42
+ };
package/ts/index.ts ADDED
@@ -0,0 +1,12 @@
1
+ import * as early from '@push.rocks/early';
2
+ early.start('tsdoc');
3
+ import * as plugins from './plugins.js';
4
+ import * as cli from './cli.js';
5
+ early.stop();
6
+
7
+ export const runCli = async () => {
8
+ await cli.run();
9
+ };
10
+
11
+ // exports
12
+ export * from './classes.aidoc.js';
package/ts/logging.ts ADDED
@@ -0,0 +1,15 @@
1
+ import * as plugins from './plugins.js';
2
+
3
+ export const logger = new plugins.smartlog.Smartlog({
4
+ logContext: {
5
+ company: 'Some Company',
6
+ companyunit: 'Some CompanyUnit',
7
+ containerName: 'Some Containername',
8
+ environment: 'local',
9
+ runtime: 'node',
10
+ zone: 'gitzone',
11
+ },
12
+ minimumLogLevel: 'silly',
13
+ });
14
+
15
+ logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
package/ts/paths.ts ADDED
@@ -0,0 +1,13 @@
1
+ import * as plugins from './plugins.js';
2
+
3
+ // dirs
4
+ export const packageDir = plugins.path.join(plugins.smartpath.get.dirnameFromImportMetaUrl(import.meta.url), '../');
5
+ export const cwd = process.cwd();
6
+ export const binDir = plugins.path.join(packageDir, './node_modules/.bin');
7
+ export const assetsDir = plugins.path.join(packageDir, './assets');
8
+ export const publicDir = plugins.path.join(cwd, './public');
9
+ export const tsDir = plugins.path.join(cwd, './ts');
10
+
11
+ // files
12
+ export const tsconfigFile = plugins.path.join(assetsDir, './tsconfig.json');
13
+ export const typedocOptionsFile = plugins.path.join(assetsDir, './typedoc.json');
package/ts/plugins.ts ADDED
@@ -0,0 +1,24 @@
1
+ // node native
2
+ import * as path from 'path';
3
+
4
+ export { path };
5
+
6
+ // pushrocks scope
7
+ import * as npmextra from '@push.rocks/npmextra';
8
+ import * as qenv from '@push.rocks/qenv';
9
+ import * as smartai from '@push.rocks/smartai';
10
+ import * as smartcli from '@push.rocks/smartcli';
11
+ import * as smartdelay from '@push.rocks/smartdelay';
12
+ import * as smartfile from '@push.rocks/smartfile';
13
+ import * as smartinteract from '@push.rocks/smartinteract';
14
+ import * as smartlog from '@push.rocks/smartlog';
15
+ import * as smartlogDestinationLocal from '@push.rocks/smartlog-destination-local';
16
+ import * as smartpath from '@push.rocks/smartpath';
17
+ import * as smartshell from '@push.rocks/smartshell';
18
+
19
+ export { npmextra, qenv, smartai, smartcli, smartdelay, smartfile, smartinteract, smartlog, smartlogDestinationLocal, smartpath, smartshell };
20
+
21
+ // third party scope
22
+ import * as typedoc from 'typedoc';
23
+
24
+ export { typedoc };