depflow 2.0.2 → 3.0.0-dev.10

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 (78) hide show
  1. package/README.md +129 -58
  2. package/build/cli/DepFLowCLI.d.ts +1 -0
  3. package/build/cli/DepFLowCLI.js +66 -19
  4. package/build/cli/DepFLowCLI.js.map +1 -1
  5. package/build/cli/bin.js +13 -12
  6. package/build/cli/bin.js.map +1 -1
  7. package/build/config/Config.d.ts +3 -3
  8. package/build/config/Config.js +3 -3
  9. package/build/config/Config.js.map +1 -1
  10. package/build/config/ImportMap.d.ts +24 -11
  11. package/build/config/ImportMap.js +43 -29
  12. package/build/config/ImportMap.js.map +1 -1
  13. package/build/config/{Tsconfig.d.ts → TSConfig.d.ts} +14 -17
  14. package/build/config/{Tsconfig.js → TSConfig.js} +42 -37
  15. package/build/config/TSConfig.js.map +1 -0
  16. package/build/schema/Config/Builder.d.ts +431 -0
  17. package/build/schema/Config/Builder.js +48 -0
  18. package/build/schema/Config/Builder.js.map +1 -0
  19. package/build/schema/Config/Config.d.ts +582 -0
  20. package/build/schema/Config/Config.js +20 -0
  21. package/build/schema/Config/Config.js.map +1 -0
  22. package/build/schema/Config/Dependency.d.ts +748 -0
  23. package/build/schema/Config/Dependency.js +25 -0
  24. package/build/schema/Config/Dependency.js.map +1 -0
  25. package/build/schema/Config/Extractor.d.ts +133 -0
  26. package/build/schema/Config/Extractor.js +25 -0
  27. package/build/schema/Config/Extractor.js.map +1 -0
  28. package/build/schema/Config/Resolver.d.ts +70 -0
  29. package/build/schema/Config/Resolver.js +25 -0
  30. package/build/schema/Config/Resolver.js.map +1 -0
  31. package/build/schema/Config/Transform.d.ts +73 -0
  32. package/build/schema/Config/Transform.js +27 -0
  33. package/build/schema/Config/Transform.js.map +1 -0
  34. package/build/schema/ImportMap.d.ts +22 -0
  35. package/build/schema/ImportMap.js +12 -0
  36. package/build/schema/ImportMap.js.map +1 -0
  37. package/build/schema/TSConfig.d.ts +56 -0
  38. package/build/schema/TSConfig.js +19 -0
  39. package/build/schema/TSConfig.js.map +1 -0
  40. package/build/schema/schema.d.ts +29 -0
  41. package/build/schema/schema.js +31 -0
  42. package/build/schema/schema.js.map +1 -0
  43. package/build/support/Builder/Builder.d.ts +46 -0
  44. package/build/support/Builder/Builder.js +116 -0
  45. package/build/support/Builder/Builder.js.map +1 -0
  46. package/build/support/Dependency/Dependency.d.ts +38 -0
  47. package/build/support/Dependency/Dependency.js +14 -0
  48. package/build/support/Dependency/Dependency.js.map +1 -0
  49. package/build/support/Dependency/GitDependency.d.ts +20 -0
  50. package/build/support/Dependency/GitDependency.js +67 -0
  51. package/build/support/Dependency/GitDependency.js.map +1 -0
  52. package/build/support/Dependency/NpmDependency.d.ts +18 -0
  53. package/build/support/Dependency/NpmDependency.js +65 -0
  54. package/build/support/Dependency/NpmDependency.js.map +1 -0
  55. package/build/support/Git.js +1 -1
  56. package/build/support/Git.js.map +1 -1
  57. package/build/support/PathResolver/AliasCompiler.d.ts +13 -6
  58. package/build/support/PathResolver/AliasCompiler.js +35 -12
  59. package/build/support/PathResolver/AliasCompiler.js.map +1 -1
  60. package/build/support/PathResolver/PathResolver.d.ts +4 -4
  61. package/build/support/PathResolver/PathResolver.js +23 -17
  62. package/build/support/PathResolver/PathResolver.js.map +1 -1
  63. package/build/support/Task/Task.js +1 -1
  64. package/build/support/Task/Task.js.map +1 -1
  65. package/build/support/Utils.d.ts +9 -1
  66. package/build/support/Utils.js +30 -0
  67. package/build/support/Utils.js.map +1 -1
  68. package/package.json +6 -7
  69. package/build/config/Tsconfig.js.map +0 -1
  70. package/build/config/schemas.d.ts +0 -641
  71. package/build/config/schemas.js +0 -51
  72. package/build/config/schemas.js.map +0 -1
  73. package/build/support/Async.d.ts +0 -22
  74. package/build/support/Async.js +0 -62
  75. package/build/support/Async.js.map +0 -1
  76. package/build/support/Dependency.d.ts +0 -109
  77. package/build/support/Dependency.js +0 -274
  78. package/build/support/Dependency.js.map +0 -1
