depflow 2.0.2 → 3.0.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/README.md +129 -58
  2. package/build/cli/DepFLowCLI.js +32 -16
  3. package/build/cli/DepFLowCLI.js.map +1 -1
  4. package/build/cli/bin.js +16 -12
  5. package/build/cli/bin.js.map +1 -1
  6. package/build/config/Config.d.ts +3 -3
  7. package/build/config/Config.js +3 -3
  8. package/build/config/ImportMap.d.ts +2 -3
  9. package/build/config/ImportMap.js +9 -10
  10. package/build/config/ImportMap.js.map +1 -1
  11. package/build/config/Tsconfig.d.ts +2 -2
  12. package/build/config/Tsconfig.js +17 -7
  13. package/build/config/Tsconfig.js.map +1 -1
  14. package/build/config/schemas.d.ts +634 -51
  15. package/build/config/schemas.js +37 -21
  16. package/build/config/schemas.js.map +1 -1
  17. package/build/support/Builder/Builder.d.ts +36 -0
  18. package/build/support/Builder/Builder.js +89 -0
  19. package/build/support/Builder/Builder.js.map +1 -0
  20. package/build/support/Dependency/Dependency.d.ts +38 -0
  21. package/build/support/Dependency/Dependency.js +14 -0
  22. package/build/support/Dependency/Dependency.js.map +1 -0
  23. package/build/support/Dependency/GitDependency.d.ts +20 -0
  24. package/build/support/Dependency/GitDependency.js +67 -0
  25. package/build/support/Dependency/GitDependency.js.map +1 -0
  26. package/build/support/Dependency/NpmDependency.d.ts +18 -0
  27. package/build/support/Dependency/NpmDependency.js +65 -0
  28. package/build/support/Dependency/NpmDependency.js.map +1 -0
  29. package/build/support/Dependency/Resolver.d.ts +7 -0
  30. package/build/support/Dependency/Resolver.js +4 -0
  31. package/build/support/Dependency/Resolver.js.map +1 -0
  32. package/build/support/PathResolver/AliasCompiler.d.ts +3 -2
  33. package/build/support/PathResolver/AliasCompiler.js +9 -3
  34. package/build/support/PathResolver/AliasCompiler.js.map +1 -1
  35. package/build/support/PathResolver/PathResolver.d.ts +3 -3
  36. package/build/support/PathResolver/PathResolver.js +6 -1
  37. package/build/support/PathResolver/PathResolver.js.map +1 -1
  38. package/build/support/Utils.d.ts +8 -0
  39. package/build/support/Utils.js +30 -0
  40. package/build/support/Utils.js.map +1 -1
  41. package/package.json +2 -2
  42. package/build/support/Dependency.d.ts +0 -109
  43. package/build/support/Dependency.js +0 -274
  44. package/build/support/Dependency.js.map +0 -1
@@ -1,51 +1,67 @@
1
1
  import { Schema } from '@netfeez/common';
