@ts-for-gir/cli 4.0.0-beta.8 → 4.0.0-rc.1

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 (64) hide show
  1. package/README.md +295 -84
  2. package/bin/ts-for-gir +26569 -0
  3. package/bin/ts-for-gir-dev +43 -0
  4. package/package.json +39 -38
  5. package/src/commands/analyze.ts +344 -0
  6. package/src/commands/command-builder.ts +30 -0
  7. package/src/commands/copy.ts +71 -76
  8. package/src/commands/doc.ts +44 -47
  9. package/src/commands/generate.ts +35 -79
  10. package/src/commands/index.ts +6 -4
  11. package/src/commands/json.ts +43 -0
  12. package/src/commands/list.ts +71 -90
  13. package/src/commands/run-generation-command.ts +70 -0
  14. package/src/config/config-loader.ts +190 -0
  15. package/src/config/config-writer.ts +52 -0
  16. package/src/config/defaults.ts +66 -0
  17. package/src/config/index.ts +8 -0
  18. package/src/config/options.ts +315 -0
  19. package/src/config.ts +3 -456
  20. package/src/formatters/typescript-formatter.ts +24 -0
  21. package/src/generation-handler.ts +122 -67
  22. package/src/index.ts +4 -4
  23. package/src/module-loader/dependency-resolver.ts +100 -0
  24. package/src/module-loader/file-finder.ts +65 -0
  25. package/src/module-loader/index.ts +8 -0
  26. package/src/module-loader/module-grouper.ts +77 -0
  27. package/src/module-loader/prompt-handler.ts +111 -0
  28. package/src/module-loader.ts +289 -578
  29. package/src/start.ts +17 -14
  30. package/src/types/command-args.ts +118 -0
  31. package/src/types/command-definition.ts +17 -0
  32. package/src/types/commands.ts +30 -0
  33. package/src/types/index.ts +15 -0
  34. package/src/types/report-types.ts +34 -0
  35. package/lib/commands/copy.d.ts +0 -12
  36. package/lib/commands/copy.js +0 -80
  37. package/lib/commands/copy.js.map +0 -1
  38. package/lib/commands/doc.d.ts +0 -12
  39. package/lib/commands/doc.js +0 -40
  40. package/lib/commands/doc.js.map +0 -1
  41. package/lib/commands/generate.d.ts +0 -12
  42. package/lib/commands/generate.js +0 -71
  43. package/lib/commands/generate.js.map +0 -1
  44. package/lib/commands/index.d.ts +0 -4
  45. package/lib/commands/index.js +0 -5
  46. package/lib/commands/index.js.map +0 -1
  47. package/lib/commands/list.d.ts +0 -12
  48. package/lib/commands/list.js +0 -81
  49. package/lib/commands/list.js.map +0 -1
  50. package/lib/config.d.ts +0 -108
  51. package/lib/config.js +0 -410
  52. package/lib/config.js.map +0 -1
  53. package/lib/generation-handler.d.ts +0 -10
  54. package/lib/generation-handler.js +0 -48
  55. package/lib/generation-handler.js.map +0 -1
  56. package/lib/index.d.ts +0 -4
  57. package/lib/index.js +0 -5
  58. package/lib/index.js.map +0 -1
  59. package/lib/module-loader.d.ts +0 -148
  60. package/lib/module-loader.js +0 -468
  61. package/lib/module-loader.js.map +0 -1
  62. package/lib/start.d.ts +0 -2
  63. package/lib/start.js +0 -16
  64. package/lib/start.js.map +0 -1
