kist 0.0.0 → 0.1.31

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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +298 -3
  3. package/js/actions/CoreActions.d.ts +6 -0
  4. package/js/actions/CoreActions.js +47 -0
  5. package/js/actions/DirectoryCleanAction/DirectoryCleanAction.d.ts +36 -0
  6. package/js/actions/DirectoryCleanAction/DirectoryCleanAction.js +123 -0
  7. package/js/actions/DirectoryCleanAction/index.d.ts +2 -0
  8. package/js/actions/DirectoryCleanAction/index.js +8 -0
  9. package/js/actions/DirectoryCopyAction/DirectoryCopyAction.d.ts +42 -0
  10. package/js/actions/DirectoryCopyAction/DirectoryCopyAction.js +118 -0
  11. package/js/actions/DirectoryCopyAction/index.d.ts +2 -0
  12. package/js/actions/DirectoryCopyAction/index.js +8 -0
  13. package/js/actions/DirectoryCreateAction/DirectoryCreateAction.d.ts +30 -0
  14. package/js/actions/DirectoryCreateAction/DirectoryCreateAction.js +85 -0
  15. package/js/actions/DirectoryCreateAction/index.d.ts +2 -0
  16. package/js/actions/DirectoryCreateAction/index.js +8 -0
  17. package/js/actions/DocumentationAction/DocumentationAction.d.ts +23 -0
  18. package/js/actions/DocumentationAction/DocumentationAction.js +88 -0
  19. package/js/actions/DocumentationAction/index.d.ts +2 -0
  20. package/js/actions/DocumentationAction/index.js +8 -0
  21. package/js/actions/FileCopyAction/FileCopyAction.d.ts +42 -0
  22. package/js/actions/FileCopyAction/FileCopyAction.js +127 -0
  23. package/js/actions/FileCopyAction/index.d.ts +2 -0
  24. package/js/actions/FileCopyAction/index.js +8 -0
  25. package/js/actions/FileRenameAction/FileRenameAction.d.ts +30 -0
  26. package/js/actions/FileRenameAction/FileRenameAction.js +84 -0
  27. package/js/actions/FileRenameAction/index.d.ts +2 -0
  28. package/js/actions/FileRenameAction/index.js +8 -0
  29. package/js/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.d.ts +31 -0
  30. package/js/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.js +98 -0
  31. package/js/actions/JavaScriptMinifyAction/index.d.ts +2 -0
  32. package/js/actions/JavaScriptMinifyAction/index.js +8 -0
  33. package/js/actions/JavaScriptMinifyAction/terser.config.d.ts +27 -0
  34. package/js/actions/JavaScriptMinifyAction/terser.config.js +119 -0
  35. package/js/actions/LintAction/LintAction.d.ts +17 -0
  36. package/js/actions/LintAction/LintAction.js +63 -0
  37. package/js/actions/LintAction/index.d.ts +2 -0
  38. package/js/actions/LintAction/index.js +8 -0
  39. package/js/actions/PackageManagerAction/PackageManagerAction.d.ts +57 -0
  40. package/js/actions/PackageManagerAction/PackageManagerAction.js +161 -0
  41. package/js/actions/PackageManagerAction/index.d.ts +2 -0
  42. package/js/actions/PackageManagerAction/index.js +8 -0
  43. package/js/actions/PackageManagerAction/package.config.d.ts +16 -0
  44. package/js/actions/PackageManagerAction/package.config.js +91 -0
  45. package/js/actions/StyleProcessingAction/StyleProcessingAction.d.ts +34 -0
  46. package/js/actions/StyleProcessingAction/StyleProcessingAction.js +164 -0
  47. package/js/actions/StyleProcessingAction/index.d.ts +2 -0
  48. package/js/actions/StyleProcessingAction/index.js +8 -0
  49. package/js/actions/StyleProcessingAction/postcss.config.compressed.d.ts +10 -0
  50. package/js/actions/StyleProcessingAction/postcss.config.compressed.js +31 -0
  51. package/js/actions/StyleProcessingAction/postcss.config.expanded.d.ts +16 -0
  52. package/js/actions/StyleProcessingAction/postcss.config.expanded.js +45 -0
  53. package/js/actions/SvgPackagerAction/SvgPackagerAction.d.ts +68 -0
  54. package/js/actions/SvgPackagerAction/SvgPackagerAction.js +186 -0
  55. package/js/actions/SvgPackagerAction/index.d.ts +2 -0
  56. package/js/actions/SvgPackagerAction/index.js +8 -0
  57. package/js/actions/SvgReaderAction/SvgReaderAction.d.ts +32 -0
  58. package/js/actions/SvgReaderAction/SvgReaderAction.js +87 -0
  59. package/js/actions/SvgReaderAction/index.d.ts +2 -0
  60. package/js/actions/SvgReaderAction/index.js +8 -0
  61. package/js/actions/SvgSpriteAction/SvgSpriteAction.d.ts +37 -0
  62. package/js/actions/SvgSpriteAction/SvgSpriteAction.js +114 -0
  63. package/js/actions/SvgSpriteAction/index.d.ts +2 -0
  64. package/js/actions/SvgSpriteAction/index.js +8 -0
  65. package/js/actions/SvgSpriteAction/svgsprite.config.d.ts +3 -0
  66. package/js/actions/SvgSpriteAction/svgsprite.config.js +117 -0
  67. package/js/actions/SvgToPngAction/SvgToPngAction.d.ts +28 -0
  68. package/js/actions/SvgToPngAction/SvgToPngAction.js +108 -0
  69. package/js/actions/SvgToPngAction/index.d.ts +2 -0
  70. package/js/actions/SvgToPngAction/index.js +8 -0
  71. package/js/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.d.ts +28 -0
  72. package/js/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.js +96 -0
  73. package/js/actions/TypeScriptCompilerAction/index.d.ts +2 -0
  74. package/js/actions/TypeScriptCompilerAction/index.js +8 -0
  75. package/js/actions/VersionWriteAction/VersionWriteAction.d.ts +45 -0
  76. package/js/actions/VersionWriteAction/VersionWriteAction.js +147 -0
  77. package/js/actions/VersionWriteAction/index.d.ts +2 -0
  78. package/js/actions/VersionWriteAction/index.js +8 -0
  79. package/js/cli/ArgumentParser.d.ts +62 -0
  80. package/js/cli/ArgumentParser.js +118 -0
  81. package/js/cli.d.ts +6 -0
  82. package/js/cli.js +58 -0
  83. package/js/core/abstract/AbstractProcess.d.ts +62 -0
  84. package/js/core/abstract/AbstractProcess.js +96 -0
  85. package/js/core/abstract/AbstractValidator.d.ts +72 -0
  86. package/js/core/abstract/AbstractValidator.js +128 -0
  87. package/js/core/config/ConfigLoader.d.ts +47 -0
  88. package/js/core/config/ConfigLoader.js +130 -0
  89. package/js/core/config/ConfigStore.d.ts +53 -0
  90. package/js/core/config/ConfigStore.js +136 -0
  91. package/js/core/config/defaultConfig.d.ts +5 -0
  92. package/js/core/config/defaultConfig.js +131 -0
  93. package/js/core/pipeline/Action.d.ts +60 -0
  94. package/js/core/pipeline/Action.js +77 -0
  95. package/js/core/pipeline/ActionRegistry.d.ts +80 -0
  96. package/js/core/pipeline/ActionRegistry.js +180 -0
  97. package/js/core/pipeline/Pipeline.d.ts +42 -0
  98. package/js/core/pipeline/Pipeline.js +107 -0
  99. package/js/core/pipeline/PipelineManager.d.ts +55 -0
  100. package/js/core/pipeline/PipelineManager.js +164 -0
  101. package/js/core/pipeline/Stage.d.ts +45 -0
  102. package/js/core/pipeline/Stage.js +110 -0
  103. package/js/core/pipeline/Step.d.ts +26 -0
  104. package/js/core/pipeline/Step.js +85 -0
  105. package/js/core/validation/OptionsValidator.d.ts +43 -0
  106. package/js/core/validation/OptionsValidator.js +123 -0
  107. package/js/index.d.ts +3 -0
  108. package/js/index.js +36 -0
  109. package/js/interface/ActionInterface.d.ts +57 -0
  110. package/js/interface/ActionInterface.js +5 -0
  111. package/js/interface/ActionPlugin.d.ts +4 -0
  112. package/js/interface/ActionPlugin.js +5 -0
  113. package/js/interface/ConfigInterface.d.ts +43 -0
  114. package/js/interface/ConfigInterface.js +5 -0
  115. package/js/interface/LiveOptionsInterface.d.ts +42 -0
  116. package/js/interface/LiveOptionsInterface.js +2 -0
  117. package/js/interface/MetadataInterface.d.ts +95 -0
  118. package/js/interface/MetadataInterface.js +2 -0
  119. package/js/interface/OptionsInterface.d.ts +45 -0
  120. package/js/interface/OptionsInterface.js +5 -0
  121. package/js/interface/PipelineOptionsInterface.d.ts +66 -0
  122. package/js/interface/PipelineOptionsInterface.js +5 -0
  123. package/js/interface/StageInterface.d.ts +79 -0
  124. package/js/interface/StageInterface.js +5 -0
  125. package/js/interface/StepInterface.d.ts +66 -0
  126. package/js/interface/StepInterface.js +5 -0
  127. package/js/interface/StepOptionsInterface.d.ts +38 -0
  128. package/js/interface/StepOptionsInterface.js +21 -0
  129. package/js/interface/index.d.ts +7 -0
  130. package/js/interface/index.js +3 -0
  131. package/js/kist.d.ts +58 -0
  132. package/js/kist.js +145 -0
  133. package/js/live/LiveServer.d.ts +95 -0
  134. package/js/live/LiveServer.js +233 -0
  135. package/js/live/LiveWatcher.d.ts +45 -0
  136. package/js/live/LiveWatcher.js +140 -0
  137. package/js/logger/Logger.d.ts +94 -0
  138. package/js/logger/Logger.js +151 -0
  139. package/js/logger/LoggerStyles.d.ts +23 -0
  140. package/js/logger/LoggerStyles.js +30 -0
  141. package/js/types/ActionOptionsType.d.ts +8 -0
  142. package/js/types/ActionOptionsType.js +2 -0
  143. package/js/types/index.d.ts +1 -0
  144. package/js/types/index.js +3 -0
  145. package/package.json +93 -7
  146. package/ts/actions/CoreActions.ts +64 -0
  147. package/ts/actions/DirectoryCleanAction/DirectoryCleanAction.ts +121 -0
  148. package/ts/actions/DirectoryCleanAction/index.ts +11 -0
  149. package/ts/actions/DirectoryCopyAction/DirectoryCopyAction.ts +118 -0
  150. package/ts/actions/DirectoryCopyAction/index.ts +11 -0
  151. package/ts/actions/DirectoryCreateAction/DirectoryCreateAction.ts +81 -0
  152. package/ts/actions/DirectoryCreateAction/index.ts +11 -0
  153. package/ts/actions/DocumentationAction/DocumentationAction.ts +100 -0
  154. package/ts/actions/DocumentationAction/index.ts +11 -0
  155. package/ts/actions/FileCopyAction/FileCopyAction.ts +125 -0
  156. package/ts/actions/FileCopyAction/index.ts +11 -0
  157. package/ts/actions/FileRenameAction/FileRenameAction.ts +82 -0
  158. package/ts/actions/FileRenameAction/index.ts +11 -0
  159. package/ts/actions/JavaScriptMinifyAction/JavaScriptMinifyAction.ts +109 -0
  160. package/ts/actions/JavaScriptMinifyAction/index.ts +11 -0
  161. package/ts/actions/JavaScriptMinifyAction/terser.config.ts +177 -0
  162. package/ts/actions/LintAction/LintAction.ts +67 -0
  163. package/ts/actions/LintAction/index.ts +11 -0
  164. package/ts/actions/PackageManagerAction/PackageManagerAction.ts +176 -0
  165. package/ts/actions/PackageManagerAction/index.ts +11 -0
  166. package/ts/actions/PackageManagerAction/package.config.ts +94 -0
  167. package/ts/actions/SassDocAction/SassDocAction.ts +66 -0
  168. package/ts/actions/SassDocAction/index.ts +11 -0
  169. package/ts/actions/StyleProcessingAction/StyleProcessingAction.ts +142 -0
  170. package/ts/actions/StyleProcessingAction/index.ts +11 -0
  171. package/ts/actions/StyleProcessingAction/postcss.config.compressed.ts +31 -0
  172. package/ts/actions/StyleProcessingAction/postcss.config.expanded.ts +47 -0
  173. package/ts/actions/SvgPackagerAction/SvgPackagerAction.ts +187 -0
  174. package/ts/actions/SvgPackagerAction/index.ts +11 -0
  175. package/ts/actions/SvgReaderAction/SvgReaderAction.ts +77 -0
  176. package/ts/actions/SvgReaderAction/index.ts +11 -0
  177. package/ts/actions/SvgSpriteAction/SvgSpriteAction.ts +127 -0
  178. package/ts/actions/SvgSpriteAction/index.ts +11 -0
  179. package/ts/actions/SvgSpriteAction/svgsprite.config.ts +123 -0
  180. package/ts/actions/SvgToPngAction/SvgToPngAction.ts +113 -0
  181. package/ts/actions/SvgToPngAction/index.ts +11 -0
  182. package/ts/actions/TypeScriptCompilerAction/TypeScriptCompilerAction.ts +117 -0
  183. package/ts/actions/TypeScriptCompilerAction/index.ts +11 -0
  184. package/ts/actions/VersionWriteAction/VersionWriteAction.ts +174 -0
  185. package/ts/actions/VersionWriteAction/index.ts +11 -0
  186. package/ts/actions/index.ts +0 -0
  187. package/ts/cli/ArgumentParser.ts +150 -0
  188. package/ts/cli/index.ts +1 -0
  189. package/ts/cli.ts +56 -0
  190. package/ts/core/abstract/AbstractProcess.ts +109 -0
  191. package/ts/core/abstract/AbstractSingleton.ts +46 -0
  192. package/ts/core/abstract/AbstractValidator.ts +167 -0
  193. package/ts/core/abstract/index.ts +0 -0
  194. package/ts/core/config/ConfigLoader.ts +141 -0
  195. package/ts/core/config/ConfigStore copy.ts +201 -0
  196. package/ts/core/config/ConfigStore.ts +157 -0
  197. package/ts/core/config/defaultConfig.ts +154 -0
  198. package/ts/core/config/index.ts +0 -0
  199. package/ts/core/index.ts +34 -0
  200. package/ts/core/pipeline/Action.ts +101 -0
  201. package/ts/core/pipeline/ActionRegistry.ts +216 -0
  202. package/ts/core/pipeline/Pipeline.ts +121 -0
  203. package/ts/core/pipeline/PipelineManager.ts +170 -0
  204. package/ts/core/pipeline/Stage.ts +131 -0
  205. package/ts/core/pipeline/Step.ts +96 -0
  206. package/ts/core/pipeline/index.ts +0 -0
  207. package/ts/core/validation/ActionValidator.ts +97 -0
  208. package/ts/core/validation/ConfigValidator.ts +103 -0
  209. package/ts/core/validation/OptionsValidator.ts +179 -0
  210. package/ts/core/validation/StageValidator.ts +175 -0
  211. package/ts/core/validation/StepValidator.ts +203 -0
  212. package/ts/core/validation/index.ts +0 -0
  213. package/ts/index.ts +26 -0
  214. package/ts/interface/ActionInterface.ts +70 -0
  215. package/ts/interface/ActionPlugin.ts +14 -0
  216. package/ts/interface/ConfigInterface.ts +55 -0
  217. package/ts/interface/File.ts +24 -0
  218. package/ts/interface/LiveOptionsInterface.ts +46 -0
  219. package/ts/interface/MetadataInterface.ts +105 -0
  220. package/ts/interface/OptionsInterface.ts +58 -0
  221. package/ts/interface/PackageJson.ts +171 -0
  222. package/ts/interface/PipelineOptionsInterface.ts +74 -0
  223. package/ts/interface/SVG.ts +84 -0
  224. package/ts/interface/StageInterface.ts +96 -0
  225. package/ts/interface/StepInterface.ts +83 -0
  226. package/ts/interface/StepOptionsInterface.ts +57 -0
  227. package/ts/interface/index.ts +9 -0
  228. package/ts/kist.ts +161 -0
  229. package/ts/live/LiveServer.ts +311 -0
  230. package/ts/live/LiveWatcher.ts +150 -0
  231. package/ts/live/index.ts +11 -0
  232. package/ts/logger/Logger.ts +187 -0
  233. package/ts/logger/LoggerStyles.ts +28 -0
  234. package/ts/logger/index.ts +0 -0
  235. package/ts/types/ActionOptionsType.ts +10 -0
  236. package/ts/types/index.ts +3 -0
  237. package/index.js +0 -3