2
- export const basicImportmap = Schema.fromObject({
3
- imports: { type: 'object' },
4
- scopes: { type: 'object' }
2
+ export const ImportMap = Schema.fromObject({
3
+ imports: { type: 'object', default: {} },
4
+ scopes: { type: 'object', default: {} }
5
5
  });
6
- export const basicTsconfig = Schema.fromObject({
6
+ export const TsConfig = Schema.fromObject({
7
7
  compilerOptions: { type: 'object', properties: {
8
8
  baseUrl: { type: 'string' },
9
9
  rootDir: { type: 'string' },
10
10
  outDir: { type: 'string' },
11
11
  paths: { type: 'object' }
12
- }, allowAdditionalProperties: true },
12
+ }, allowAdditionalProperties: true }
13
13
  }, true);
14
- let test = basicTsconfig.infer;
15
- export const builder = Schema.fromObject({
14
+ export const ExtractorEntry = Schema.fromObject({
15
+ from: { type: 'string', required: true },
16
+ to: { type: 'string', required: true },
17
+ replacer: { union: [{ type: 'string' }, { type: 'object', properties: {
18
+ search: { type: 'string', required: true },
19
+ replace: { type: 'string', required: true }
20
+ } }], nullable: true }
21
+ });
22
+ export const BuilderEntry = Schema.fromObject({
16
23
  maxTimeMs: { type: 'number', default: 60000 },
17
24
  run: { union: [{ type: 'string' }, { type: 'array', items: { type: 'string' } }] },
18
- move: { union: [{ type: 'string' }, { type: 'object' }] }
25
+ extract: { union: [{ type: 'string' }, { type: 'array', items: ExtractorEntry.root }] }
19
26
  });
20
- export const pathResolverEntry = Schema.fromObject({
27
+ export const ResolverEntry = Schema.fromObject({
21
28
  alias: { type: 'string', required: true },
22
29
  target: { union: [
23
30
  { type: 'string' },
24
31
  { type: 'object', properties: {
25
32
  local: { type: 'string', required: true },
33
+ type: { type: 'string' },
26
34
  cdn: { type: 'string' }
27
35
  } }
28
36
  ], required: true }
29
37
  });
30
- export const dependency = Schema.fromObject({
38
+ export const GitDependency = Schema.fromObject({
31
39
  name: { type: 'string', required: true },
32
40
  repo: { type: 'string', required: true },
33
- tag: { type: 'string' },
34
- builder: { type: 'array', default: [], items: builder.root },
35
- resolver: { type: 'array', nullable: true, default: [], items: pathResolverEntry.root }
41
+ tag: { type: 'string', default: 'main' },
42
+ builder: { type: 'array', default: [], items: BuilderEntry.root },
43
+ resolver: { type: 'array', nullable: true, default: [], items: ResolverEntry.root }
36
44
  });
37
- export const npmDependencySchema = Schema.fromObject({
45
+ export const NpmDependency = Schema.fromObject({
38
46
  name: { type: 'string', required: true },
39
- resolver: { type: 'array', nullable: true, default: [], items: pathResolverEntry.root }
47
+ version: { type: 'string', required: true },
48
+ builder: { type: 'array', default: [], items: BuilderEntry.root },
49
+ resolver: { type: 'array', nullable: true, default: [], items: ResolverEntry.root }
40
50
  });
41
- export const config = Schema.fromObject({
51
+ export const Config = Schema.fromObject({
52
+ $schema: { type: 'string', default: '.depflow/schema.json' },
42
53
  flowFolder: { type: 'string', default: '.depflow' },
43
- outDir: { type: 'string', default: '.' },
54
+ outDir: { type: 'string', default: 'dist' },
44
55
  tsconfig: { type: 'string', nullable: true, default: null },
45
56
  importmap: { type: 'string', nullable: true, default: null },
46
- dependencies: { type: 'array', default: [], items: dependency.root },
47
- npmDependencies: { type: 'array', default: [], items: npmDependencySchema.root }
57
+ dependencies: { type: 'array', default: [], items: GitDependency.root },
58
+ npmDependencies: { type: 'array', default: [], items: NpmDependency.root }
48
59
  });
49
- export const schemas = { basicTsconfig, config, builder, pathResolver: pathResolverEntry, dependency };
50
- export default schemas;
60
+ export const Schemas = {
61
+ Config,
62
+ TsConfig, ImportMap,
63
+ BuilderEntry, ResolverEntry,
64
+ GitDependency, NpmDependency
65
+ };
66
+ export default Schemas;
51
67
  //# sourceMappingURL=schemas.js.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,aAAa;IAC3B,aAAa,EAAE,aAAa;CAC/B,CAAC;AAYF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type Logger from "@netfeez/vterm";
2
+ import type Schemas from "../../config/schemas.js";
3
+ export declare class Builder {
4
+ protected readonly pipeline: Builder.BuilderEntry[];
5
+ protected readonly cwd: string;
6
+ protected readonly logger: Logger | null;
7
+ constructor(info: Builder.Info);
8
+ run(): Promise<void>;
9
+ /**
10
+ * Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
11
+ * 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.
12
+ * 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.
13
+ * @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
14
+ * @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.
15
+ * @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.
16
+ */
17
+ protected runExtractor(entry: string | Builder.Extractor[]): Promise<void>;
18
+ /**
19
+ * 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.
20
+ * @param commands An array of strings representing the shell commands to be executed as part of the build process.
21
+ * @param logger An optional Logger instance for logging the output and errors from the command execution.
22
+ * @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.
23
+ * @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.
24
+ */
25
+ protected runTask(commands: string[], cwd: string, maxTimeMs: number): Promise<void>;
26
+ }
27
+ export declare namespace Builder {
28
+ type BuilderEntry = Schemas.BuilderEntry['infer'];
29
+ type Extractor = Schemas.ExtractorEntry['infer'];
30
+ interface Info {
31
+ pipeline: BuilderEntry[];
32
+ cwd: string;
33
+ logger?: Logger | null;
34
+ }
35
+ }
36
+ export default Builder;
@@ -0,0 +1,89 @@
1
+ import Utils from "../Utils.js";
2
+ import Async from "../Async.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
+ let ranTask = false;
18
+ if (step.run)
19
+ try {
20
+ const commands = typeof step.run === 'string' ? [step.run] : step.run;
21
+ await this.runTask(commands, this.cwd, step.maxTimeMs ?? 60000);
22
+ }
23
+ catch (error) {
24
+ this.logger?.error(`&C1[Run] &C7${error}`);
25
+ }
26
+ finally {
27
+ ranTask = true;
28
+ }
29
+ if (step.extract)
30
+ try {
31
+ if (ranTask)
32
+ this.logger?.line();
33
+ await this.runExtractor(step.extract);
34
+ }
35
+ catch (error) {
36
+ this.logger?.error(`&C1[Extract] &C7${error}`);
37
+ }
38
+ }
39
+ this.logger?.groupEnd();
40
+ }
41
+ /**
42
+ * Runs the extraction process based on the provided entry configuration, which can be either a string or an array of extraction entries.
43
+ * 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.
44
+ * 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.
45
+ * @param entry A string or an array of extraction entries that define the source, target, and optional path transformation for the extraction process.
46
+ * @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.
47
+ * @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.
48
+ */
49
+ async runExtractor(entry) {
50
+ const extractor = typeof entry === 'string' ? [{ from: '**/*', to: entry }] : entry;
51
+ for (const entry of extractor) {
52
+ const { from, to: toEntry, replacer } = entry;
53
+ const regex = !replacer ? null : new RegExp(typeof replacer === 'string' ? replacer : replacer.search, 'g');
54
+ const value = !replacer || typeof replacer === 'string' ? '' : replacer.replace;
55
+ const to = Path.isAbsolute(toEntry) ? toEntry : Path.join(Path.cwd, toEntry);
56
+ this.logger?.log(`&C7Extracting &C3${from}&C7 to &C3${to}&C7...`);
57
+ await File.smartCopy(from, to, {
58
+ cwd: this.cwd,
59
+ map: path => regex ? path.replace(regex, value) : path
60
+ });
61
+ }
62
+ }
63
+ /**
64
+ * 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.
65
+ * @param commands An array of strings representing the shell commands to be executed as part of the build process.
66
+ * @param logger An optional Logger instance for logging the output and errors from the command execution.
67
+ * @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.
68
+ * @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.
69
+ */
70
+ runTask(commands, cwd, maxTimeMs) {
71
+ return Async.awaitEvent((done, fail) => {
72
+ const pollito = new Task(cwd, commands);
73
+ if (this.logger) {
74
+ pollito.on('line', (line) => this.logger?.info(`${line}`));
75
+ pollito.on('error', (msg, step) => this.logger?.error(`&C1[Step ${step}]&C7: &C1${msg}`));
76
+ }
77
+ pollito.once('finish', (data) => {
78
+ if (data.fails > 0)
79
+ fail(new Error(`Build failed with ${data.fails} failed steps.`));
80
+ else
81
+ done();
82
+ });
83
+ pollito.start().catch(fail);
84
+ return () => { pollito.stop(); };
85
+ }, maxTimeMs);
86
+ }
87
+ }
88
+ export default Builder;
89
+ //# sourceMappingURL=Builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Builder.js","sourceRoot":"","sources":["../../../src/support/Builder/Builder.ts"],"names":[],"mapp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C,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;CACJ;AAUD,eAAe,OAAO,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type Logger from "@netfeez/vterm";
2
+ import type Resolver from "./Resolver.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.BuilderEntry[];
8
+ readonly resolver: Resolver.ResolverEntry[];
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.BuilderEntry[];
35
+ resolver?: Resolver.ResolverEntry[];
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,CAAyB;IAChC,QAAQ,CAA2B;IAEnD,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 Schemas from "../../config/schemas.js";
3
+ import Dependency from './Dependency.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 = Schemas.GitDependency['infer'];
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;AAKlD,OAAO,SAAS,MAAM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
+ 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 = Schemas.ResolverEntry['infer'];
16
+ type Dependency = Schemas.NpmDependency['infer'];
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";
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,sBAAsB,CAAC;AAE5C,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,IAAI,MAAM,iBAAiB,CAAC;AACnC,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,OAAO,KAAK,MAAM,4BAA4B,CAAC;AAE/C,MAAM,OAAO,aAAc,SAAQ,UAAU;IAIrB;IAHb,OAAO,CAAS;IAEvB,YACoB,UAAkB,EAClC,UAAoC,EACpC,SAAwB,IAAI;QAE5B,KAAK,CAAC;YACF,IAAI,EAAE,UAAU,CAAC,IAAI;YACrB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,QAAQ,EAAE,UAAU,CAAC,QAAQ,IAAI,EAAE;SACtC,EAAE,MAAM,CAAC,CAAC;QARK,eAAU,GAAV,UAAU,CAAQ;QASlC,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACtC,CAAC;IAED,IAAW,MAAM;QACb,IAAI,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC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C,CAAA;YACF,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;AAKD,eAAe,aAAa,CAAC"}
@@ -0,0 +1,7 @@
1
+ import Schemas from "../../config/schemas.js";
2
+ export declare class Resolver {
3
+ }
4
+ export declare namespace Resolver {
5
+ type ResolverEntry = Schemas.ResolverEntry['infer'];
6
+ }
7
+ export default Resolver;
@@ -0,0 +1,4 @@
1
+ export class Resolver {
2
+ }
3
+ export default Resolver;
4
+ //# sourceMappingURL=Resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../../src/support/Dependency/Resolver.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,QAAQ;CACpB;AAID,eAAe,QAAQ,CAAC"}
@@ -1,4 +1,4 @@
1
- import schemas from '../../config/schemas.js';
1
+ import Schemas from '../../config/schemas.js';
2
2
  export declare class AliasCompiler {
3
3
  private projectRoot;
4
4
  constructor(projectRoot: string);
@@ -9,11 +9,12 @@ export declare class AliasCompiler {
9
9
  * @param config The configuration object containing dependencies with resolver entries to compile into aliases.
10
10
  * @returns An array of compiled alias objects ready for use in path resolution.
11
11
  */
12
- compile(config: schemas.config['infer']): AliasCompiler.CompiledAlias[];
12
+ compile(config: Schemas.Config['infer']): AliasCompiler.CompiledAlias[];
13
13
  }
14
14
  export declare namespace AliasCompiler {
15
15
  interface Target {
16
16
  local: string;
17
+ type?: string;
17
18
  cdn?: string;
18
19
  }
19
20
  interface CompiledAlias {
@@ -26,10 +26,16 @@ export class AliasCompiler {
26
26
  ? Utils.removeWildcardSuffix(rawLocal)
27
27
  : path.resolve(this.projectRoot, Utils.removeWildcardSuffix(rawLocal));
28
28
  let cdnTarget;
29
- if (typeof entry.target === 'object' && entry.target.cdn) {
30
- cdnTarget = Utils.removeWildcardSuffix(entry.target.cdn);
29
+ let typeTarget;
30
+ if (typeof entry.target === 'object') {
31
+ if (entry.target.type) {
32
+ typeTarget = Utils.removeWildcardSuffix(entry.target.type);
33
+ }
34
+ if (entry.target.cdn) {
35
+ cdnTarget = Utils.removeWildcardSuffix(entry.target.cdn);
36
+ }
31
37
  }
32
- result.push({ alias, isWildcard, targets: { local: localTarget, cdn: cdnTarget } });
38
+ result.push({ alias, isWildcard, targets: { local: localTarget, type: typeTarget, cdn: cdnTarget } });
33
39
  }
34
40
  }
35
41
  return result;
@@ -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,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BAE3E,IAAI,SAA6B,CAAC;gBAClC,IAAI,UAA8B,CAAC;gBACnC,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACnC,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;wBACpB,UAAU,GAAG,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAC/D,CAAC;oBACD,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;wBACnB,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC7D,CAAC;gBACL,CAAC;gBAED,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;YAC1G,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ;AAaD,eAAe,aAAa,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { Logger } from "@netfeez/vterm";
2
- import schemas from '../../config/schemas.js';
2
+ import Schemas from '../../config/schemas.js';
3
3
  import PathRewriter from './PathRewriter.js';
4
4
  import AliasCompiler from './AliasCompiler.js';
5
5
  export declare class PathResolver {
6
- readonly config: schemas.config['infer'];
6
+ readonly config: Schemas.Config['infer'];
7
7
  readonly options: PathResolver.Options;
8
8
  static readonly PROJECT_ROOT: string;
9
9
  static readonly EXTENSIONS: string[];
@@ -11,7 +11,7 @@ export declare class PathResolver {
11
11
  protected readonly rewriter: PathRewriter;
12
12
  protected readonly absoluteOutDir: string;
13
13
  readonly aliases: AliasCompiler.CompiledAlias[];
14
- constructor(config: schemas.config['infer'], options?: PathResolver.Options);
14
+ constructor(config: Schemas.Config['infer'], 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.
@@ -39,7 +39,12 @@ export class PathResolver {
39
39
  this.logger.log(`&C2Starting path resolver in &C3${mode} &C2mode...`);
40
40
  if (!await File.exists(this.absoluteOutDir))
41
41
  return void this.logger.warn(`Directory &C4${this.absoluteOutDir}&R not found.`);
42
- const files = await File.getAllFiles(this.absoluteOutDir, PathResolver.EXTENSIONS);
42
+ // const files = await File.getAllFiles(this.absoluteOutDir, PathResolver.EXTENSIONS);
43
+ const files = [];
44
+ files.push(...await File.find('**/*.js'));
45
+ files.push(...await File.find('**/*.ts'));
46
+ files.push(...await File.find('**/*.jsx'));
47
+ files.push(...await File.find('**/*.tsx'));
43
48
  let rewrittenCount = 0;
44
49
  for (const file of files) {
45
50
  if (await this.processFile(file, mode))
@@ -1 +1 @@
1
- {"version":3,"file":"PathResolver.js","sourceRoot":"","sources":["../../../src/support/PathResolver/PathResolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,EAAE,EAAE,QAAQ,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC;AAE9C,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,KAAK,MAAM,aAAa,CAAC;AAEhC,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAE/C,MAAM,OAAO,YAAY;IAUD;IACA;IAVb,MAAM,CAAU,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;IAC7C,MAAM,CAAU,UAAU,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAEhD,MAAM,CAAS;IACf,QAAQ,CAAe;IACvB,cAAc,CAAS;IAC1B,OAAO,CAAgC;IAEv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