@@ -0,0 +1,116 @@
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
@@ -0,0 +1 @@
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,IAA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AAC,CAAC;;oBAChF,IAAI,EAAE,CAAC;YAChB,CAAC,CAAC,CAAC;YACH,OAAO,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO,GAAG,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACrC,CAAC,EAAE,SAAS,CAAC,CAAC;IAClB,CAAC;IACD;;;;;OAKG;IACO,MAAM,CAAC,QAAQ,CAAC,QAA2B;QACjD,IAAI,OAAO,QAAQ,KAAK,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"}
@@ -0,0 +1,38 @@
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;
@@ -0,0 +1,14 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,20 @@
1
+ import Logger from "@netfeez/vterm";
2
+ import Dependency from './Dependency.js';
3
+ import schema from '../../schema/schema.js';
4
+ export declare class GitDependency extends Dependency implements GitDependency.Dependency {
5
+ readonly flowFolder: string;
6
+ readonly repo: GitDependency.repo;
7
+ readonly tag: string;
8
+ constructor(flowFolder: string, dependency: GitDependency.Dependency, logger?: Logger | null);
9
+ /** Get the folder of the dependency */
10
+ get folder(): string;
11
+ install(): Promise<void>;
12
+ uninstall(): Promise<void>;
13
+ build(): Promise<void>;
14
+ resolve(): Promise<void>;
15
+ }
16
+ export declare namespace GitDependency {
17
+ type repo = `https://github.com/${string}/${string}.git` | `git@github.com:${string}/${string}.git`;
18
+ type Dependency = schema.Dependency.GitDependency;
19
+ }
20
+ export default GitDependency;
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>
3
+ * @description Dependency utility.
4
+ * @license Apache-2.0
5
+ */
6
+ import { File, Path } from '@netfeez/common-node';
7
+ import Validator from "../Validator.js";
8
+ import Git from "../Git.js";
9
+ import Utils from "../Utils.js";
10
+ import Dependency from './Dependency.js';
11
+ import Builder from '../Builder/Builder.js';
12
+ export class GitDependency extends Dependency {
13
+ flowFolder;
14
+ repo;
15
+ tag;
16
+ constructor(flowFolder, dependency, logger = null) {
17
+ super({
18
+ name: dependency.name,
19
+ builder: dependency.builder,
20
+ resolver: dependency.resolver || {}
21
+ }, logger);
22
+ this.flowFolder = flowFolder;
23
+ Validator.validateRepo(dependency.repo);
24
+ this.repo = dependency.repo;
25
+ this.tag = dependency.tag;
26
+ }
27
+ /** Get the folder of the dependency */
28
+ get folder() {
29
+ let path = Path.join(this.flowFolder, this.name);
30
+ path = Path.normalize(path);
31
+ return path;
32
+ }
33
+ async install() {
34
+ try {
35
+ this.logger?.group(Utils.newGroup('#00B4FF'));
36
+ if (await File.exists(this.folder)) {
37
+ this.logger?.log(`&C3Repository already exists, pulling latest changes...`);
38
+ await Git.pull(this.folder, { logger: this.logger ?? undefined });
39
+ this.logger?.log(`&C2Pull completed successfully.`);
40
+ }
41
+ else {
42
+ this.logger?.log(`&C5Cloning repository from &C6${this.repo}&C5...`);
43
+ await Git.clone(this.repo, this.folder, { tag: this.tag, logger: this.logger ?? undefined });
44
+ this.logger?.log(`&C2Clone completed successfully.`);
45
+ }
46
+ await this.build();
47
+ this.logger?.groupEnd();
48
+ }
49
+ catch (error) {
50
+ throw error;
51
+ }
52
+ }
53
+ async uninstall() { }
54
+ async build() {
55
+ if (this.builder.length === 0)
56
+ return;
57
+ const builder = new Builder({
58
+ pipeline: this.builder,
59
+ cwd: this.folder,
60
+ logger: this.logger
61
+ });
62
+ await builder.run();
63
+ }
64
+ async resolve() { }
65
+ }
66
+ export default GitDependency;
67
+ //# sourceMappingURL=GitDependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GitDependency.js","sourceRoot":"","sources":["../../../src/support/Dependency/GitDependency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAGlD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAG5C,MAAM,OAAO,aAAc,SAAQ,UAAU;IAKrB;IAJJ,IAAI,CAAqB;IACzB,GAAG,CAAS;IAE5B,YACoB,UAAkB,EAClC,UAAoC,EACpC,SAAwB,IAAI;QAC5B,KAAK,CAAC;YACF,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ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,SAAS,EAAE,CAAC,CAAC;gBAC7F,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,kCAAkC,CAAC,CAAC;YACzD,CAAC;YACD,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;YACnB,IAAI,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,MAAM,KAAK,CAAC;QAAC,CAAC;IACpC,CAAC;IACM,KAAK,CAAC,SAAS,KAAmB,CAAC;IACnC,KAAK,CAAC,KAAK;QACd,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO;QACtC,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC;YACxB,QAAQ,EAAE,IAAI,CAAC,OAAO;YACtB,GAAG,EAAE,IAAI,CAAC,MAAM;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;IACxB,CAAC;IACM,KAAK,CAAC,OAAO,KAAmB,CAAC;CAE3C;AAOD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Dependency } from "./Dependency.js";
2
+ import Logger from "@netfeez/vterm";
3
+ import schema from "../../schema/schema.js";
4
+ export declare class NpmDependency extends Dependency implements NpmDependency.Dependency {
5
+ readonly flowFolder: string;
6
+ version: string;
7
+ constructor(flowFolder: string, dependency: NpmDependency.Dependency, logger?: Logger | null);
8
+ get folder(): string;
9
+ install(): Promise<void>;
10
+ uninstall(): Promise<void>;
11
+ build(): Promise<void>;
12
+ resolve(): Promise<void>;
13
+ }
14
+ export declare namespace NpmDependency {
15
+ type Resolver = schema.Resolver;
16
+ type Dependency = schema.Dependency.NpmDependency;
17
+ }
18
+ export default NpmDependency;
@@ -0,0 +1,65 @@
1
+ import { Path } from "@netfeez/common-node";
2
+ import Builder from "../Builder/Builder.js";
3
+ import Task from "../Task/Task.js";
4
+ import Utils from "../Utils.js";
5
+ import { Dependency } from "./Dependency.js";
6
+ import Async from "@netfeez/common-node/Async.js";
7
+ export class NpmDependency extends Dependency {
8
+ flowFolder;
9
+ version;
10
+ constructor(flowFolder, dependency, logger = null) {
11
+ super({
12
+ name: dependency.name,
13
+ builder: dependency.builder,
14
+ resolver: dependency.resolver || []
15
+ }, logger);
16
+ this.flowFolder = flowFolder;
17
+ this.version = dependency.version;
18
+ }
19
+ get folder() {
20
+ let path = Path.join(this.flowFolder, 'node_modules', this.name);
21
+ path = Path.normalize(path);
22
+ return path;
23
+ }
24
+ async install() {
25
+ try {
26
+ this.logger?.group(Utils.newGroup('#00B4FF'));
27
+ this.logger?.log(`&C5Using npm to install &C6${this.name}&C5...`);
28
+ const identifier = `${this.name}@${this.version}`;
29
+ const task = new Task(this.flowFolder, [
30
+ `npm install ${identifier} --prefix ./ --no-save`
31
+ ]);
32
+ await Async.awaitEvent((done, fail) => {
33
+ if (this.logger) {
34
+ task.on('line', (data) => this.logger?.log(`&C3${data}`));
35
+ task.on('error', (data) => this.logger?.error(`&C1${data}`));
36
+ }
37
+ task.on('finish', () => {
38
+ this.logger?.log(`&C2Installation of ${this.name} completed successfully.`);
39
+ done();
40
+ });
41
+ task.start().catch(fail);
42
+ return () => { task.stop(); };
43
+ });
44
+ await this.build();
45
+ this.logger?.groupEnd();
46
+ }
47
+ catch (error) {
48
+ throw error;
49
+ }
50
+ }
51
+ async uninstall() { }
52
+ async build() {
53
+ if (this.builder.length === 0)
54
+ return;
55
+ const builder = new Builder({
56
+ pipeline: this.builder,
57
+ cwd: this.folder,
58
+ logger: this.logger
59
+ });
60
+ await builder.run();
61
+ }
62
+ async resolve() { }
63
+ }
64
+ export default NpmDependency;
65
+ //# sourceMappingURL=NpmDependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NpmDependency.js","sourceRoot":"","sources":["../../../src/support/Dependency/NpmDependency.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAs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AAE,IAAI,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;IACxB,CAAC;IACM,KAAK,CAAC,OAAO,KAAmB,CAAC;CAE3C;AAKD,eAAe,aAAa,CAAC"}
@@ -1,5 +1,5 @@
1
+ import { Async } from "@netfeez/common-node";
1
2
  import Task from "./Task/Task.js";
