@servable/tools 1.6.1 → 1.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "source": "src/index.js",
5
5
  "main": "src/index.js",
6
- "version": "1.6.1",
6
+ "version": "1.6.2",
7
7
  "description": "Servable tools is a utility that builds a protocol's manifest and documents it.",
8
8
  "author": "Servable Community",
9
9
  "license": "ISC",
@@ -316,6 +316,20 @@ export default class ProtocolLoaderV1_0_0 extends BaseClass {
316
316
  return this._importJSDefault({ path, })
317
317
  }
318
318
 
319
+ async beforeEnd() {
320
+ const cacheKey = 'beforeEnd'
321
+ if (this._valueInCache(cacheKey)) {
322
+ return this._valueInCache(cacheKey)
323
+ }
324
+
325
+ const path = `${this.path}/beforeEnd/index.js`
326
+ if (!(await checkFileExists(path))) {
327
+ return null
328
+ }
329
+
330
+ return this._importJSDefault({ path, })
331
+ }
332
+
319
333
  configFolder() {
320
334
  return `${this.path}/config`
321
335
  }
@@ -301,6 +301,11 @@ export default class ProtocolLoaderV1_1_0 extends BaseClass {
301
301
  return main ? main.beforeInit : null
302
302
  }
303
303
 
304
+ async beforeEnd() {
305
+ const main = await this.main()
306
+ return main ? main.beforeEnd : null
307
+ }
308
+
304
309
  async main() {
305
310
 
306
311
  const path = `${this.path}/main.js`