@ts-for-gir/lib 3.0.0 → 3.0.2

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 (103) hide show
  1. package/lib/constants.d.ts +9 -1
  2. package/lib/constants.js +4 -1
  3. package/lib/constants.js.map +1 -1
  4. package/lib/dependency-manager.d.ts +11 -0
  5. package/lib/dependency-manager.js +28 -14
  6. package/lib/dependency-manager.js.map +1 -1
  7. package/lib/gir-module.js +2 -3
  8. package/lib/gir-module.js.map +1 -1
  9. package/lib/index.d.ts +0 -3
  10. package/lib/index.js +0 -3
  11. package/lib/index.js.map +1 -1
  12. package/lib/symtable.js +1 -2
  13. package/lib/symtable.js.map +1 -1
  14. package/lib/types/generate-config.d.ts +2 -0
  15. package/lib/types/user-config.d.ts +2 -0
  16. package/lib/utils.d.ts +6 -0
  17. package/lib/utils.js +10 -0
  18. package/lib/utils.js.map +1 -1
  19. package/package.json +9 -10
  20. package/lib/injection/classes/GLib-2-0.d.ts +0 -2
  21. package/lib/injection/classes/GLib-2-0.js +0 -35
  22. package/lib/injection/classes/GLib-2-0.js.map +0 -1
  23. package/lib/injection/classes/gjs/GLib-2.0.d.ts +0 -2
  24. package/lib/injection/classes/gjs/GLib-2.0.js +0 -205
  25. package/lib/injection/classes/gjs/GLib-2.0.js.map +0 -1
  26. package/lib/injection/classes/gjs/GObject-2.0.d.ts +0 -2
  27. package/lib/injection/classes/gjs/GObject-2.0.js +0 -634
  28. package/lib/injection/classes/gjs/GObject-2.0.js.map +0 -1
  29. package/lib/injection/classes/gjs/Gio-2.0.d.ts +0 -5
  30. package/lib/injection/classes/gjs/Gio-2.0.js +0 -218
  31. package/lib/injection/classes/gjs/Gio-2.0.js.map +0 -1
  32. package/lib/injection/classes/node-gtk/GLib-2.0.d.ts +0 -2
  33. package/lib/injection/classes/node-gtk/GLib-2.0.js +0 -19
  34. package/lib/injection/classes/node-gtk/GLib-2.0.js.map +0 -1
  35. package/lib/injection/classes/node-gtk/GObject-2.0.d.ts +0 -2
  36. package/lib/injection/classes/node-gtk/GObject-2.0.js +0 -66
  37. package/lib/injection/classes/node-gtk/GObject-2.0.js.map +0 -1
  38. package/lib/injection/classes/node-gtk/Gdk-4.0.d.ts +0 -2
  39. package/lib/injection/classes/node-gtk/Gdk-4.0.js +0 -32
  40. package/lib/injection/classes/node-gtk/Gdk-4.0.js.map +0 -1
  41. package/lib/injection/classes/node-gtk/Gio-2.0.d.ts +0 -2
  42. package/lib/injection/classes/node-gtk/Gio-2.0.js +0 -14
  43. package/lib/injection/classes/node-gtk/Gio-2.0.js.map +0 -1
  44. package/lib/injection/classes/node-gtk/Graphene-1.0.d.ts +0 -2
  45. package/lib/injection/classes/node-gtk/Graphene-1.0.js +0 -133
  46. package/lib/injection/classes/node-gtk/Graphene-1.0.js.map +0 -1
  47. package/lib/injection/classes/node-gtk/Gtk-3.0.d.ts +0 -2
  48. package/lib/injection/classes/node-gtk/Gtk-3.0.js +0 -31
  49. package/lib/injection/classes/node-gtk/Gtk-3.0.js.map +0 -1
  50. package/lib/injection/classes/node-gtk/Gtk-4.0.d.ts +0 -2
  51. package/lib/injection/classes/node-gtk/Gtk-4.0.js +0 -52
  52. package/lib/injection/classes/node-gtk/Gtk-4.0.js.map +0 -1
  53. package/lib/injection/classes/node-gtk/Pango-1.0.d.ts +0 -2
  54. package/lib/injection/classes/node-gtk/Pango-1.0.js +0 -31
  55. package/lib/injection/classes/node-gtk/Pango-1.0.js.map +0 -1
  56. package/lib/package-data-parser.d.ts +0 -13
  57. package/lib/package-data-parser.js +0 -67
  58. package/lib/package-data-parser.js.map +0 -1
  59. package/lib/package-data.d.ts +0 -9
  60. package/lib/package-data.js +0 -41
  61. package/lib/package-data.js.map +0 -1
  62. package/lib/template-processor.d.ts +0 -114
  63. package/lib/template-processor.js +0 -252
  64. package/lib/template-processor.js.map +0 -1
  65. package/lib/types/package-section.d.ts +0 -8
  66. package/lib/types/package-section.js +0 -2
  67. package/lib/types/package-section.js.map +0 -1
  68. package/templates/README.md +0 -102
  69. package/templates/cogl-2-0.d.ts +0 -0
  70. package/templates/gjs/README-GJS.md +0 -109
  71. package/templates/gjs/ambient.d.ts +0 -59
  72. package/templates/gjs/cairo-1.0.d.ts +0 -9
  73. package/templates/gjs/cairo.d.ts +0 -8
  74. package/templates/gjs/cairo.js +0 -11
  75. package/templates/gjs/gettext.d.ts +0 -41
  76. package/templates/gjs/gettext.js +0 -11
  77. package/templates/gjs/gio-2.0.d.ts +0 -101
  78. package/templates/gjs/gjs.d.ts +0 -757
  79. package/templates/gjs/gjs.js +0 -10
  80. package/templates/gjs/gobject-2.0.d.ts +0 -238
  81. package/templates/gjs/module-ambient.d.ts +0 -31
  82. package/templates/gjs/module-import.d.ts +0 -33
  83. package/templates/gjs/module.append.d.ts +0 -1
  84. package/templates/gjs/module.d.ts +0 -12
  85. package/templates/gjs/module.js +0 -17
  86. package/templates/gjs/system.d.ts +0 -32
  87. package/templates/gjs/system.js +0 -11
  88. package/templates/gjs/tsconfig.alias.json +0 -12
  89. package/templates/granite-1.0.d.ts +0 -7
  90. package/templates/granite-7.0.d.ts +0 -7
  91. package/templates/gstbase-0.10.d.ts +0 -5
  92. package/templates/node-gtk/README-NODE-GTK.md +0 -71
  93. package/templates/node-gtk/ambient.d.ts +0 -19
  94. package/templates/node-gtk/gobject-2.0.d.ts +0 -57
  95. package/templates/node-gtk/module-import.d.ts +0 -29
  96. package/templates/node-gtk/module.append.d.ts +0 -1
  97. package/templates/node-gtk/module.d.ts +0 -10
  98. package/templates/node-gtk/module.js +0 -18
  99. package/templates/node-gtk/node-gtk.d.ts +0 -25
  100. package/templates/node-gtk/node-gtk.js +0 -7
  101. package/templates/package.json +0 -173
  102. package/templates/rygelserver-2.6.d.ts +0 -3
  103. package/templates/tsconfig.doc.json +0 -30