2
- import Async from "./Async.js";
3
3
  export class Git {
4
4
  path;
5
5
  repo;
@@ -1 +1 @@
1
- {"version":3,"file":"Git.js","sourceRoot":"","sources":["../../src/support/Git.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,KAAK,MAAM,YAAY,CAAC;AAG/B,MAAM,OAAO,GAAG;IAIE;IACA;IAJJ,MAAM,CAAgB;IACtB,GAAG,CAAS;IACtB,YACc,IAAY,EACZ,IAAY,EACtB,OAAwB;QAFd,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QAGtB,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,IAAI,IAAI,CAAC;QAC7B,IAAI,CAAC,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACpC,CAAC;IACD;;;;;;;;;;;;OAYG;IACI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAY,EAAE,IAAY,EAAE,OAAwB;QAC1E,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC;QACrD,MAAM,QAAQ,GAAG;YACb,aAAa,IAAI,IAAI,IAAI,EAAE;YAC3B,MAAM,IAAI,EAAE;SACf,CAAC;QACF,IAAI,GAAG;YAAE,QAAQ,CAAC,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,OAAO,C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AAC,YAAY,IAAI,YAAY,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1F,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;gBAC5B,IAAI,OAAO,CAAC,KAAK,KAAK,CAAC;oBAAE,IAAI,CAAC,OAAO,CAAC,CAAC;;oBAClC,IAAI,CAAC,IAAI,KAAK,CAAC,yBAAyB,OAAO,CAAC,KAAK,4BAA4B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;YACxH,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACzB,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAUD,eAAe,GAAG,CAAC"}
@@ -1,4 +1,5 @@
1
- import schemas from '../../config/schemas.js';
1
+ import Config from '../../config/Config.js';
2
+ import schema from '../../schema/schema.js';
2
3
  export declare class AliasCompiler {
3
4
  private projectRoot;
4
5
  constructor(projectRoot: string);
@@ -9,13 +10,19 @@ export declare class AliasCompiler {
9
10
  * @param config The configuration object containing dependencies with resolver entries to compile into aliases.
10
11
  * @returns An array of compiled alias objects ready for use in path resolution.
11
12
  */
12
- compile(config: schemas.config['infer']): AliasCompiler.CompiledAlias[];
13
+ compile(config: Config.Config): AliasCompiler.CompiledAlias[];
14
+ /**
15
+ * Resolves an array of resolver entries into compiled alias objects, handling both string and object target formats.
16
+ * It determines if each alias is a wildcard and resolves local paths to absolute paths based on the project root.
17
+ * The method also extracts type and CDN targets if provided in the resolver entry.
18
+ * @param resolver An array of resolver entries to process into compiled aliases.
19
+ * @returns An array of compiled alias objects derived from the resolver entries.
20
+ */
21
+ protected resolve(resolver: AliasCompiler.Resolver): AliasCompiler.CompiledAlias[];
13
22
  }
14
23
  export declare namespace AliasCompiler {
15
- interface Target {
16
- local: string;
17
- cdn?: string;
18
- }
24
+ type Resolver = schema.Resolver;
25
+ type Target = Exclude<schema.Target, string>;
19
26
  interface CompiledAlias {
20
27
  alias: string;
21
28
  targets: Target;
@@ -14,23 +14,46 @@ export class AliasCompiler {
14
14
  */
15
15
  compile(config) {
16
16
  const result = [];
17
- const allDeps = [...(config.dependencies || []), ...(config.npmDependencies || [])];
17
+ const allDeps = [
18
+ ...(config.dependencies || []),
19
+ ...(config.npmDependencies || [])
20
+ ];
21
+ const baseResolvers = config.resolver || {};
18
22
  for (const dep of allDeps) {
19
23
  if (typeof dep !== 'object' || !dep.resolver)
20
24
  continue;
21
- for (const entry of dep.resolver) {
22
- const isWildcard = Utils.isWildcard(entry.alias);
23
- const alias = Utils.removeWildcardSuffix(entry.alias);
24
- const rawLocal = typeof entry.target === 'string' ? entry.target : entry.target.local;
25
- const localTarget = path.isAbsolute(rawLocal)
26
- ? Utils.removeWildcardSuffix(rawLocal)
27
- : path.resolve(this.projectRoot, Utils.removeWildcardSuffix(rawLocal));
28
- let cdnTarget;
29
- if (typeof entry.target === 'object' && entry.target.cdn) {
30
- cdnTarget = Utils.removeWildcardSuffix(entry.target.cdn);
25
+ result.push(...this.resolve(dep.resolver));
26
+ }
27
+ result.push(...this.resolve(baseResolvers));
28
+ return result;
29
+ }
30
+ /**
31
+ * Resolves an array of resolver entries into compiled alias objects, handling both string and object target formats.
32
+ * It determines if each alias is a wildcard and resolves local paths to absolute paths based on the project root.
33
+ * The method also extracts type and CDN targets if provided in the resolver entry.
34
+ * @param resolver An array of resolver entries to process into compiled aliases.
35
+ * @returns An array of compiled alias objects derived from the resolver entries.
36
+ */
37
+ resolve(resolver) {
38
+ const result = [];
39
+ for (const [crudeAlias, target] of Object.entries(resolver)) {
40
+ const isWildcard = Utils.isWildcard(crudeAlias);
41
+ const alias = Utils.removeWildcardSuffix(crudeAlias);
42
+ const rawLocal = typeof target === 'string' ? target : target.local;
43
+ const localTarget = path.isAbsolute(rawLocal)
44
+ ? Utils.removeWildcardSuffix(rawLocal)
45
+ : path.resolve(this.projectRoot, Utils.removeWildcardSuffix(rawLocal));
46
+ let cdnTarget;
47
+ let typeTarget;
48
+ if (typeof target === 'object') {
49
+ if (target.type) {
50
+ typeTarget = Utils.removeWildcardSuffix(target.type);
51
+ }
52
+ if (target.cdn) {
53
+ cdnTarget = Utils.removeWildcardSuffix(target.cdn);
31
54
  }
32
- result.push({ alias, isWildcard, targets: { local: localTarget, cdn: cdnTarget } });
33
55
  }
56
+ result.push({ alias, isWildcard, targets: { local: localTarget, type: typeTarget, cdn: cdnTarget } });
34
57
  }
35
58
  return result;
36
59
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AliasCompiler.js","sourceRoot":"","sources":["../../../src/support/PathResolver/AliasCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,MAAM,OAAO,aAAa;IACF;IAApB,YAAoB,WAAmB;QAAnB,gBAAW,GAAX,WAAW,CAAQ;IAAG,CAAC;IAC3C;;;;;;OAMG;IACI,OAAO,CAAC,MAA+B;QAC1C,MAAM,MAAM,GAAkC,EAAE,CAAC;QACjD,MAAM,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,CAAC;QAEpF,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,QAAQ;gBAAE,SAAS;YAEvD,KAAK,MAAM,KAAK,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;gBAC/B,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBACjD,MAAM,KAAK,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BAAoB,CAAC,QAAQ,CAAC,CAAC,CAAC;YAE3E,IAAI,SAA6B,CAAC;YAClC,IAAI,UAA8B,CAAC;YACnC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;gBAC7B,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;oBACd,UAAU,GAAG,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;gBACzD,CAAC;gBACD,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;oBACb,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACvD,CAAC;YACL,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC1G,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAUD,eAAe,aAAa,CAAC"}
@@ -1,17 +1,17 @@
1
1
  import { Logger } from "@netfeez/vterm";
2
- import schemas from '../../config/schemas.js';
3
2
  import PathRewriter from './PathRewriter.js';
4
3
  import AliasCompiler from './AliasCompiler.js';
4
+ import Config from '../../config/Config.js';
5
5
  export declare class PathResolver {
6
- readonly config: schemas.config['infer'];
6
+ readonly config: Config.Config;
7
7
  readonly options: PathResolver.Options;
8
8
  static readonly PROJECT_ROOT: string;
9
9
  static readonly EXTENSIONS: string[];
10
10
  protected readonly logger: Logger;
11
11
  protected readonly rewriter: PathRewriter;
12
- protected readonly absoluteOutDir: string;
12
+ protected readonly outDir: string;
13
13
  readonly aliases: AliasCompiler.CompiledAlias[];
14
- constructor(config: schemas.config['infer'], options?: PathResolver.Options);
14
+ constructor(config: Config.Config, options?: PathResolver.Options);
15
15
  /**
16
16
  * Resolves and rewrites paths in built files based on the provided mode (local or CDN).
17
17
  * It processes all files in the output directory, rewriting import paths according to the configured aliases.
@@ -3,13 +3,13 @@
3
3
  * @description Utility for path resolution with Local/CDN support and dual path fixing.
4
4
  * @license Apache-2.0
5
5
  */
6
- import PATH from "node:path";
7
6
  import FS, { promises as FSP } from 'node:fs';
8
- import { File } from '@netfeez/common-node';
7
+ import { File, Path } from '@netfeez/common-node';
9
8
  import { Logger } from "@netfeez/vterm";
10
9
  import Utils from '../Utils.js';
11
10
  import PathRewriter from './PathRewriter.js';
12
11
  import AliasCompiler from './AliasCompiler.js';
12
+ import Async from "@netfeez/common-node/Async.js";
13
13
  export class PathResolver {
14
14
  config;
15
15
  options;
@@ -17,15 +17,15 @@ export class PathResolver {
17
17
  static EXTENSIONS = ['.js', '.ts', '.jsx', '.tsx'];
18
18
  logger;
19
19
  rewriter;
20
- absoluteOutDir;
20
+ outDir;
21
21
  aliases;
22
22
  constructor(config, options = {}) {
23
23
  this.config = config;
24
24
  this.options = options;
25
25
  this.logger = options.logger || new Logger({ name: 'PATH-RW' });
26
- const outDir = config.outDir || '.';
27
- this.absoluteOutDir = !PATH.isAbsolute(outDir)
28
- ? PATH.resolve(PathResolver.PROJECT_ROOT, outDir)
26
+ const outDir = config.outDir || 'build';
27
+ this.outDir = !Path.isAbsolute(outDir)
28
+ ? Path.resolve(PathResolver.PROJECT_ROOT, outDir)
29
29
  : outDir;
30
30
  this.aliases = new AliasCompiler(PathResolver.PROJECT_ROOT).compile(config);
31
31
  this.rewriter = new PathRewriter(this.aliases, PathResolver.PROJECT_ROOT);
@@ -36,15 +36,21 @@ export class PathResolver {
36
36
  * @param mode The resolution mode ('local' or 'cdn') to determine which target paths to use.
37
37
  */
38
38
  async rewritePaths(mode) {
39
- this.logger.log(`&C2Starting path resolver in &C3${mode} &C2mode...`);
40
- if (!await File.exists(this.absoluteOutDir))
41
- return void this.logger.warn(`Directory &C4${this.absoluteOutDir}&R not found.`);
42
- const files = await File.getAllFiles(this.absoluteOutDir, PathResolver.EXTENSIONS);
39
+ this.logger.log(`&C2Starting path resolver in &C3${mode} &C2mode for ${this.outDir}...`);
40
+ if (!await File.exists(this.outDir))
41
+ return void this.logger.warn(`Directory &C4${this.outDir}&R not found.`);
42
+ const filter = '**/*.{js,ts,jsx,tsx,{c,m}js}';
43
+ const files = await File.find(filter, this.outDir);
43
44
  let rewrittenCount = 0;
44
- for (const file of files) {
45
- if (await this.processFile(file, mode))
46
- rewrittenCount++;
47
- }
45
+ const limiter = Async.currencyLimiter(16);
46
+ const promises = files.map((file) => {
47
+ file = Path.join(this.outDir, file);
48
+ return limiter(() => this.processFile(file, mode).then(changed => {
49
+ if (changed)
50
+ rewrittenCount++;
51
+ }));
52
+ });
53
+ await Promise.all(promises);
48
54
  this.logger.log(`&C2Path aliases resolved in &C3${rewrittenCount} &C2files.`);
49
55
  }
50
56
  /**
@@ -78,19 +84,19 @@ export class PathResolver {
78
84
  */
79
85
  async watch(mode) {
80
86
  await this.rewritePaths(mode);
81
- this.logger.log(`&C2Watching for changes in &C4${this.absoluteOutDir}...`);
87
+ this.logger.log(`&C2Watching for changes in &C4${this.outDir}...`);
82
88
  const debouncedProcessor = Utils.debounce(async (fullPath, filename) => {
83
89
  if (await this.processFile(fullPath, mode)) {
84
90
  this.logger.log(`&C2File &C4${filename}&C2 updated.`);
85
91
  }
86
92
  }, 300);
87
- FS.watch(this.absoluteOutDir, { recursive: true }, (eventType, filename) => {
93
+ FS.watch(this.outDir, { recursive: true }, (eventType, filename) => {
88
94
  if (!filename)
89
95
  return;
90
96
  const isTargetExtension = PathResolver.EXTENSIONS.some(ext => filename.endsWith(ext));
91
97
  if (!isTargetExtension)
92
98
  return;
93
- const fullPath = PATH.join(this.absoluteOutDir, filename);
99
+ const fullPath = Path.join(this.outDir, filename);
94
100
  debouncedProcessor(fullPath, filename);
95
101
  });
96
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PathResolver.js","sourceRoot":"","sources":["../../../src/support/PathResolver/PathResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO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