@shell-shock/core 0.2.0 → 0.3.0

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 (154) hide show
  1. package/README.md +221 -0
  2. package/dist/_virtual/rolldown_runtime.cjs +29 -1
  3. package/dist/api.cjs +57 -1
  4. package/dist/api.cjs.map +1 -0
  5. package/dist/api.d.cts +9 -1
  6. package/dist/api.d.cts.map +1 -0
  7. package/dist/api.d.mts +9 -1
  8. package/dist/api.d.mts.map +1 -0
  9. package/dist/api.mjs +55 -1
  10. package/dist/api.mjs.map +1 -0
  11. package/dist/components/docs.cjs +105 -0
  12. package/dist/components/docs.cjs.map +1 -0
  13. package/dist/components/docs.d.cts +56 -0
  14. package/dist/components/docs.d.cts.map +1 -0
  15. package/dist/components/docs.d.mts +56 -0
  16. package/dist/components/docs.d.mts.map +1 -0
  17. package/dist/components/docs.mjs +102 -0
  18. package/dist/components/docs.mjs.map +1 -0
  19. package/dist/components/index.cjs +5 -0
  20. package/dist/components/index.d.cts +2 -0
  21. package/dist/components/index.d.mts +2 -0
  22. package/dist/components/index.mjs +3 -0
  23. package/dist/config.cjs +18 -1
  24. package/dist/config.cjs.map +1 -0
  25. package/dist/config.d.cts +2 -1
  26. package/dist/config.d.cts.map +1 -0
  27. package/dist/config.d.mts +2 -1
  28. package/dist/config.d.mts.map +1 -0
  29. package/dist/config.mjs +17 -1
  30. package/dist/config.mjs.map +1 -0
  31. package/dist/contexts/command.cjs +21 -0
  32. package/dist/contexts/command.cjs.map +1 -0
  33. package/dist/contexts/command.d.cts +18 -0
  34. package/dist/contexts/command.d.cts.map +1 -0
  35. package/dist/contexts/command.d.mts +18 -0
  36. package/dist/contexts/command.d.mts.map +1 -0
  37. package/dist/contexts/command.mjs +19 -0
  38. package/dist/contexts/command.mjs.map +1 -0
  39. package/dist/contexts/index.cjs +4 -0
  40. package/dist/contexts/index.d.cts +2 -0
  41. package/dist/contexts/index.d.mts +2 -0
  42. package/dist/contexts/index.mjs +3 -0
  43. package/dist/helpers/docs-helpers.cjs +17 -0
  44. package/dist/helpers/docs-helpers.cjs.map +1 -0
  45. package/dist/helpers/docs-helpers.mjs +16 -0
  46. package/dist/helpers/docs-helpers.mjs.map +1 -0
  47. package/dist/helpers/persistence.cjs +50 -1
  48. package/dist/helpers/persistence.cjs.map +1 -0
  49. package/dist/helpers/persistence.mjs +47 -1
  50. package/dist/helpers/persistence.mjs.map +1 -0
  51. package/dist/helpers/resolve-command.cjs +177 -1
  52. package/dist/helpers/resolve-command.cjs.map +1 -0
  53. package/dist/helpers/resolve-command.mjs +172 -1
  54. package/dist/helpers/resolve-command.mjs.map +1 -0
  55. package/dist/helpers/update-package-json.cjs +36 -1
  56. package/dist/helpers/update-package-json.cjs.map +1 -0
  57. package/dist/helpers/update-package-json.mjs +34 -1
  58. package/dist/helpers/update-package-json.mjs.map +1 -0
  59. package/dist/helpers/utilities.cjs +41 -1
  60. package/dist/helpers/utilities.cjs.map +1 -0
  61. package/dist/helpers/utilities.mjs +39 -1
  62. package/dist/helpers/utilities.mjs.map +1 -0
  63. package/dist/helpers/validations.cjs +97 -0
  64. package/dist/helpers/validations.cjs.map +1 -0
  65. package/dist/helpers/validations.mjs +97 -0
  66. package/dist/helpers/validations.mjs.map +1 -0
  67. package/dist/index.cjs +16 -1
  68. package/dist/index.cjs.map +1 -0
  69. package/dist/index.d.cts +7 -18
  70. package/dist/index.d.mts +6 -18
  71. package/dist/index.mjs +10 -1
  72. package/dist/index.mjs.map +1 -0
  73. package/dist/plugin-utils/context-helpers.cjs +86 -0
  74. package/dist/plugin-utils/context-helpers.cjs.map +1 -0
  75. package/dist/plugin-utils/context-helpers.d.cts +58 -0
  76. package/dist/plugin-utils/context-helpers.d.cts.map +1 -0
  77. package/dist/plugin-utils/context-helpers.d.mts +58 -0
  78. package/dist/plugin-utils/context-helpers.d.mts.map +1 -0
  79. package/dist/plugin-utils/context-helpers.mjs +79 -0
  80. package/dist/plugin-utils/context-helpers.mjs.map +1 -0
  81. package/dist/plugin-utils/get-command-tree.cjs +24 -0
  82. package/dist/plugin-utils/get-command-tree.cjs.map +1 -0
  83. package/dist/plugin-utils/get-command-tree.d.cts +16 -0
  84. package/dist/plugin-utils/get-command-tree.d.cts.map +1 -0
  85. package/dist/plugin-utils/get-command-tree.d.mts +16 -0
  86. package/dist/plugin-utils/get-command-tree.d.mts.map +1 -0
  87. package/dist/plugin-utils/get-command-tree.mjs +24 -0
  88. package/dist/plugin-utils/get-command-tree.mjs.map +1 -0
  89. package/dist/plugin-utils/index.cjs +16 -0
  90. package/dist/plugin-utils/index.d.cts +5 -0
  91. package/dist/plugin-utils/index.d.mts +5 -0
  92. package/dist/plugin-utils/index.mjs +6 -0
  93. package/dist/plugin-utils/reflect.cjs +25 -0
  94. package/dist/plugin-utils/reflect.cjs.map +1 -0
  95. package/dist/plugin-utils/reflect.d.cts +14 -0
  96. package/dist/plugin-utils/reflect.d.cts.map +1 -0
  97. package/dist/plugin-utils/reflect.d.mts +14 -0
  98. package/dist/plugin-utils/reflect.d.mts.map +1 -0
  99. package/dist/plugin-utils/reflect.mjs +24 -0
  100. package/dist/plugin-utils/reflect.mjs.map +1 -0
  101. package/dist/plugin-utils/traverse-command-tree.cjs +33 -0
  102. package/dist/plugin-utils/traverse-command-tree.cjs.map +1 -0
  103. package/dist/plugin-utils/traverse-command-tree.d.cts +23 -0
  104. package/dist/plugin-utils/traverse-command-tree.d.cts.map +1 -0
  105. package/dist/plugin-utils/traverse-command-tree.d.mts +23 -0
  106. package/dist/plugin-utils/traverse-command-tree.d.mts.map +1 -0
  107. package/dist/plugin-utils/traverse-command-tree.mjs +31 -0
  108. package/dist/plugin-utils/traverse-command-tree.mjs.map +1 -0
  109. package/dist/plugin.cjs +267 -0
  110. package/dist/plugin.cjs.map +1 -0
  111. package/dist/plugin.d.cts +13 -0
  112. package/dist/plugin.d.cts.map +1 -0
  113. package/dist/plugin.d.mts +13 -0
  114. package/dist/plugin.d.mts.map +1 -0
  115. package/dist/plugin.mjs +261 -0
  116. package/dist/plugin.mjs.map +1 -0
  117. package/dist/types/command.d.cts +13 -4
  118. package/dist/types/command.d.cts.map +1 -0
  119. package/dist/types/command.d.mts +13 -4
  120. package/dist/types/command.d.mts.map +1 -0
  121. package/dist/types/command.mjs +1 -1
  122. package/dist/types/config.d.cts +71 -23
  123. package/dist/types/config.d.cts.map +1 -0
  124. package/dist/types/config.d.mts +71 -23
  125. package/dist/types/config.d.mts.map +1 -0
  126. package/dist/types/config.mjs +1 -1
  127. package/dist/types/context.d.cts +7 -3
  128. package/dist/types/context.d.cts.map +1 -0
  129. package/dist/types/context.d.mts +7 -3
  130. package/dist/types/context.d.mts.map +1 -0
  131. package/dist/types/context.mjs +1 -1
  132. package/dist/types/index.d.cts +4 -4
  133. package/dist/types/index.d.mts +4 -4
  134. package/dist/types/index.mjs +1 -1
  135. package/dist/types/internal.cjs +0 -0
  136. package/dist/types/internal.d.cts +24 -0
  137. package/dist/types/internal.d.cts.map +1 -0
  138. package/dist/types/internal.d.mts +24 -0
  139. package/dist/types/internal.d.mts.map +1 -0
  140. package/dist/types/internal.mjs +1 -0
  141. package/dist/types/options.d.cts +2 -1
  142. package/dist/types/options.d.cts.map +1 -0
  143. package/dist/types/options.d.mts +2 -1
  144. package/dist/types/options.d.mts.map +1 -0
  145. package/dist/types/options.mjs +1 -1
  146. package/package.json +230 -55
  147. package/dist/helpers/get-default-options.cjs +0 -1
  148. package/dist/helpers/get-default-options.d.cts +0 -15
  149. package/dist/helpers/get-default-options.d.mts +0 -15
  150. package/dist/helpers/get-default-options.mjs +0 -1
  151. package/dist/powerlines.cjs +0 -3
  152. package/dist/powerlines.d.cts +0 -12
  153. package/dist/powerlines.d.mts +0 -12
  154. package/dist/powerlines.mjs +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/core",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "A package containing the core Shell Shock functionality used to build and manage a command-line application.",