@@ -1,148 +0,0 @@
1
- /**
2
- * The ModuleLoader is used for reading gir modules from the file system and to solve conflicts (e.g. Gtk-3.0 and Gtk-4.0 would be a conflict)
3
- */
4
- import { ListQuestion } from 'inquirer';
5
- import { DependencyManager, ResolveType, GirModule, Logger } from '@ts-for-gir/lib';
6
- import type { GirModulesGroupedMap, OptionsGeneration, GirModuleResolvedBy, GirModulesGrouped, DependencyMap, Dependency, AnswerVersion } from '@ts-for-gir/lib';
7
- export declare class ModuleLoader {
8
- protected readonly config: OptionsGeneration;
9
- log: Logger;
10
- dependencyManager: DependencyManager;
11
- /** Transitive module dependencies */
12
- modDependencyMap: DependencyMap;
13
- constructor(config: OptionsGeneration);
14
- /**
15
- * Groups Gir modules by name id
16
- * E.g. Gtk-3.0 and Gtk-4.0 will be grouped
17
- * @param girFiles
18
- */
19
- protected groupGirFiles(resolveGirModules: Set<GirModuleResolvedBy> | GirModuleResolvedBy[]): GirModulesGroupedMap;
20
- /**
21
- * Sorts out the module the user has not selected via cli prompt
22
- * @param girModulesGrouped
23
- * @param selected Users selected module packageName
24
- */
25
- protected sortVersionsByAnswer(girModulesGrouped: GirModulesGrouped, selected: string[]): {
26
- keep: Set<GirModuleResolvedBy>;
27
- ignore: string[];
28
- };
29
- protected generateContinueQuestion(message?: string, choices?: string[]): ListQuestion;
30
- protected generateIgnoreDepsQuestion(message?: string, choices?: string[]): ListQuestion;
31
- protected askIgnoreDepsPrompt(deps: GirModuleResolvedBy[] | Set<GirModuleResolvedBy>): Promise<'Yes' | 'No' | 'Go back'>;
32
- /**
33
- * Ask for duplicates / multiple versions of a module
34
- * @param girModuleGrouped
35
- * @param message
36
- */
37
- protected generateModuleVersionQuestion(girModuleGrouped: GirModulesGrouped, message?: string): ListQuestion;
38
- /**
39
- * Find modules that depend on the module with the name 'packageName'
40
- * @param girModulesGroupedMap
41
- * @param packageName
42
- */
43
- protected findGirFilesDependOnPackage(girModulesGroupedMap: GirModulesGroupedMap, packageName: string): GirModuleResolvedBy[];
44
- /**
45
- * Find modules that depend on the module with the names in `packageNames`
46
- * @param girModulesGroupedMap
47
- * @param packageName
48
- */
49
- protected findGirFilesDependOnPackages(girModulesGroupedMap: GirModulesGroupedMap, packageNames: string[]): GirModuleResolvedBy[];
50
- protected askForVersionsPrompt(girModulesGrouped: GirModulesGrouped): Promise<AnswerVersion>;
51
- /**
52
- * If multiple versions of the same module are found, this will aks the user with input prompts for the version he wish to use.
53
- * Ignores also modules that depend on a module that should be ignored
54
- * @param resolveFirModules
55
- */
56
- protected askForEachConflictVersionsPrompt(girModulesGroupedMap: GirModulesGroupedMap, ignore: string[]): Promise<{
57
- keep: Set<GirModuleResolvedBy>;
58
- ignore: string[];
59
- }>;
60
- /**
61
- * Asks via cli prompt if the user wants to add the ignored modules to his config file
62
- * @param ignoredModules
63
- */
64
- protected askAddToIgnoreToConfigPrompt(ignoredModules: string[] | Set<string>): Promise<void>;
65
- /**
66
- * Figure out transitive module dependencies
67
- * @param packageName
68
- * @param result
69
- */
70
- protected traverseDependencies(packageName: string, result?: {
71
- [name: string]: Dependency;
72
- }): void;
73
- /**
74
- * Extends the modDependencyMap by the current Module,
75
- * should be called for each girModule so that the modDependencyMap is complete
76
- * @param girModule
77
- */
78
- protected extendDependencyMapByGirModule(girModule: GirModule): void;
79
- /**
80
- * Sets the traverse dependencies for the current girModule,
81
- * is required so that all dependencies can be found internally when generating the dependency imports for the module .d.ts file
82
- * @param girModules
83
- */
84
- protected initGirModules(girModules: GirModuleResolvedBy[]): Promise<void>;
85
- /**
86
- * Reads a gir xml module file and creates an object of GirModule.
87
- * Also sets the setDependencyMap
88
- * @param fillName
89
- * @param config
90
- */
91
- protected loadAndCreateGirModule(dependency: Dependency): Promise<GirModule | null>;
92
- /**
93
- * Returns a girModule found by `packageName` property
94
- * @param girModules Array of girModules
95
- * @param packageNames Full name like 'Gtk-3.0' you are looking for
96
- */
97
- protected findGirModuleByFullNames(girModules: (GirModuleResolvedBy | GirModule)[], packageNames: string[]): Array<GirModuleResolvedBy | GirModule>;
98
- /**
99
- * Checks if a girModules with the `packageNames` exists
100
- * @param girModules
101
- * @param packageName
102
- */
103
- protected existsGirModules(girModules: (GirModuleResolvedBy | GirModule)[], packageName: string): boolean;
104
- /**
105
- * Reads the gir xml module files and creates an object of GirModule for each module
106
- * @param dependencies
107
- * @param girModules
108
- * @param resolvedBy
109
- * @param failedGirModules
110
- * @param ignoreDependencies
111
- * @returns
112
- */
113
- protected loadGirModules(dependencies: Dependency[], ignoreDependencies?: string[], girModules?: GirModuleResolvedBy[], resolvedBy?: ResolveType, failedGirModules?: Set<string>): Promise<{
114
- loaded: GirModuleResolvedBy[];
115
- failed: Set<string>;
116
- }>;
117
- /**
118
- * Find modules with the possibility to use wild cards for module names. E.g. `Gtk*` or `'*'`
119
- * @param modules
120
- * @param ignore
121
- */
122
- protected findGirFiles(globPackageNames: string[], ignore?: string[]): Promise<Set<string>>;
123
- protected girFilePathToDependencies(girFiles: Set<string>): Promise<Dependency[]>;
124
- /**
125
- * Loads all found `packageNames`
126
- * @param girDirectories
127
- * @param packageNames
128
- * @param doNotAskForVersionOnConflict Set this to false if you want to get a prompt for each version conflict
129
- */
130
- getModulesResolved(packageNames: string[], ignore?: string[], doNotAskForVersionOnConflict?: boolean): Promise<{
131
- keep: GirModuleResolvedBy[];
132
- grouped: GirModulesGroupedMap;
133
- ignore: string[];
134
- failed: Set<string>;
135
- }>;
136
- /**
137
- * Find modules
138
- * @param girDirectories
139
- * @param modules
140
- */
141
- getModules(modules: string[], ignore?: string[]): Promise<{
142
- grouped: GirModulesGroupedMap;
143
- loaded: GirModuleResolvedBy[];
144
- failed: string[];
145
- }>;
146
- /** Start parsing the gir modules */
147
- parse(girModules: GirModuleResolvedBy[]): void;
148
- }
@@ -1,468 +0,0 @@
1
- /**
2
- * The ModuleLoader is used for reading gir modules from the file system and to solve conflicts (e.g. Gtk-3.0 and Gtk-4.0 would be a conflict)
3
- */
4
- import inquirer from 'inquirer';
5
- import { glob } from 'glob';
6
- import { basename, join } from 'path';
7
- import { bold } from 'colorette';
8
- import { DependencyManager, ResolveType, GirModule, Logger, splitModuleName, union, isIterable, WARN_NO_GIR_FILE_FOUND_FOR_PACKAGE, } from '@ts-for-gir/lib';
9
- import { Config } from './config.js';
10
- export class ModuleLoader {
11
- config;
12
- log;
13
- dependencyManager;
14
- /** Transitive module dependencies */
15
- modDependencyMap = {};
16
- constructor(config) {
17
- this.config = config;
18
- this.log = new Logger(config.verbose, 'ModuleLoader');
19
- this.dependencyManager = DependencyManager.getInstance(config);
20
- }
21
- /**
22
- * Groups Gir modules by name id
23
- * E.g. Gtk-3.0 and Gtk-4.0 will be grouped
24
- * @param girFiles
25
- */
26
- groupGirFiles(resolveGirModules) {
27
- const girModulesGrouped = {};
28
- for (const resolveGirModule of resolveGirModules) {
29
- const { namespace } = splitModuleName(resolveGirModule.packageName);
30
- const id = namespace.toLowerCase();
31
- if (!girModulesGrouped[id]) {
32
- girModulesGrouped[id] = {
33
- namespace: namespace,
34
- modules: [resolveGirModule],
35
- hasConflict: false,
36
- };
37
- }
38
- else {
39
- girModulesGrouped[id].modules.push(resolveGirModule);
40
- girModulesGrouped[id].hasConflict = true;
41
- }
42
- }
43
- return girModulesGrouped;
44
- }
45
- /**
46
- * Sorts out the module the user has not selected via cli prompt
47
- * @param girModulesGrouped
48
- * @param selected Users selected module packageName
49
- */
50
- sortVersionsByAnswer(girModulesGrouped, selected) {
51
- const keep = new Set();
52
- let ignore = [];
53
- if (!girModulesGrouped.hasConflict) {
54
- keep.add(girModulesGrouped.modules[0]);
55
- }
56
- else {
57
- const keepModules = this.findGirModuleByFullNames(girModulesGrouped.modules, selected);
58
- const girModulePackageNames = girModulesGrouped.modules.map((resolveGirModule) => resolveGirModule.packageName);
59
- if (!keepModules || keepModules.length <= 0) {
60
- throw new Error('Module not found!');
61
- }
62
- for (const keepModule of keepModules) {
63
- keep.add(keepModule);
64
- }
65
- const toIgnore = girModulePackageNames.filter((packageName) => !selected.includes(packageName));
66
- ignore = ignore.concat(toIgnore);
67
- }
68
- return {
69
- keep,
70
- ignore,
71
- };
72
- }
73
- generateContinueQuestion(message = `do you want to continue?`, choices = ['Yes', 'Go back']) {
74
- const question = {
75
- name: 'continue',
76
- message,
77
- type: 'list',
78
- choices,
79
- };
80
- return question;
81
- }
82
- generateIgnoreDepsQuestion(message = `Do you want to ignore them too?`, choices = ['Yes', 'No', 'Go back']) {
83
- const question = {
84
- name: 'continue',
85
- message,
86
- type: 'list',
87
- choices,
88
- };
89
- return question;
90
- }
91
- async askIgnoreDepsPrompt(deps) {
92
- let question = null;
93
- const size = deps.length || deps.size || 0;
94
- if (size > 0) {
95
- this.log.log(bold('\nThe following modules have the ignored modules as dependencies:'));
96
- for (const dep of deps) {
97
- this.log.log(`- ${dep.packageName}`);
98
- }
99
- this.log.log(bold('\n'));
100
- question = this.generateIgnoreDepsQuestion();
101
- }
102
- else {
103
- this.log.log(bold('\nNo dependencies found on the ignored modules'));
104
- question = this.generateContinueQuestion();
105
- }
106
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
107
- const answer = (await inquirer.prompt([question])).continue;
108
- return answer;
109
- }
110
- /**
111
- * Ask for duplicates / multiple versions of a module
112
- * @param girModuleGrouped
113
- * @param message
114
- */
115
- generateModuleVersionQuestion(girModuleGrouped, message) {
116
- message = message || `Multiple versions of '${girModuleGrouped.namespace}' found, which one do you want to use?`;
117
- const choices = ['All', ...girModuleGrouped.modules.map((module) => module.packageName)];
118
- const question = {
119
- name: girModuleGrouped.namespace,
120
- message,
121
- type: 'list',
122
- choices,
123
- };
124
- return question;
125
- }
126
- /**
127
- * Find modules that depend on the module with the name 'packageName'
128
- * @param girModulesGroupedMap
129
- * @param packageName
130
- */
131
- findGirFilesDependOnPackage(girModulesGroupedMap, packageName) {
132
- const girModules = [];
133
- for (const girModulesGrouped of Object.values(girModulesGroupedMap)) {
134
- for (const girModuleResolvedBy of girModulesGrouped.modules) {
135
- if (girModuleResolvedBy.packageName === packageName) {
136
- continue;
137
- }
138
- for (const dep of girModuleResolvedBy.module.dependencies) {
139
- if (dep.packageName === packageName && !girModules.includes(girModuleResolvedBy)) {
140
- girModules.push(girModuleResolvedBy);
141
- }
142
- }
143
- }
144
- }
145
- return girModules;
146
- }
147
- /**
148
- * Find modules that depend on the module with the names in `packageNames`
149
- * @param girModulesGroupedMap
150
- * @param packageName
151
- */
152
- findGirFilesDependOnPackages(girModulesGroupedMap, packageNames) {
153
- let girModules = [];
154
- for (const packageName of packageNames) {
155
- girModules = [...girModules, ...this.findGirFilesDependOnPackage(girModulesGroupedMap, packageName)];
156
- }
157
- return girModules;
158
- }
159
- async askForVersionsPrompt(girModulesGrouped) {
160
- const question = this.generateModuleVersionQuestion(girModulesGrouped);
161
- const choices = question.choices;
162
- if (!choices) {
163
- throw new Error('No valid questions!');
164
- }
165
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
166
- const selected = (await inquirer.prompt([question]))[girModulesGrouped.namespace];
167
- if (!selected) {
168
- throw new Error('No valid answer!');
169
- }
170
- if (selected === 'All') {
171
- return {
172
- selected: choices.filter((choice) => choice !== 'All'),
173
- unselected: [],
174
- };
175
- }
176
- const unselected = choices.filter((choice) => choice !== selected);
177
- return {
178
- selected: [selected],
179
- unselected,
180
- };
181
- }
182
- /**
183
- * If multiple versions of the same module are found, this will aks the user with input prompts for the version he wish to use.
184
- * Ignores also modules that depend on a module that should be ignored
185
- * @param resolveFirModules
186
- */
187
- async askForEachConflictVersionsPrompt(girModulesGroupedMap, ignore) {
188
- let keep = new Set();
189
- for (const girModulesGrouped of Object.values(girModulesGroupedMap)) {
190
- // Remove ignored modules from group
191
- girModulesGrouped.modules = girModulesGrouped.modules.filter((girGroup) => !ignore.includes(girGroup.packageName));
192
- girModulesGrouped.hasConflict = girModulesGrouped.modules.length >= 2;
193
- if (girModulesGrouped.modules.length <= 0) {
194
- continue;
195
- }
196
- // Ask for version if there is a conflict
197
- if (!girModulesGrouped.hasConflict) {
198
- keep = union(keep, girModulesGrouped.modules);
199
- }
200
- else {
201
- let goBack = true;
202
- let versionAnswer = null;
203
- let ignoreDepsAnswer = null;
204
- let wouldIgnoreDeps = [];
205
- while (goBack) {
206
- versionAnswer = await this.askForVersionsPrompt(girModulesGrouped);
207
- // Check modules that depend on the unchosen modules
208
- wouldIgnoreDeps = this.findGirFilesDependOnPackages(girModulesGroupedMap, versionAnswer.unselected);
209
- // Do not check dependencies that have already been ignored
210
- wouldIgnoreDeps = wouldIgnoreDeps.filter((dep) => !ignore.includes(dep.packageName));
211
- ignoreDepsAnswer = await this.askIgnoreDepsPrompt(wouldIgnoreDeps);
212
- goBack = ignoreDepsAnswer === 'Go back';
213
- }
214
- if (!versionAnswer) {
215
- throw new Error('Error in processing the prompt versionAnswer');
216
- }
217
- if (ignoreDepsAnswer === 'Yes') {
218
- // Also ignore the dependencies of the unselected version
219
- ignore = ignore.concat(wouldIgnoreDeps.map((dep) => dep.packageName));
220
- }
221
- const unionMe = this.sortVersionsByAnswer(girModulesGrouped, versionAnswer.selected);
222
- // Do not ignore the selected package version
223
- keep = union(keep, unionMe.keep);
224
- // Ignore the unchosen package versions
225
- ignore = ignore.concat(unionMe.ignore);
226
- }
227
- }
228
- if (ignore && ignore.length > 0) {
229
- const ignoreLogList = '- ' + ignore.join('\n- ');
230
- this.log.log(bold(`\n The following modules will be ignored:`));
231
- this.log.log(`\n${ignoreLogList}\n`);
232
- await this.askAddToIgnoreToConfigPrompt(ignore);
233
- }
234
- return {
235
- keep,
236
- ignore,
237
- };
238
- }
239
- /**
240
- * Asks via cli prompt if the user wants to add the ignored modules to his config file
241
- * @param ignoredModules
242
- */
243
- async askAddToIgnoreToConfigPrompt(ignoredModules) {
244
- const questions = [
245
- {
246
- name: 'addToIgnore',
247
- message: `Do you want to add the ignored modules to your config so that you don't need to select them again next time?\n Config path: '${Config.configFilePath}`,
248
- type: 'list',
249
- choices: ['No', 'Yes'],
250
- },
251
- ];
252
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
253
- const answer = await inquirer.prompt(questions);
254
- if (answer.addToIgnore === 'Yes') {
255
- await Config.addToConfig({
256
- ignore: Array.from(ignoredModules),
257
- });
258
- this.log.log(`Add ignored modules to '${Config.configFilePath}'`);
259
- }
260
- }
261
- /**
262
- * Figure out transitive module dependencies
263
- * @param packageName
264
- * @param result
265
- */
266
- traverseDependencies(packageName, result = {}) {
267
- const deps = this.modDependencyMap[packageName];
268
- if (isIterable(deps)) {
269
- for (const dep of deps) {
270
- if (result[dep.packageName])
271
- continue;
272
- result[dep.packageName] = dep;
273
- this.traverseDependencies(dep.packageName, result);
274
- }
275
- }
276
- }
277
- /**
278
- * Extends the modDependencyMap by the current Module,
279
- * should be called for each girModule so that the modDependencyMap is complete
280
- * @param girModule
281
- */
282
- extendDependencyMapByGirModule(girModule) {
283
- this.modDependencyMap[girModule.packageName] = girModule.dependencies;
284
- }
285
- /**
286
- * Sets the traverse dependencies for the current girModule,
287
- * is required so that all dependencies can be found internally when generating the dependency imports for the module .d.ts file
288
- * @param girModules
289
- */
290
- async initGirModules(girModules) {
291
- for (const girModule of girModules) {
292
- const result = {};
293
- this.traverseDependencies(girModule.packageName, result);
294
- await girModule.module.initTransitiveDependencies(Object.values(result));
295
- }
296
- }
297
- /**
298
- * Reads a gir xml module file and creates an object of GirModule.
299
- * Also sets the setDependencyMap
300
- * @param fillName
301
- * @param config
302
- */
303
- async loadAndCreateGirModule(dependency) {
304
- if (!dependency.exists || dependency.path === null) {
305
- return null;
306
- }
307
- this.log.log(`Loading ${dependency.packageName}...`);
308
- const girModule = await GirModule.load(dependency, this.config, this.dependencyManager);
309
- // Figure out transitive module dependencies
310
- this.extendDependencyMapByGirModule(girModule);
311
- return girModule;
312
- }
313
- /**
314
- * Returns a girModule found by `packageName` property
315
- * @param girModules Array of girModules
316
- * @param packageNames Full name like 'Gtk-3.0' you are looking for
317
- */
318
- findGirModuleByFullNames(girModules, packageNames) {
319
- return girModules.filter((girModule) => packageNames.includes(girModule.packageName));
320
- }
321
- /**
322
- * Checks if a girModules with the `packageNames` exists
323
- * @param girModules
324
- * @param packageName
325
- */
326
- existsGirModules(girModules, packageName) {
327
- const foundModule = this.findGirModuleByFullNames(girModules, [packageName]);
328
- return foundModule.length > 0;
329
- }
330
- /**
331
- * Reads the gir xml module files and creates an object of GirModule for each module
332
- * @param dependencies
333
- * @param girModules
334
- * @param resolvedBy
335
- * @param failedGirModules
336
- * @param ignoreDependencies
337
- * @returns
338
- */
339
- async loadGirModules(dependencies, ignoreDependencies = [], girModules = [], resolvedBy = ResolveType.BY_HAND, failedGirModules = new Set()) {
340
- let newModuleFound = false;
341
- // Clone array
342
- dependencies = [...dependencies];
343
- while (dependencies.length > 0) {
344
- const dependency = dependencies.shift();
345
- if (!dependency?.packageName)
346
- continue;
347
- // If module has not already been loaded
348
- if (!this.existsGirModules(girModules, dependency.packageName)) {
349
- const girModule = await this.loadAndCreateGirModule(dependency);
350
- if (!girModule) {
351
- if (!failedGirModules.has(dependency.packageName)) {
352
- this.log.warn(WARN_NO_GIR_FILE_FOUND_FOR_PACKAGE(dependency.packageName));
353
- failedGirModules.add(dependency.packageName);
354
- }
355
- }
356
- else if (girModule && girModule.packageName) {
357
- const addModule = {
358
- packageName: girModule.packageName,
359
- module: girModule,
360
- resolvedBy,
361
- path: dependency.path,
362
- };
363
- girModules.push(addModule);
364
- newModuleFound = true;
365
- }
366
- }
367
- }
368
- if (!newModuleFound) {
369
- return {
370
- loaded: girModules,
371
- failed: failedGirModules,
372
- };
373
- }
374
- // Figure out transitive module dependencies
375
- await this.initGirModules(girModules);
376
- // Load girModules for dependencies
377
- for (const girModule of girModules) {
378
- // Load dependencies
379
- const transitiveDependencies = girModule.module.transitiveDependencies;
380
- if (transitiveDependencies.length > 0) {
381
- await this.loadGirModules(transitiveDependencies, ignoreDependencies, girModules, ResolveType.DEPENDENCE, failedGirModules);
382
- }
383
- }
384
- return {
385
- loaded: girModules,
386
- failed: failedGirModules,
387
- };
388
- }
389
- /**
390
- * Find modules with the possibility to use wild cards for module names. E.g. `Gtk*` or `'*'`
391
- * @param modules
392
- * @param ignore
393
- */
394
- async findGirFiles(globPackageNames, ignore = []) {
395
- const foundFiles = new Set();
396
- for (let i = 0; i < globPackageNames.length; i++) {
397
- if (!globPackageNames[i]) {
398
- continue;
399
- }
400
- const filename = `${globPackageNames[i]}.gir`;
401
- const pattern = this.config.girDirectories.map((girDirectory) => join(girDirectory, filename));
402
- const ignoreGirs = ignore.map((girDirectory) => girDirectory + '.gir');
403
- const files = await glob(pattern, { ignore: ignoreGirs });
404
- files.forEach((file) => foundFiles.add(file));
405
- }
406
- return foundFiles;
407
- }
408
- async girFilePathToDependencies(girFiles) {
409
- const dependencies = [];
410
- for (const girFile of girFiles) {
411
- const packageName = basename(girFile, '.gir');
412
- const { namespace, version } = splitModuleName(packageName);
413
- const dep = await this.dependencyManager.get(namespace, version);
414
- dependencies.push(dep);
415
- }
416
- return dependencies;
417
- }
418
- /**
419
- * Loads all found `packageNames`
420
- * @param girDirectories
421
- * @param packageNames
422
- * @param doNotAskForVersionOnConflict Set this to false if you want to get a prompt for each version conflict
423
- */
424
- async getModulesResolved(packageNames, ignore = [], doNotAskForVersionOnConflict = true) {
425
- const girFiles = await this.findGirFiles([...packageNames], ignore);
426
- // Always require these because GJS does...
427
- const GLib = await this.dependencyManager.get('GLib', '2.0');
428
- const Gio = await this.dependencyManager.get('Gio', '2.0');
429
- const GObject = await this.dependencyManager.get('GObject', '2.0');
430
- const dependencies = await this.girFilePathToDependencies(girFiles);
431
- const { loaded, failed } = await this.loadGirModules([
432
- GLib,
433
- Gio,
434
- GObject,
435
- ...dependencies.filter((dep) => dep.namespace !== 'GLib' && dep.namespace !== 'Gio' && dep.namespace !== 'GObject'),
436
- ], ignore);
437
- let keep = [];
438
- if (doNotAskForVersionOnConflict) {
439
- keep = loaded;
440
- }
441
- else {
442
- const girModulesGrouped = this.groupGirFiles(loaded);
443
- const filtered = await this.askForEachConflictVersionsPrompt(girModulesGrouped, ignore);
444
- keep = Array.from(filtered.keep);
445
- }
446
- const grouped = this.groupGirFiles(keep);
447
- return { keep, grouped, ignore, failed };
448
- }
449
- /**
450
- * Find modules
451
- * @param girDirectories
452
- * @param modules
453
- */
454
- async getModules(modules, ignore = []) {
455
- const girFiles = await this.findGirFiles(modules, ignore);
456
- const dependencies = await this.girFilePathToDependencies(girFiles);
457
- const { loaded, failed } = await this.loadGirModules(dependencies, ignore);
458
- const grouped = this.groupGirFiles(loaded);
459
- return { grouped, loaded, failed: Array.from(failed) };
460
- }
461
- /** Start parsing the gir modules */
462
- parse(girModules) {
463
- for (const girModule of girModules) {
464
- girModule.module.parse();
465
- }
466
- }
467
- }
468
- //# sourceMappingURL=module-loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"module-loader.js","sourceRoot":"","sources":["../src/module-loader.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,QAAmC,MAAM,UAAU,CAAA;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,MAAM,CA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1D,CAAC;IAED,oCAAoC;IAC7B,KAAK,CAAC,UAAiC;QAC1C,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACjC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAA;QAC5B,CAAC;IACL,CAAC;CACJ"}
package/lib/start.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/lib/start.js DELETED
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import yargs from 'yargs';
3
- import { hideBin } from 'yargs/helpers';
4
- import { generate, list, doc, copy } from './commands/index.js';
5
- import { Config } from './config.js';
6
- void yargs(hideBin(process.argv))
7
- .scriptName(Config.appName)
8
- .strict()
9
- .usage(Config.usage)
10
- .command(generate.command, generate.description, generate.builder, generate.handler)
11
- .command(list.command, list.description, list.builder, list.handler)
12
- .command(copy.command, copy.description, copy.builder, copy.handler)
13
- .command(doc.command, doc.description, doc.builder, doc.handler)
14
- .demandCommand(1)
15
- .help().argv;
16
- //# sourceMappingURL=start.js.map
package/lib/start.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"start.js","sourceRoot":"","sources":["../src/start.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,KAAK,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KAC5B,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC;KAC1B,MAAM,EAAE;KACR,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;KACnB,OAAO,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;KACnF,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;KACnE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC;KACnE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC;KAC/D,aAAa,CAAC,CAAC,CAAC;KAChB,IAAI,EAAE,CAAC,IAAI,CAAA"}