depflow 3.0.0-dev.10 → 3.0.0-dev.11

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 (172) hide show
  1. package/README.md +108 -43
  2. package/dist/builder/Builder.d.ts +279 -0
  3. package/dist/builder/Builder.js +391 -0
  4. package/dist/builder/Builder.js.map +1 -0
  5. package/dist/cli/CLI.d.ts +157 -0
  6. package/dist/cli/CLI.js +214 -0
  7. package/dist/cli/CLI.js.map +1 -0
  8. package/dist/cli/DepFLowCLI.d.ts +93 -0
  9. package/dist/cli/DepFLowCLI.js +413 -0
  10. package/dist/cli/DepFLowCLI.js.map +1 -0
  11. package/dist/cli/Flags.d.ts +106 -0
  12. package/dist/cli/Flags.js +125 -0
  13. package/dist/cli/Flags.js.map +1 -0
  14. package/dist/cli/bin.js +68 -0
  15. package/dist/cli/bin.js.map +1 -0
  16. package/dist/config/Config.d.ts +690 -0
  17. package/dist/config/Config.js +45 -0
  18. package/dist/config/Config.js.map +1 -0
  19. package/dist/config/ImportMap.d.ts +60 -0
  20. package/dist/config/ImportMap.js +66 -0
  21. package/dist/config/ImportMap.js.map +1 -0
  22. package/dist/config/JsonSchema.d.ts +12 -0
  23. package/dist/config/JsonSchema.js +26 -0
  24. package/dist/config/JsonSchema.js.map +1 -0
  25. package/dist/config/Settings.d.ts +201 -0
  26. package/dist/config/Settings.js +191 -0
  27. package/dist/config/Settings.js.map +1 -0
  28. package/dist/config/TSConfig.d.ts +73 -0
  29. package/dist/config/TSConfig.js +73 -0
  30. package/dist/config/TSConfig.js.map +1 -0
  31. package/dist/config/codecs/JsonCodec.d.ts +30 -0
  32. package/dist/config/codecs/JsonCodec.js +31 -0
  33. package/dist/config/codecs/JsonCodec.js.map +1 -0
  34. package/dist/config/codecs/YamlCodec.d.ts +62 -0
  35. package/dist/config/codecs/YamlCodec.js +89 -0
  36. package/dist/config/codecs/YamlCodec.js.map +1 -0
  37. package/dist/dependency/DepUtils.d.ts +50 -0
  38. package/dist/dependency/DepUtils.js +71 -0
  39. package/dist/dependency/DepUtils.js.map +1 -0
  40. package/dist/dependency/Dependency.d.ts +81 -0
  41. package/dist/dependency/Dependency.js +71 -0
  42. package/dist/dependency/Dependency.js.map +1 -0
  43. package/dist/dependency/Git.d.ts +75 -0
  44. package/dist/dependency/Git.js +97 -0
  45. package/dist/dependency/Git.js.map +1 -0
  46. package/dist/dependency/GitDependency.d.ts +30 -0
  47. package/dist/dependency/GitDependency.js +79 -0
  48. package/dist/dependency/GitDependency.js.map +1 -0
  49. package/dist/dependency/NpmDependency.d.ts +27 -0
  50. package/dist/dependency/NpmDependency.js +91 -0
  51. package/dist/dependency/NpmDependency.js.map +1 -0
  52. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.d.ts +18 -5
  53. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.js +31 -9
  54. package/dist/resolve/AliasCompiler.js.map +1 -0
  55. package/{build/support/PathResolver → dist/resolve}/PathResolver.d.ts +25 -8
  56. package/dist/resolve/PathResolver.js +133 -0
  57. package/dist/resolve/PathResolver.js.map +1 -0
  58. package/dist/resolve/PathRewriter.d.ts +24 -0
  59. package/{build/support/PathResolver → dist/resolve}/PathRewriter.js +21 -11
  60. package/dist/resolve/PathRewriter.js.map +1 -0
  61. package/{build → dist}/schema/Config/Builder.d.ts +114 -49
  62. package/dist/schema/Config/Builder.js +78 -0
  63. package/dist/schema/Config/Builder.js.map +1 -0
  64. package/{build → dist}/schema/Config/Config.d.ts +169 -78
  65. package/dist/schema/Config/Config.js +62 -0
  66. package/dist/schema/Config/Config.js.map +1 -0
  67. package/{build → dist}/schema/Config/Dependency.d.ts +219 -89
  68. package/dist/schema/Config/Dependency.js +80 -0
  69. package/dist/schema/Config/Dependency.js.map +1 -0
  70. package/{build → dist}/schema/Config/Extractor.d.ts +41 -17
  71. package/dist/schema/Config/Extractor.js +43 -0
  72. package/dist/schema/Config/Extractor.js.map +1 -0
  73. package/{build → dist}/schema/Config/Resolver.d.ts +25 -8
  74. package/dist/schema/Config/Resolver.js +43 -0
  75. package/dist/schema/Config/Resolver.js.map +1 -0
  76. package/{build → dist}/schema/Config/Transform.d.ts +22 -5
  77. package/dist/schema/Config/Transform.js +51 -0
  78. package/dist/schema/Config/Transform.js.map +1 -0
  79. package/dist/schema/Defaults.d.ts +20 -0
  80. package/dist/schema/Defaults.js +24 -0
  81. package/dist/schema/Defaults.js.map +1 -0
  82. package/dist/schema/ImportMap.d.ts +30 -0
  83. package/dist/schema/ImportMap.js +28 -0
  84. package/dist/schema/ImportMap.js.map +1 -0
  85. package/{build → dist}/schema/TSConfig.d.ts +23 -9
  86. package/dist/schema/TSConfig.js +39 -0
  87. package/dist/schema/TSConfig.js.map +1 -0
  88. package/{build → dist}/schema/schema.d.ts +11 -2
  89. package/{build → dist}/schema/schema.js +11 -2
  90. package/dist/schema/schema.js.map +1 -0
  91. package/dist/task/Command.d.ts +287 -0
  92. package/dist/task/Command.js +404 -0
  93. package/dist/task/Command.js.map +1 -0
  94. package/dist/task/Group.d.ts +15 -0
  95. package/dist/task/Group.js +29 -0
  96. package/dist/task/Group.js.map +1 -0
  97. package/dist/task/OutputPolicy.d.ts +262 -0
  98. package/dist/task/OutputPolicy.js +364 -0
  99. package/dist/task/OutputPolicy.js.map +1 -0
  100. package/dist/task/Task.d.ts +210 -0
  101. package/dist/task/Task.js +312 -0
  102. package/dist/task/Task.js.map +1 -0
  103. package/package.json +13 -10
  104. package/.gitignore +0 -7
  105. package/build/cli/DepFLowCLI.d.ts +0 -16
  106. package/build/cli/DepFLowCLI.js +0 -254
  107. package/build/cli/DepFLowCLI.js.map +0 -1
  108. package/build/cli/bin.js +0 -38
  109. package/build/cli/bin.js.map +0 -1
  110. package/build/config/Config.d.ts +0 -28
  111. package/build/config/Config.js +0 -46
  112. package/build/config/Config.js.map +0 -1
  113. package/build/config/ImportMap.d.ts +0 -51
  114. package/build/config/ImportMap.js +0 -97
  115. package/build/config/ImportMap.js.map +0 -1
  116. package/build/config/TSConfig.d.ts +0 -54
  117. package/build/config/TSConfig.js +0 -104
  118. package/build/config/TSConfig.js.map +0 -1
  119. package/build/schema/Config/Builder.js +0 -48
  120. package/build/schema/Config/Builder.js.map +0 -1
  121. package/build/schema/Config/Config.js +0 -20
  122. package/build/schema/Config/Config.js.map +0 -1
  123. package/build/schema/Config/Dependency.js +0 -25
  124. package/build/schema/Config/Dependency.js.map +0 -1
  125. package/build/schema/Config/Extractor.js +0 -25
  126. package/build/schema/Config/Extractor.js.map +0 -1
  127. package/build/schema/Config/Resolver.js +0 -25
  128. package/build/schema/Config/Resolver.js.map +0 -1
  129. package/build/schema/Config/Transform.js +0 -27
  130. package/build/schema/Config/Transform.js.map +0 -1
  131. package/build/schema/ImportMap.d.ts +0 -22
  132. package/build/schema/ImportMap.js +0 -12
  133. package/build/schema/ImportMap.js.map +0 -1
  134. package/build/schema/TSConfig.js +0 -19
  135. package/build/schema/TSConfig.js.map +0 -1
  136. package/build/schema/schema.js.map +0 -1
  137. package/build/support/Builder/Builder.d.ts +0 -46
  138. package/build/support/Builder/Builder.js +0 -116
  139. package/build/support/Builder/Builder.js.map +0 -1
  140. package/build/support/Dependency/Dependency.d.ts +0 -38
  141. package/build/support/Dependency/Dependency.js +0 -14
  142. package/build/support/Dependency/Dependency.js.map +0 -1
  143. package/build/support/Dependency/GitDependency.d.ts +0 -20
  144. package/build/support/Dependency/GitDependency.js +0 -67
  145. package/build/support/Dependency/GitDependency.js.map +0 -1
  146. package/build/support/Dependency/NpmDependency.d.ts +0 -18
  147. package/build/support/Dependency/NpmDependency.js +0 -65
  148. package/build/support/Dependency/NpmDependency.js.map +0 -1
  149. package/build/support/Git.d.ts +0 -53
  150. package/build/support/Git.js +0 -86
  151. package/build/support/Git.js.map +0 -1
  152. package/build/support/PathResolver/AliasCompiler.js.map +0 -1
  153. package/build/support/PathResolver/PathResolver.js +0 -105
  154. package/build/support/PathResolver/PathResolver.js.map +0 -1
  155. package/build/support/PathResolver/PathRewriter.d.ts +0 -18
  156. package/build/support/PathResolver/PathRewriter.js.map +0 -1
  157. package/build/support/PathResolver/Utils.d.ts +0 -36
  158. package/build/support/PathResolver/Utils.js +0 -45
  159. package/build/support/PathResolver/Utils.js.map +0 -1
  160. package/build/support/Task/Command.d.ts +0 -49
  161. package/build/support/Task/Command.js +0 -100
  162. package/build/support/Task/Command.js.map +0 -1
  163. package/build/support/Task/Task.d.ts +0 -84
  164. package/build/support/Task/Task.js +0 -145
  165. package/build/support/Task/Task.js.map +0 -1
  166. package/build/support/Utils.d.ts +0 -40
  167. package/build/support/Utils.js +0 -138
  168. package/build/support/Utils.js.map +0 -1
  169. package/build/support/Validator.d.ts +0 -22
  170. package/build/support/Validator.js +0 -28
  171. package/build/support/Validator.js.map +0 -1
  172. /package/{build → dist}/cli/bin.d.ts +0 -0