6
6
  "repository": {
@@ -38,119 +38,294 @@
38
38
  },
39
39
  "license": "Apache-2.0",
40
40
  "private": false,
41
- "main": "dist/index.cjs",
42
- "module": "dist/index.mjs",
43
- "typings": "dist/index.d.mts",
41
+ "main": "./dist/index.cjs",
42
+ "module": "./dist/index.mjs",
44
43
  "exports": {
45
- "./package.json": "./package.json",
46
44
  ".": {
47
- "import": {
48
- "types": "./dist/index.d.mts",
49
- "default": "./dist/index.mjs"
50
- },
51
45
  "require": {
52
46
  "types": "./dist/index.d.cts",
53
47
  "default": "./dist/index.cjs"
54
48
  },
49
+ "import": {
50
+ "types": "./dist/index.d.mts",
51
+ "default": "./dist/index.mjs"
52
+ },
55
53
  "default": {
56
54
  "types": "./dist/index.d.mts",
57
55
  "default": "./dist/index.mjs"
58
56
  }
59
57
  },
60
- "./index": {
58
+ "./api": {
59
+ "require": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" },
60
+ "import": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" },
61
+ "default": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" }
62
+ },
63
+ "./components": {
64
+ "require": {
65
+ "types": "./dist/components/index.d.cts",
66
+ "default": "./dist/components/index.cjs"
67
+ },
61
68
  "import": {
62
- "types": "./dist/index.d.mts",
63
- "default": "./dist/index.mjs"
69
+ "types": "./dist/components/index.d.mts",
70
+ "default": "./dist/components/index.mjs"
64
71
  },
72
+ "default": {
73
+ "types": "./dist/components/index.d.mts",
74
+ "default": "./dist/components/index.mjs"
75
+ }
76
+ },
77
+ "./components/docs": {
65
78
  "require": {
66
- "types": "./dist/index.d.cts",
67
- "default": "./dist/index.cjs"
79
+ "types": "./dist/components/docs.d.cts",
80
+ "default": "./dist/components/docs.cjs"
81
+ },
82
+ "import": {
83
+ "types": "./dist/components/docs.d.mts",
84
+ "default": "./dist/components/docs.mjs"
68
85
  },
69
86
  "default": {
70
- "types": "./dist/index.d.mts",
71
- "default": "./dist/index.mjs"
87
+ "types": "./dist/components/docs.d.mts",
88
+ "default": "./dist/components/docs.mjs"
72
89
  }
73
90
  },
74
91
  "./config": {
75
- "import": {
76
- "types": "./dist/config.d.mts",
77
- "default": "./dist/config.mjs"
78
- },
79
92
  "require": {
80
93
  "types": "./dist/config.d.cts",
81
94
  "default": "./dist/config.cjs"
82
95
  },
96
+ "import": {
97
+ "types": "./dist/config.d.mts",
98
+ "default": "./dist/config.mjs"
99
+ },
83
100
  "default": {
84
101
  "types": "./dist/config.d.mts",
85
102
  "default": "./dist/config.mjs"
86
103
  }
87
104
  },
88
- "./api": {
89
- "import": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" },
90
- "require": { "types": "./dist/api.d.cts", "default": "./dist/api.cjs" },
91
- "default": { "types": "./dist/api.d.mts", "default": "./dist/api.mjs" }
105
+ "./contexts": {
106
+ "require": {
107
+ "types": "./dist/contexts/index.d.cts",
108
+ "default": "./dist/contexts/index.cjs"
109
+ },
110
+ "import": {
111
+ "types": "./dist/contexts/index.d.mts",
112
+ "default": "./dist/contexts/index.mjs"
113
+ },
114
+ "default": {
115
+ "types": "./dist/contexts/index.d.mts",
116
+ "default": "./dist/contexts/index.mjs"
117
+ }
92
118
  },
93
- "./powerlines": {
119
+ "./contexts/command": {
120
+ "require": {
121
+ "types": "./dist/contexts/command.d.cts",
122
+ "default": "./dist/contexts/command.cjs"
123
+ },
94
124
  "import": {
95
- "types": "./dist/powerlines.d.mts",
96
- "default": "./dist/powerlines.mjs"
125
+ "types": "./dist/contexts/command.d.mts",
126
+ "default": "./dist/contexts/command.mjs"
97
127
  },
128
+ "default": {
129
+ "types": "./dist/contexts/command.d.mts",
130
+ "default": "./dist/contexts/command.mjs"
131
+ }
132
+ },
133
+ "./package.json": "./package.json",
134
+ "./plugin": {
98
135
  "require": {
99
- "types": "./dist/powerlines.d.cts",
100
- "default": "./dist/powerlines.cjs"
136
+ "types": "./dist/plugin.d.cts",
137
+ "default": "./dist/plugin.cjs"
138
+ },
139
+ "import": {
140
+ "types": "./dist/plugin.d.mts",
141
+ "default": "./dist/plugin.mjs"
101
142
  },
102
143
  "default": {
103
- "types": "./dist/powerlines.d.mts",
104
- "default": "./dist/powerlines.mjs"
144
+ "types": "./dist/plugin.d.mts",
145
+ "default": "./dist/plugin.mjs"
105
146
  }
106
147
  },
107
- "./types": {
148
+ "./plugin-utils": {
149
+ "require": {
150
+ "types": "./dist/plugin-utils/index.d.cts",
151
+ "default": "./dist/plugin-utils/index.cjs"
152
+ },
108
153
  "import": {
109
- "types": "./dist/types/index.d.mts",
110
- "default": "./dist/types/index.mjs"
154
+ "types": "./dist/plugin-utils/index.d.mts",
155
+ "default": "./dist/plugin-utils/index.mjs"
156
+ },
157
+ "default": {
158
+ "types": "./dist/plugin-utils/index.d.mts",
159
+ "default": "./dist/plugin-utils/index.mjs"
160
+ }
161
+ },
162
+ "./plugin-utils/context-helpers": {
163
+ "require": {
164
+ "types": "./dist/plugin-utils/context-helpers.d.cts",
165
+ "default": "./dist/plugin-utils/context-helpers.cjs"
166
+ },
167
+ "import": {
168
+ "types": "./dist/plugin-utils/context-helpers.d.mts",
169
+ "default": "./dist/plugin-utils/context-helpers.mjs"
170
+ },
171
+ "default": {
172
+ "types": "./dist/plugin-utils/context-helpers.d.mts",
173
+ "default": "./dist/plugin-utils/context-helpers.mjs"
174
+ }
175
+ },
176
+ "./plugin-utils/get-command-tree": {
177
+ "require": {
178
+ "types": "./dist/plugin-utils/get-command-tree.d.cts",
179
+ "default": "./dist/plugin-utils/get-command-tree.cjs"
180
+ },
181
+ "import": {
182
+ "types": "./dist/plugin-utils/get-command-tree.d.mts",
183
+ "default": "./dist/plugin-utils/get-command-tree.mjs"
111
184
  },
185
+ "default": {
186
+ "types": "./dist/plugin-utils/get-command-tree.d.mts",
187
+ "default": "./dist/plugin-utils/get-command-tree.mjs"
188
+ }
189
+ },
190
+ "./plugin-utils/reflect": {
191
+ "require": {
192
+ "types": "./dist/plugin-utils/reflect.d.cts",
193
+ "default": "./dist/plugin-utils/reflect.cjs"
194
+ },
195
+ "import": {
196
+ "types": "./dist/plugin-utils/reflect.d.mts",
197
+ "default": "./dist/plugin-utils/reflect.mjs"
198
+ },
199
+ "default": {
200
+ "types": "./dist/plugin-utils/reflect.d.mts",
201
+ "default": "./dist/plugin-utils/reflect.mjs"
202
+ }
203
+ },
204
+ "./plugin-utils/traverse-command-tree": {
205
+ "require": {
206
+ "types": "./dist/plugin-utils/traverse-command-tree.d.cts",
207
+ "default": "./dist/plugin-utils/traverse-command-tree.cjs"
208
+ },
209
+ "import": {
210
+ "types": "./dist/plugin-utils/traverse-command-tree.d.mts",
211
+ "default": "./dist/plugin-utils/traverse-command-tree.mjs"
212
+ },
213
+ "default": {
214
+ "types": "./dist/plugin-utils/traverse-command-tree.d.mts",
215
+ "default": "./dist/plugin-utils/traverse-command-tree.mjs"
216
+ }
217
+ },
218
+ "./types": {
112
219
  "require": {
113
220
  "types": "./dist/types/index.d.cts",
114
221
  "default": "./dist/types/index.cjs"
115
222
  },
223
+ "import": {
224
+ "types": "./dist/types/index.d.mts",
225
+ "default": "./dist/types/index.mjs"
226
+ },
116
227
  "default": {
117
228
  "types": "./dist/types/index.d.mts",
118
229
  "default": "./dist/types/index.mjs"
119
230
  }
120
231
  },
121
- "./types/*": {
232
+ "./types/command": {
233
+ "require": {
234
+ "types": "./dist/types/command.d.cts",
235
+ "default": "./dist/types/command.cjs"
236
+ },
237
+ "import": {
238
+ "types": "./dist/types/command.d.mts",
239
+ "default": "./dist/types/command.mjs"
240
+ },
241
+ "default": {
242
+ "types": "./dist/types/command.d.mts",
243
+ "default": "./dist/types/command.mjs"
244
+ }
245
+ },
246
+ "./types/config": {
247
+ "require": {
248
+ "types": "./dist/types/config.d.cts",
249
+ "default": "./dist/types/config.cjs"
250
+ },
122
251
  "import": {
123
- "types": "./dist/types/*.d.mts",
124
- "default": "./dist/types/*.mjs"
252
+ "types": "./dist/types/config.d.mts",
253
+ "default": "./dist/types/config.mjs"
125
254
  },
255
+ "default": {
256
+ "types": "./dist/types/config.d.mts",
257
+ "default": "./dist/types/config.mjs"
258
+ }
259
+ },
260
+ "./types/context": {
126
261
  "require": {
127
- "types": "./dist/types/*.d.cts",
128
- "default": "./dist/types/*.cjs"
262
+ "types": "./dist/types/context.d.cts",
263
+ "default": "./dist/types/context.cjs"
264
+ },
265
+ "import": {
266
+ "types": "./dist/types/context.d.mts",
267
+ "default": "./dist/types/context.mjs"
129
268
  },
130
269
  "default": {
131
- "types": "./dist/types/*.d.mts",
132
- "default": "./dist/types/*.mjs"
270
+ "types": "./dist/types/context.d.mts",
271
+ "default": "./dist/types/context.mjs"
272
+ }
273
+ },
274
+ "./types/internal": {
275
+ "require": {
276
+ "types": "./dist/types/internal.d.cts",
277
+ "default": "./dist/types/internal.cjs"
278
+ },
279
+ "import": {
280
+ "types": "./dist/types/internal.d.mts",
281
+ "default": "./dist/types/internal.mjs"
282
+ },
283
+ "default": {
284
+ "types": "./dist/types/internal.d.mts",
285
+ "default": "./dist/types/internal.mjs"
286
+ }
287
+ },
288
+ "./types/options": {
289
+ "require": {
290
+ "types": "./dist/types/options.d.cts",
291
+ "default": "./dist/types/options.cjs"
292
+ },
293
+ "import": {
294
+ "types": "./dist/types/options.d.mts",
295
+ "default": "./dist/types/options.mjs"
296
+ },
297
+ "default": {
298
+ "types": "./dist/types/options.d.mts",
299
+ "default": "./dist/types/options.mjs"
133
300
  }
134
301
  }
135
302
  },
303
+ "types": "./dist/index.d.cts",
304
+ "typings": "dist/index.d.mts",
136
305
  "files": ["dist/**/*"],
137
306
  "keywords": ["shell-shock", "powerlines", "storm-software"],
138
307
  "dependencies": {
139
- "@powerlines/deepkit": "^0.5.10",
140
- "@powerlines/plugin-plugin": "^0.12.47",
141
- "@powerlines/plugin-tsdown": "^0.1.47",
142
- "@stryke/convert": "^0.6.29",
143
- "@stryke/helpers": "^0.9.31",
144
- "@stryke/json": "^0.9.32",
145
- "@stryke/path": "^0.24.0",
146
- "@stryke/string-format": "^0.12.29",
147
- "@stryke/type-checks": "^0.5.14",
308
+ "@powerlines/deepkit": "^0.6.37",
309
+ "@powerlines/plugin-nodejs": "^0.1.160",
310
+ "@powerlines/plugin-plugin": "^0.12.208",
311
+ "@powerlines/plugin-tsdown": "^0.1.210",
312
+ "@stryke/cli": "^0.13.12",
313
+ "@stryke/convert": "^0.6.38",
314
+ "@stryke/fs": "^0.33.40",
315
+ "@stryke/helpers": "0.9.40",
316
+ "@stryke/json": "^0.9.41",
317
+ "@stryke/path": "^0.26.4",
318
+ "@stryke/string-format": "^0.13.7",
319
+ "@stryke/type-checks": "^0.5.23",
320
+ "@stryke/types": "^0.10.37",
321
+ "automd": "0.4.2",
148
322
  "defu": "^6.1.4",
149
- "powerlines": "^0.36.0",
150
- "@stryke/capnp": "^0.12.51",
151
- "@stryke/fs": "^0.33.26"
323
+ "powerlines": "^0.38.24",
324
+ "@alloy-js/core": "0.22.0",
325
+ "@alloy-js/markdown": "0.22.0",
326
+ "@powerlines/plugin-alloy": "^0.19.37"
152
327
  },
153
- "devDependencies": { "@types/node": "^24.10.4", "typescript": "^5.9.3" },
328
+ "devDependencies": { "@types/node": "^22.19.7", "typescript": "^5.9.3" },
154
329
  "publishConfig": { "access": "public" },
155
- "gitHead": "e7794a7d008c5d32b5a999b62421281d370166cd"
330
+ "gitHead": "150522912ecb85c5d409659bc146c2c6ae635923"
156
331
  }
@@ -1 +0,0 @@
1
- const e=require(`../_virtual/rolldown_runtime.cjs`);let t=require(`@powerlines/deepkit/vendor/type`),n=require(`@stryke/type-checks/is-function`);function r(e,r){return e.config.defaultOptions===!1?[]:Array.isArray(e.config.defaultOptions)?e.config.defaultOptions:(0,n.isFunction)(e.config.defaultOptions)?e.config.defaultOptions(e,r):[{name:`help`,title:`Help`,description:`Show help information.`,alias:[`h`,`?`],kind:t.ReflectionKind.boolean,optional:!0,default:!1,skipAddingNegative:!0},{name:`version`,title:`Version`,description:`Show the version of the application.`,alias:[`v`],kind:t.ReflectionKind.boolean,optional:!0,default:!1,skipAddingNegative:!0}]}exports.getDefaultOptions=r;
@@ -1,15 +0,0 @@
1
- import { CommandBase, CommandOption } from "../types/command.cjs";
2
- import { Context } from "../types/context.cjs";
3
-
4
- //#region src/helpers/get-default-options.d.ts
5
-
6
- /**
7
- * Get the default command options.
8
- *
9
- * @param context - The build context.
10
- * @param command - The command input.
11
- * @returns The default command options.
12
- */
13
- declare function getDefaultOptions(context: Context, command: CommandBase): CommandOption[];
14
- //#endregion
15
- export { getDefaultOptions };
@@ -1,15 +0,0 @@
1
- import { CommandBase, CommandOption } from "../types/command.mjs";
2
- import { Context } from "../types/context.mjs";
3
-
4
- //#region src/helpers/get-default-options.d.ts
5
-
6
- /**
7
- * Get the default command options.
8
- *
9
- * @param context - The build context.
10
- * @param command - The command input.
11
- * @returns The default command options.
12
- */
13
- declare function getDefaultOptions(context: Context, command: CommandBase): CommandOption[];
14
- //#endregion
15
- export { getDefaultOptions };
@@ -1 +0,0 @@
1
- import{ReflectionKind as e}from"@powerlines/deepkit/vendor/type";import{isFunction as t}from"@stryke/type-checks/is-function";function n(n,r){return n.config.defaultOptions===!1?[]:Array.isArray(n.config.defaultOptions)?n.config.defaultOptions:t(n.config.defaultOptions)?n.config.defaultOptions(n,r):[{name:`help`,title:`Help`,description:`Show help information.`,alias:[`h`,`?`],kind:e.boolean,optional:!0,default:!1,skipAddingNegative:!0},{name:`version`,title:`Version`,description:`Show the version of the application.`,alias:[`v`],kind:e.boolean,optional:!0,default:!1,skipAddingNegative:!0}]}export{n as getDefaultOptions};
@@ -1,3 +0,0 @@
1
- Object.defineProperty(exports,`__esModule`,{value:!0});const e=require(`./_virtual/rolldown_runtime.cjs`),t=require(`./helpers/get-default-options.cjs`),n=require(`./helpers/persistence.cjs`),r=require(`./helpers/resolve-command.cjs`),i=require(`./helpers/update-package-json.cjs`),a=require(`./helpers/utilities.cjs`);let o=require(`@stryke/fs/chmod-x`),s=require(`@stryke/path/append`),c=require(`@stryke/path/file-path-fns`),l=require(`@stryke/path/is-parent-path`),u=require(`@stryke/path/join-paths`),d=require(`@stryke/path/replace`),f=require(`@stryke/path/resolve-parent-path`),p=require(`@stryke/string-format/title-case`),m=require(`@stryke/type-checks/is-set-object`),h=require(`defu`),g=require(`node:fs`);const _=50,v=(e={})=>[{name:`shell-shock:config`,async config(){return this.trace(`Resolving the Shell Shock configuration.`),(0,h.defu)(e,{entry:!this.config.entry||Array.isArray(this.config.entry)&&this.config.entry.length===0?[(0,u.joinPaths)(this.config.sourceRoot,`**/*`)]:void 0,build:{target:`node22`,platform:`node`},interactive:!0,type:`application`,framework:`shell-shock`})},configResolved:{order:`pre`,async handler(){this.trace(`Shell Shock configuration has been resolved.`),await i.updatePackageJsonBinary(this),this.config.name=a.getAppName(this),this.config.title=a.getAppTitle(this),this.config.description=a.getAppDescription(this),this.options=t.getDefaultOptions(this,{id:null,name:this.config.name,title:this.config.title,description:this.config.description,path:[],isVirtual:!1}),this.inputs??=[]}}},{name:`shell-shock:inputs`,async configResolved(){this.trace(`Finding command entry points.`),this.commandsPath=r.findCommandsRoot(this),this.inputs=this.entry.filter(e=>(0,c.findFileName)(e.file,{withExtension:!1})===`command`).reduce((e,t)=>{let n=(0,s.appendPath)((0,s.appendPath)(t.file,this.config.projectRoot),this.workspaceConfig.workspaceRoot);if(!(0,l.isParentPath)(n,this.commandsPath))throw Error(`Command entry point "${n}" is not located within the commands root "${this.commandsPath}". Please ensure that all command entry points are located within the current project.`);let i=r.resolveCommandPath(this,n),a=i.replaceAll(`/`,`-`);if(!e.some(e=>e.id===a)){let o=r.findCommandName(n);e.push({id:a,path:i.split(`/`).filter(Boolean),name:o,title:(0,p.titleCase)(o),isVirtual:!1,entry:{...t,file:n,input:{file:t.file,name:t.name},output:o}})}return e},this.inputs)}},{name:`shell-shock:virtual-inputs`,configResolved:{order:`post`,async handler(){this.inputs.length===0?this.warn(`No commands were found in the project. Please ensure at least one command exists.`):(this.info(`Shell Shock will create an application with the following commands: \n${this.inputs.filter(e=>!e.isVirtual).map(e=>` - ${e.id}: ${(0,d.replacePath)(e.entry.file,this.commandsPath)}${e.isVirtual?` (virtual)`:``}`).join(`
2
- `)}`),this.trace(`Finding and adding virtual command inputs for each command previously found.`),this.inputs=this.inputs.reduce((e,t)=>{let n=0,i=(0,f.resolveParentPath)((0,c.findFilePath)(t.entry.file));for(;i!==this.commandsPath;){if(n++>50)throw Error(`Maximum command virtual parent depth of 50 exceeded while processing command: ${t.name}`);if(!e.some(e=>(0,c.findFilePath)(e.entry.file)===i)){let t=(0,u.joinPaths)(i,`command.ts`),n=r.resolveCommandPath(this,t),a=n.replaceAll(`/`,`-`);if(!e.some(e=>e.id===a)){let i=r.findCommandName(t);e.push({id:a,path:n.split(`/`).filter(Boolean),name:i,title:(0,p.titleCase)(i),isVirtual:!0,entry:{file:t,input:{file:t}}})}}i=(0,f.resolveParentPath)(i)}return e},this.inputs).sort((e,t)=>e.path.length-t.path.length),this.trace(`Final command input list: \n${this.inputs.map(e=>` - ${e.id}: ${(0,d.replacePath)(e.entry.file,this.commandsPath)}${e.isVirtual?` (virtual)`:``}`).join(`
3
- `)}`))}}},{name:`shell-shock:reflect-commands`,async prepare(){if(this.entry=[],this.commands={},this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&this.fs.existsSync(n.getCommandsPersistencePath(this)))this.debug(`Skipping reflection initialization as the meta checksum has not changed.`),await n.readCommandsPersistence(this);else{for(let e of this.inputs.filter(e=>e.path.length===1))this.commands[e.name]=await r.reflectCommandTree(this,e);await n.writeCommandsPersistence(this)}}},{name:`shell-shock:chmod+x`,async buildEnd(){if(!(0,m.isSetObject)(this.packageJson.bin)){this.warn(`No binaries were found in package.json. Please ensure the binaries are correctly configured.`);return}this.debug(`Adding executable permissions to binaries.`);for(let e of Object.values(this.packageJson.bin))(0,g.existsSync)((0,s.appendPath)(e,this.config.output.buildPath))&&await(0,o.chmodX)((0,s.appendPath)(e,this.config.output.buildPath))}}];var y=v;exports.default=y,exports.shellShock=v;
@@ -1,12 +0,0 @@
1
- import { Context } from "./types/context.cjs";
2
- import { Options } from "./types/config.cjs";
3
- import { Plugin } from "powerlines";
4
-
5
- //#region src/powerlines.d.ts
6
-
7
- /**
8
- * The core Powerlines plugin to build Shell Shock projects.
9
- */
10
- declare const shellShock: <TContext extends Context = Context>(options?: Options) => Plugin<TContext>[];
11
- //#endregion
12
- export { shellShock as default, shellShock };
@@ -1,12 +0,0 @@
1
- import { Context } from "./types/context.mjs";
2
- import { Options } from "./types/config.mjs";
3
- import { Plugin } from "powerlines";
4
-
5
- //#region src/powerlines.d.ts
6
-
7
- /**
8
- * The core Powerlines plugin to build Shell Shock projects.
9
- */
10
- declare const shellShock: <TContext extends Context = Context>(options?: Options) => Plugin<TContext>[];
11
- //#endregion
12
- export { shellShock as default, shellShock };
@@ -1,3 +0,0 @@
1
- import{getDefaultOptions as e}from"./helpers/get-default-options.mjs";import{getCommandsPersistencePath as t,readCommandsPersistence as n,writeCommandsPersistence as r}from"./helpers/persistence.mjs";import{findCommandName as i,findCommandsRoot as a,reflectCommandTree as o,resolveCommandPath as s}from"./helpers/resolve-command.mjs";import{updatePackageJsonBinary as c}from"./helpers/update-package-json.mjs";import{getAppDescription as l,getAppName as u,getAppTitle as d}from"./helpers/utilities.mjs";import{chmodX as f}from"@stryke/fs/chmod-x";import{appendPath as p}from"@stryke/path/append";import{findFileName as m,findFilePath as h}from"@stryke/path/file-path-fns";import{isParentPath as g}from"@stryke/path/is-parent-path";import{joinPaths as _}from"@stryke/path/join-paths";import{replacePath as v}from"@stryke/path/replace";import{resolveParentPath as y}from"@stryke/path/resolve-parent-path";import{titleCase as b}from"@stryke/string-format/title-case";import{isSetObject as x}from"@stryke/type-checks/is-set-object";import{defu as S}from"defu";import{existsSync as C}from"node:fs";const w=(w={})=>[{name:`shell-shock:config`,async config(){return this.trace(`Resolving the Shell Shock configuration.`),S(w,{entry:!this.config.entry||Array.isArray(this.config.entry)&&this.config.entry.length===0?[_(this.config.sourceRoot,`**/*`)]:void 0,build:{target:`node22`,platform:`node`},interactive:!0,type:`application`,framework:`shell-shock`})},configResolved:{order:`pre`,async handler(){this.trace(`Shell Shock configuration has been resolved.`),await c(this),this.config.name=u(this),this.config.title=d(this),this.config.description=l(this),this.options=e(this,{id:null,name:this.config.name,title:this.config.title,description:this.config.description,path:[],isVirtual:!1}),this.inputs??=[]}}},{name:`shell-shock:inputs`,async configResolved(){this.trace(`Finding command entry points.`),this.commandsPath=a(this),this.inputs=this.entry.filter(e=>m(e.file,{withExtension:!1})===`command`).reduce((e,t)=>{let n=p(p(t.file,this.config.projectRoot),this.workspaceConfig.workspaceRoot);if(!g(n,this.commandsPath))throw Error(`Command entry point "${n}" is not located within the commands root "${this.commandsPath}". Please ensure that all command entry points are located within the current project.`);let r=s(this,n),a=r.replaceAll(`/`,`-`);if(!e.some(e=>e.id===a)){let o=i(n);e.push({id:a,path:r.split(`/`).filter(Boolean),name:o,title:b(o),isVirtual:!1,entry:{...t,file:n,input:{file:t.file,name:t.name},output:o}})}return e},this.inputs)}},{name:`shell-shock:virtual-inputs`,configResolved:{order:`post`,async handler(){this.inputs.length===0?this.warn(`No commands were found in the project. Please ensure at least one command exists.`):(this.info(`Shell Shock will create an application with the following commands: \n${this.inputs.filter(e=>!e.isVirtual).map(e=>` - ${e.id}: ${v(e.entry.file,this.commandsPath)}${e.isVirtual?` (virtual)`:``}`).join(`
2
- `)}`),this.trace(`Finding and adding virtual command inputs for each command previously found.`),this.inputs=this.inputs.reduce((e,t)=>{let n=0,r=y(h(t.entry.file));for(;r!==this.commandsPath;){if(n++>50)throw Error(`Maximum command virtual parent depth of 50 exceeded while processing command: ${t.name}`);if(!e.some(e=>h(e.entry.file)===r)){let t=_(r,`command.ts`),n=s(this,t),a=n.replaceAll(`/`,`-`);if(!e.some(e=>e.id===a)){let r=i(t);e.push({id:a,path:n.split(`/`).filter(Boolean),name:r,title:b(r),isVirtual:!0,entry:{file:t,input:{file:t}}})}}r=y(r)}return e},this.inputs).sort((e,t)=>e.path.length-t.path.length),this.trace(`Final command input list: \n${this.inputs.map(e=>` - ${e.id}: ${v(e.entry.file,this.commandsPath)}${e.isVirtual?` (virtual)`:``}`).join(`
3
- `)}`))}}},{name:`shell-shock:reflect-commands`,async prepare(){if(this.entry=[],this.commands={},this.config.command!==`prepare`&&this.persistedMeta?.checksum===this.meta.checksum&&this.fs.existsSync(t(this)))this.debug(`Skipping reflection initialization as the meta checksum has not changed.`),await n(this);else{for(let e of this.inputs.filter(e=>e.path.length===1))this.commands[e.name]=await o(this,e);await r(this)}}},{name:`shell-shock:chmod+x`,async buildEnd(){if(!x(this.packageJson.bin)){this.warn(`No binaries were found in package.json. Please ensure the binaries are correctly configured.`);return}this.debug(`Adding executable permissions to binaries.`);for(let e of Object.values(this.packageJson.bin))C(p(e,this.config.output.buildPath))&&await f(p(e,this.config.output.buildPath))}}];var T=w;export{T as default,w as shellShock};