@@ -1,31 +0,0 @@
1
- export const classesPango10Node = [
2
- {
3
- versions: ['1.0'],
4
- qualifiedName: 'Pango.Layout',
5
- methods: [
6
- {
7
- girTypeName: 'method',
8
- name: 'setMarkup',
9
- inParams: [
10
- {
11
- name: 'markup',
12
- type: [{ type: 'string' }],
13
- },
14
- ],
15
- returnTypes: [{ type: 'void' }],
16
- },
17
- {
18
- girTypeName: 'method',
19
- name: 'setText',
20
- inParams: [
21
- {
22
- name: 'text',
23
- type: [{ type: 'string' }],
24
- },
25
- ],
26
- returnTypes: [{ type: 'void' }],
27
- },
28
- ],
29
- },
30
- ];
31
- //# sourceMappingURL=Pango-1.0.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Pango-1.0.js","sourceRoot":"","sources":["../../../../src/injection/classes/node-gtk/Pango-1.0.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAChD;QACI,QAAQ,EAAE,CAAC,KAAK,CAAC;QACjB,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE;YACL;gBACI,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,WAAW;gBACjB,QAAQ,EAAE;oBACN;wBACI,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;qBAC7B;iBACJ;gBACD,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;aAClC;YACD;gBACI,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE;oBACN;wBACI,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;qBAC7B;iBACJ;gBACD,WAAW,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;aAClC;SACJ;KACJ;CACJ,CAAA"}
@@ -1,13 +0,0 @@
1
- import { Logger } from './logger.js';
2
- import type { GenerateConfig, PackageSectionParsed, PackageDataParsed, PackageData } from './types/index.js';
3
- export declare class PackageDataParser {
4
- protected readonly config: GenerateConfig;
5
- protected log: Logger;
6
- protected packages: PackageData[];
7
- constructor(config: GenerateConfig);
8
- get(name: string): PackageData | undefined;
9
- protected parseSections(sections: PackageSectionParsed[]): void;
10
- protected transformPackageData(pkg: PackageDataParsed, parentSection?: PackageSectionParsed): PackageData;
11
- protected parsePackages(packages: PackageDataParsed[], parentSection?: PackageSectionParsed): void;
12
- start(): Promise<void>;
13
- }
@@ -1,67 +0,0 @@
1
- import { parseStringPromise } from 'xml2js';
2
- import { readFile } from 'fs/promises';
3
- import { resolve } from 'path';
4
- import { Logger } from './logger.js';
5
- import { __dirname, splitModuleName, cleanString } from './utils.js';
6
- export class PackageDataParser {
7
- config;
8
- log;
9
- packages = [];
10
- constructor(config) {
11
- this.config = config;
12
- this.log = new Logger('', config.verbose, 'ModuleLoader');
13
- }
14
- get(name) {
15
- return this.packages.find((pkg) => pkg.gir === name);
16
- }
17
- parseSections(sections) {
18
- for (const section of sections) {
19
- this.log.log(`Found section`, section.$.name);
20
- if (section.package) {
21
- this.parsePackages(section.package);
22
- }
23
- if (section.section) {
24
- this.parseSections(section.section);
25
- }
26
- }
27
- }
28
- transformPackageData(pkg, parentSection) {
29
- const { gir, home, gallery, 'c-docs': cDocs, deprecated, maintainers, maintainer } = pkg.$;
30
- const description = cleanString(pkg._);
31
- if (!gir) {
32
- throw new Error(`No gir name specified for package "${pkg.$.name}"`);
33
- }
34
- const { namespace, version } = splitModuleName(gir);
35
- const trans = {
36
- description,
37
- namespace,
38
- version,
39
- gir,
40
- home,
41
- gallery,
42
- cDocs,
43
- deprecated: deprecated === 'true',
44
- maintainers: maintainers || maintainer,
45
- section: parentSection,
46
- };
47
- return trans;
48
- }
49
- parsePackages(packages, parentSection) {
50
- for (const pkg of packages) {
51
- this.log.log(`Found package "${pkg.$.name}"`);
52
- if (pkg.$.ignore === 'true' || !pkg.$.gir) {
53
- this.log.warn(`Ignoring package "${pkg.$.name}"`);
54
- continue;
55
- }
56
- const transPgk = this.transformPackageData(pkg, parentSection);
57
- this.packages.push(transPgk);
58
- }
59
- }
60
- async start() {
61
- this.log.log(`Parsing package.xml...`);
62
- const fileContents = await readFile(resolve(__dirname, '../packages.xml'), 'utf8');
63
- const result = (await parseStringPromise(fileContents));
64
- this.parseSections(result.packages.section);
65
- }
66
- }
67
- //# sourceMappingURL=package-data-parser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-data-parser.js","sourceRoot":"","sources":["../src/package-data-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAUpE,MAAM,OAAO,iBAAiB;IAIK;IAHrB,GAAG,CAAQ;IACX,QAAQ,GAAkB,EAAE,CAAA;IAEtC,YAA+B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;QACjD,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;IAC7D,CAAC;IAEM,GAAG,CAAC,IAAY;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,KAAK,IAAI,CAAC,CAAA;IACxD,CAAC;IAES,aAAa,CAAC,QAAgC;QACpD,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YAC7C,IAAI,OAAO,CAAC,OAAO,EAAE;gBACjB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;aACtC;YAED,IAAI,OAAO,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AAC,oBAAoB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC9D,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;SAC/B;IACL,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAA;QAClF,MAAM,MAAM,GAAG,CAAC,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAsB,CAAA;QAC5E,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC/C,CAAC;CACJ"}
@@ -1,9 +0,0 @@
1
- import { Logger } from './logger.js';
2
- import type { GenerateConfig, PackageSection } from './types/index.js';
3
- export declare class PackageData {
4
- protected readonly config: GenerateConfig;
5
- log: Logger;
6
- constructor(config: GenerateConfig);
7
- start(): Promise<void>;
8
- parseSections(sections: PackageSection[]): Promise<void>;
9
- }
@@ -1,41 +0,0 @@
1
- import { parseStringPromise } from 'xml2js';
2
- import { readFile } from 'fs/promises';
3
- import { resolve } from 'path';
4
- import { Logger } from './logger.js';
5
- import { __dirname } from './utils.js';
6
- export class PackageDataParser {
7
- config;
8
- log;
9
- constructor(config) {
10
- this.config = config;
11
- this.log = new Logger('', config.verbose || true, 'ModuleLoader');
12
- }
13
- async start() {
14
- this.log.log(`Parsing package.xml...`);
15
- const fileContents = await readFile(resolve(__dirname, '../packages.xml'), 'utf8');
16
- const result = (await parseStringPromise(fileContents));
17
- this.log.log(`Parsed package.xml`, result.packages.section);
18
- this.parseSections(result.packages.section);
19
- }
20
- async parseSections(sections) {
21
- for (const section of sections) {
22
- this.log.log(`Found package section`, section.$.name);
23
- if (section.package) {
24
- for (const pkg of section.package) {
25
- this.log.log(`Found package`, pkg.$.name);
26
- }
27
- }
28
- if (section.section) {
29
- this.parseSections(section.section);
30
- }
31
- }
32
- }
33
- async parsePackages(packages) {
34
- for (const key in data) {
35
- if (Object.prototype.hasOwnProperty.call(data, key)) {
36
- const element = data[key];
37
- }
38
- }
39
- }
40
- }
41
- //# sourceMappingURL=package-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-data.js","sourceRoot":"","sources":["../src/package-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAItC,MAAM,OAAO,iBAAiB;IAEK;IAD/B,GAAG,CAAQ;IACX,YAA+B,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;QACjD,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,EAAE,EAAE,MAAM,CAAC,OAAO,IAAI,IAAI,EAAE,cAAc,CAAC,CAAA;IACrE,CAAC;IAED,KAAK,CAAC,KAAK;QACP,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;QACtC,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAA;QAClF,MAAM,MAAM,GAAG,CAAC,MAAM,kBAAkB,CAAC,YAAY,CAAC,CAAsB,CAAA;QAC5E,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC3D,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAE/C,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAA0B;QAC1C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;YAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YACrD,IAAG,OAAO,CAAC,OAAO,EAAE;gBAChB,KAAK,MAAM,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE;oBAC/B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;iBAC5C;aACJ;YAED,IAAG,OAAO,CAAC,OAAO,EAAE;gBAChB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;aACtC;SAEJ;IACL,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAuB;QACvC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACpB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE;gBACjD,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;aAE7B;SACJ;IACL,CAAC;CACJ"}
@@ -1,114 +0,0 @@
1
- /**
2
- * The TemplateProcessor is used generate strings from templates files or template strings
3
- * For example, the signal methods are generated here
4
- */
5
- import ejs from 'ejs';
6
- import { Logger } from './logger.js';
7
- import { Transformation } from './transformation.js';
8
- import type { GenerateConfig, Dependency, TemplateData, Environment } from './types/index.js';
9
- export declare class TemplateProcessor {
10
- protected readonly data: TemplateData | undefined;
11
- protected readonly packageName: string;
12
- protected readonly deps: Dependency[];
13
- protected readonly config: GenerateConfig;
14
- protected environmentTemplateDir: string;
15
- protected log: Logger;
16
- protected transformation: Transformation;
17
- constructor(data: TemplateData | undefined, packageName: string, deps: Dependency[], config: GenerateConfig);
18
- /**
19
- * Get the output or input directory of the environment
20
- * @param environment The environment to get the directory for
21
- * @param baseDir The base directory
22
- * @returns The path to the directory
23
- */
24
- protected getEnvironmentDir: (environment: Environment, baseDir: string) => string;
25
- protected getAppendTemplateName(templateFilename: string): string;
26
- /**
27
- * Loads and renders a template and gets the rendered templates back
28
- * @param templateFilename
29
- */
30
- load(templateFilename: string, options?: Partial<ejs.Options>, overrideTemplateData?: TemplateData): Promise<{
31
- prepend: string;
32
- append: string;
33
- }>;
34
- /**
35
- * Loads and renders all templates in a directory and gets the rendered templates back
36
- * @param templateDirname
37
- * @param fileExtension
38
- * @param options EJS options
39
- * @param overrideTemplateData Override template data if you want
40
- * @returns The rendered templates
41
- */
42
- loadAll(templateDirname: string, fileExtension: string, options?: Partial<ejs.Options>, overrideTemplateData?: TemplateData): Promise<{
43
- [path: string]: string;
44
- }>;
45
- /**
46
- * Loads an template, render the template and write the template to the filesystem
47
- * @param templateFilename The filename of the template
48
- * @param baseOutputPath The base output directory path where the templates should be written to
49
- * @param outputFilename The filename of the output file
50
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
51
- * @param content A (optional) string that should be appended to the rendered template
52
- * @param options EJS options
53
- * @param overrideTemplateData Override template data if you want
54
- * @return The rendered template string
55
- */
56
- create(templateFilename: string, baseOutputPath: string, outputFilename: string, prependEnv?: boolean, content?: string, options?: Partial<ejs.Options>, overrideTemplateData?: TemplateData): Promise<string>;
57
- /**
58
- * Loads all templates with file extension in dir, render the templates and write the template to the filesystem
59
- * @param fileExtension The file extension of the templates
60
- * @param templateDirname The directory where the templates are located
61
- * @param baseOutputPath The base output directory path where the templates should be written to
62
- * @param outputDirname The child output directory of the base output directory where the templates should be written to
63
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
64
- * @param append A (optional) string that should be appended to the rendered template
65
- * @param options EJS options
66
- * @param overrideTemplateData Override template data if you want
67
- * @return The rendered (and if possible prettified) templates
68
- */
69
- createAll(fileExtension: string, templateDirname: string, baseOutputPath: string, outputDirname: string, prependEnv?: boolean, append?: string, options?: Partial<ejs.Options>, overrideTemplateData?: TemplateData): Promise<{
70
- [path: string]: string;
71
- }>;
72
- getOutputPath(baseOutputPath: string, outputFilename: string, prependEnv?: boolean): string;
73
- /**
74
- * Writes the `content` to the filesystem
75
- * @param content The content (normally the content of a rendered template file) that should be written to the filesystem
76
- * @param baseOutputPath The base output directory path where the templates should be written to
77
- * @param outputFilename The filename of the output file
78
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
79
- * @returns
80
- */
81
- protected write(content: string, baseOutputPath: string, outputFilename: string, prependEnv?: boolean): Promise<string>;
82
- /**
83
- *
84
- * @param templateString The template content string that should be rendered
85
- * @param options EJS options
86
- * @param overrideTemplateData Override template data if you want
87
- * @returns
88
- */
89
- protected render(templateString: string, options?: Partial<ejs.Options>, overrideTemplateData?: TemplateData): Promise<string>;
90
- /**
91
- * Checks if the template file or directory exists and returns the path if found
92
- * Tries first to load the file / directory from the environment-specific template folder and otherwise looks for it in the general template folder
93
- * @param templateFilename
94
- */
95
- exists(templateFilename: string): string | null;
96
- /**
97
- * Reads a template file from filesystem and gets the raw string back
98
- * @param templateFilename
99
- * @return The raw template content
100
- */
101
- protected read(templateFilename: string): Promise<string>;
102
- /**
103
- * Reads all template files from a directory and gets the raw strings back
104
- * @param templateDirname
105
- * @param fileExtension
106
- * @return The raw template contents
107
- * @throws Error if the template directory does not exist
108
- * @throws Error if the template directory is empty
109
- */
110
- protected readAll(templateDirname: string, fileExtension: string): Promise<{
111
- [path: string]: string;
112
- }>;
113
- }
114
- export default TemplateProcessor;
@@ -1,252 +0,0 @@
1
- /**
2
- * The TemplateProcessor is used generate strings from templates files or template strings
3
- * For example, the signal methods are generated here
4
- */
5
- import { existsSync } from 'fs';
6
- import { readFile, writeFile, mkdir, readdir } from 'fs/promises';
7
- import { join, dirname, relative, extname } from 'path';
8
- import ejs from 'ejs';
9
- import { Logger } from './logger.js';
10
- import { APP_NAME, APP_USAGE, APP_SOURCE, APP_VERSION, PACKAGE_DESC, PACKAGE_KEYWORDS } from './constants.js';
11
- import { __dirname, getDestPath } from './utils.js';
12
- import { DependencyManager } from './dependency-manager.js';
13
- import { Transformation } from './transformation.js';
14
- const TEMPLATE_DIR = join(__dirname, '../templates');
15
- export class TemplateProcessor {
16
- data;
17
- packageName;
18
- deps;
19
- config;
20
- environmentTemplateDir;
21
- log;
22
- transformation;
23
- constructor(data, packageName, deps, config) {
24
- this.data = data;
25
- this.packageName = packageName;
26
- this.deps = deps;
27
- this.config = config;
28
- this.transformation = new Transformation(config);
29
- const dep = DependencyManager.getInstance(config);
30
- let outdir = config.outdir || './';
31
- // Make outdir relative to the root directory
32
- outdir = relative(config.root, outdir);
33
- const typeDir = getDestPath(outdir);
34
- this.data = {
35
- ...this.data,
36
- APP_NAME,
37
- APP_USAGE,
38
- APP_SOURCE,
39
- APP_VERSION,
40
- PACKAGE_DESC: PACKAGE_DESC(packageName, this.config.environment, this.data?.girModule?.libraryVersion),
41
- PACKAGE_KEYWORDS: PACKAGE_KEYWORDS(packageName, this.config.environment),
42
- importName: this.transformation.transformImportName(packageName),
43
- dep,
44
- deps,
45
- typeDir,
46
- join,
47
- dirname,
48
- };
49
- this.environmentTemplateDir = this.getEnvironmentDir(config.environment, TEMPLATE_DIR);
50
- this.log = new Logger(config.environment, config.verbose, this.packageName);
51
- }
52
- /**
53
- * Get the output or input directory of the environment
54
- * @param environment The environment to get the directory for
55
- * @param baseDir The base directory
56
- * @returns The path to the directory
57
- */
58
- getEnvironmentDir = (environment, baseDir) => {
59
- if (!baseDir.endsWith(environment))
60
- if (environment === 'gjs' && !baseDir.endsWith('/gjs')) {
61
- return join(baseDir, 'gjs');
62
- }
63
- if (environment === 'node' && !baseDir.endsWith('/node-gtk')) {
64
- return join(baseDir, 'node-gtk');
65
- }
66
- return baseDir;
67
- };
68
- getAppendTemplateName(templateFilename) {
69
- let appendTemplateFilename = templateFilename;
70
- if (appendTemplateFilename.endsWith('.d.ts')) {
71
- appendTemplateFilename = appendTemplateFilename.replace('.d.ts', '.append.d.ts');
72
- }
73
- else if (extname(appendTemplateFilename)) {
74
- const ext = extname(appendTemplateFilename);
75
- appendTemplateFilename = appendTemplateFilename.replace(ext, '.append' + ext);
76
- }
77
- else {
78
- appendTemplateFilename += '.append';
79
- }
80
- return appendTemplateFilename;
81
- }
82
- /**
83
- * Loads and renders a template and gets the rendered templates back
84
- * @param templateFilename
85
- */
86
- async load(templateFilename, options = {}, overrideTemplateData = {}) {
87
- const fileContent = await this.read(templateFilename);
88
- const prepend = await this.render(fileContent, options, overrideTemplateData);
89
- let append = '';
90
- const appendTemplateFilename = this.getAppendTemplateName(templateFilename);
91
- if (this.exists(appendTemplateFilename)) {
92
- const appendFileContent = await this.read(appendTemplateFilename);
93
- append = await this.render(appendFileContent, options, overrideTemplateData);
94
- }
95
- return { prepend, append };
96
- }
97
- /**
98
- * Loads and renders all templates in a directory and gets the rendered templates back
99
- * @param templateDirname
100
- * @param fileExtension
101
- * @param options EJS options
102
- * @param overrideTemplateData Override template data if you want
103
- * @returns The rendered templates
104
- */
105
- async loadAll(templateDirname, fileExtension, options = {}, overrideTemplateData = {}) {
106
- const fileContents = await this.readAll(templateDirname, fileExtension);
107
- for (const file of Object.keys(fileContents)) {
108
- fileContents[file] = await this.render(fileContents[file], options, overrideTemplateData);
109
- }
110
- return fileContents;
111
- }
112
- /**
113
- * Loads an template, render the template and write the template to the filesystem
114
- * @param templateFilename The filename of the template
115
- * @param baseOutputPath The base output directory path where the templates should be written to
116
- * @param outputFilename The filename of the output file
117
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
118
- * @param content A (optional) string that should be appended to the rendered template
119
- * @param options EJS options
120
- * @param overrideTemplateData Override template data if you want
121
- * @return The rendered template string
122
- */
123
- async create(templateFilename, baseOutputPath, outputFilename, prependEnv = true, content = '', options = {}, overrideTemplateData = {}) {
124
- const { prepend, append } = await this.load(templateFilename, options, overrideTemplateData);
125
- const code = prepend + '\n' + content + '\n' + append;
126
- await this.write(code, baseOutputPath, outputFilename, prependEnv);
127
- return code;
128
- }
129
- /**
130
- * Loads all templates with file extension in dir, render the templates and write the template to the filesystem
131
- * @param fileExtension The file extension of the templates
132
- * @param templateDirname The directory where the templates are located
133
- * @param baseOutputPath The base output directory path where the templates should be written to
134
- * @param outputDirname The child output directory of the base output directory where the templates should be written to
135
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
136
- * @param append A (optional) string that should be appended to the rendered template
137
- * @param options EJS options
138
- * @param overrideTemplateData Override template data if you want
139
- * @return The rendered (and if possible prettified) templates
140
- */
141
- async createAll(fileExtension, templateDirname, baseOutputPath, outputDirname, prependEnv = true, append = '', options = {}, overrideTemplateData = {}) {
142
- const rendered = await this.loadAll(templateDirname, fileExtension, options, overrideTemplateData);
143
- const result = {};
144
- for (const filename of Object.keys(rendered)) {
145
- const destPath = getDestPath(baseOutputPath, outputDirname, filename);
146
- result[destPath] = rendered[filename] + '\n' + append;
147
- await this.write(result[destPath], baseOutputPath, join(outputDirname, filename), prependEnv);
148
- }
149
- return result;
150
- }
151
- getOutputPath(baseOutputPath, outputFilename, prependEnv = true) {
152
- const filePath = this.config.package
153
- ? join(this.data?.importName || this.packageName, outputFilename)
154
- : outputFilename;
155
- const outputPath = prependEnv ? getDestPath(baseOutputPath, filePath) : join(baseOutputPath, filePath);
156
- return outputPath;
157
- }
158
- /**
159
- * Writes the `content` to the filesystem
160
- * @param content The content (normally the content of a rendered template file) that should be written to the filesystem
161
- * @param baseOutputPath The base output directory path where the templates should be written to
162
- * @param outputFilename The filename of the output file
163
- * @param prependEnv A (optional) boolean that indicates if the environment should be prepended to the output path
164
- * @returns
165
- */
166
- async write(content, baseOutputPath, outputFilename, prependEnv = true) {
167
- const outputPath = this.getOutputPath(baseOutputPath, outputFilename, prependEnv);
168
- // write template result file
169
- await mkdir(dirname(outputPath), { recursive: true });
170
- await writeFile(outputPath, content, { encoding: 'utf8', flag: 'w' });
171
- return Promise.resolve(outputPath);
172
- }
173
- /**
174
- *
175
- * @param templateString The template content string that should be rendered
176
- * @param options EJS options
177
- * @param overrideTemplateData Override template data if you want
178
- * @returns
179
- */
180
- async render(templateString, options = {}, overrideTemplateData = {}) {
181
- try {
182
- const renderedTpl = await ejs.render(templateString, {
183
- ...this.config,
184
- ...this.data,
185
- packageName: this.packageName,
186
- ...overrideTemplateData,
187
- }, {
188
- async: true,
189
- ...options,
190
- });
191
- return renderedTpl;
192
- }
193
- catch (error) {
194
- console.error(error);
195
- this.log.error('Error on render', error);
196
- return '';
197
- }
198
- }
199
- /**
200
- * Checks if the template file or directory exists and returns the path if found
201
- * Tries first to load the file / directory from the environment-specific template folder and otherwise looks for it in the general template folder
202
- * @param templateFilename
203
- */
204
- exists(templateFilename) {
205
- const fullEnvironmentTemplatePath = join(this.environmentTemplateDir, templateFilename);
206
- const fullGeneralTemplatePath = join(TEMPLATE_DIR, templateFilename);
207
- if (existsSync(fullEnvironmentTemplatePath)) {
208
- return fullEnvironmentTemplatePath;
209
- }
210
- if (existsSync(fullGeneralTemplatePath)) {
211
- return fullGeneralTemplatePath;
212
- }
213
- return null;
214
- }
215
- /**
216
- * Reads a template file from filesystem and gets the raw string back
217
- * @param templateFilename
218
- * @return The raw template content
219
- */
220
- async read(templateFilename) {
221
- const path = this.exists(templateFilename);
222
- if (path) {
223
- return await readFile(path, 'utf8');
224
- }
225
- throw new Error(`Template '${templateFilename}' not found'`);
226
- }
227
- /**
228
- * Reads all template files from a directory and gets the raw strings back
229
- * @param templateDirname
230
- * @param fileExtension
231
- * @return The raw template contents
232
- * @throws Error if the template directory does not exist
233
- * @throws Error if the template directory is empty
234
- */
235
- async readAll(templateDirname, fileExtension) {
236
- const path = this.exists(templateDirname);
237
- if (path) {
238
- const files = (await readdir(path)).filter((file) => file.endsWith(fileExtension));
239
- if (files.length === 0) {
240
- throw new Error(`Template directory '${templateDirname}' is empty'`);
241
- }
242
- const results = {};
243
- for (const file of files) {
244
- results[file] = await readFile(join(path, file), 'utf8');
245
- }
246
- return results;
247
- }
248
- throw new Error(`Template directory '${templateDirname}' not found'`);
249
- }
250
- }
251
- export default TemplateProcessor;
252
- //# sourceMappingURL=template-processor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-processor.js","sourceRoot":"","sources":["../src/template-processor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAC/B,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACvD,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAC7G,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAIpD,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAA;AAEpD,MAAM,OAAO,iBAAiB;IAKH;IACA;IACA;IACA;IAPb,sBAAsB,CAAQ;IAC9B,GAAG,CAAQ;IACX,cAAc,CAAgB;IACxC,YACuB,IAA8B,EAC9B,WAAmB,EACnB,IAAkB,EAClB,MAAsB;QAHtB,SAAI,GAAJ,IAAI,CAA0B;QAC9B,gBAAW,GAAX,WAAW,CAAQ;QACnB,SAAI,GAAJ,IAAI,CAAc;QAClB,WAAM,GAAN,MAAM,CAAgB;QAEzC,IAAI,CAAC,cAAc,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;QAChD,MAAM,GAAG,GAAG,iBAAiB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA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BAAwB;QACzC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;QAC1C,IAAI,IAAI,EAAE;YACN,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;SACtC;QACD,MAAM,IAAI,KAAK,CAAC,aAAa,gBAAgB,cAAc,CAAC,CAAA;IAChE,CAAC;IAED;;;;;;;OAOG;IACO,KAAK,CAAC,OAAO,CAAC,eAAuB,EAAE,aAAqB;QAClE,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;QACzC,IAAI,IAAI,EAAE;YACN,MAAM,KAAK,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAA;YAClF,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;gBACpB,MAAM,IAAI,KAAK,CAAC,uBAAuB,eAAe,aAAa,CAAC,CAAA;aACvE;YACD,MAAM,OAAO,GAA+B,EAAE,CAAA;YAC9C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACtB,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,CAAA;aAC3D;YACD,OAAO,OAAO,CAAA;SACjB;QACD,MAAM,IAAI,KAAK,CAAC,uBAAuB,eAAe,cAAc,CAAC,CAAA;IACzE,CAAC;CACJ;AAED,eAAe,iBAAiB,CAAA"}
@@ -1,8 +0,0 @@
1
- import type { PackageData } from './index.js';
2
- export interface PackageSection {
3
- $: {
4
- name: string;
5
- };
6
- package?: PackageData[];
7
- section?: PackageSection[];
8
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=package-section.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"package-section.js","sourceRoot":"","sources":["../../src/types/package-section.ts"],"names":[],"mappings":""}