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,254 +0,0 @@
1
- import path from "node:path";
2
- import Logger, { DebugUI } from "@netfeez/vterm";
3
- import Utils from "../support/Utils.js";
4
- import Validator from "../support/Validator.js";
5
- import GitDependency from "../support/Dependency/GitDependency.js";
6
- import PathResolver from "../support/PathResolver/PathResolver.js";
7
- import Config from "../config/Config.js";
8
- import schema from "../schema/schema.js";
9
- import TSConfig from "../config/TSConfig.js";
10
- import ImportMap from "../config/ImportMap.js";
11
- import NpmDependency from "../support/Dependency/NpmDependency.js";
12
- import Builder from "../support/Builder/Builder.js";
13
- export class DepFlowCLI extends DebugUI {
14
- configPath;
15
- projectRoot;
16
- constructor(configPath = 'depFlow.json') {
17
- super();
18
- this.configPath = configPath;
19
- this.out = new Logger({
20
- logger: this.out,
21
- formatter: { maxMessageLength: 100 }
22
- });
23
- const absoluteConfigPath = path.resolve(process.cwd(), this.configPath);
24
- this.projectRoot = path.dirname(absoluteConfigPath);
25
- this.addCommand('add', this.commandAdd, { usage: 'dep add <repo_url> [name]', description: 'Add a dependency to the configuration file.' });
26
- this.addCommand('remove', this.commandRemove, { usage: 'dep remove <name> | <repo_url>', description: 'Remove a dependency from the configuration file by name or repo URL.' });
27
- this.addCommand('install', this.commandInstall, { usage: 'dep install [name1 name2 ...]', description: 'Install dependencies. If names are provided, only those dependencies will be installed.' });
28
- this.addCommand('uninstall', this.uninstall, { usage: 'dep uninstall [name1 name2 ...]', description: 'Uninstall dependencies. If names are provided, only those dependencies will be uninstalled.' });
29
- this.addCommand('run', this.commandRun, { usage: 'dep run <script>', description: 'Run a custom action defined in the configuration file.' });
30
- this.addCommand('list', this.list, { usage: 'dep list', description: 'List all dependencies in the configuration file.' });
31
- this.addCommand('rewrite-paths', this.rewritePaths, { usage: 'dep rewrite-paths [--watch] [--cdn]', description: 'Resolve and rewrite paths in built files based on depFlow configuration.' });
32
- this.addCommand('sync', this.commandSync, { usage: 'dep sync', description: 'Syncs depFlow.json with tsconfig.json and generates the importmap.' });
33
- }
34
- async commandAdd(command, args) {
35
- try {
36
- let [repo, name] = args;
37
- this.out.group(Utils.newGroup('#FFB4DC'));
38
- this.out.info(`Adding dependency...`);
39
- Validator.validateRepo(repo);
40
- if (!name)
41
- name = Utils.getRepoName(repo);
42
- const dep = schema.Dependency.GitDependency.processData({ name, repo });
43
- const config = await Config.load(this.configPath);
44
- config.dependencies.push(dep);
45
- await Config.save(this.configPath, config);
46
- this.out.info(`Added dependency "${dep.name}".`);
47
- }
48
- catch (error) {
49
- this.out.error(`&C1${error}`);
50
- }
51
- finally {
52
- this.out.groupEnd();
53
- }
54
- }
55
- async commandRemove(command, args) {
56
- try {
57
- const [identifier] = args;
58
- this.out.group(Utils.newGroup('#FFB4DC'));
59
- if (!identifier)
60
- throw new Error('Usage: dep remove <name> | <repo_url>');
61
- const config = await Config.load(this.configPath);
62
- config.dependencies = config.dependencies.filter(dep => dep.name !== identifier && dep.repo !== identifier);
63
- await Config.save(this.configPath, config);
64
- this.out.info(`Removed dependency "${identifier}".`);
65
- }
66
- catch (error) {
67
- this.out.error(`&C1${error}`);
68
- }
69
- finally {
70
- this.out.groupEnd();
71
- }
72
- }
73
- async commandInstall(command, args) {
74
- try {
75
- this.out.group(Utils.newGroup('#FFB4DC'));
76
- const config = await Config.load(this.configPath);
77
- const gitDependencies = config.dependencies;
78
- if (gitDependencies.length === 0)
79
- throw new Error(args.length > 0 ? 'Specified dependencies not found.' : 'No dependencies to install.');
80
- this.out.info(`&C5Installing dependencies...`);
81
- for (const dep of gitDependencies) {
82
- try {
83
- this.out.group(Utils.newGroup('#FFB4DC'));
84
- this.out.info(`&C5Installing &C6"${dep.name}" &C5from &C6${dep.repo}&C5...`);
85
- this.out.line();
86
- const dependency = new GitDependency(config.flowFolder, dep, this.out);
87
- await dependency.install();
88
- this.out.line();
89
- this.out.info(`&C2Installed &C6${dep.name}.`);
90
- }
91
- finally {
92
- this.out.groupEnd();
93
- }
94
- }
95
- const npmDependencies = config.npmDependencies;
96
- for (const dep of npmDependencies) {
97
- try {
98
- this.out.group(Utils.newGroup('#FFB4DC'));
99
- this.out.info(`&C5Installing npm dependency &C6"${dep.name}" &C5version &C6${dep.version}&C5...`);
100
- this.out.line();
101
- const dependency = new NpmDependency(config.flowFolder, dep, this.out);
102
- await dependency.install();
103
- this.out.line();
104
- this.out.info(`&C2Installed npm dependency &C6${dep.name}.`);
105
- }
106
- finally {
107
- this.out.groupEnd();
108
- }
109
- }
110
- await this.commandSync('sync', []);
111
- }
112
- catch (error) {
113
- this.out.error(`&C1${error}`);
114
- }
115
- finally {
116
- this.out.groupEnd();
117
- }
118
- }
119
- async uninstall(command, args) {
120
- try {
121
- this.out.group(Utils.newGroup('#FFB4DC'));
122
- const config = await Config.load(this.configPath);
123
- const dependencies = config.dependencies;
124
- if (dependencies.length === 0)
125
- throw new Error(args.length > 0 ? 'Specified dependencies not found.' : 'No dependencies to uninstall.');
126
- for (const dep of dependencies) {
127
- try {
128
- this.out.group(Utils.newGroup('#FFB4DC'));
129
- this.out.info(`&C1Uninstalling "${dep.name}" from "${dep.repo}"...`);
130
- this.out.line();
131
- const dependency = new GitDependency(config.flowFolder, dep, this.out);
132
- await dependency.uninstall();
133
- this.out.line();
134
- this.out.info(`Uninstalled "${dep.name}".`);
135
- this.out.groupEnd();
136
- }
137
- finally {
138
- this.out.groupEnd();
139
- }
140
- }
141
- }
142
- catch (error) {
143
- this.out.error(`&C1${error}`);
144
- }
145
- finally {
146
- this.out.groupEnd();
147
- }
148
- }
149
- async commandRun(command, args) {
150
- try {
151
- const [actionName] = args;
152
- if (!actionName)
153
- throw new Error('Usage: dep run <action>');
154
- this.out.group(Utils.newGroup('#FFB4DC'));
155
- this.out.info(`&C5Running action &C6${actionName}&C5...`);
156
- const config = await Config.load(this.configPath);
157
- const action = config.actions[actionName];
158
- if (!action)
159
- throw new Error(`action "${actionName}" not found in configuration.`);
160
- const pipeline = Array.isArray(action) ? action : [action];
161
- const builder = new Builder({
162
- cwd: this.projectRoot,
163
- pipeline,
164
- logger: this.out
165
- });
166
- await builder.run();
167
- }
168
- catch (error) {
169
- this.out.error(`&C1${error}`);
170
- }
171
- finally {
172
- this.out.groupEnd();
173
- }
174
- }
175
- async list(command, args) {
176
- this.out.group(Utils.newGroup('#FFB4DC'));
177
- try {
178
- const config = await Config.load(this.configPath);
179
- if (config.dependencies.length === 0) {
180
- this.out.info(`No dependencies found.`);
181
- }
182
- for (const dep of config.dependencies) {
183
- this.out.info(`&C6${dep.name} &C7from &C2${dep.repo}`);
184
- }
185
- }
186
- catch (error) {
187
- this.out.error(`&C1${error}`);
188
- }
189
- finally {
190
- this.out.groupEnd();
191
- }
192
- }
193
- async rewritePaths(command, args) {
194
- this.out.group(Utils.newGroup('#FFB4DC'));
195
- try {
196
- const config = await Config.load(this.configPath);
197
- const watch = args.includes('--watch') || args.includes('-w');
198
- const useCDN = args.includes('--cdn');
199
- const mode = useCDN ? 'cdn' : 'local';
200
- const dir = config.outDir;
201
- this.out.info(`Mode: &C3${useCDN ? 'CDN' : 'Local'}`);
202
- if (watch)
203
- this.out.info(`Watcher: &C2Enabled`);
204
- const resolver = new PathResolver(config, { logger: this.out });
205
- if (watch)
206
- await resolver.watch(mode);
207
- else
208
- await resolver.rewritePaths(mode);
209
- }
210
- catch (error) {
211
- this.out.error(`&C1${error.message || error}`);
212
- }
213
- finally {
214
- this.out.groupEnd();
215
- }
216
- }
217
- async commandSync(command, args) {
218
- try {
219
- this.out.group(Utils.newGroup('#FFB4DC'));
220
- this.out.info(`Synchronizing configurations...`);
221
- const useCDN = args.includes('--cdn');
222
- const mode = useCDN ? 'cdn' : 'local';
223
- const config = await Config.load(this.configPath);
224
- const resolver = new PathResolver(config, { logger: this.out });
225
- const tsconfigFile = config.tsconfig;
226
- const importMapFile = config.importmap;
227
- const tsconfigPath = path.join(this.projectRoot, tsconfigFile || 'tsconfig.json');
228
- const importMapPath = path.join(this.projectRoot, importMapFile || 'importmap.json');
229
- if (tsconfigFile) {
230
- const tsconfig = await TSConfig.load(tsconfigPath, { logger: this.out });
231
- tsconfig.updatePaths(resolver.aliases);
232
- await tsconfig.save();
233
- }
234
- else
235
- this.out.warn(`No tsconfig file specified in configuration. Skipping tsconfig synchronization.`);
236
- if (importMapFile) {
237
- const importmap = await ImportMap.load(importMapPath, { logger: this.out });
238
- importmap.updateImports(resolver.aliases, mode);
239
- await importmap.save();
240
- }
241
- else
242
- this.out.warn(`No import map file specified in configuration. Skipping import map synchronization.`);
243
- this.out.info(`&C2Successfully synced all configurations.`);
244
- }
245
- catch (error) {
246
- this.out.error(`&C1Error during sync: ${error}`);
247
- }
248
- finally {
249
- this.out.groupEnd();
250
- }
251
- }
252
- }
253
- export default DepFlowCLI;
254
- //# sourceMappingURL=DepFLowCLI.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DepFLowCLI.js","sourceRoot":"","sources":["../../src/cli/DepFLowCLI.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,SAAS,MAAM,yBAAy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AE5G,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,yBAAyB,KAAK,EAAE,CAAC,CAAC;QAAC,CAAC;gBAC7D,CAAC;YAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAAC,CAAC;IACpC,CAAC;CACJ;AAED,eAAe,UAAU,CAAC"}
package/build/cli/bin.js DELETED
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env node
2
- import { File } from "@netfeez/common-node";
3
- import DepFlowCLI from "./DepFLowCLI.js";
4
- import { Utils } from "../support/Utils.js";
5
- import schema from "../schema/schema.js";
6
- async function startupSchemaValidation(flowPath) {
7
- const jsonSchema = schema.Config.jsonSchema;
8
- File.write(`.depflow/schema.json`, JSON.stringify(jsonSchema));
9
- }
10
- const skip = 2;
11
- const [commandName, ...argsList] = process.argv.slice(skip);
12
- const { args, flags } = Utils.extractFlags(argsList);
13
- console.log(commandName, args, flags);
14
- const flowTag = flags['--flow'] || flags['-f'] || [];
15
- const flowPath = flowTag[0] || 'depflow.json';
16
- const cli = new DepFlowCLI(flowPath);
17
- await startupSchemaValidation(flowPath);
18
- try {
19
- if (commandName !== null) {
20
- const command = cli.getCommand(commandName);
21
- if (command) {
22
- await command.exec.call(cli, commandName, args);
23
- }
24
- else {
25
- cli.out.error(`Unknown command: ${commandName}`);
26
- cli.getCommand('help')?.exec.call(cli, 'help', []);
27
- }
28
- }
29
- else
30
- cli.start();
31
- }
32
- catch (error) {
33
- cli.out.error(`&C(#FFB4DC)╭─────────────────────────────────────────────`);
34
- cli.out.error(`&C(#FFB4DC)│ &C1${error?.stack || error}`);
35
- cli.out.error(`&C(#FFB4DC)╰─────────────────────────────────────────────`);
36
- process.exit(1);
37
- }
38
- //# sourceMappingURL=bin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bin.js","sourceRo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E,IAAI,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACJ,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,oBAAoB,WAAW,EAAE,CAAC,CAAC;YACjD,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QACvD,CAAC;IACL,CAAC;;QAAM,GAAG,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC;AAAC,OAAO,KAAU,EAAE,CAAC;IAClB,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC3E,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,mBAAmB,KAAK,EAAE,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC;IAC1D,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACnB,CAAC"}
@@ -1,28 +0,0 @@
1
- import schema from '../schema/schema.js';
2
- export declare class Config {
3
- /**
4
- * Loads the configuration from a file at the specified path.
5
- * If the file does not exist, it creates a new configuration file with default values and returns those defaults.
6
- * If the file exists, it reads the content, parses it as JSON, and processes it using the defined schema to ensure it conforms to the expected structure.
7
- * This method is essential for managing application settings or other relevant information in a structured format that can be easily read and modified as needed.
8
- * @param path The file system path of the configuration file to load.
9
- * @returns A promise that resolves to the loaded configuration object, which conforms to the expected structure defined in the Config.Config type.
10
- * @throws Will throw an error if there is an issue during the file reading or writing process, such as insufficient permissions or invalid path.
11
- */
12
- static load(path: string): Promise<Config.Config>;
13
- /**
14
- * Saves the provided configuration object to a file at the specified path.
15
- * It converts the configuration object into a JSON string with proper formatting and writes it to the file using the File.write method.
16
- * This function is essential for persisting configuration data, allowing applications to store settings or other relevant information in a structured format that can be easily read and modified as needed.
17
- * @param path The file system path where the configuration should be saved.
18
- * @param config The configuration object to be saved, which should conform to the expected structure defined in the Config.ConfigToProcess type.
19
- * @returns A promise that resolves when the save operation is complete.
20
- * @throws Will throw an error if there is an issue during the file writing process, such as insufficient permissions or invalid path.
21
- */
22
- static save(path: string, config: Config.ConfigToProcess): Promise<void>;
23
- }
24
- export declare namespace Config {
25
- type Config = schema.Config;
26
- type ConfigToProcess = schema.Config.toProcess;
27
- }
28
- export default Config;
@@ -1,46 +0,0 @@
1
- /**
2
- * @author NetFeez <netfeez.dev@gmail.com>
3
- * @description Utility to help with File operations.
4
- * @license Apache-2.0
5
- */
6
- import { File } from '@netfeez/common-node';
7
- import schema from '../schema/schema.js';
8
- export class Config {
9
- /**
10
- * Loads the configuration from a file at the specified path.
11
- * If the file does not exist, it creates a new configuration file with default values and returns those defaults.
12
- * If the file exists, it reads the content, parses it as JSON, and processes it using the defined schema to ensure it conforms to the expected structure.
13
- * This method is essential for managing application settings or other relevant information in a structured format that can be easily read and modified as needed.
14
- * @param path The file system path of the configuration file to load.
15
- * @returns A promise that resolves to the loaded configuration object, which conforms to the expected structure defined in the Config.Config type.
16
- * @throws Will throw an error if there is an issue during the file reading or writing process, such as insufficient permissions or invalid path.
17
- */
18
- static async load(path) {
19
- if (!await File.exists(path)) {
20
- const defaults = schema.Config.processData({});
21
- await Config.save(path, defaults);
22
- return defaults;
23
- }
24
- else {
25
- const content = await File.read(path, 'utf-8');
26
- const json = JSON.parse(content);
27
- const config = schema.Config.processData(json);
28
- return config;
29
- }
30
- }
31
- /**
32
- * Saves the provided configuration object to a file at the specified path.
33
- * It converts the configuration object into a JSON string with proper formatting and writes it to the file using the File.write method.
34
- * This function is essential for persisting configuration data, allowing applications to store settings or other relevant information in a structured format that can be easily read and modified as needed.
35
- * @param path The file system path where the configuration should be saved.
36
- * @param config The configuration object to be saved, which should conform to the expected structure defined in the Config.ConfigToProcess type.
37
- * @returns A promise that resolves when the save operation is complete.
38
- * @throws Will throw an error if there is an issue during the file writing process, such as insufficient permissions or invalid path.
39
- */
40
- static async save(path, config) {
41
- const content = JSON.stringify(config, null, 2);
42
- await File.write(path, content, 'utf-8');
43
- }
44
- }
45
- export default Config;
46
- //# sourceMappingURL=Config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Config.js","sourceRoot":"","sources":["../../src/config/Config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,MAAM,OAAO,MAAM;IACf;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY;QAC1B,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC/C,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAClC,OAAO,QAAQ,CAAC;QACpB,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,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC/C,OAAO,MAAM,CAAC;QAClB,CAAC;IACL,CAAC;IACD;;;;;;;;OAQG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,MAA8B;QAC1D,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAChD,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CACJ;AAMD,eAAe,MAAM,CAAC"}
@@ -1,51 +0,0 @@
1
- import { Logger } from '@netfeez/vterm';
2
- import AliasCompiler from '../support/PathResolver/AliasCompiler.js';
3
- import schema from '../schema/schema.js';
4
- export declare class ImportMap {
5
- protected data: ImportMap.Data;
6
- protected path: string;
7
- protected logger: Logger;
8
- constructor(data: ImportMap.Data, path: string, options?: ImportMap.Options);
9
- /**
10
- * Updates the import map data based on the provided compiled aliases.
11
- * It constructs an "imports" section where each alias is mapped to its target path.
12
- * @param aliases An array of compiled aliases.
13
- * @param mode The resolution mode ('local' or 'cdn').
14
- */
15
- updateImports(aliases: AliasCompiler.CompiledAlias[], mode: 'local' | 'cdn'): void;
16
- /**
17
- * Saves the provided import map data to a specified file path.
18
- * It ensures that the directory for the file exists, converts the data to a JSON string with proper formatting, and writes it to the file system.
19
- * The method also includes logging to inform users when the save operation is successful.
20
- * @param path The path to the import map file to save.
21
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
22
- */
23
- save(path?: string): Promise<void>;
24
- /**
25
- * Saves the provided import map data to a specified file path.
26
- * It ensures that the directory for the file exists, converts the data to a JSON string with proper formatting, and writes it to the file system.
27
- * The method also includes logging to inform users when the save operation is successful.
28
- * @param path The path to the import map file to save.
29
- * @param data The import map data to be saved.
30
- * @param options Additional options for saving, such as a logger for logging messages during the save process.
31
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
32
- */
33
- static save(path: string, data: ImportMap.Data, options?: ImportMap.Options): Promise<void>;
34
- /**
35
- * Factory method: Loads, validates (or creates default), and returns an instance of the ImportMap class.
36
- * It checks if the specified import map file exists, and if it does, it attempts to read and parse its content as JSON.
37
- * If the file does not exist or contains invalid JSON, it initializes the data with a default structure containing an empty "imports" object.
38
- * Finally, it returns a new instance of ImportMap with the loaded or default data, allowing for further manipulation and saving of the import map configuration.
39
- * @param path The path to the import map file to load.
40
- * @param options Additional options for loading, such as a logger for logging messages during the load process.
41
- * @returns A promise that resolves to an instance of ImportMap initialized with the loaded or default data.
42
- */
43
- static load(path: string, options?: ImportMap.Options): Promise<ImportMap>;
44
- }
45
- export declare namespace ImportMap {
46
- type Data = schema.ImportMap.Root;
47
- interface Options {
48
- logger?: Logger;
49
- }
50
- }
51
- export default ImportMap;
@@ -1,97 +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 ImportMap {
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: 'IMP-MAP' });
12
- }
13
- /**
14
- * Updates the import map data based on the provided compiled aliases.
15
- * It constructs an "imports" section where each alias is mapped to its target path.
16
- * @param aliases An array of compiled aliases.
17
- * @param mode The resolution mode ('local' or 'cdn').
18
- */
19
- updateImports(aliases, mode) {
20
- if (!this.data.imports)
21
- this.data.imports = {};
22
- const projectRoot = Path.dirname(this.path);
23
- for (const aliasObj of aliases) {
24
- const key = aliasObj.isWildcard ? `${aliasObj.alias}/` : aliasObj.alias;
25
- let target = mode === 'cdn' && aliasObj.targets.cdn
26
- ? aliasObj.targets.cdn
27
- : aliasObj.targets.local;
28
- if (target === aliasObj.targets.local) {
29
- target = Path.diff(projectRoot, target);
30
- target = target.startsWith('.') ? target : `./${target}`;
31
- target = Path.normalize(target);
32
- }
33
- if (aliasObj.isWildcard) {
34
- if (!target.endsWith('/'))
35
- target += '/';
36
- }
37
- this.data.imports[key] = target;
38
- }
39
- }
40
- /**
41
- * Saves the provided import map data to a specified file path.
42
- * It ensures that the directory for the file exists, converts the data to a JSON string with proper formatting, and writes it to the file system.
43
- * The method also includes logging to inform users when the save operation is successful.
44
- * @param path The path to the import map file to save.
45
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
46
- */
47
- async save(path = this.path) {
48
- await ImportMap.save(path, this.data, { logger: this.logger });
49
- if (path !== this.path)
50
- this.path = path;
51
- }
52
- /**
53
- * Saves the provided import map data to a specified file path.
54
- * It ensures that the directory for the file exists, converts the data to a JSON string with proper formatting, and writes it to the file system.
55
- * The method also includes logging to inform users when the save operation is successful.
56
- * @param path The path to the import map file to save.
57
- * @param data The import map data to be saved.
58
- * @param options Additional options for saving, such as a logger for logging messages during the save process.
59
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
60
- */
61
- static async save(path, data, options = {}) {
62
- const logger = options.logger || new Logger({ name: 'IMP-MAP' });
63
- const folder = Path.dirname(path);
64
- await File.ensureDir(folder);
65
- const json = JSON.stringify(data, null, 4);
66
- await File.write(path, json);
67
- const filename = Path.fileName(path);
68
- logger.log(`&C2Saved file &C4${filename}`);
69
- }
70
- /**
71
- * Factory method: Loads, validates (or creates default), and returns an instance of the ImportMap class.
72
- * It checks if the specified import map file exists, and if it does, it attempts to read and parse its content as JSON.
73
- * If the file does not exist or contains invalid JSON, it initializes the data with a default structure containing an empty "imports" object.
74
- * Finally, it returns a new instance of ImportMap with the loaded or default data, allowing for further manipulation and saving of the import map configuration.
75
- * @param path The path to the import map file to load.
76
- * @param options Additional options for loading, such as a logger for logging messages during the load process.
77
- * @returns A promise that resolves to an instance of ImportMap initialized with the loaded or default data.
78
- */
79
- static async load(path, options = {}) {
80
- const logger = options.logger || new Logger({ name: 'IMP-MAP' });
81
- let data;
82
- if (!await File.exists(path)) {
83
- const filename = Path.fileName(path);
84
- logger.warn(`&C3${filename} not found. Creating defaults...`);
85
- data = schema.ImportMap.processData({});
86
- // await ImportMap.save(projectRoot, filename, data, { logger });
87
- }
88
- else {
89
- const content = await File.read(path, 'utf-8');
90
- const json = JSON.parse(content);
91
- data = schema.ImportMap.processData(json);
92
- }
93
- return new ImportMap(data, path, { logger });
94
- }
95
- }
96
- export default ImportMap;
97
- //# sourceMappingURL=ImportMap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ImportMap.js","sourceRoot":"","sources":["../../src/config/ImportMap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,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BAAoB,QAAQ,EAAE,CAAC,CAAC;IAC/C,CAAC;IACD;;;;;;;;OAQG;IACI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAY,EAAE,UAA6B,EAAE;QAClE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;QACjE,IAAI,IAAoB,CAAC;QACzB,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,SAAS,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YACxC,iEAAiE;QACrE,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,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QAC9C,CAAC;QAAC,OAAO,IAAI,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IACnD,CAAC;CACJ;AAOD,eAAe,SAAS,CAAC"}
@@ -1,54 +0,0 @@
1
- import { Logger } from '@netfeez/vterm';
2
- import AliasCompiler from '../support/PathResolver/AliasCompiler.js';
3
- import schema from '../schema/schema.js';
4
- export declare class TSConfig {
5
- protected data: TSConfig.Data;
6
- protected path: string;
7
- protected logger: Logger;
8
- constructor(data: TSConfig.Data, path: string, options?: TSConfig.Options);
9
- /**
10
- * Updates the paths in the tsconfig data based on the provided compiled aliases.
11
- * 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.
12
- * 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.
13
- * Finally, it updates the paths in the tsconfig data with the new mappings, allowing TypeScript to resolve module paths according to the defined aliases.
14
- * @param aliases An array of compiled aliases containing alias names, target paths, and wildcard information.
15
- */
16
- updatePaths(aliases: AliasCompiler.CompiledAlias[]): void;
17
- /**
18
- * Saves the current tsconfig data to a file.
19
- * 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.
20
- * 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.
21
- * @param path The path to the tsconfig file where the data should be saved.
22
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
23
- */
24
- save(path?: string): Promise<void>;
25
- /**
26
- * 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.
27
- * 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.
28
- * 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.
29
- * @param path The path to the tsconfig file where the data should be saved.
30
- * @param data The tsconfig data to be saved, structured according to the defined schema.
31
- * @param options Additional options for saving, such as a logger for logging messages during the save process.
32
- * @returns A promise that resolves when the save operation is complete, or rejects if an error occurs during the process.
33
- * @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.
34
- */
35
- static save(path: string, data: TSConfig.Data, options?: TSConfig.Options): Promise<void>;
36
- /**
37
- * Static method to load tsconfig data from a specified file.
38
- * It takes the project root, filename, and options (including a logger) as parameters.
39
- * 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.
40
- * 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.
41
- * @param path The path to the tsconfig file to load.
42
- * @param options Additional options for loading, such as a logger for logging messages during the load process.
43
- * @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.
44
- * @throws Will throw an error if there is an issue during the load process, which
45
- */
46
- static load(path: string, options: TSConfig.Options): Promise<TSConfig>;
47
- }
48
- export declare namespace TSConfig {
49
- type Data = schema.TSConfig.Root;
50
- interface Options {
51
- logger?: Logger;
52
- }
53
- }
54
- export default TSConfig;