kist 0.0.0 → 0.1.30

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 (236) 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 +69 -0
  90. package/js/core/config/ConfigStore.js +168 -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.ts +201 -0
  196. package/ts/core/config/defaultConfig.ts +154 -0
  197. package/ts/core/config/index.ts +0 -0
  198. package/ts/core/index.ts +34 -0
  199. package/ts/core/pipeline/Action.ts +101 -0
  200. package/ts/core/pipeline/ActionRegistry.ts +216 -0
  201. package/ts/core/pipeline/Pipeline.ts +121 -0
  202. package/ts/core/pipeline/PipelineManager.ts +170 -0
  203. package/ts/core/pipeline/Stage.ts +131 -0
  204. package/ts/core/pipeline/Step.ts +96 -0
  205. package/ts/core/pipeline/index.ts +0 -0
  206. package/ts/core/validation/ActionValidator.ts +97 -0
  207. package/ts/core/validation/ConfigValidator.ts +103 -0
  208. package/ts/core/validation/OptionsValidator.ts +179 -0
  209. package/ts/core/validation/StageValidator.ts +175 -0
  210. package/ts/core/validation/StepValidator.ts +203 -0
  211. package/ts/core/validation/index.ts +0 -0
  212. package/ts/index.ts +26 -0
  213. package/ts/interface/ActionInterface.ts +70 -0
  214. package/ts/interface/ActionPlugin.ts +14 -0
  215. package/ts/interface/ConfigInterface.ts +55 -0
  216. package/ts/interface/File.ts +24 -0
  217. package/ts/interface/LiveOptionsInterface.ts +46 -0
  218. package/ts/interface/MetadataInterface.ts +105 -0
  219. package/ts/interface/OptionsInterface.ts +58 -0
  220. package/ts/interface/PackageJson.ts +171 -0
  221. package/ts/interface/PipelineOptionsInterface.ts +74 -0
  222. package/ts/interface/SVG.ts +84 -0
  223. package/ts/interface/StageInterface.ts +96 -0
  224. package/ts/interface/StepInterface.ts +83 -0
  225. package/ts/interface/StepOptionsInterface.ts +57 -0
  226. package/ts/interface/index.ts +9 -0
  227. package/ts/kist.ts +161 -0
  228. package/ts/live/LiveServer.ts +311 -0
  229. package/ts/live/LiveWatcher.ts +150 -0
  230. package/ts/live/index.ts +11 -0
  231. package/ts/logger/Logger.ts +187 -0
  232. package/ts/logger/LoggerStyles.ts +28 -0
  233. package/ts/logger/index.ts +0 -0
  234. package/ts/types/ActionOptionsType.ts +10 -0
  235. package/ts/types/index.ts +3 -0
  236. package/index.js +0 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Scape Agency
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,303 @@
1
- # KIST - TypeScript & SCSS Package Manager
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/getkist/brand/master/src/logo/kist.png" width="20%" height="20%" alt="kist logo"></p>
3
+ <h1 align="center" style='border-bottom: none;'>kist</h1>
4
+ <h3 align="center">Package Pipeline Processor</h3>
2
5
 