@@ -0,0 +1,171 @@
1
+ // ============================================================================
2
+ // Import
3
+ // ============================================================================
4
+
5
+ // import { Record, string, optional, array, union } from 'runtypes';
6
+
7
+ // ============================================================================
8
+ // Interfaces
9
+ // ============================================================================
10
+
11
+ /**
12
+ * TypeScript interface describing the structure of a package.json file.
13
+ * This interface includes all standard fields used by npm, as well as common
14
+ * fields used by related tools like Yarn, and can be extended with custom
15
+ * fields as needed.
16
+ */
17
+ export interface PackageJson {
18
+ // The name of the package.
19
+ name: string;
20
+
21
+ // The version of the package.
22
+ version: string;
23
+
24
+ // A brief description of the package.
25
+ description?: string;
26
+
27
+ // The entry point for the package.
28
+ main?: string;
29
+
30
+ // Scripts that can be executed with npm/yarn.
31
+ scripts?: Record<string, string>;
32
+
33
+ // Production dependencies of the package.
34
+ dependencies?: Record<string, string>;
35
+
36
+ // Development dependencies of the package.
37
+ devDependencies?: Record<string, string>;
38
+
39
+ // Repository information for the package.
40
+ repository?: {
41
+ type: string;
42
+ url: string;
43
+ };
44
+
45
+ // Keywords associated with the package.
46
+ keywords?: string[];
47
+
48
+ // The author of the package.
49
+ author?:
50
+ | string
51
+ | {
52
+ name: string;
53
+ email?: string;
54
+ url?: string;
55
+ };
56
+
57
+ // The license under which the package is provided.
58
+ license?: string;
59
+
60
+ // Links to the package bug tracker.
61
+ bugs?: {
62
+ url?: string;
63
+ email?: string;
64
+ };
65
+
66
+ // The URL to the homepage of the package.
67
+ homepage?: string;
68
+
69
+ // Indicates if the package should be published.
70
+ private?: boolean;
71
+
72
+ // Peer dependencies of the package.
73
+ peerDependencies?: Record<string, string>;
74
+
75
+ // Engine requirements for the package.
76
+ engines?: {
77
+ node?: string;
78
+ npm?: string;
79
+ };
80
+
81
+ // Executable files included with the package.
82
+ bin?: Record<string, string>;
83
+
84
+ // Path to the TypeScript declaration files.
85
+ types?: string;
86
+
87
+ // Other contributors to the package.
88
+ contributors?: Array<
89
+ | string
90
+ | {
91
+ name: string;
92
+ email?: string;
93
+ url?: string;
94
+ }
95
+ >;
96
+
97
+ // Funding information for the package.
98
+ funding?:
99
+ | string
100
+ | {
101
+ type: string;
102
+ url: string;
103
+ };
104
+
105
+ // An array of file patterns included in the package.
106
+ files?: string[];
107
+
108
+ // Target browsers/environments for tools like Babel.
109
+ browserslist?: string[] | Record<string, string[]>;
110
+
111
+ // Configuration for publishing the package.
112
+ publishConfig?: Record<string, any>;
113
+
114
+ // Configuration parameters used in scripts.
115
+ config?: Record<string, any>;
116
+
117
+ // Alternative to "types", path to TypeScript declaration files.
118
+ typings?: string;
119
+
120
+ // Define export map for submodules and conditions.
121
+ exports?: Record<string, any>;
122
+
123
+ // Specify an ES module entry point.
124
+ module?: string;
125
+
126
+ // Indicate which modules in the package have side effects.
127
+ sideEffects?: boolean | string[];
128
+
129
+ // Optional dependencies.
130
+ optionalDependencies?: Record<string, string>;
131
+
132
+ // Dependencies to be bundled with the package.
133
+ bundledDependencies?: string[];
134
+
135
+ // Metadata for peer dependencies.
136
+ peerDependenciesMeta?: Record<string, { optional?: boolean }>;
137
+
138
+ // Dependency resolution hints for yarn.
139
+ resolutions?: Record<string, string>;
140
+
141
+ // Workspace configuration for managing multiple packages.
142
+ workspaces?:
143
+ | string[]
144
+ | {
145
+ packages: string[];
146
+ };
147
+
148
+ // ESLint configuration embedded in package.json.
149
+ eslintConfig?: Record<string, any>;
150
+
151
+ // Babel configuration embedded in package.json.
152
+ babel?: Record<string, any>;
153
+
154
+ // Prettier configuration embedded in package.json.
155
+ prettier?: Record<string, any>;
156
+
157
+ // Husky configuration for Git hooks.
158
+ husky?: Record<string, any>;
159
+
160
+ // Jest configuration for unit tests.
161
+ jest?: Record<string, any>;
162
+
163
+ // Enforce engine requirements strictly.
164
+ enginesStrict?: boolean;
165
+
166
+ // Specify OS compatibility.
167
+ os?: string[];
168
+
169
+ // Specify CPU architecture compatibility.
170
+ cpu?: string[];
171
+ }
@@ -0,0 +1,74 @@
1
+ // ============================================================================
2
+ // Interfaces
3
+ // ============================================================================
4
+
5
+ /**
6
+ * PipelineOptionsInterface defines settings for managing the pipeline's
7
+ * execution behavior, including timeouts, failure handling, concurrency,
8
+ * and retry strategies.
9
+ */
10
+ export interface PipelineOptionsInterface {
11
+ /**
12
+ * Default timeout in milliseconds for each step within the pipeline.
13
+ *
14
+ * If a step exceeds this duration, it will be forcibly terminated to
15
+ * prevent blocking the pipeline. This setting helps manage steps that
16
+ * might hang or take longer than expected.
17
+ *
18
+ * @default 30000
19
+ * @example 15000
20
+ */
21
+ stepTimeout?: number;
22
+
23
+ /**
24
+ * Specifies whether to halt the entire pipeline if a step fails.
25
+ * - true: The pipeline will stop execution immediately upon encountering
26
+ * a failed step.
27
+ * - false: The pipeline will continue executing subsequent steps and
28
+ * stages despite errors.
29
+ *
30
+ * Default is true (halt on failure), ensuring the pipeline stops at the
31
+ * first sign of trouble.
32
+ *
33
+ * @default true
34
+ */
35
+ haltOnFailure?: boolean;
36
+
37
+ /**
38
+ * Specifies the maximum number of concurrent stages allowed to run in
39
+ * parallel. This setting controls resource usage and can help prevent
40
+ * overloading the system.
41
+ *
42
+ * - `0` or `undefined`: No limit, all stages run in parallel (as allowed
43
+ * by their dependencies).
44
+ * - A positive integer: Limits the number of stages that can run
45
+ * simultaneously.
46
+ *
47
+ * @default undefined
48
+ */
49
+ maxConcurrentStages?: number;
50
+
51
+ /**
52
+ * Specifies a retry strategy for steps that fail.
53
+ *
54
+ * - `retries`: Number of retry attempts before marking a step as failed.
55
+ * - `delay`: Time in milliseconds between retry attempts.
56
+ *
57
+ * This allows automatic retries for temporary failures, improving
58
+ * pipeline robustness.
59
+ *
60
+ * @default { retries: 0, delay: 0 }
61
+ * @example { retries: 3, delay: 1000 }
62
+ */
63
+ retryStrategy?: {
64
+ /**
65
+ * Number of retry attempts before marking a step as failed.
66
+ */
67
+ retries: number;
68
+
69
+ /**
70
+ * Time in milliseconds between retry attempts.
71
+ */
72
+ delay: number;
73
+ };
74
+ }
@@ -0,0 +1,84 @@
1
+ // ============================================================================
2
+ // Interfaces
3
+ // ============================================================================
4
+
5
+ // export interface Svg {
6
+ // metadata: {
7
+ // name: string;
8
+ // // ... other metadata properties
9
+ // };
10
+ // source: string;
11
+ // // ... other Svg properties
12
+ // }
13
+
14
+ /**
15
+ * Represents the metadata associated with an SVG graphic.
16
+ */
17
+ interface SvgMetadata {
18
+ // The name of the SVG graphic.
19
+ name: string;
20
+ // Optional creator of the SVG graphic.
21
+ creator?: string;
22
+ // Optional description of the SVG graphic.
23
+ description?: string;
24
+ // Optional license information for the SVG graphic.
25
+ license?: string;
26
+ }
27
+
28
+ /**
29
+ * Represents an SVG (Scalable Vector Graphics) object.
30
+ */
31
+ export interface Svg {
32
+ // Metadata associated with the SVG.
33
+ metadata: SvgMetadata;
34
+ // The SVG content as a string.
35
+ source: string;
36
+ // Optional width of the SVG graphic.
37
+ width?: number;
38
+ // Optional height of the SVG graphic.
39
+ height?: number;
40
+ // Optional 'viewBox' attribute that defines the position and dimension,
41
+ // in user space, of an SVG viewport.
42
+ viewBox?: string;
43
+ // Optional array of path data (for more detailed manipulation or data
44
+ // extraction).
45
+ paths?: SvgPath[];
46
+ }
47
+
48
+ /**
49
+ * Represents the path element within an SVG, detailing its specific properties.
50
+ */
51
+ interface SvgPath {
52
+ // Path data (the "d" attribute).
53
+ d: string;
54
+ // Optional fill color.
55
+ fill?: string;
56
+ // Optional stroke color.
57
+ stroke?: string;
58
+ // Optional stroke width.
59
+ strokeWidth?: number;
60
+ }
61
+
62
+ /**
63
+ * Example usage of the Svg interface.
64
+ */
65
+ const exampleSvg: Svg = {
66
+ metadata: {
67
+ name: "Example SVG",
68
+ creator: "Example Creator",
69
+ description: "A sample SVG file",
70
+ license: "MIT",
71
+ },
72
+ source: '<svg width="100" height="100">...</svg>',
73
+ width: 100,
74
+ height: 100,
75
+ viewBox: "0 0 100 100",
76
+ paths: [
77
+ {
78
+ d: "M10 10 H 90 V 90 H 10 L 10 10",
79
+ fill: "none",
80
+ stroke: "black",
81
+ strokeWidth: 2,
82
+ },
83
+ ],
84
+ };
@@ -0,0 +1,96 @@
1
+ // ============================================================================
2
+ // Import
3
+ // ============================================================================
4
+
5
+ import { StepInterface } from "./StepInterface";
6
+
7
+ // ============================================================================
8
+ // Interfaces
9
+ // ============================================================================
10
+
11
+ /**
12
+ * StageInterface represents a stage in the packaging pipeline, consisting of
13
+ * multiple steps. Each stage serves as a logical grouping of related steps,
14
+ * providing a structured way to organize the pipeline execution flow. Stages
15
+ * can have dependencies on other stages, allowing for complex sequencing of
16
+ * actions within the pipeline.
17
+ */
18
+ export interface StageInterface {
19
+ /**
20
+ * A unique identifier for the stage, used for logging, tracking, and
21
+ * reporting purposes. The name should be descriptive enough to clearly
22
+ * convey the purpose of the stage.
23
+ */
24
+ name: string;
25
+
26
+ /**
27
+ * An ordered array of steps that comprise the stage.
28
+ * Steps are executed consecutively within the stage, following the order
29
+ * they are defined in. Each step is expected to implement the
30
+ * StepInterface, providing specific actions to be performed.
31
+ */
32
+ steps: StepInterface[];
33
+
34
+ /**
35
+ * An optional list of stage names that this stage depends on.
36
+ * The current stage will not begin execution until all specified dependent
37
+ * stages have completed successfully. This allows for orchestrating
38
+ * complex dependencies and ensuring proper sequencing of stages in the
39
+ * pipeline.
40
+ */
41
+ dependsOn?: string[];
42
+
43
+ /**
44
+ * An optional description of the stage, providing additional context and
45
+ * details about what the stage is intended to accomplish. Useful for
46
+ * documentation, logging, and understanding the overall pipeline flow.
47
+ */
48
+ description?: string;
49
+
50
+ /**
51
+ * An optional flag to control whether the stage should be executed.
52
+ * This can be used to conditionally skip stages based on dynamic criteria,
53
+ * such as environment settings or previous results.
54
+ * Default is true (stage will be executed).
55
+ */
56
+ enabled?: boolean;
57
+
58
+ /**
59
+ * Optional timeout for the entire stage, specified in milliseconds.
60
+ * If the stage exceeds this duration, it will be forcibly terminated to
61
+ * prevent blocking the pipeline indefinitely. Helps manage long-running
62
+ * stages and ensures the pipeline maintains predictable execution times.
63
+ */
64
+ timeout?: number;
65
+
66
+ /**
67
+ * Priority level for the stage, used to influence execution order in
68
+ * concurrent scenarios. Higher priority stages may execute before lower
69
+ * priority ones when multiple stages are eligible to run simultaneously.
70
+ * Default: `'normal'`.
71
+ * - `'low'`: Lower execution priority.
72
+ * - `'normal'`: Default execution priority.
73
+ * - `'high'`: Higher execution priority.
74
+ */
75
+ priority?: "low" | "normal" | "high";
76
+
77
+ /**
78
+ * Optional tags to attach metadata or labels to the stage. Tags can be
79
+ * used for filtering, reporting, or integration with external tools that
80
+ * require context or categorization.
81
+ */
82
+ tags?: Record<string, string>;
83
+
84
+ /**
85
+ * Optional hooks that allow custom logic to be executed before or after
86
+ * the stage.
87
+ * Useful for injecting custom behavior or performing additional
88
+ * setup/cleanup tasks.
89
+ * - `before`: Function to run before the stage starts.
90
+ * - `after`: Function to run after the stage completes.
91
+ */
92
+ hooks?: {
93
+ before?: () => Promise<void> | void;
94
+ after?: () => Promise<void> | void;
95
+ };
96
+ }
@@ -0,0 +1,83 @@
1
+ // ============================================================================
2
+ // Import
3
+ // ============================================================================
4
+
5
+ import { ActionInterface } from "./ActionInterface";
6
+ import { StepOptionsInterface } from "./StepOptionsInterface";
7
+
8
+ // ============================================================================
9
+ // Interfaces
10
+ // ============================================================================
11
+
12
+ /**
13
+ * StepInterface defines a single executable unit within a pipeline stage.
14
+ * Each step encapsulates a specific action to be performed, along with
15
+ * configuration options that tailor its behavior. Steps are executed in
16
+ * sequence within their respective stages.
17
+ */
18
+ export interface StepInterface {
19
+ /**
20
+ * A unique identifier for the step, used for logging, debugging, and
21
+ * reporting. This name should be descriptive and clearly indicate the
22
+ * purpose of the step.
23
+ */
24
+ name: string;
25
+
26
+ /**
27
+ * The action that this step will perform, represented by a class
28
+ * implementing the ActionInterface. This action defines the core
29
+ * functionality of the step, such as building, testing, or deploying.
30
+ * The action is responsible for executing the main logic associated with
31
+ * the step.
32
+ */
33
+ action: ActionInterface;
34
+ // action: string; // Name of the action to perform (matches registry).
35
+
36
+ /**
37
+ * Optional configuration options specific to the step.
38
+ * These options allow customization of the step's behavior, providing
39
+ * flexibility to adapt the action to different contexts or requirements.
40
+ * For example, build steps might accept options for minification or target
41
+ * environments.
42
+ */
43
+ options?: StepOptionsInterface;
44
+
45
+ /**
46
+ * An optional flag to enable or disable this step dynamically.
47
+ * - `true`: Step will be executed (default behavior).
48
+ * - `false`: Step will be skipped during execution.
49
+ */
50
+ enabled?: boolean;
51
+
52
+ /**
53
+ * Optional timeout for this step, specified in milliseconds.
54
+ * If the step exceeds this duration, it will be forcibly terminated,
55
+ * ensuring the pipeline remains predictable and responsive.
56
+ */
57
+ timeout?: number;
58
+
59
+ /**
60
+ * An optional description providing additional context or details about
61
+ * the step. Useful for documentation, reporting, or explaining the
62
+ * purpose of the step to maintainers.
63
+ */
64
+ description?: string;
65
+
66
+ /**
67
+ * An optional set of tags to provide metadata for the step.
68
+ * Tags can be used for logging, filtering, or integrating with external
69
+ * tools and systems that require context.
70
+ */
71
+ tags?: Record<string, string>;
72
+
73
+ /**
74
+ * Optional hooks to execute custom logic before or after the step.
75
+ * Hooks can be used for additional setup, teardown, or condition checks.
76
+ * - `before`: Function executed before the step runs.
77
+ * - `after`: Function executed after the step completes.
78
+ */
79
+ hooks?: {
80
+ before?: () => Promise<void> | void;
81
+ after?: () => Promise<void> | void;
82
+ };
83
+ }
@@ -0,0 +1,57 @@
1
+ // ============================================================================
2
+ // Interfaces
3
+ // ============================================================================
4
+
5
+ /**
6
+ * StepOptionsInterface represents the configuration options for a step,
7
+ * allowing customization of the step's behavior through specific parameters
8
+ * and settings. This interface can be extended for action-specific options,
9
+ * providing type safety and clarity for different configurations used within
10
+ * the packaging pipeline.
11
+ */
12
+ export interface StepOptionsInterface {
13
+ /**
14
+ * An optional description of the step, useful for logging, debugging, and
15
+ * reporting. This provides additional context about the step's purpose and
16
+ * configuration.
17
+ */
18
+ description?: string;
19
+
20
+ /**
21
+ * Specifies whether the step should be enabled or skipped.
22
+ * This can be used to conditionally execute steps based on dynamic
23
+ * criteria.
24
+ * Default is true (enabled).
25
+ */
26
+ enabled?: boolean;
27
+
28
+ /**
29
+ * A flexible map of key-value pairs representing configuration settings
30
+ * specific to the step. Each action can define its own expected structure
31
+ * for these options, enabling fine-grained control.
32
+ *
33
+ * Examples:
34
+ * - Build step: `{ minify: true, target: 'es6', sourceMap: false }`
35
+ * - Test step: `{ framework: 'jest', coverage: true, timeout: 3000 }`
36
+ *
37
+ * This generic structure ensures compatibility with a wide range of use cases.
38
+ */
39
+ // [key: string]: unknown; // Generic key-value pairs to support diverse options.
40
+ }
41
+
42
+ /**
43
+ * Recommendations for Extending StepOptionsInterface:
44
+ * - For specific actions, extend `StepOptionsInterface` to add detailed types
45
+ * and enforce stricter validation.
46
+ *
47
+ * Example:
48
+ * ```typescript
49
+ * export interface BuildStepOptions extends StepOptionsInterface {
50
+ * minify?: boolean;
51
+ * target?: 'es5' | 'es6' | 'es2020';
52
+ * sourceMap?: boolean;
53
+ * }
54
+ * ```
55
+ *
56
+ * This approach ensures type safety while maintaining flexibility for general steps.
57
+ */
@@ -0,0 +1,9 @@
1
+ // Exporting all interfaces from the interfaces directory
2
+
3
+ export { ActionInterface } from "./ActionInterface";
4
+ export { ConfigInterface } from "./ConfigInterface";
5
+ export { LiveOptionsInterface } from "./LiveOptionsInterface";
6
+ export { OptionsInterface } from "./OptionsInterface";
7
+ export { StageInterface } from "./StageInterface";
8
+ export { StepInterface } from "./StepInterface";
9
+ export { StepOptionsInterface } from "./StepOptionsInterface";