@@ -1,104 +0,0 @@
1
- import { Logger } from '@netfeez/vterm';
2
- import { File, Path } from '@netfeez/common-node';
3
- import schema from '../schema/schema.js';
4
- export class TSConfig {
5
- data;
6
- path;
7
- logger;
8
- constructor(data, path, options = {}) {
9
- this.data = data;
10
- this.path = path;
11
- this.logger = options.logger || new Logger({ name: 'TS-CFG' });
12
- }
13
- /**
14
- * Updates the paths in the tsconfig data based on the provided compiled aliases.
15
- * It ensures that the compilerOptions and paths properties exist in the tsconfig data, and then iterates through the compiled aliases to construct the appropriate path mappings.
16
- * For each alias, it calculates the relative path from the project root to the local target and normalizes it. If the alias is a wildcard, it appends '/*' to the target path.
17
- * Finally, it updates the paths in the tsconfig data with the new mappings, allowing TypeScript to resolve module paths according to the defined aliases.
18
- * @param aliases An array of compiled aliases containing alias names, target paths, and wildcard information.
19
- */
20
- updatePaths(aliases) {
21
- if (!this.data.compilerOptions)
22
- this.data.compilerOptions = {};
23
- if (!this.data.compilerOptions.paths)
24
- this.data.compilerOptions.paths = {};
25
- const projectRoot = Path.dirname(this.path);
26
- for (const alias of aliases) {
27
- const key = alias.isWildcard ? `${alias.alias}/*` : alias.alias;
28
- let target = Path.diff(projectRoot, alias.targets.local);
29
- target = target.startsWith('.') ? target : `./${target}`;
30
- target = Path.normalize(target);
31
- let typeTarget;
32
- if (alias.targets.type) {
33
- typeTarget = Path.diff(projectRoot, alias.targets.type);
34
- typeTarget = typeTarget.startsWith('.') ? typeTarget : `./${typeTarget}`;
35
- typeTarget = Path.normalize(typeTarget);
36
- }
37
- if (alias.isWildcard) {
38
- const suffix = target.endsWith('/') ? '*' : '/*';
39
- target = `${target}${suffix}`;
40
- if (typeTarget) {
41
- typeTarget = `${typeTarget}${suffix}`;
42
- }
43
- }
44
- this.data.compilerOptions.paths[key] = typeTarget ? [typeTarget, target] : [target];
45
- }
46
- }
47
- /**
48
- * Saves the current tsconfig data to a file.
49
- * It constructs the path to the tsconfig file using the project root and filename, converts the data to a JSON string with proper formatting, and writes it to the file system using the File.write method.
50
- * The method also includes error handling to log any issues that occur during the save process, ensuring that users are informed of any problems when attempting to save the tsconfig configuration.
51
- * @param path The path to the tsconfig file where the data should be saved.
52
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
53
- */
54
- async save(path = this.path) {
55
- await TSConfig.save(path, this.data, { logger: this.logger });
56
- if (path !== this.path)
57
- this.path = path;
58
- }
59
- /**
60
- * Static method to save tsconfig data to a specified file. It takes the project root, filename, tsconfig data, and options (including a logger) as parameters.
61
- * The method constructs the full path to the tsconfig file, converts the data to a formatted JSON string, and writes it to the file system.
62
- * It also includes error handling to log any issues that arise during the save process, providing feedback on whether the operation was successful or if it encountered problems.
63
- * @param path The path to the tsconfig file where the data should be saved.
64
- * @param data The tsconfig data to be saved, structured according to the defined schema.
65
- * @param options Additional options for saving, such as a logger for logging messages during the save process.
66
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
67
- * @throws Will throw an error if there is an issue during the save process, which can be caught by the caller to handle it appropriately.
68
- */
69
- static async save(path, data, options = {}) {
70
- const logger = options.logger || new Logger({ name: 'TS-CFG' });
71
- const json = JSON.stringify(data, null, 4);
72
- await File.write(path, json);
73
- const filename = Path.fileName(path);
74
- logger.log(`&C2Saved file &C4${filename}&C2 successfully.`);
75
- }
76
- /**
77
- * Static method to load tsconfig data from a specified file.
78
- * It takes the project root, filename, and options (including a logger) as parameters.
79
- * The method checks if the tsconfig file exists, and if it does, it reads the content, parses it as JSON, and processes it using the defined schema to ensure it conforms to the expected structure.
80
- * If the file does not exist, it creates a default tsconfig data object using the schema. Finally, it returns an instance of the Tsconfig class initialized with the loaded or default data.
81
- * @param path The path to the tsconfig file to load.
82
- * @param options Additional options for loading, such as a logger for logging messages during the load process.
83
- * @returns A promise that resolves to an instance of the Tsconfig class containing the loaded data, or rejects if there is an error during the load process.
84
- * @throws Will throw an error if there is an issue during the load process, which
85
- */
86
- static async load(path, options) {
87
- const logger = options.logger || new Logger({ name: 'TS-CFG' });
88
- let data;
89
- if (!await File.exists(path)) {
90
- const filename = Path.fileName(path);
91
- logger.warn(`&C3${filename} not found. Creating defaults...`);
92
- data = schema.TSConfig.processData({});
93
- // this.save(projectRoot, filename, data, { logger }).catch(err => logger.error(`Failed to create default tsconfig:`, err.message));
94
- }
95
- else {
96
- const content = await File.read(path, 'utf-8');
97
- const json = JSON.parse(content);
98
- data = schema.TSConfig.processData(json);
99
- }
100
- return new TSConfig(data, path, { logger });
101
- }
102
- }
103
- export default TSConfig;
104
- //# sourceMappingURL=TSConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSConfig.js","sourceRoot":"","sources":["../../src/config/TSConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,OAAO,QAAQ;IAIH;IACA;IAJJ,MAAM,CAAS;IAEzB,YACc,IAAmB,EACnB,IAAY,EACtB,UAA4B,EAAE;QAFpB,SAAI,GAAJ,IAAI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CAAC;QAC3C,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAC7B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACrC,MAAM,CAAC,GAAG,CAAC,oBAAoB,QAAQ,mBAAmB,CAAC,CAAC;IAChE,CAAC;IACD;;;;;;;;;OASG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,OAAyB;QAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAChE,IAAI,IAAmB,CAAC;QACxB,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,CAAC,IAAI,CAAC,MAAM,QAAQ,kCAAkC,CAAC,CAAC;YAC9D,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACvC,oIAAoI;QACxI,CAAC;aAAM,CAAC;YACJ,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACjC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC;QAAC,OAAO,IAAI,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAClD,CAAC;CACJ;AASD,eAAe,QAAQ,CAAC"}
@@ -1,48 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- import { GlobalTransform } from './Transform.js';
3
- import Extractor from './Extractor.js';
4
- export const RunEntry = new Schema({
5
- type: 'object',
6
- required: true,
7
- properties: {
8
- maxTimeMs: { type: 'number', default: 60000, minimum: -1 },
9
- allowFails: { type: 'boolean', default: false },
10
- run: { type: 'union', required: true, union: [
11
- { type: 'string' },
12
- { type: 'array', items: { type: 'string' } }
13
- ] }
14
- }
15
- });
16
- export const ExtractEntry = new Schema({
17
- type: 'object',
18
- required: true,
19
- properties: {
20
- extract: { type: 'union', required: true, union: [
21
- { type: 'string' },
22
- Extractor.root
23
- ] }
24
- }
25
- });
26
- export const TransformEntry = new Schema({
27
- type: 'object',
28
- required: true,
29
- properties: {
30
- transform: GlobalTransform.root
31
- }
32
- });
33
- export const BuilderEntry = new Schema({
34
- type: 'union',
35
- required: true,
36
- union: [
37
- RunEntry.root,
38
- ExtractEntry.root,
39
- TransformEntry.root
40
- ]
41
- });
42
- export const Builder = new Schema({
43
- type: 'array',
44
- default: [],
45
- items: BuilderEntry.root
46
- });
47
- export default Builder;
48
- //# sourceMappingURL=Builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/schema/Config/Builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC;IAC/B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE;QAC1D,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;QAC/C,GAAG,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;gBACzC,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClB,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;aAC/C,EAAE;KACN;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC;IACnC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE;gBAC7C,EAAE,IAAI,EAAE,QAAQ,EAAE;gBAClB,SAAS,CAAC,IAAI;aACjB,EAAE;KACN;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,SAAS,EAAE,eAAe,CAAC,IAAI;KAClC;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC;IACnC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,QAAQ,CAAC,IAAI;QACb,YAAY,CAAC,IAAI;QACjB,cAAc,CAAC,IAAI;KACtB;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC;IAC9B,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,YAAY,CAAC,IAAI;CAC3B,CAAC,CAAC;AAIH,eAAe,OAAO,CAAC"}
@@ -1,20 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- import Builder from './Builder.js';
3
- import Resolver from './Resolver.js';
4
- import { GitDependency, NpmDependency } from './Dependency.js';
5
- export const Config = new Schema({
6
- type: 'object',
7
- properties: {
8
- $schema: { type: 'string', default: '.depflow/schema.json' },
9
- flowFolder: { type: 'string', default: '.depflow' },
10
- outDir: { type: 'string', default: 'dist' },
11
- tsconfig: { type: 'string', nullable: true, default: null },
12
- importmap: { type: 'string', nullable: true, default: null },
13
- actions: { type: 'object', allowAdditionalProperties: Builder.root, default: {} },
14
- resolver: Resolver.root,
15
- dependencies: { type: 'array', default: [], items: GitDependency.root },
16
- npmDependencies: { type: 'array', default: [], items: NpmDependency.root }
17
- }
18
- });
19
- export default Config;
20
- //# sourceMappingURL=Config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../../src/schema/Config/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAE/D,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC;IAC7B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,sBAAsB,EAAE;QAC5D,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE;QACnD,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3C,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;QAC3D,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAyB,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QACjF,QAAQ,EAAE,QAAQ,CAAC,IAAI;QACvB,YAAY,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE;QACvE,eAAe,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,aAAa,CAAC,IAAI,EAAE;KAC7E;CACJ,CAAC,CAAC;AAKH,eAAe,MAAM,CAAC"}
@@ -1,25 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- import Builder from './Builder.js';
3
- import Resolver from './Resolver.js';
4
- export const GitDependency = new Schema({
5
- type: 'object',
6
- properties: {
7
- name: { type: 'string', required: true },
8
- repo: { type: 'string', required: true },
9
- tag: { type: 'string', default: 'main' },
10
- builder: Builder.root,
11
- resolver: Resolver.root
12
- }
13
- });
14
- export const NpmDependency = new Schema({
15
- type: 'object',
16
- properties: {
17
- name: { type: 'string', required: true },
18
- version: { type: 'string', required: true },
19
- builder: Builder.root,
20
- resolver: Resolver.root
21
- }
22
- });
23
- export const Dependency = { GitDependency, NpmDependency };
24
- export default Dependency;
25
- //# sourceMappingURL=Dependency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/schema/Config/Dependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,eAAe,CAAC;AAErC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE;QACxC,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI;KAC1B;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3C,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,QAAQ,EAAE,QAAQ,CAAC,IAAI;KAC1B;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAK3D,eAAe,UAAU,CAAC"}
@@ -1,25 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- import Transform from './Transform.js';
3
- export const ExtractorEntry = new Schema({
4
- type: 'object',
5
- required: true,
6
- properties: {
7
- to: { type: 'string', required: true },
8
- map: { ...Transform.root, required: false },
9
- transform: { ...Transform.root, required: false }
10
- }
11
- });
12
- export const Extractor = new Schema({
13
- type: 'object',
14
- required: true,
15
- allowAdditionalProperties: {
16
- type: 'union',
17
- required: true,
18
- union: [
19
- { type: 'string', required: true },
20
- ExtractorEntry.root
21
- ]
22
- }
23
- });
24
- export default Extractor;
25
- //# sourceMappingURL=Extractor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../../src/schema/Config/Extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtC,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC3C,SAAS,EAAE,EAAE,GAAG,SAAS,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;KACpD;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,yBAAyB,EAAE;QACvB,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACH,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAClC,cAAc,CAAC,IAAI;SACtB;KACJ;CACJ,CAAC,CAAC;AAGH,eAAe,SAAS,CAAC"}
@@ -1,25 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- export const TargetOptions = new Schema({
3
- type: 'object',
4
- properties: {
5
- local: { type: 'string', required: true },
6
- type: { type: 'string' },
7
- cdn: { type: 'string' }
8
- }
9
- });
10
- export const Target = new Schema({
11
- type: 'union',
12
- required: true,
13
- union: [
14
- { type: 'string' },
15
- TargetOptions.root
16
- ]
17
- });
18
- export const Resolver = new Schema({
19
- type: 'object',
20
- required: true,
21
- default: {},
22
- allowAdditionalProperties: Target.root,
23
- });
24
- export default Resolver;
25
- //# sourceMappingURL=Resolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../../src/schema/Config/Resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACzC,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxB,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;KAC1B;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC;IAC7B,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClB,aAAa,CAAC,IAAI;KACrB;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC;IAC/B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,EAAE;IACX,yBAAyB,EAAE,MAAM,CAAC,IAAI;CACzC,CAAC,CAAC;AAIH,eAAe,QAAQ,CAAC"}
@@ -1,27 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- export const TransformOptions = new Schema({
3
- type: 'object',
4
- properties: {
5
- search: { type: 'string', required: true },
6
- flags: { type: 'string', default: 'g', pattern: /^[gimsuy]*$/ },
7
- replace: { type: 'string', required: true }
8
- }
9
- });
10
- export const GlobalTransform = new Schema({
11
- type: 'object',
12
- required: true,
13
- properties: {
14
- glob: { type: 'string', required: true },
15
- ...TransformOptions.root.properties,
16
- }
17
- });
18
- export const Transform = new Schema({
19
- type: 'union',
20
- required: true,
21
- union: [
22
- { type: 'string' },
23
- TransformOptions.root
24
- ]
25
- });
26
- export default Transform;
27
- //# sourceMappingURL=Transform.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../src/schema/Config/Transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC;IACvC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACR,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1C,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,aAAa,EAAE;QAC/D,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC9C;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxC,GAAG,gBAAgB,CAAC,IAAI,CAAC,UAAU;KACtC;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC;IAChC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClB,gBAAgB,CAAC,IAAI;KACxB;CACJ,CAAC,CAAC;AAIH,eAAe,SAAS,CAAC"}
@@ -1,22 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- export declare const ImportMap: Schema<{
3
- readonly type: "object";
4
- readonly allowAdditionalProperties: true;
5
- readonly default: {};
6
- readonly properties: {
7
- readonly imports: {
8
- readonly type: "object";
9
- readonly allowAdditionalProperties: true;
10
- readonly default: {};
11
- };
12
- readonly scopes: {
13
- readonly type: "object";
14
- readonly allowAdditionalProperties: true;
15
- readonly default: {};
16
- };
17
- };
18
- }>;
19
- export declare namespace ImportMap {
20
- type Root = typeof ImportMap.infer;
21
- }
22
- export default ImportMap;
@@ -1,12 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- export const ImportMap = new Schema({
3
- type: 'object',
4
- allowAdditionalProperties: true,
5
- default: {},
6
- properties: {
7
- imports: { type: 'object', allowAdditionalProperties: true, default: {} },
8
- scopes: { type: 'object', allowAdditionalProperties: true, default: {} }
9
- }
10
- });
11
- export default ImportMap;
12
- //# sourceMappingURL=ImportMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../../src/schema/ImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,yBAAyB,EAAE,IAAI;IAC/B,OAAO,EAAE,EAAE;IACX,UAAU,EAAE;QACR,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAyB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;QACzE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,yBAAyB,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE;KAC3E;CACJ,CAAC,CAAC;AAMH,eAAe,SAAS,CAAC"}
@@ -1,19 +0,0 @@
1
- import { Schema } from '@netfeez/common';
2
- export const CompilerOptions = new Schema({
3
- type: 'object',
4
- allowAdditionalProperties: true,
5
- properties: {
6
- rootDir: { type: 'string' },
7
- outDir: { type: 'string' },
8
- paths: { type: 'object', allowAdditionalProperties: { type: 'array', items: { type: 'string' } } }
9
- }
10
- });
11
- export const TSConfig = new Schema({
12
- type: 'object',
13
- allowAdditionalProperties: true,
14
- properties: {
15
- compilerOptions: CompilerOptions.root
16
- }
17
- });
18
- export default TSConfig;
19
- //# sourceMappingURL=TSConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TSConfig.js","sourceRoot":"","sources":["../../src/schema/TSConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,MAAM,CA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E,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,MAAM,KAAW,MAAM,CAWtB;AAXD,WAAiB,MAAM;IACL,eAAQ,GAAG,SAAS,CAAC;IACrB,gBAAS,GAAG,UAAU,CAAC;IACvB,aAAM,GAAG,OAAO,CAAC;IACjB,eAAQ,GAAG,SAAS,CAAC;IACrB,aAAM,GAAG,OAAO,CAAC;IACjB,gBAAS,GAAG,UAAU,CAAC;IACvB,sBAAe,GAAG,gBAAgB,CAAC;IACnC,gBAAS,GAAG,UAAU,CAAC;IACvB,cAAO,GAAG,QAAQ,CAAC;IACnB,iBAAU,GAAG,WAAW,CAAC;AAC3C,CAAC,EAXgB,MAAM,KAAN,MAAM,QAWtB;AAED,eAAe,MAAM,CAAC"}
@@ -1,46 +0,0 @@
1
- import type Logger from "@netfeez/vterm";
2
- import schema from "../../schema/schema.js";
3
- export declare class Builder {
4
- protected readonly pipeline: Builder.Builder;
5
- protected readonly cwd: string;
6
- protected readonly logger: Logger | null;
7
- constructor(info: Builder.Info);
8
- run(): Promise<void>;
9
- protected runGlobalTransform(options: schema.GlobalTransform): Promise<void>;
10
- /**
11
- * Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
12
- * It handles the copying of files from the specified source to the target location, applying any necessary path transformations based on the provided replacer configuration.
13
- * This method is essential for managing the file extraction phase of the build process, allowing for flexible and customizable file handling as defined in the builder configuration.
14
- * @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
15
- * @returns A promise that resolves when the extraction process is complete, or rejects with an error if any issues occur during the file copying or transformation.
16
- * @throws Will throw an error if any issues occur during the file copying process, such as problems with reading or writing files, or if the provided entry configuration is invalid.
17
- */
18
- protected runExtractor(entry: string | Builder.Extractor): Promise<void>;
19
- /**
20
- * Runs a series of shell commands as part of the build process, using a child process to execute the commands and capturing the output for logging. It handles the execution of the commands, providing feedback on the progress and any errors that occur during the process. This method is essential for executing the necessary setup commands defined in the builder configuration, allowing for a flexible and dynamic build process that can accommodate various requirements for different dependencies.
21
- * @param commands An array of strings representing the shell commands to be executed as part of the build process.
22
- * @param logger An optional Logger instance for logging the output and errors from the command execution.
23
- * @returns A promise that resolves when the command execution is complete, or rejects with an error if any command fails, allowing callers to handle such scenarios appropriately.
24
- * @throws Will throw an error if any issues occur during the execution of the commands, such as problems with spawning the child process or if any command returns a non-zero exit code.
25
- */
26
- protected runTask(commands: string[], cwd: string, maxTimeMs: number): Promise<void>;
27
- /**
28
- * Creates a string replacement function based on the provided replacer configuration, which can be either a simple string or an object defining a search pattern and replacement string. This method is used to generate a function that can be applied to strings for dynamic transformations during the build process, allowing for flexible and customizable string manipulation as defined in the builder configuration.
29
- * @param replacer A configuration for string replacement, which can be either a string (used as a regex pattern) or an object containing a search pattern and a replacement string.
30
- * @returns A function that takes a string as input and returns a new string with the specified replacements applied, based on the provided replacer configuration.
31
- * @throws Will throw an error if the provided replacer configuration is invalid, such as if it is neither a string nor an object with the required properties.
32
- */
33
- protected static replacer(replacer?: schema.Transform): Builder.Transformer;
34
- }
35
- export declare namespace Builder {
36
- type Transformer = (str: string) => string;
37
- type Transform = schema.Transform;
38
- type Builder = schema.Builder;
39
- type Extractor = schema.Extractor;
40
- interface Info {
41
- pipeline: Builder;
42
- cwd: string;
43
- logger?: Logger | null;
44
- }
45
- }
46
- export default Builder;
@@ -1,116 +0,0 @@
1
- import { Async } from "@netfeez/common-node";
2
- import Utils from "../Utils.js";
3
- import Task from "../Task/Task.js";
4
- import { File, Path } from "@netfeez/common-node";
5
- export class Builder {
6
- pipeline = [];
7
- cwd = process.cwd();
8
- logger;
9
- constructor(info) {
10
- this.pipeline = info.pipeline;
11
- this.cwd = info.cwd;
12
- this.logger = info.logger || null;
13
- }
14
- async run() {
15
- this.logger?.group(Utils.newGroup('#00FFB4'));
16
- for (const step of this.pipeline) {
17
- if ('run' in step && step.run) {
18
- const commands = typeof step.run === 'string' ? [step.run] : step.run;
19
- await this.runTask(commands, this.cwd, step.maxTimeMs ?? 60000);
20
- }
21
- if ('extract' in step && step.extract) {
22
- await this.runExtractor(step.extract);
23
- }
24
- if ('transform' in step && step.transform) {
25
- await this.runGlobalTransform(step.transform);
26
- }
27
- }
28
- this.logger?.groupEnd();
29
- }
30
- async runGlobalTransform(options) {
31
- this.logger?.log(`&C7Applying global transformation in &C3${this.cwd}&C7...`);
32
- const transformAction = Builder.replacer(options);
33
- const glob = options.glob;
34
- await File.smartProcess(glob, this.cwd, {
35
- cwd: this.cwd,
36
- }, async ({ src, dest }) => {
37
- const content = await File.read(src);
38
- const transformedContent = transformAction(content);
39
- await File.write(dest, transformedContent);
40
- });
41
- }
42
- /**
43
- * Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
44
- * It handles the copying of files from the specified source to the target location, applying any necessary path transformations based on the provided replacer configuration.
45
- * This method is essential for managing the file extraction phase of the build process, allowing for flexible and customizable file handling as defined in the builder configuration.
46
- * @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
47
- * @returns A promise that resolves when the extraction process is complete, or rejects with an error if any issues occur during the file copying or transformation.
48
- * @throws Will throw an error if any issues occur during the file copying process, such as problems with reading or writing files, or if the provided entry configuration is invalid.
49
- */
50
- async runExtractor(entry) {
51
- const extractor = typeof entry === 'string'
52
- ? { '**/*': { to: entry } }
53
- : entry;
54
- for (const [from, entry] of Object.entries(extractor)) {
55
- const { to, map, transform } = typeof entry === 'string' ? { to: entry, map: undefined, transform: undefined } : entry;
56
- const mapper = Builder.replacer(map);
57
- const replacer = Builder.replacer(transform);
58
- const destination = Path.isAbsolute(to) ? to : Path.join(Path.cwd, to);
59
- this.logger?.log(`&C7Extracting &C3${from}&C7 to &C3${to}&C7...`);
60
- await File.smartProcess(from, destination, {
61
- cwd: this.cwd,
62
- map: mapper,
63
- }, async ({ src, dest }) => {
64
- const content = await File.read(src);
65
- const transformedContent = replacer(content);
66
- await File.write(dest, transformedContent);
67
- });
68
- }
69
- }
70
- /**
71
- * Runs a series of shell commands as part of the build process, using a child process to execute the commands and capturing the output for logging. It handles the execution of the commands, providing feedback on the progress and any errors that occur during the process. This method is essential for executing the necessary setup commands defined in the builder configuration, allowing for a flexible and dynamic build process that can accommodate various requirements for different dependencies.
72
- * @param commands An array of strings representing the shell commands to be executed as part of the build process.
73
- * @param logger An optional Logger instance for logging the output and errors from the command execution.
74
- * @returns A promise that resolves when the command execution is complete, or rejects with an error if any command fails, allowing callers to handle such scenarios appropriately.
75
- * @throws Will throw an error if any issues occur during the execution of the commands, such as problems with spawning the child process or if any command returns a non-zero exit code.
76
- */
77
- runTask(commands, cwd, maxTimeMs) {
78
- return Async.awaitEvent((done, fail) => {
79
- const pollito = new Task(cwd, commands);
80
- if (this.logger) {
81
- pollito.on('line', (line) => this.logger?.info(`${line}`));
82
- pollito.on('error', (msg, step) => this.logger?.error(`&C1[Step ${step}]&C7: &C1${msg}`));
83
- }
84
- pollito.once('finish', (data) => {
85
- if (data.fails > 0)
86
- fail(new Error(`Build failed with ${data.fails} failed steps.`));
87
- else
88
- done();
89
- });
90
- pollito.start().catch(fail);
91
- return () => { pollito.stop(); };
92
- }, maxTimeMs);
93
- }
94
- /**
95
- * Creates a string replacement function based on the provided replacer configuration, which can be either a simple string or an object defining a search pattern and replacement string. This method is used to generate a function that can be applied to strings for dynamic transformations during the build process, allowing for flexible and customizable string manipulation as defined in the builder configuration.
96
- * @param replacer A configuration for string replacement, which can be either a string (used as a regex pattern) or an object containing a search pattern and a replacement string.
97
- * @returns A function that takes a string as input and returns a new string with the specified replacements applied, based on the provided replacer configuration.
98
- * @throws Will throw an error if the provided replacer configuration is invalid, such as if it is neither a string nor an object with the required properties.
99
- */
100
- static replacer(replacer) {
101
- if (typeof replacer === 'string') {
102
- const search = new RegExp(replacer, 'g');
103
- return (str) => str.replace(search, '');
104
- }
105
- else if (replacer !== null && typeof replacer === 'object') {
106
- const flags = replacer.flags || 'g';
107
- const search = new RegExp(replacer.search, flags);
108
- const replace = replacer.replace || '';
109
- return (str) => str.replace(search, replace);
110
- }
111
- else
112
- return (str) => str;
113
- }
114
- }
115
- export default Builder;
116
- //# sourceMappingURL=Builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/support/Builder/Builder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGlD,MAAM,OAAO,OAAO;IACG,QAAQ,GAAoB,EAAE,CAAC;IAC/B,GAAG,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;IAC5B,MAAM,CAAgB;IAEzC,YAAmB,IAAkB;QACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC;IACtC,CAAC;IACM,KAAK,CAAC,GAAG;QACZ,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;QAE9C,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/B,IAAI,KAAK,IAAI,IAAI,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;gBAC5B,MAAM,QAAQ,GAAG,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,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K,QAAQ,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;YACzC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC5C,CAAC;aAAM,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC3D,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,IAAI,GAAG,CAAC;YACpC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YAClD,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;YACvC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjD,CAAC;;YAAM,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;IAC/B,CAAC;CACJ;AAYD,eAAe,OAAO,CAAC"}
@@ -1,38 +0,0 @@
1
- import type Logger from "@netfeez/vterm";
2
- import type AliasCompiler from "../PathResolver/AliasCompiler.js";
3
- import type Builder from "../Builder/Builder.js";
4
- export declare abstract class Dependency {
5
- protected readonly logger: Logger | null;
6
- readonly name: string;
7
- readonly builder: Builder.Builder;
8
- readonly resolver: AliasCompiler.Resolver;
9
- constructor(info: Dependency.Info, logger?: Logger | null);
10
- /**
11
- * Install the dependency.
12
- * This method should handle the installation process, such as downloading files, setting up configurations, etc.
13
- */
14
- abstract install(): Promise<void>;
15
- /**
16
- * Uninstall the dependency.
17
- * This method should handle the uninstallation process, such as removing files, cleaning up configurations, etc.
18
- */
19
- abstract uninstall(): Promise<void>;
20
- /**
21
- * Build the dependency.
22
- * This method should handle the build process, such as compiling code, bundling files, etc.
23
- */
24
- abstract build(): Promise<void>;
25
- /**
26
- * Resolve the dependency.
27
- * This method should handle the resolution process, such as fetching dependencies, resolving versions, etc.
28
- */
29
- abstract resolve(): Promise<void>;
30
- }
31
- export declare namespace Dependency {
32
- interface Info {
33
- name: string;
34
- builder?: Builder.Builder;
35
- resolver?: AliasCompiler.Resolver;
36
- }
37
- }
38
- export default Dependency;
@@ -1,14 +0,0 @@
1
- export class Dependency {
2
- logger;
3
- name;
4
- builder;
5
- resolver;
6
- constructor(info, logger) {
7
- this.name = info.name;
8
- this.builder = info.builder || [];
9
- this.resolver = info.resolver || {};
10
- this.logger = logger || null;
11
- }
12
- }
13
- export default Dependency;
14
- //# sourceMappingURL=Dependency.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/support/Dependency/Dependency.ts"],"names":[],"mappings":"AAKA,MAAM,OAAgB,UAAU;IACT,MAAM,CAAgB;IAEzB,IAAI,CAAS;IACb,OAAO,CAAkB;IACzB,QAAQ,CAAyB;IAEjD,YAAmB,IAAqB,EAAE,MAAsB;QAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;QACpC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;IACjC,CAAC;CAqBJ;AAQD,eAAe,UAAU,CAAC"}