collectronic
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -6,7 +6,10 @@ #!/usr/bin/env node | ||
hooks?: { | ||
beforePrint?: (collectedData: any) => any; | ||
beforePrint?: (collectedData: any) => Promise<any>; | ||
}; | ||
} | ||
interface CollectronicConfigExport { | ||
getConfig: () => Promise<CollectronicConfig>; | ||
} | ||
declare const collect: () => Promise<void>; | ||
export type { CollectronicConfig }; | ||
export type { CollectronicConfig, CollectronicConfigExport }; | ||
export { collect }; |
@@ -15,3 +15,4 @@ #!/usr/bin/env node | ||
const configPath = path.join(process.cwd(), `.config/collectronic.ts`); | ||
const localConfig = (await tsImport.load(configPath)).default; | ||
const localConfigExport = (await tsImport.load(configPath)).default; | ||
const localConfig = await localConfigExport.getConfig(); | ||
const config = (0, options_defaults_1.defaults)({ | ||
@@ -40,3 +41,3 @@ tag: `metadata`, | ||
let output = _.mergeWith({}, ...foundJsons, concat_arrays_1.concatArrays); | ||
output = config.hooks?.beforePrint?.(output); | ||
output = await config.hooks?.beforePrint?.(output); | ||
const collectedData = JSON.stringify(output, undefined, 4); | ||
@@ -43,0 +44,0 @@ console.log(collectedData); |
{ | ||
"name": "collectronic", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"main": "dist/main.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/main.d.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
31545
73