3
- KIST is a TypeScript and SCSS package manager.
6
+ <br/>
7
+
8
+ <div align="center">
9
+
10
+ [![Website](https://img.shields.io/website?url=https%3A%2F%2Fwww.kist&up_message=Up&up_color=5e4d34&down_message=Down&down_color=5e4d34&style=flat-square&logo=Firefox&logoColor=FFFFFF&label=Website&labelColor=5e4d34&color=5e4d34)
11
+ ](https://www.kist)
12
+ [![NPM Version](https://img.shields.io/npm/v/kist?style=flat-square&logo=npm&logoColor=FFFFFF&label=NPM&labelColor=5e4d34&color=5e4d34&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Fkist)](https://www.npmjs.com/package/kist)
13
+ [![devContainer](https://img.shields.io/badge/devContainer-235e4d34?style=flat-square&logo=Docker&logoColor=%23FFFFFF&labelColor=%235e4d34&color=%235e4d34)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/getkist/kist)
14
+ [![StackBlitz](https://img.shields.io/badge/StackBlitz-235e4d34?style=flat-square&logo=StackBlitz&logoColor=%23FFFFFF&labelColor=%235e4d34&color=%235e4d34)](https://stackblitz.com/github/getkist/kist/tree/main?file=src%2Findex.html)
15
+ [![GitHub License](https://img.shields.io/github/license/getkist/kist?style=flat-square&logo=readthedocs&logoColor=FFFFFF&label=&labelColor=%235e4d34&color=%235e4d34&link=LICENSE)](https://github.com/getkist/kist/blob/main/LICENSE)
16
+
17
+ </div>
18
+
19
+ <div align="center">
20
+
21
+ [![Report a Bug](https://img.shields.io/badge/Report%20a%20Bug-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23D2D9DF)](https://github.com/getkist/kist/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=bug_report.yml)
22
+ [![Request a Feature](https://img.shields.io/badge/Request%20a%20Feature-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23D2D9DF)](https://github.com/getkist/kist/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=feature_request.yml)
23
+ [![Ask a Question](https://img.shields.io/badge/Ask%20a%20Question-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23D2D9DF)](https://github.com/getkist/kist/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=question.yml)
24
+ [![Make a Suggestion](https://img.shields.io/badge/Make%20a%20Suggestion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23D2D9DF)](https://github.com/getkist/kist/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=suggestion.yml)
25
+ [![Start a Discussion](https://img.shields.io/badge/Start%20a%20Discussion-GitHub?style=flat-square&&logoColor=%23FFFFFF&color=%23D2D9DF)](https://github.com/getkist/kist/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected&projects=&template=discussion.yml)
26
+
27
+ </div>
28
+
29
+ ---
30
+
31
+ <br/>
32
+
33
+ kist is a highly customizable and efficient package builder designed to streamline software development workflows. It provides a modular framework for managing build pipelines with support for live reload functionality.
34
+
35
+ `kist` is a package builder designed to enhance the efficiency and organization of software development projects. Key to its design philosophy is the adaptability to various development workflows, making it an ideal companion for a range of projects from small-scale personal endeavors to large, complex enterprise applications. `kist` stands not just as a tool but as a partner in the software development journey, enhancing productivity, reducing overhead, and bringing clarity and ease to the package management process.
36
+
37
+ ---
38
+
39
+ ## Features
40
+
41
+ - Modular pipeline system with stages and steps.
42
+ - Live reload functionality for enhanced developer experience.
43
+ - Plugin-based architecture to extend functionality.
44
+ - TypeScript support for a modern development workflow.
45
+ - Robust error handling and logging.
46
+
47
+ ---
48
+
49
+ ## Quickstart
50
+
51
+ To install `kist`, use npm or yarn:
52
+
53
+ ### NPM
54
+
55
+ ```bash
56
+ npm install kist --save-dev
57
+ ```
58
+
59
+ ### Yarn
60
+
61
+ ```bash
62
+ yarn add kist --dev
63
+ ```
64
+
65
+ ---
4
66
 
5
67
  ## Installation
6
68
 
69
+ 1. Clone the Repository:
70
+
71
+ ```sh
72
+ git clone <https://github.com/getkist/kist.git>
73
+ cd kist
74
+ ```
75
+
76
+ 2. Install Dependencies:
77
+
78
+ ```sh
79
+ npm install
80
+ ```
81
+
82
+ 3. Build the Project:
83
+
84
+ ```sh
85
+ npm run build
86
+ ```
87
+
88
+ 4. Link the CLI Globally:
89
+
90
+ ```sh
91
+ npm link
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Usage
97
+
98
+ ### Run the Pipeline
99
+
100
+ Run the pipeline defined in your pack.yaml file:
101
+
102
+ ```sh
103
+ pack
104
+ ```
105
+
106
+ ### Enable Live Reload
107
+
108
+ Run the pipeline with live reload enabled:
109
+
110
+ ```sh
111
+ pack --live
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Configuration
117
+
118
+ The pipeline configuration is defined in a pack.yaml file located in the root of your project. Here’s an example:
119
+
120
+ ```sh
121
+ stages:
122
+
123
+ - name: build
124
+ steps:
125
+ - name: compile
126
+ action: build
127
+ options:
128
+ source: src/
129
+ output: dist/
130
+ - name: test
131
+ dependsOn: [build]
132
+ steps:
133
+ - name: run-tests
134
+ action: test
135
+ ```
136
+
137
+ Stage and Step Structure
138
+
139
+ - Stages: Define a group of steps to be executed.
140
+ - Steps: Individual tasks within a stage (e.g., compiling, testing).
141
+ - Dependencies: Stages can depend on other stages to enforce execution order.
142
+
143
+ ---
144
+
145
+ ## Development
146
+
147
+ ### Build
148
+
149
+ Compile the TypeScript files into JavaScript:
150
+
151
+ ```sh
152
+ npm run build-tsc
153
+ ```
154
+
155
+ ### Lint
156
+
157
+ Run ESLint to check for code issues:
158
+
159
+ ```sh
160
+ npm run lint
161
+ ```
162
+
163
+ ### Run Tests
164
+
165
+ Run all tests in the src/tests directory:
166
+
167
+ ```sh
168
+ npm run test
169
+ ```
170
+
171
+ ### Live Reload
172
+
173
+ To enable live reload during development, add the --live flag:
174
+
175
+ ```sh
176
+ pack --live
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Folder Structure
182
+
7
183
  ```sh
8
- npm install kist
184
+ kist/
185
+ ├── src/
186
+ │ ├── core/ # Core pipeline logic
187
+ │ ├── live/ # Live reload server and related components
188
+ │ ├── actions/ # Built-in step actions (e.g., build, test)
189
+ │ ├── tests/ # Unit tests
190
+ │ └── pack.ts # Entry point for the CLI
191
+ ├── dist/ # Compiled JavaScript output
192
+ ├── pack.yaml # Example configuration file
193
+ ├── package.json # Project metadata and dependencies
194
+ ├── tsconfig.json # TypeScript configuration
195
+ └── README.md # Project documentation
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Key Components
201
+
202
+ ### Pipeline
203
+
204
+ The Pipeline class manages the execution of stages and steps defined in the pack.yaml file.
205
+
206
+ ### LiveReloadServer
207
+
208
+ The LiveReloadServer provides live reload functionality by watching files for changes and notifying connected clients.
209
+
210
+ ### ConfigLoader
211
+
212
+ The ConfigLoader reads and validates the pipeline configuration from the pack.yaml file.
213
+
214
+ ### Actions
215
+
216
+ kist supports plugin-based actions. Default actions include:
217
+
218
+ - build: Compiles source files.
219
+ - test: Runs tests.
220
+ - lint: Lints the codebase.
221
+
222
+ Custom actions can be implemented and registered as plugins.
223
+
224
+ ```mermaid
225
+ graph TD
226
+ subgraph Pipeline
227
+ Stage1[Stage 1]
228
+ Stage2[Stage 2]
229
+ Stage3[Stage 3]
230
+ end
231
+
232
+ subgraph Stage1
233
+ Step1_1[Step 1.1]
234
+ Step1_2[Step 1.2]
235
+ end
236
+ subgraph Stage2
237
+ Step2_1[Step 2.1]
238
+ Step2_2[Step 2.2]
239
+ end
240
+ subgraph Stage3
241
+ Step3_1[Step 3.1]
242
+ Step3_2[Step 3.2]
243
+ end
244
+
245
+ Step1_1 --> Action1_1[Action: DirectoryCleanAction]
246
+ Step1_2 --> Action1_2[Action: DirectoryCopyAction]
247
+ Step2_1 --> Action2_1[Action: FileCopyAction]
248
+ Step2_2 --> Action2_2[Action: StyleProcessingAction]
249
+ Step3_1 --> Action3_1[Action: PackageManagerAction]
250
+ Step3_2 --> Action3_2[Action: VersionWriteAction]
251
+
252
+ Stage1 --> Stage2
253
+ Stage2 --> Stage3
254
+ ```
255
+
256
+ ---
257
+
258
+ ## Colophon
259
+
260
+ ### Authors
261
+
262
+ **kist** is an open-source project by **[Scape Agency](https://www.scape.agency "Scape Agency website")**.
263
+
264
+ #### Scape Agency
265
+
266
+ Scape Agency is a spatial innovation collective that dreams, discovers and designs the everyday of tomorrow. We blend design thinking with emerging technologies to create a brighter perspective for people and planet. Our products and services naturalise technology in liveable and sustainable –scapes that spark the imagination and inspire future generations.
267
+
268
+ - website: [scape.agency](https://www.scape.agency "Scape Agency website")
269
+ - github: [github.com/getkist](https://github.com/getkist "Scape Agency GitHub")
270
+
271
+ ### Development Resources
272
+
273
+ #### Contributing
274
+
275
+ We'd love for you to contribute and to make this project even better than it is today!
276
+ Please refer to the [contribution guidelines](.github/CONTRIBUTING.md) for information.
277
+
278
+ Contributions are welcome! Follow these steps to contribute:
279
+
280
+ 1. Fork the repository.
281
+ 2. Create a new feature branch.
282
+ 3. Make your changes and write tests.
283
+ 4. Submit a pull request.
284
+
285
+ ### Legal Information
286
+
287
+ #### Copyright
288
+
289
+ Copyright &copy; 2024 [Scape Agency BV](https://www.scape.agency/ "Scape Agency website"). All Rights Reserved.
290
+
291
+ #### License
292
+
293
+ Except as otherwise noted, the code in this repository is licensed under the MIT License. Also see [LICENSE](https://github.com/getkist/community/blob/master/src/LICENSE). The documentation is licensed under the [Creative Commons Attribution 4.0 International (CC BY 4.0) License](https://creativecommons.org/licenses/by/4.0/).
294
+
295
+ #### Disclaimer
296
+
297
+ **THIS SOFTWARE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
298
+
299
+ ---
300
+
301
+ <p align="center">
302
+ <b>Made with ❤️ by <a href="https://www.scape.agency" target="_blank">Scape Agency</a></b>
303
+ </p>
@@ -0,0 +1,6 @@
1
+ import { ActionInterface } from "../interface/ActionInterface";
2
+ /**
3
+ * A record of core actions, mapped by their unique `name` property.
4
+ * Automatically derives names from the action classes.
5
+ */
6
+ export declare const coreActions: Record<string, new () => ActionInterface>;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ // ============================================================================
3
+ // Import
4
+ // ============================================================================
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.coreActions = void 0;
7
+ const DirectoryCleanAction_1 = require("../actions/DirectoryCleanAction");
8
+ const DirectoryCopyAction_1 = require("../actions/DirectoryCopyAction");
9
+ const DirectoryCreateAction_1 = require("../actions/DirectoryCreateAction");
10
+ const DocumentationAction_1 = require("../actions/DocumentationAction");
11
+ const FileCopyAction_1 = require("../actions/FileCopyAction");
12
+ const FileRenameAction_1 = require("../actions/FileRenameAction");
13
+ const JavaScriptMinifyAction_1 = require("../actions/JavaScriptMinifyAction");
14
+ const LintAction_1 = require("../actions/LintAction");
15
+ const PackageManagerAction_1 = require("../actions/PackageManagerAction");
16
+ const StyleProcessingAction_1 = require("../actions/StyleProcessingAction");
17
+ const SvgPackagerAction_1 = require("../actions/SvgPackagerAction");
18
+ const SvgReaderAction_1 = require("../actions/SvgReaderAction");
19
+ const SvgSpriteAction_1 = require("../actions/SvgSpriteAction");
20
+ const SvgToPngAction_1 = require("../actions/SvgToPngAction");
21
+ const TypeScriptCompilerAction_1 = require("../actions/TypeScriptCompilerAction");
22
+ const VersionWriteAction_1 = require("../actions/VersionWriteAction");
23
+ // ============================================================================
24
+ // Core Actions
25
+ // ============================================================================
26
+ /**
27
+ * A record of core actions, mapped by their unique `name` property.
28
+ * Automatically derives names from the action classes.
29
+ */
30
+ exports.coreActions = {
31
+ [new DirectoryCleanAction_1.DirectoryCleanAction().name]: DirectoryCleanAction_1.DirectoryCleanAction,
32
+ [new DirectoryCopyAction_1.DirectoryCopyAction().name]: DirectoryCopyAction_1.DirectoryCopyAction,
33
+ [new DirectoryCreateAction_1.DirectoryCreateAction().name]: DirectoryCreateAction_1.DirectoryCreateAction,
34
+ [new DocumentationAction_1.DocumentationAction().name]: DocumentationAction_1.DocumentationAction,
35
+ [new FileCopyAction_1.FileCopyAction().name]: FileCopyAction_1.FileCopyAction,
36
+ [new FileRenameAction_1.FileRenameAction().name]: FileRenameAction_1.FileRenameAction,
37
+ [new JavaScriptMinifyAction_1.JavaScriptMinifyAction().name]: JavaScriptMinifyAction_1.JavaScriptMinifyAction,
38
+ [new LintAction_1.LintAction().name]: LintAction_1.LintAction,
39
+ [new PackageManagerAction_1.PackageManagerAction().name]: PackageManagerAction_1.PackageManagerAction,
40
+ [new StyleProcessingAction_1.StyleProcessingAction().name]: StyleProcessingAction_1.StyleProcessingAction,
41
+ [new SvgPackagerAction_1.SvgPackagerAction().name]: SvgPackagerAction_1.SvgPackagerAction,
42
+ [new SvgReaderAction_1.SvgReaderAction().name]: SvgReaderAction_1.SvgReaderAction,
43
+ [new SvgSpriteAction_1.SvgSpriteAction().name]: SvgSpriteAction_1.SvgSpriteAction,
44
+ [new SvgToPngAction_1.SvgToPngAction().name]: SvgToPngAction_1.SvgToPngAction,
45
+ [new TypeScriptCompilerAction_1.TypeScriptCompilerAction().name]: TypeScriptCompilerAction_1.TypeScriptCompilerAction,
46
+ [new VersionWriteAction_1.VersionWriteAction().name]: VersionWriteAction_1.VersionWriteAction,
47
+ };
@@ -0,0 +1,36 @@
1
+ import { Action } from "../../core/pipeline/Action";
2
+ import { ActionOptionsType } from "../../types/ActionOptionsType";
3
+ /**
4
+ * DirectoryCleanAction is a step action responsible for cleaning a directory
5
+ * by deleting all its contents while optionally retaining files and
6
+ * directories that match specified glob patterns.
7
+ */
8
+ export declare class DirectoryCleanAction extends Action {
9
+ /**
10
+ * Executes the directory cleaning action.
11
+ *
12
+ * @param options - The options specific to directory cleaning, including
13
+ * the directory path and glob patterns to retain.
14
+ * @returns A Promise that resolves when the directory has been
15
+ * successfully cleaned, or silently resolves if the directory does not
16
+ * exist.
17
+ */
18
+ execute(options: ActionOptionsType): Promise<void>;
19
+ /**
20
+ * Deletes all contents of a specified directory, excluding files and
21
+ * directories that match specified glob patterns.
22
+ *
23
+ * @param dirPath - The path to the directory to be cleaned.
24
+ * @param keepPatterns - An optional array of glob patterns for files
25
+ * and directories to retain.
26
+ * @returns A Promise that resolves when the directory has been
27
+ * successfully cleaned.
28
+ * @throws {Error} Throws an error if deleting any file or directory fails.
29
+ */
30
+ private cleanDirectoryContents;
31
+ /**
32
+ * Provides a description of the action.
33
+ * @returns A string description of the action.
34
+ */
35
+ describe(): string;
36
+ }
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ // ============================================================================
3
+ // Import
4
+ // ============================================================================
5
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DirectoryCleanAction = void 0;
19
+ const fs_1 = __importDefault(require("fs"));
20
+ const micromatch_1 = __importDefault(require("micromatch")); // For glob pattern matching
21
+ const path_1 = __importDefault(require("path"));
22
+ const Action_1 = require("../../core/pipeline/Action");
23
+ // ============================================================================
24
+ // Classes
25
+ // ============================================================================
26
+ /**
27
+ * DirectoryCleanAction is a step action responsible for cleaning a directory
28
+ * by deleting all its contents while optionally retaining files and
29
+ * directories that match specified glob patterns.
30
+ */
31
+ class DirectoryCleanAction extends Action_1.Action {
32
+ // Methods
33
+ // ========================================================================
34
+ /**
35
+ * Executes the directory cleaning action.
36
+ *
37
+ * @param options - The options specific to directory cleaning, including
38
+ * the directory path and glob patterns to retain.
39
+ * @returns A Promise that resolves when the directory has been
40
+ * successfully cleaned, or silently resolves if the directory does not
41
+ * exist.
42
+ */
43
+ execute(options) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ const dirPath = options.dirPath;
46
+ const keepPatterns = options.keep;
47
+ if (!dirPath) {
48
+ throw new Error("Missing required option: dirPath.");
49
+ }
50
+ if (!fs_1.default.existsSync(dirPath)) {
51
+ this.logWarn(`Directory does not exist, skipping: ${dirPath}`);
52
+ return; // Exit gracefully if directory does not exist
53
+ }
54
+ this.logInfo(`Cleaning directory: ${dirPath}`);
55
+ try {
56
+ yield this.cleanDirectoryContents(dirPath, keepPatterns);
57
+ this.logInfo(`Directory cleaned successfully: ${dirPath}`);
58
+ }
59
+ catch (error) {
60
+ this.logError(`Error cleaning directory "${dirPath}":`, error);
61
+ }
62
+ });
63
+ }
64
+ /**
65
+ * Deletes all contents of a specified directory, excluding files and
66
+ * directories that match specified glob patterns.
67
+ *
68
+ * @param dirPath - The path to the directory to be cleaned.
69
+ * @param keepPatterns - An optional array of glob patterns for files
70
+ * and directories to retain.
71
+ * @returns A Promise that resolves when the directory has been
72
+ * successfully cleaned.
73
+ * @throws {Error} Throws an error if deleting any file or directory fails.
74
+ */
75
+ cleanDirectoryContents(dirPath, keepPatterns) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ const files = yield fs_1.default.promises.readdir(dirPath);
78
+ for (const file of files) {
79
+ const curPath = path_1.default.join(dirPath, file);
80
+ const relativePath = path_1.default.relative(dirPath, curPath);
81
+ // Skip files/directories matching keep patterns
82
+ if (keepPatterns &&
83
+ micromatch_1.default.isMatch(relativePath, keepPatterns)) {
84
+ this.logInfo(`Skipping: ${relativePath}`);
85
+ continue;
86
+ }
87
+ try {
88
+ const stat = yield fs_1.default.promises.lstat(curPath);
89
+ if (stat.isDirectory()) {
90
+ // Recursively clean subdirectory
91
+ yield fs_1.default.promises.rmdir(curPath, { recursive: true });
92
+ this.logInfo(`Deleted directory: ${relativePath}`);
93
+ }
94
+ else {
95
+ // Delete file
96
+ yield fs_1.default.promises.unlink(curPath);
97
+ this.logInfo(`Deleted file: ${relativePath}`);
98
+ }
99
+ }
100
+ catch (error) {
101
+ this.logError(`Error deleting: ${relativePath}`, error);
102
+ }
103
+ }
104
+ });
105
+ }
106
+ /**
107
+ * Provides a description of the action.
108
+ * @returns A string description of the action.
109
+ */
110
+ describe() {
111
+ let description = `
112
+ Cleans a directory by deleting all its contents while retaining
113
+ files and directories matching specified glob patterns. If the
114
+ directory does not exist, the action will skip gracefully.
115
+ `;
116
+ return description;
117
+ }
118
+ }
119
+ exports.DirectoryCleanAction = DirectoryCleanAction;
120
+ // ============================================================================
121
+ // Export
122
+ // ============================================================================
123
+ // export default DirectoryCleanAction;
@@ -0,0 +1,2 @@
1
+ import { DirectoryCleanAction } from "./DirectoryCleanAction";
2
+ export { DirectoryCleanAction };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // ============================================================================
3
+ // Import
4
+ // ============================================================================
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DirectoryCleanAction = void 0;
7
+ const DirectoryCleanAction_1 = require("./DirectoryCleanAction");
8
+ Object.defineProperty(exports, "DirectoryCleanAction", { enumerable: true, get: function () { return DirectoryCleanAction_1.DirectoryCleanAction; } });
@@ -0,0 +1,42 @@
1
+ import { Action } from "../../core/pipeline/Action";
2
+ import { ActionOptionsType } from "../../types";
3
+ /**
4
+ * DirectoryCopyAction is a step action responsible for copying all files and
5
+ * subdirectories from one directory to another, using asynchronous operations
6
+ * for efficient handling.
7
+ */
8
+ export declare class DirectoryCopyAction extends Action {
9
+ /**
10
+ * Executes the directory copy action.
11
+ * @param options - The options specific to directory copying, including
12
+ * the source and destination paths.
13
+ * @returns A Promise that resolves when the directory contents have been
14
+ * successfully copied, or rejects with an error if the action fails.
15
+ */
16
+ execute(options: ActionOptionsType): Promise<void>;
17
+ /**
18
+ * Asynchronously copies all files and subdirectories from the source
19
+ * directory to the destination directory. If the destination directory
20
+ * does not exist, it will be created.
21
+ *
22
+ * @param srcDir - The path of the source directory.
23
+ * @param destDir - The path of the destination directory.
24
+ * @throws {Error} If any file or directory could not be copied.
25
+ */
26
+ private copyFiles;
27
+ /**
28
+ * Recursively copies files and directories from the source to the
29
+ * destination directory.
30
+ * This method creates the destination directory if it does not exist and
31
+ * recursively copies all nested files and directories.
32
+ *
33
+ * @param srcDir - Source directory.
34
+ * @param destDir - Destination directory.
35
+ */
36
+ private recursiveCopy;
37
+ /**
38
+ * Provides a description of the action.
39
+ * @returns A string description of the action.
40
+ */
41
+ describe(): string;
42
+ }