depflow 3.0.0-dev.10 → 3.0.0-dev.12

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 (175) hide show
  1. package/README.md +513 -117
  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/Actions.d.ts +187 -0
  6. package/dist/cli/Actions.js +793 -0
  7. package/dist/cli/Actions.js.map +1 -0
  8. package/dist/cli/CLI.d.ts +170 -0
  9. package/dist/cli/CLI.js +231 -0
  10. package/dist/cli/CLI.js.map +1 -0
  11. package/dist/cli/DepflowCLI.d.ts +62 -0
  12. package/dist/cli/DepflowCLI.js +229 -0
  13. package/dist/cli/DepflowCLI.js.map +1 -0
  14. package/dist/cli/Flags.d.ts +106 -0
  15. package/dist/cli/Flags.js +125 -0
  16. package/dist/cli/Flags.js.map +1 -0
  17. package/dist/cli/bin.js +63 -0
  18. package/dist/cli/bin.js.map +1 -0
  19. package/dist/config/Config.d.ts +690 -0
  20. package/dist/config/Config.js +45 -0
  21. package/dist/config/Config.js.map +1 -0
  22. package/dist/config/ImportMap.d.ts +60 -0
  23. package/dist/config/ImportMap.js +66 -0
  24. package/dist/config/ImportMap.js.map +1 -0
  25. package/dist/config/JsonSchema.d.ts +12 -0
  26. package/dist/config/JsonSchema.js +26 -0
  27. package/dist/config/JsonSchema.js.map +1 -0
  28. package/dist/config/Settings.d.ts +201 -0
  29. package/dist/config/Settings.js +191 -0
  30. package/dist/config/Settings.js.map +1 -0
  31. package/dist/config/TSConfig.d.ts +73 -0
  32. package/dist/config/TSConfig.js +73 -0
  33. package/dist/config/TSConfig.js.map +1 -0
  34. package/dist/config/codecs/JsonCodec.d.ts +30 -0
  35. package/dist/config/codecs/JsonCodec.js +31 -0
  36. package/dist/config/codecs/JsonCodec.js.map +1 -0
  37. package/dist/config/codecs/YamlCodec.d.ts +62 -0
  38. package/dist/config/codecs/YamlCodec.js +89 -0
  39. package/dist/config/codecs/YamlCodec.js.map +1 -0
  40. package/dist/dependency/DepUtils.d.ts +78 -0
  41. package/dist/dependency/DepUtils.js +122 -0
  42. package/dist/dependency/DepUtils.js.map +1 -0
  43. package/dist/dependency/Dependency.d.ts +81 -0
  44. package/dist/dependency/Dependency.js +71 -0
  45. package/dist/dependency/Dependency.js.map +1 -0
  46. package/dist/dependency/Git.d.ts +75 -0
  47. package/dist/dependency/Git.js +97 -0
  48. package/dist/dependency/Git.js.map +1 -0
  49. package/dist/dependency/GitDependency.d.ts +30 -0
  50. package/dist/dependency/GitDependency.js +79 -0
  51. package/dist/dependency/GitDependency.js.map +1 -0
  52. package/dist/dependency/NpmDependency.d.ts +27 -0
  53. package/dist/dependency/NpmDependency.js +91 -0
  54. package/dist/dependency/NpmDependency.js.map +1 -0
  55. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.d.ts +18 -5
  56. package/{build/support/PathResolver → dist/resolve}/AliasCompiler.js +31 -9
  57. package/dist/resolve/AliasCompiler.js.map +1 -0
  58. package/{build/support/PathResolver → dist/resolve}/PathResolver.d.ts +25 -8
  59. package/dist/resolve/PathResolver.js +133 -0
  60. package/dist/resolve/PathResolver.js.map +1 -0
  61. package/dist/resolve/PathRewriter.d.ts +24 -0
  62. package/{build/support/PathResolver → dist/resolve}/PathRewriter.js +21 -11
  63. package/dist/resolve/PathRewriter.js.map +1 -0
  64. package/{build → dist}/schema/Config/Builder.d.ts +114 -49
  65. package/dist/schema/Config/Builder.js +78 -0
  66. package/dist/schema/Config/Builder.js.map +1 -0
  67. package/{build → dist}/schema/Config/Config.d.ts +169 -78
  68. package/dist/schema/Config/Config.js +62 -0
  69. package/dist/schema/Config/Config.js.map +1 -0
  70. package/{build → dist}/schema/Config/Dependency.d.ts +219 -89
  71. package/dist/schema/Config/Dependency.js +80 -0
  72. package/dist/schema/Config/Dependency.js.map +1 -0
  73. package/{build → dist}/schema/Config/Extractor.d.ts +41 -17
  74. package/dist/schema/Config/Extractor.js +43 -0
  75. package/dist/schema/Config/Extractor.js.map +1 -0
  76. package/{build → dist}/schema/Config/Resolver.d.ts +25 -8
  77. package/dist/schema/Config/Resolver.js +43 -0
  78. package/dist/schema/Config/Resolver.js.map +1 -0
  79. package/{build → dist}/schema/Config/Transform.d.ts +22 -5
  80. package/dist/schema/Config/Transform.js +51 -0
  81. package/dist/schema/Config/Transform.js.map +1 -0
  82. package/dist/schema/Defaults.d.ts +20 -0
  83. package/dist/schema/Defaults.js +24 -0
  84. package/dist/schema/Defaults.js.map +1 -0
  85. package/dist/schema/ImportMap.d.ts +30 -0
  86. package/dist/schema/ImportMap.js +28 -0
  87. package/dist/schema/ImportMap.js.map +1 -0
  88. package/{build → dist}/schema/TSConfig.d.ts +23 -9
  89. package/dist/schema/TSConfig.js +39 -0
  90. package/dist/schema/TSConfig.js.map +1 -0
  91. package/{build → dist}/schema/schema.d.ts +11 -2
  92. package/{build → dist}/schema/schema.js +11 -2
  93. package/dist/schema/schema.js.map +1 -0
  94. package/dist/task/Command.d.ts +287 -0
  95. package/dist/task/Command.js +404 -0
  96. package/dist/task/Command.js.map +1 -0
  97. package/dist/task/Group.d.ts +15 -0
  98. package/dist/task/Group.js +29 -0
  99. package/dist/task/Group.js.map +1 -0
  100. package/dist/task/OutputPolicy.d.ts +262 -0
  101. package/dist/task/OutputPolicy.js +364 -0
  102. package/dist/task/OutputPolicy.js.map +1 -0
  103. package/dist/task/Task.d.ts +210 -0
  104. package/dist/task/Task.js +312 -0
  105. package/dist/task/Task.js.map +1 -0
  106. package/package.json +14 -10
  107. package/.gitignore +0 -7
  108. package/build/cli/DepFLowCLI.d.ts +0 -16
  109. package/build/cli/DepFLowCLI.js +0 -254
  110. package/build/cli/DepFLowCLI.js.map +0 -1
  111. package/build/cli/bin.js +0 -38
  112. package/build/cli/bin.js.map +0 -1
  113. package/build/config/Config.d.ts +0 -28
  114. package/build/config/Config.js +0 -46
  115. package/build/config/Config.js.map +0 -1
  116. package/build/config/ImportMap.d.ts +0 -51
  117. package/build/config/ImportMap.js +0 -97
  118. package/build/config/ImportMap.js.map +0 -1
  119. package/build/config/TSConfig.d.ts +0 -54
  120. package/build/config/TSConfig.js +0 -104
  121. package/build/config/TSConfig.js.map +0 -1
  122. package/build/schema/Config/Builder.js +0 -48
  123. package/build/schema/Config/Builder.js.map +0 -1
  124. package/build/schema/Config/Config.js +0 -20
  125. package/build/schema/Config/Config.js.map +0 -1
  126. package/build/schema/Config/Dependency.js +0 -25
  127. package/build/schema/Config/Dependency.js.map +0 -1
  128. package/build/schema/Config/Extractor.js +0 -25
  129. package/build/schema/Config/Extractor.js.map +0 -1
  130. package/build/schema/Config/Resolver.js +0 -25
  131. package/build/schema/Config/Resolver.js.map +0 -1
  132. package/build/schema/Config/Transform.js +0 -27
  133. package/build/schema/Config/Transform.js.map +0 -1
  134. package/build/schema/ImportMap.d.ts +0 -22
  135. package/build/schema/ImportMap.js +0 -12
  136. package/build/schema/ImportMap.js.map +0 -1
  137. package/build/schema/TSConfig.js +0 -19
  138. package/build/schema/TSConfig.js.map +0 -1
  139. package/build/schema/schema.js.map +0 -1
  140. package/build/support/Builder/Builder.d.ts +0 -46
  141. package/build/support/Builder/Builder.js +0 -116
  142. package/build/support/Builder/Builder.js.map +0 -1
  143. package/build/support/Dependency/Dependency.d.ts +0 -38
  144. package/build/support/Dependency/Dependency.js +0 -14
  145. package/build/support/Dependency/Dependency.js.map +0 -1
  146. package/build/support/Dependency/GitDependency.d.ts +0 -20
  147. package/build/support/Dependency/GitDependency.js +0 -67
  148. package/build/support/Dependency/GitDependency.js.map +0 -1
  149. package/build/support/Dependency/NpmDependency.d.ts +0 -18
  150. package/build/support/Dependency/NpmDependency.js +0 -65
  151. package/build/support/Dependency/NpmDependency.js.map +0 -1
  152. package/build/support/Git.d.ts +0 -53
  153. package/build/support/Git.js +0 -86
  154. package/build/support/Git.js.map +0 -1
  155. package/build/support/PathResolver/AliasCompiler.js.map +0 -1
  156. package/build/support/PathResolver/PathResolver.js +0 -105
  157. package/build/support/PathResolver/PathResolver.js.map +0 -1
  158. package/build/support/PathResolver/PathRewriter.d.ts +0 -18
  159. package/build/support/PathResolver/PathRewriter.js.map +0 -1
  160. package/build/support/PathResolver/Utils.d.ts +0 -36
  161. package/build/support/PathResolver/Utils.js +0 -45
  162. package/build/support/PathResolver/Utils.js.map +0 -1
  163. package/build/support/Task/Command.d.ts +0 -49
  164. package/build/support/Task/Command.js +0 -100
  165. package/build/support/Task/Command.js.map +0 -1
  166. package/build/support/Task/Task.d.ts +0 -84
  167. package/build/support/Task/Task.js +0 -145
  168. package/build/support/Task/Task.js.map +0 -1
  169. package/build/support/Utils.d.ts +0 -40
  170. package/build/support/Utils.js +0 -138
  171. package/build/support/Utils.js.map +0 -1
  172. package/build/support/Validator.d.ts +0 -22
  173. package/build/support/Validator.js +0 -28
  174. package/build/support/Validator.js.map +0 -1
  175. /package/{build → dist}/cli/bin.d.ts +0 -0
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for git and npm dependencies.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
7
+ import Builder from './Builder.js';
8
+ import Resolver from './Resolver.js';
9
+ import Defaults from '../Defaults.js';
10
+ export var DependencyName;
11
+ (function (DependencyName) {
12
+ /**
13
+ * The identities the flow folder reserves for itself, declared once so no source can claim them.
14
+ */
15
+ const RESERVED = 'schema\\.json|node_modules';
16
+ /** A `user/repo` identity or a single segment: the identity of a git source, also the name of its checkout folder. */
17
+ DependencyName.GIT = new RegExp(`^(?!(?:${RESERVED})(?:/|$))[A-Za-z0-9][A-Za-z0-9._-]*(?:/[A-Za-z0-9][A-Za-z0-9._-]*)?$`);
18
+ /** A package name, optionally scoped: the identity of an npm source. */
19
+ DependencyName.NPM = new RegExp(`^(?!(${RESERVED})$)@?[A-Za-z0-9][A-Za-z0-9._~-]*(/[A-Za-z0-9][A-Za-z0-9._~-]*)?$`);
20
+ })(DependencyName || (DependencyName = {}));
21
+ export const GitDependency = new Schema({
22
+ type: 'object',
23
+ keys: {
24
+ name: {
25
+ type: 'string',
26
+ required: true,
27
+ pattern: DependencyName.GIT,
28
+ description: 'Unique name used to reference the dependency in flows and path aliases. It is an identity, not an arbitrary path: a `<user>/<repo>` pair or a single alphanumeric segment.'
29
+ },
30
+ repo: {
31
+ type: 'string',
32
+ required: true,
33
+ description: 'Git repository URL to clone the dependency from.'
34
+ },
35
+ tag: {
36
+ type: 'string',
37
+ default: 'main',
38
+ description: 'Git tag, branch or commit to check out after cloning. Defaults to "main".'
39
+ },
40
+ builder: {
41
+ ...Builder.definition,
42
+ get default() { return Defaults.array(); },
43
+ description: 'Build pipeline applied after cloning the repository.'
44
+ },
45
+ resolver: {
46
+ ...Resolver.definition,
47
+ get default() { return Defaults.record(); },
48
+ description: 'Target resolution used to rewrite the dependency paths.'
49
+ }
50
+ }
51
+ });
52
+ export const NpmDependency = new Schema({
53
+ type: 'object',
54
+ keys: {
55
+ name: {
56
+ type: 'string',
57
+ required: true,
58
+ pattern: DependencyName.NPM,
59
+ description: 'NPM package name to install, optionally scoped.'
60
+ },
61
+ version: {
62
+ type: 'string',
63
+ required: true,
64
+ description: 'NPM package version or semver range to install.'
65
+ },
66
+ builder: {
67
+ ...Builder.definition,
68
+ get default() { return Defaults.array(); },
69
+ description: 'Build pipeline applied after installing the package.'
70
+ },
71
+ resolver: {
72
+ ...Resolver.definition,
73
+ get default() { return Defaults.record(); },
74
+ description: 'Target resolution used to rewrite the dependency paths.'
75
+ }
76
+ }
77
+ });
78
+ export const Dependency = { GitDependency, NpmDependency };
79
+ export default Dependency;
80
+ //# sourceMappingURL=Dependency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Dependency.js","sourceRoot":"","sources":["../../../src/schema/Config/Dependency.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,MAAM,KAAW,cAAc,CAa9B;AAbD,WAAiB,cAAc;IAE3B;;OAEG;IACH,MAAM,QAAQ,GAAG,4BAA4B,CAAC;IAE9C,sHAAsH;IACzG,kBAAG,GAAW,IAAI,MAAM,CAAC,UAAU,QAAQ,sEAAsE,CAAC,CAAC;IAEhI,wEAAwE;IAC3D,kBAAG,GAAW,IAAI,MAAM,CAAC,QAAQ,QAAQ,kEAAkE,CAAC,CAAC;AAE9H,CAAC,EAbgB,cAAc,KAAd,cAAc,QAa9B;AAGD,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACF,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,cAAc,CAAC,GAAG;YAC3B,WAAW,EAAE,4KAA4K;SAC5L;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kDAAkD;SAClE;QACD,GAAG,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,MAAM;YACf,WAAW,EAAE,2EAA2E;SAC3F;QACD,OAAO,EAAE;YACL,GAAG,OAAO,CAAC,UAAU;YACrB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC1C,WAAW,EAAE,sDAAsD;SACtE;QACD,QAAQ,EAAE;YACN,GAAG,QAAQ,CAAC,UAAU;YACtB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3C,WAAW,EAAE,yDAAyD;SACzE;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACF,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,cAAc,CAAC,GAAG;YAC3B,WAAW,EAAE,iDAAiD;SACjE;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,iDAAiD;SACjE;QACD,OAAO,EAAE;YACL,GAAG,OAAO,CAAC,UAAU;YACrB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAC1C,WAAW,EAAE,sDAAsD;SACtE;QACD,QAAQ,EAAE;YACN,GAAG,QAAQ,CAAC,UAAU;YACtB,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3C,WAAW,EAAE,yDAAyD;SACzE;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC;AAK3D,eAAe,UAAU,CAAC"}
@@ -1,59 +1,73 @@
1
- import { Schema } from '@netfeez/common';
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for file extraction mappings from source globs.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
2
7
  export declare const ExtractorEntry: Schema<{
3
8
  readonly type: "object";
4
9
  readonly required: true;
5
- readonly properties: {
10
+ readonly keys: {
6
11
  readonly to: {
7
12
  readonly type: "string";
8
13
  readonly required: true;
14
+ readonly description: "Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.";
9
15
  };
10
16
  readonly map: {
11
- readonly required: false;
12
17
  readonly type: "union";
13
- readonly union: [{
18
+ readonly union: readonly [{
14
19
  readonly type: "string";
15
20
  }, {
16
21
  readonly type: "object";
17
- readonly properties: {
22
+ readonly keys: {
18
23
  readonly search: {
19
24
  readonly type: "string";
20
25
  readonly required: true;
26
+ readonly description: "The regular expression pattern to search for in the file content.";
21
27
  };
22
28
  readonly flags: {
23
29
  readonly type: "string";
24
30
  readonly default: "g";
25
31
  readonly pattern: RegExp;
32
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
26
33
  };
27
34
  readonly replace: {
28
35
  readonly type: "string";
29
36
  readonly required: true;
37
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
30
38
  };
31
39
  };
32
40
  }];
41
+ readonly required: false;
42
+ readonly description: "Transformation applied to the destination path of the extracted files.";
33
43
  };
34
44
  readonly transform: {
35
- readonly required: false;
36
45
  readonly type: "union";
37
- readonly union: [{
46
+ readonly union: readonly [{
38
47
  readonly type: "string";
39
48
  }, {
40
49
  readonly type: "object";
41
- readonly properties: {
50
+ readonly keys: {
42
51
  readonly search: {
43
52
  readonly type: "string";
44
53
  readonly required: true;
54
+ readonly description: "The regular expression pattern to search for in the file content.";
45
55
  };
46
56
  readonly flags: {
47
57
  readonly type: "string";
48
58
  readonly default: "g";
49
59
  readonly pattern: RegExp;
60
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
50
61
  };
51
62
  readonly replace: {
52
63
  readonly type: "string";
53
64
  readonly required: true;
65
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
54
66
  };
55
67
  };
56
68
  }];
69
+ readonly required: false;
70
+ readonly description: "Transformation applied to the content of the extracted files.";
57
71
  };
58
72
  };
59
73
  }>;
@@ -62,71 +76,81 @@ export declare namespace ExtractorEntry { }
62
76
  export declare const Extractor: Schema<{
63
77
  readonly type: "object";
64
78
  readonly required: true;
65
- readonly allowAdditionalProperties: {
79
+ readonly additional: {
66
80
  readonly type: "union";
67
81
  readonly required: true;
68
- readonly union: [{
82
+ readonly union: readonly [{
69
83
  readonly type: "string";
70
84
  readonly required: true;
71
85
  }, {
72
86
  readonly type: "object";
73
87
  readonly required: true;
74
- readonly properties: {
88
+ readonly keys: {
75
89
  readonly to: {
76
90
  readonly type: "string";
77
91
  readonly required: true;
92
+ readonly description: "Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.";
78
93
  };
79
94
  readonly map: {
80
- readonly required: false;
81
95
  readonly type: "union";
82
- readonly union: [{
96
+ readonly union: readonly [{
83
97
  readonly type: "string";
84
98
  }, {
85
99
  readonly type: "object";
86
- readonly properties: {
100
+ readonly keys: {
87
101
  readonly search: {
88
102
  readonly type: "string";
89
103
  readonly required: true;
104
+ readonly description: "The regular expression pattern to search for in the file content.";
90
105
  };
91
106
  readonly flags: {
92
107
  readonly type: "string";
93
108
  readonly default: "g";
94
109
  readonly pattern: RegExp;
110
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
95
111
  };
96
112
  readonly replace: {
97
113
  readonly type: "string";
98
114
  readonly required: true;
115
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
99
116
  };
100
117
  };
101
118
  }];
119
+ readonly required: false;
120
+ readonly description: "Transformation applied to the destination path of the extracted files.";
102
121
  };
103
122
  readonly transform: {
104
- readonly required: false;
105
123
  readonly type: "union";
106
- readonly union: [{
124
+ readonly union: readonly [{
107
125
  readonly type: "string";
108
126
  }, {
109
127
  readonly type: "object";
110
- readonly properties: {
128
+ readonly keys: {
111
129
  readonly search: {
112
130
  readonly type: "string";
113
131
  readonly required: true;
132
+ readonly description: "The regular expression pattern to search for in the file content.";
114
133
  };
115
134
  readonly flags: {
116
135
  readonly type: "string";
117
136
  readonly default: "g";
118
137
  readonly pattern: RegExp;
138
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
119
139
  };
120
140
  readonly replace: {
121
141
  readonly type: "string";
122
142
  readonly required: true;
143
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
123
144
  };
124
145
  };
125
146
  }];
147
+ readonly required: false;
148
+ readonly description: "Transformation applied to the content of the extracted files.";
126
149
  };
127
150
  };
128
151
  }];
129
152
  };
153
+ readonly description: "Mapping of source glob patterns, relative to the folder the pipeline works in, to extraction entries, each describing where and how files are extracted.";
130
154
  }>;
131
155
  export type Extractor = typeof Extractor.infer;
132
156
  export declare namespace Extractor { }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for file extraction mappings from source globs.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
7
+ import Transform from './Transform.js';
8
+ export const ExtractorEntry = new Schema({
9
+ type: 'object',
10
+ required: true,
11
+ keys: {
12
+ to: {
13
+ type: 'string',
14
+ required: true,
15
+ description: 'Destination folder to which the matched files are copied. A relative path is resolved against the project root, an absolute one is used as it stands.'
16
+ },
17
+ map: {
18
+ ...Transform.definition,
19
+ required: false,
20
+ description: 'Transformation applied to the destination path of the extracted files.'
21
+ },
22
+ transform: {
23
+ ...Transform.definition,
24
+ required: false,
25
+ description: 'Transformation applied to the content of the extracted files.'
26
+ }
27
+ }
28
+ });
29
+ export const Extractor = new Schema({
30
+ type: 'object',
31
+ required: true,
32
+ additional: {
33
+ type: 'union',
34
+ required: true,
35
+ union: [
36
+ { type: 'string', required: true },
37
+ ExtractorEntry.definition
38
+ ]
39
+ },
40
+ description: 'Mapping of source glob patterns, relative to the folder the pipeline works in, to extraction entries, each describing where and how files are extracted.'
41
+ });
42
+ export default Extractor;
43
+ //# sourceMappingURL=Extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../../src/schema/Config/Extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC;IACrC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF,EAAE,EAAE;YACA,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uJAAuJ;SACvK;QACD,GAAG,EAAE;YACD,GAAG,SAAS,CAAC,UAAU;YACvB,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,wEAAwE;SACxF;QACD,SAAS,EAAE;YACP,GAAG,SAAS,CAAC,UAAU;YACvB,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,+DAA+D;SAC/E;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,UAAU,EAAE;QACR,IAAI,EAAE,OAAO;QACb,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE;YACH,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;YAClC,cAAc,CAAC,UAAU;SAC5B;KACJ;IACD,WAAW,EAAE,0JAA0J;CAC1K,CAAC,CAAC;AAGH,eAAe,SAAS,CAAC"}
@@ -1,16 +1,24 @@
1
- import { Schema } from '@netfeez/common';
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for dependency resolution targets: local, type and cdn.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
2
7
  export declare const TargetOptions: Schema<{
3
8
  readonly type: "object";
4
- readonly properties: {
9
+ readonly keys: {
5
10
  readonly local: {
6
11
  readonly type: "string";
7
12
  readonly required: true;
13
+ readonly description: "Local path or glob pattern the dependency resolves to.";
8
14
  };
9
15
  readonly type: {
10
16
  readonly type: "string";
17
+ readonly description: "Optional identifier describing the resolution type.";
11
18
  };
12
19
  readonly cdn: {
13
20
  readonly type: "string";
21
+ readonly description: "CDN URL used when the dependency is resolved in CDN mode.";
14
22
  };
15
23
  };
16
24
  }>;
@@ -19,51 +27,60 @@ export declare namespace TargetOptions { }
19
27
  export declare const Target: Schema<{
20
28
  readonly type: "union";
21
29
  readonly required: true;
22
- readonly union: [{
30
+ readonly union: readonly [{
23
31
  readonly type: "string";
24
32
  }, {
25
33
  readonly type: "object";
26
- readonly properties: {
34
+ readonly keys: {
27
35
  readonly local: {
28
36
  readonly type: "string";
29
37
  readonly required: true;
38
+ readonly description: "Local path or glob pattern the dependency resolves to.";
30
39
  };
31
40
  readonly type: {
32
41
  readonly type: "string";
42
+ readonly description: "Optional identifier describing the resolution type.";
33
43
  };
34
44
  readonly cdn: {
35
45
  readonly type: "string";
46
+ readonly description: "CDN URL used when the dependency is resolved in CDN mode.";
36
47
  };
37
48
  };
38
49
  }];
50
+ readonly description: "Resolution target of a dependency: either a plain string or an object with local, type and cdn options.";
39
51
  }>;
40
52
  export type Target = typeof Target.infer;
41
53
  export declare namespace Target { }
42
54
  export declare const Resolver: Schema<{
43
55
  readonly type: "object";
44
56
  readonly required: true;
45
- readonly default: {};
46
- readonly allowAdditionalProperties: {
57
+ readonly default: Record<string, never>;
58
+ readonly additional: {
47
59
  readonly type: "union";
48
60
  readonly required: true;
49
- readonly union: [{
61
+ readonly union: readonly [{
50
62
  readonly type: "string";
51
63
  }, {
52
64
  readonly type: "object";
53
- readonly properties: {
65
+ readonly keys: {
54
66
  readonly local: {
55
67
  readonly type: "string";
56
68
  readonly required: true;
69
+ readonly description: "Local path or glob pattern the dependency resolves to.";
57
70
  };
58
71
  readonly type: {
59
72
  readonly type: "string";
73
+ readonly description: "Optional identifier describing the resolution type.";
60
74
  };
61
75
  readonly cdn: {
62
76
  readonly type: "string";
77
+ readonly description: "CDN URL used when the dependency is resolved in CDN mode.";
63
78
  };
64
79
  };
65
80
  }];
81
+ readonly description: "Resolution target of a dependency: either a plain string or an object with local, type and cdn options.";
66
82
  };
83
+ readonly description: "Mapping of dependency names to their resolution targets (local file or CDN).";
67
84
  }>;
68
85
  export type Resolver = typeof Resolver.infer;
69
86
  export declare namespace Resolver { }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for dependency resolution targets: local, type and cdn.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
7
+ import Defaults from '../Defaults.js';
8
+ export const TargetOptions = new Schema({
9
+ type: 'object',
10
+ keys: {
11
+ local: {
12
+ type: 'string',
13
+ required: true,
14
+ description: 'Local path or glob pattern the dependency resolves to.'
15
+ },
16
+ type: {
17
+ type: 'string',
18
+ description: 'Optional identifier describing the resolution type.'
19
+ },
20
+ cdn: {
21
+ type: 'string',
22
+ description: 'CDN URL used when the dependency is resolved in CDN mode.'
23
+ }
24
+ }
25
+ });
26
+ export const Target = new Schema({
27
+ type: 'union',
28
+ required: true,
29
+ union: [
30
+ { type: 'string' },
31
+ TargetOptions.definition
32
+ ],
33
+ description: 'Resolution target of a dependency: either a plain string or an object with local, type and cdn options.'
34
+ });
35
+ export const Resolver = new Schema({
36
+ type: 'object',
37
+ required: true,
38
+ get default() { return Defaults.record(); },
39
+ additional: Target.definition,
40
+ description: 'Mapping of dependency names to their resolution targets (local file or CDN).'
41
+ });
42
+ export default Resolver;
43
+ //# sourceMappingURL=Resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Resolver.js","sourceRoot":"","sources":["../../../src/schema/Config/Resolver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC;IACpC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACF,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,wDAAwD;SACxE;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qDAAqD;SACrE;QACD,GAAG,EAAE;YACD,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2DAA2D;SAC3E;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC;IAC7B,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClB,aAAa,CAAC,UAAU;KAC3B;IACD,WAAW,EAAE,yGAAyG;CACzH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC;IAC/B,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,OAAO,KAAK,OAAO,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3C,UAAU,EAAE,MAAM,CAAC,UAAU;IAC7B,WAAW,EAAE,8EAA8E;CAC9F,CAAC,CAAC;AAIH,eAAe,QAAQ,CAAC"}
@@ -1,19 +1,27 @@
1
- import { Schema } from '@netfeez/common';
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for content transformations: search pattern, flags and replacement.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
2
7
  export declare const TransformOptions: Schema<{
3
8
  readonly type: "object";
4
- readonly properties: {
9
+ readonly keys: {
5
10
  readonly search: {
6
11
  readonly type: "string";
7
12
  readonly required: true;
13
+ readonly description: "The regular expression pattern to search for in the file content.";
8
14
  };
9
15
  readonly flags: {
10
16
  readonly type: "string";
11
17
  readonly default: "g";
12
18
  readonly pattern: RegExp;
19
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
13
20
  };
14
21
  readonly replace: {
15
22
  readonly type: "string";
16
23
  readonly required: true;
24
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
17
25
  };
18
26
  };
19
27
  }>;
@@ -22,51 +30,60 @@ export declare namespace TransformOptions { }
22
30
  export declare const GlobalTransform: Schema<{
23
31
  readonly type: "object";
24
32
  readonly required: true;
25
- readonly properties: {
33
+ readonly keys: {
26
34
  readonly search: {
27
35
  readonly type: "string";
28
36
  readonly required: true;
37
+ readonly description: "The regular expression pattern to search for in the file content.";
29
38
  };
30
39
  readonly flags: {
31
40
  readonly type: "string";
32
41
  readonly default: "g";
33
42
  readonly pattern: RegExp;
43
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
34
44
  };
35
45
  readonly replace: {
36
46
  readonly type: "string";
37
47
  readonly required: true;
48
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
38
49
  };
39
50
  readonly glob: {
40
51
  readonly type: "string";
41
52
  readonly required: true;
53
+ readonly description: "Glob pattern matching the files to which the global transformation is applied.";
42
54
  };
43
55
  };
56
+ readonly description: "Global transformation applied to all files matching a glob pattern.";
44
57
  }>;
45
58
  export type GlobalTransform = typeof GlobalTransform.infer;
46
59
  export declare namespace GlobalTransform { }
47
60
  export declare const Transform: Schema<{
48
61
  readonly type: "union";
49
62
  readonly required: true;
50
- readonly union: [{
63
+ readonly union: readonly [{
51
64
  readonly type: "string";
52
65
  }, {
53
66
  readonly type: "object";
54
- readonly properties: {
67
+ readonly keys: {
55
68
  readonly search: {
56
69
  readonly type: "string";
57
70
  readonly required: true;
71
+ readonly description: "The regular expression pattern to search for in the file content.";
58
72
  };
59
73
  readonly flags: {
60
74
  readonly type: "string";
61
75
  readonly default: "g";
62
76
  readonly pattern: RegExp;
77
+ readonly description: "Flags applied to the regular expression search. Defaults to \"g\" (global).";
63
78
  };
64
79
  readonly replace: {
65
80
  readonly type: "string";
66
81
  readonly required: true;
82
+ readonly description: "The replacement string used to substitute the matches found by the search pattern.";
67
83
  };
68
84
  };
69
85
  }];
86
+ readonly description: "A transformation definition: either a plain string used as a regex pattern or an object with search, flags and replace options.";
70
87
  }>;
71
88
  export type Transform = typeof Transform.infer;
72
89
  export declare namespace Transform { }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Schema definitions for content transformations: search pattern, flags and replacement.
4
+ * @license Apache-2.0
5
+ */
6
+ import Schema from '@netfeez/schema';
7
+ export const TransformOptions = new Schema({
8
+ type: 'object',
9
+ keys: {
10
+ search: {
11
+ type: 'string',
12
+ required: true,
13
+ description: 'The regular expression pattern to search for in the file content.'
14
+ },
15
+ flags: {
16
+ type: 'string',
17
+ default: 'g',
18
+ pattern: /^[gimsuy]*$/,
19
+ description: 'Flags applied to the regular expression search. Defaults to "g" (global).'
20
+ },
21
+ replace: {
22
+ type: 'string',
23
+ required: true,
24
+ description: 'The replacement string used to substitute the matches found by the search pattern.'
25
+ }
26
+ }
27
+ });
28
+ export const GlobalTransform = new Schema({
29
+ type: 'object',
30
+ required: true,
31
+ keys: {
32
+ glob: {
33
+ type: 'string',
34
+ required: true,
35
+ description: 'Glob pattern matching the files to which the global transformation is applied.'
36
+ },
37
+ ...TransformOptions.definition.keys
38
+ },
39
+ description: 'Global transformation applied to all files matching a glob pattern.'
40
+ });
41
+ export const Transform = new Schema({
42
+ type: 'union',
43
+ required: true,
44
+ union: [
45
+ { type: 'string' },
46
+ TransformOptions.definition
47
+ ],
48
+ description: 'A transformation definition: either a plain string used as a regex pattern or an object with search, flags and replace options.'
49
+ });
50
+ export default Transform;
51
+ //# sourceMappingURL=Transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transform.js","sourceRoot":"","sources":["../../../src/schema/Config/Transform.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC;IACvC,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE;QACF,MAAM,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,mEAAmE;SACnF;QACD,KAAK,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,GAAG;YACZ,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,2EAA2E;SAC3F;QACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,oFAAoF;SACpG;KACJ;CACJ,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,gFAAgF;SAChG;QACD,GAAG,gBAAgB,CAAC,UAAU,CAAC,IAAI;KACtC;IACD,WAAW,EAAE,qEAAqE;CACrF,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC;IAChC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACH,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClB,gBAAgB,CAAC,UAAU;KAC9B;IACD,WAAW,EAAE,iIAAiI;CACjJ,CAAC,CAAC;AAIH,eAAe,SAAS,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Fresh default factories for the mutable collection defaults declared by the schemas.
4
+ * @license Apache-2.0
5
+ */
6
+ export declare namespace Defaults {
7
+ /**
8
+ * Materializes a brand new empty array. Used as the value of a `default` accessor, so every
9
+ * processed document receives its own array instead of sharing the one held by the schema.
10
+ * @returns A new empty array on every access.
11
+ **/
12
+ function array(): never[];
13
+ /**
14
+ * Materializes a brand new empty record. Used as the value of a `default` accessor, so every
15
+ * processed document receives its own object instead of sharing the one held by the schema.
16
+ * @returns A new empty record on every access.
17
+ **/
18
+ function record(): Record<string, never>;
19
+ }
20
+ export default Defaults;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @author NetFeez <netfeez.dev@gmail.com>.
3
+ * @description Fresh default factories for the mutable collection defaults declared by the schemas.
4
+ * @license Apache-2.0
5
+ */
6
+ export var Defaults;
7
+ (function (Defaults) {
8
+ /**
9
+ * Materializes a brand new empty array. Used as the value of a `default` accessor, so every
10
+ * processed document receives its own array instead of sharing the one held by the schema.
11
+ * @returns A new empty array on every access.
12
+ **/
13
+ function array() { return []; }
14
+ Defaults.array = array;
15
+ /**
16
+ * Materializes a brand new empty record. Used as the value of a `default` accessor, so every
17
+ * processed document receives its own object instead of sharing the one held by the schema.
18
+ * @returns A new empty record on every access.
19
+ **/
20
+ function record() { return {}; }
21
+ Defaults.record = record;
22
+ })(Defaults || (Defaults = {}));
23
+ export default Defaults;
24
+ //# sourceMappingURL=Defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Defaults.js","sourceRoot":"","sources":["../../src/schema/Defaults.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,KAAW,QAAQ,CAgBxB;AAhBD,WAAiB,QAAQ;IAErB;;;;QAII;IACJ,SAAgB,KAAK,KAAc,OAAO,EAAE,CAAC,CAAC,CAAC;IAA/B,SAAA,KAAK,QAA0B,CAAA;IAE/C;;;;QAII;IACJ,SAAgB,MAAM,KAA4B,OAAO,EAAE,CAAC,CAAC,CAAC;IAA9C,SAAA,MAAM,SAAwC,CAAA;AAElE,CAAC,EAhBgB,QAAQ,KAAR,QAAQ,QAgBxB;AAED,eAAe,QAAQ,CAAC"}