[{"data":1,"prerenderedAt":1436,"buildId":1437},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks":3},{"id":4,"title":5,"body":6,"description":1418,"extension":1419,"frontmatter":1420,"heading":1425,"meta":1427,"navigation":1429,"order":1423,"path":1430,"seo":1431,"sitemap":1432,"source":1433,"stem":1434,"__hash__":1435},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks.md","Lifecycle hooks - Every kubb:* build event",{"type":7,"value":8,"toc":1401},"minimark",[9,22,101,106,117,399,403,406,409,413,436,558,562,572,812,826,830,850,1003,1029,1033,1036,1128,1135,1139,1144,1156,1232,1236,1244,1314,1349,1352,1361],[10,11,12,13,17,18,21],"p",{},"Hooks let you run code in every build phase. Each phase fires a ",[14,15,16],"code",{},"kubb:*"," hook on one shared emitter, typed by ",[14,19,20],{},"KubbHooks",". Handlers can be async, and Kubb awaits each one.",[23,24,25,38],"table",{},[26,27,28],"thead",{},[29,30,31,35],"tr",{},[32,33,34],"th",{},"Listener",[32,36,37],{},"Receives",[39,40,41,82],"tbody",{},[29,42,43,55],{},[44,45,46,47,54],"td",{},"A plugin's ",[48,49,51],"a",{"href":50},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fplugins",[14,52,53],{},"hooks"," map",[44,56,57,58,61,62,65,66,69,70,73,74,77,78,81],{},"The hooks from ",[14,59,60],{},"kubb:setup:end"," to ",[14,63,64],{},"kubb:build:end",", including its own ",[14,67,68],{},"kubb:plugin:setup",". It misses the ",[14,71,72],{},"lifecycle"," and ",[14,75,76],{},"generation"," hooks, ",[14,79,80],{},"kubb:setup:start",", and the output passes.",[29,83,84,96],{},[44,85,86,89,90],{},[14,87,88],{},"kubb.hooks.hook(name, handler)"," from ",[48,91,93],{"href":92},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fengine#createkubb",[14,94,95],{},"createKubb",[44,97,98,99],{},"Every hook except ",[14,100,68],{},[102,103,105],"h2",{"id":104},"listening","Listening",[10,107,108,109,112,113,116],{},"Attach listeners before you call ",[14,110,111],{},"build()",". ",[14,114,115],{},"hook()"," returns a function that removes the listener.",[118,119,123],"pre",{"language":120,"code":121,"class":122},"ts","import { createKubb } from 'kubb'\n\nconst kubb = createKubb({\n input: '.\u002FpetStore.yaml',\n output: { path: '.\u002Fgen' },\n})\n\nkubb.hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n console.log(`${plugin.name} finished in ${duration}ms`)\n})\n\nkubb.hooks.hook('kubb:build:end', ({ files }) => {\n console.log(`Generated ${files.length} files`)\n})\n\nawait kubb.build()","highlights",[14,124,126,153,154,153,156,153,173,153,190,153,214,153,219,153,221,153,265,153,310,153,314,153,316,153,346,153,378,153,382,153,384],{"class":125},"language-ts",[127,128,131,135,139,143,146,149],"span",{"class":129,"style":130},"line","display: inline",[127,132,134],{"style":133},"color:#d73a49;--hls-dark:#f97583","import ",[127,136,138],{"style":137},"color:#005cc5;--hls-dark:#79b8ff","{ ",[127,140,142],{"style":141},"color:#24292e;--hls-dark:#e1e4e8","createKubb ",[127,144,145],{"style":137},"} ",[127,147,148],{"style":133},"from ",[127,150,152],{"style":151},"color:#032f62;--hls-dark:#9ecbff","'kubb'","\n",[127,155],{"class":129,"style":130},[127,157,158,161,164,167,170],{"class":129,"style":130},[127,159,160],{"style":133},"const ",[127,162,163],{"style":141},"kubb ",[127,165,166],{"style":133},"= ",[127,168,95],{"style":169},"color:#6f42c1;--hls-dark:#b392f0",[127,171,172],{"style":137},"({",[127,174,175,178,181,184,187],{"class":129,"style":130},[127,176,177],{"style":137}," ",[127,179,180],{"style":137},"input",[127,182,183],{"style":133},": ",[127,185,186],{"style":151},"'.\u002FpetStore.yaml'",[127,188,189],{"style":133},",",[127,191,192,194,197,199,201,204,206,209,212],{"class":129,"style":130},[127,193,177],{"style":133},[127,195,196],{"style":137},"output",[127,198,183],{"style":133},[127,200,138],{"style":137},[127,202,203],{"style":137},"path",[127,205,183],{"style":133},[127,207,208],{"style":151},"'.\u002Fgen' ",[127,210,211],{"style":137},"}",[127,213,189],{"style":133},[127,215,216],{"class":129,"style":130},[127,217,218],{"style":137},"})",[127,220],{"class":129,"style":130},[127,222,223,226,229,231,233,236,239,242,245,248,251,253,256,259,262],{"class":129,"style":130},[127,224,225],{"style":141},"kubb",[127,227,228],{"style":133},".",[127,230,53],{"style":137},[127,232,228],{"style":133},[127,234,235],{"style":169},"hook",[127,237,238],{"style":137},"(",[127,240,241],{"style":151},"'kubb:plugin:end'",[127,243,244],{"style":133},", ",[127,246,247],{"style":137},"({ ",[127,249,250],{"style":141},"plugin",[127,252,244],{"style":133},[127,254,255],{"style":141},"duration ",[127,257,258],{"style":137},"}) ",[127,260,261],{"style":133},"=> ",[127,263,264],{"style":137},"{",[127,266,267,269,272,274,277,279,282,285,287,289,292,294,297,299,302,304,307],{"class":129,"style":130},[127,268,177],{"style":137},[127,270,271],{"style":141},"console",[127,273,228],{"style":133},[127,275,276],{"style":169},"log",[127,278,238],{"style":137},[127,280,281],{"style":151},"`",[127,283,284],{"style":141},"${",[127,286,250],{"style":141},[127,288,228],{"style":133},[127,290,291],{"style":137},"name",[127,293,211],{"style":141},[127,295,296],{"style":151}," finished in ",[127,298,284],{"style":141},[127,300,301],{"style":141},"duration",[127,303,211],{"style":141},[127,305,306],{"style":151},"ms`",[127,308,309],{"style":137},")",[127,311,312],{"class":129,"style":130},[127,313,218],{"style":137},[127,315],{"class":129,"style":130},[127,317,318,320,322,324,326,328,330,333,335,337,340,342,344],{"class":129,"style":130},[127,319,225],{"style":141},[127,321,228],{"style":133},[127,323,53],{"style":137},[127,325,228],{"style":133},[127,327,235],{"style":169},[127,329,238],{"style":137},[127,331,332],{"style":151},"'kubb:build:end'",[127,334,244],{"style":133},[127,336,247],{"style":137},[127,338,339],{"style":141},"files ",[127,341,258],{"style":137},[127,343,261],{"style":133},[127,345,264],{"style":137},[127,347,348,350,352,354,356,358,361,363,366,368,371,373,376],{"class":129,"style":130},[127,349,177],{"style":137},[127,351,271],{"style":141},[127,353,228],{"style":133},[127,355,276],{"style":169},[127,357,238],{"style":137},[127,359,360],{"style":151},"`Generated ",[127,362,284],{"style":141},[127,364,365],{"style":141},"files",[127,367,228],{"style":133},[127,369,370],{"style":137},"length",[127,372,211],{"style":141},[127,374,375],{"style":151}," files`",[127,377,309],{"style":137},[127,379,380],{"class":129,"style":130},[127,381,218],{"style":137},[127,383],{"class":129,"style":130},[127,385,386,389,391,393,396],{"class":129,"style":130},[127,387,388],{"style":133},"await ",[127,390,225],{"style":141},[127,392,228],{"style":133},[127,394,395],{"style":169},"build",[127,397,398],{"style":137},"()",[102,400,402],{"id":401},"firing-order","Firing order",[10,404,405],{},"A full generation run fires the hooks in this order.",[407,408],"lifecycle-timeline",{},[102,410,412],{"id":411},"generation-run","Generation run",[10,414,415,418,419,73,421,424,425,427,428,431,432,435],{},[14,416,417],{},".generate()"," fires the ",[14,420,76],{},[14,422,423],{},"setup"," hooks. The CLI adds the ",[14,426,72],{}," pair around all configs. A direct ",[14,429,430],{},".build()"," or ",[14,433,434],{},".safeBuild()"," fires none of them.",[23,437,438,451],{},[26,439,440],{},[29,441,442,445,448],{},[32,443,444],{},"Hook",[32,446,447],{},"Payload",[32,449,450],{},"Fires",[39,452,453,472,487,499,510,525,546],{},[29,454,455,460,465],{},[44,456,457],{},[14,458,459],{},"kubb:lifecycle:start",[44,461,462],{},[14,463,464],{},"{ version }",[44,466,467,468,471],{},"When ",[14,469,470],{},"kubb generate"," starts, before the first config. CLI only.",[29,473,474,479,484],{},[44,475,476],{},[14,477,478],{},"kubb:generation:start",[44,480,481],{},[14,482,483],{},"{ config }",[44,485,486],{},"When a run begins, before setup.",[29,488,489,493,496],{},[44,490,491],{},[14,492,80],{},[44,494,495],{},"none",[44,497,498],{},"Before the driver and storage are set up.",[29,500,501,505,507],{},[44,502,503],{},[14,504,60],{},[44,506,495],{},[44,508,509],{},"After setup, before the build pipeline. Also fires when setup fails.",[29,511,512,517,522],{},[44,513,514],{},[14,515,516],{},"kubb:generation:end",[44,518,519],{},[14,520,521],{},"{ config, storage, status, diagnostics, filesCreated, hrStart }",[44,523,524],{},"When the run finishes, after the output passes.",[29,526,527,532,537],{},[44,528,529],{},[14,530,531],{},"kubb:generation:summary",[44,533,534],{},[14,535,536],{},"{ duration, fileCount, failedPlugins, status }",[44,538,539,540,542,543,545],{},"Right after ",[14,541,516],{},", with the run's totals. ",[14,544,301],{}," is in milliseconds.",[29,547,548,553,555],{},[44,549,550],{},[14,551,552],{},"kubb:lifecycle:end",[44,554,495],{},[44,556,557],{},"After the last config. CLI only.",[102,559,561],{"id":560},"build-pipeline","Build pipeline",[10,563,564,244,566,568,569,571],{},[14,565,417],{},[14,567,430],{},", and ",[14,570,434],{}," all fire these hooks.",[23,573,574,584],{},[26,575,576],{},[29,577,578,580,582],{},[32,579,444],{},[32,581,447],{},[32,583,450],{},[39,585,586,609,623,638,653,667,682,697,712,727,752,779,798],{},[29,587,588,592,600],{},[44,589,590],{},[14,591,68],{},[44,593,594],{},[48,595,597],{"href":596},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fplugins#setup-context",[14,598,599],{},"KubbPluginSetupContext",[44,601,602,603,605,606,228],{},"Once per plugin, after its ",[14,604,423],{}," and before ",[14,607,608],{},"kubb:build:start",[29,610,611,615,620],{},[44,612,613],{},[14,614,608],{},[44,616,617],{},[14,618,619],{},"{ config, adapter, meta, nodeCounts, getPlugin, files, upsertFile }",[44,621,622],{},"When the AST is ready, before plugins run. Skipped when no adapter parsed input.",[29,624,625,630,635],{},[44,626,627],{},[14,628,629],{},"kubb:plugin:start",[44,631,632],{},[14,633,634],{},"{ plugin }",[44,636,637],{},"Before a plugin's templates run.",[29,639,640,645,650],{},[44,641,642],{},[14,643,644],{},"kubb:generate:schema",[44,646,647],{},[14,648,649],{},"(node, ctx)",[44,651,652],{},"For each schema node.",[29,654,655,660,664],{},[44,656,657],{},[14,658,659],{},"kubb:generate:operation",[44,661,662],{},[14,663,649],{},[44,665,666],{},"For each operation node.",[29,668,669,674,679],{},[44,670,671],{},[14,672,673],{},"kubb:generate:operations",[44,675,676],{},[14,677,678],{},"(nodes, ctx)",[44,680,681],{},"Once, with every operation node.",[29,683,684,689,694],{},[44,685,686],{},[14,687,688],{},"kubb:plugin:end",[44,690,691],{},[14,692,693],{},"{ plugin, duration, success, error, config, files, upsertFile }",[44,695,696],{},"After a plugin finishes.",[29,698,699,704,709],{},[44,700,701],{},[14,702,703],{},"kubb:plugins:end",[44,705,706],{},[14,707,708],{},"{ config, files, upsertFile }",[44,710,711],{},"After every plugin, before files reach the storage. Add aggregate files, such as a barrel, here.",[29,713,714,719,724],{},[44,715,716],{},[14,717,718],{},"kubb:files:processing:start",[44,720,721],{},[14,722,723],{},"{ files }",[44,725,726],{},"Before the generated files are written.",[29,728,729,734,738],{},[44,730,731],{},[14,732,733],{},"kubb:files:processing:update",[44,735,736],{},[14,737,723],{},[44,739,740,741,743,744,747,748,751],{},"As files are written. ",[14,742,365],{}," holds progress records (",[14,745,746],{},"{ processed, total, percentage, file, config }","), not ",[14,749,750],{},"FileNode","s.",[29,753,754,759,764],{},[44,755,756],{},[14,757,758],{},"kubb:file:processed",[44,760,761],{},[14,762,763],{},"{ file, source, stored }",[44,765,766,767,770,771,774,775,228],{},"After each file is printed and handed to the storage. ",[14,768,769],{},"stored"," is the previous content, or ",[14,772,773],{},"null",". See ",[48,776,778],{"href":777},"#file-hook-payloads","File hook payloads",[29,780,781,786,791],{},[44,782,783],{},[14,784,785],{},"kubb:files:processing:end",[44,787,788],{},[14,789,790],{},"{ files, unchanged }",[44,792,793,794,797],{},"After every file is written. ",[14,795,796],{},"unchanged"," lists the paths whose content did not change.",[29,799,800,804,809],{},[44,801,802],{},[14,803,64],{},[44,805,806],{},[14,807,808],{},"{ files, config, outputDir }",[44,810,811],{},"After every file is written and the adapter has settled.",[10,813,814,815,818,819,89,822,825],{},"Kit fires the ",[14,816,817],{},"kubb:generate:*"," hooks, not core: only plugins defined with ",[14,820,821],{},"defineExtension",[14,823,824],{},"kubb\u002Fkit"," emit them, and only when an adapter parsed input.",[102,827,829],{"id":828},"output-passes","Output passes",[10,831,832,833,835,836,839,840,244,843,846,847,228],{},"These hooks fire after a build without errors, only from ",[14,834,417],{}," with ",[14,837,838],{},"fsStorage",". Each group fires only when the config sets ",[14,841,842],{},"output.format",[14,844,845],{},"output.lint",", or ",[14,848,849],{},"output.postGenerate",[23,851,852,862],{},[26,853,854],{},[29,855,856,858,860],{},[32,857,444],{},[32,859,447],{},[32,861,450],{},[39,863,864,876,888,900,912,928,946,964,988],{},[29,865,866,871,873],{},[44,867,868],{},[14,869,870],{},"kubb:format:start",[44,872,495],{},[44,874,875],{},"Before the formatter runs.",[29,877,878,883,885],{},[44,879,880],{},[14,881,882],{},"kubb:format:end",[44,884,495],{},[44,886,887],{},"After formatting.",[29,889,890,895,897],{},[44,891,892],{},[14,893,894],{},"kubb:lint:start",[44,896,495],{},[44,898,899],{},"Before the linter runs.",[29,901,902,907,909],{},[44,903,904],{},[14,905,906],{},"kubb:lint:end",[44,908,495],{},[44,910,911],{},"After linting.",[29,913,914,919,921],{},[44,915,916],{},[14,917,918],{},"kubb:commands:start",[44,920,495],{},[44,922,923,924,927],{},"Before the ",[14,925,926],{},"postGenerate"," commands run.",[29,929,930,935,940],{},[44,931,932],{},[14,933,934],{},"kubb:command:start",[44,936,937],{},[14,938,939],{},"{ id, command, name, args }",[44,941,942,943,945],{},"Before one ",[14,944,926],{}," command runs.",[29,947,948,953,958],{},[44,949,950],{},[14,951,952],{},"kubb:command:line",[44,954,955],{},[14,956,957],{},"{ id, line }",[44,959,960,961,963],{},"For each output line of a ",[14,962,926],{}," command.",[29,965,966,971,976],{},[44,967,968],{},[14,969,970],{},"kubb:command:end",[44,972,973],{},[14,974,975],{},"{ id, command, name, args, success, error }",[44,977,978,979,981,982,73,985,228],{},"After one ",[14,980,926],{}," command finishes. A failed command also carries ",[14,983,984],{},"stdout",[14,986,987],{},"stderr",[29,989,990,995,997],{},[44,991,992],{},[14,993,994],{},"kubb:commands:end",[44,996,495],{},[44,998,999,1000,1002],{},"After every ",[14,1001,926],{}," command. Also fires when the run is aborted between them.",[10,1004,1005,1006,1008,1009,244,1012,244,1015,244,1018,73,1021,1024,1025,228],{},"The ",[14,1007,926],{}," events also fire under their old names, ",[14,1010,1011],{},"kubb:hooks:start",[14,1013,1014],{},"kubb:hook:start",[14,1016,1017],{},"kubb:hook:line",[14,1019,1020],{},"kubb:hook:end",[14,1022,1023],{},"kubb:hooks:end",". Those names are deprecated and Kubb v6 removes them. See ",[48,1026,1028],{"href":1027},"\u002Fdocs\u002F5.x\u002Freference\u002Fdeprecations#kubb-core","Deprecations",[102,1030,1032],{"id":1031},"messaging","Messaging",[10,1034,1035],{},"These hooks carry log messages and diagnostics, and fire at any point.",[23,1037,1038,1049],{},[26,1039,1040],{},[29,1041,1042,1044,1046],{},[32,1043,444],{},[32,1045,447],{},[32,1047,1048],{},"Fires for",[39,1050,1051,1066,1080,1094,1109],{},[29,1052,1053,1058,1063],{},[44,1054,1055],{},[14,1056,1057],{},"kubb:info",[44,1059,1060],{},[14,1061,1062],{},"{ message, info }",[44,1064,1065],{},"An informational message.",[29,1067,1068,1073,1077],{},[44,1069,1070],{},[14,1071,1072],{},"kubb:success",[44,1074,1075],{},[14,1076,1062],{},[44,1078,1079],{},"A step that completed.",[29,1081,1082,1087,1091],{},[44,1083,1084],{},[14,1085,1086],{},"kubb:warn",[44,1088,1089],{},[14,1090,1062],{},[44,1092,1093],{},"A problem that does not fail the build.",[29,1095,1096,1101,1106],{},[44,1097,1098],{},[14,1099,1100],{},"kubb:error",[44,1102,1103],{},[14,1104,1105],{},"{ error, meta }",[44,1107,1108],{},"An error without a diagnostic code, so its stack survives.",[29,1110,1111,1116,1121],{},[44,1112,1113],{},[14,1114,1115],{},"kubb:diagnostic",[44,1117,1118],{},[14,1119,1120],{},"{ diagnostic }",[44,1122,1123,1124,228],{},"A coded error, warning, or info, or an update notice. See ",[48,1125,1127],{"href":1126},"\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics","diagnostics",[10,1129,1130,1134],{},[48,1131,1133],{"href":1132},"\u002Fdocs\u002F5.x\u002Fintroduction\u002Farchitecture#lifecycle","Architecture"," explains the lifecycle.",[102,1136,1138],{"id":1137},"less-common-cases","Less common cases",[1140,1141,1143],"h3",{"id":1142},"hook-listener-scope","Hook listener scope",[10,1145,1146,1147,1149,1150,61,1152,65,1154,228],{},"When your plugin listens through its ",[14,1148,53],{}," map, it gets the hooks from ",[14,1151,60],{},[14,1153,64],{},[14,1155,68],{},[1157,1158,1159,1163,1172,1182,1211,1222],"ul",{},[1160,1161,1162],"li",{},"Kubb adds these listeners during setup and removes them when the build ends.",[1160,1164,1165,1166,73,1168,77,1170,81],{},"They miss the ",[14,1167,72],{},[14,1169,76],{},[14,1171,80],{},[1160,1173,1174,1176,1177,605,1179,1181],{},[14,1175,68],{}," fires once per plugin, after its ",[14,1178,423],{},[14,1180,608],{},". Kubb calls the plugin's own handler directly.",[1160,1183,1184,1185,1188,1189,1192,1193,431,1195,1197,1198,1201,1202,1204,1205,1207,1208,1210],{},"Each listener runs with a context as ",[14,1186,1187],{},"this",", the same object ",[14,1190,1191],{},"useKubb()"," returns. For a hook Kubb fires, such as ",[14,1194,608],{},[14,1196,703],{},", that is the plugin's own visit context, the ",[14,1199,1200],{},"ctx"," its visit hooks get. For a hook fired inside another hook, it is the context of the hook that fired it. The ",[14,1203,817],{}," hooks run with the template context, so ",[14,1206,1187],{}," is the ",[14,1209,1200],{}," argument.",[1160,1212,1213,1215,1216,1218,1219,1221],{},[14,1214,459],{}," fires when ",[14,1217,470],{}," starts, before the first config. ",[14,1220,417],{}," and the bundler plugins skip it.",[1160,1223,1224,1225,1231],{},"When a listener throws during the build, Kubb reports ",[48,1226,1228],{"href":1227},"\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics#kubb-plugin-failed",[14,1229,1230],{},"KUBB_PLUGIN_FAILED"," for its plugin and goes on, as for a visit hook. The other plugins still run and their files are still written.",[1140,1233,1235],{"id":1234},"visit-hooks","Visit hooks",[10,1237,46,1238,1240,1241,228],{},[14,1239,53],{}," map can also hold four visit hooks. Kubb calls them for that plugin only, while it walks the input, and they never reach ",[14,1242,1243],{},"kubb.hooks",[23,1245,1246,1256],{},[26,1247,1248],{},[29,1249,1250,1252,1254],{},[32,1251,444],{},[32,1253,447],{},[32,1255,450],{},[39,1257,1258,1273,1287,1300],{},[29,1259,1260,1265,1270],{},[44,1261,1262],{},[14,1263,1264],{},"kubb:plugin:visit:start",[44,1266,1267],{},[14,1268,1269],{},"(ctx)",[44,1271,1272],{},"Once, before the first schema.",[29,1274,1275,1280,1284],{},[44,1276,1277],{},[14,1278,1279],{},"kubb:plugin:visit:schema",[44,1281,1282],{},[14,1283,649],{},[44,1285,1286],{},"For each schema node, before the operations.",[29,1288,1289,1294,1298],{},[44,1290,1291],{},[14,1292,1293],{},"kubb:plugin:visit:operation",[44,1295,1296],{},[14,1297,649],{},[44,1299,666],{},[29,1301,1302,1307,1311],{},[44,1303,1304],{},[14,1305,1306],{},"kubb:plugin:visit:end",[44,1308,1309],{},[14,1310,1269],{},[44,1312,1313],{},"Once, after the last operation.",[10,1315,1316,1318,1319,244,1322,1325,1326,1329,1330,244,1332,73,1334,1336,1337,1340,1341,89,1343,1345,1346,1348],{},[14,1317,1200],{}," is the template context without ",[14,1320,1321],{},"resolver",[14,1323,1324],{},"getResolver"," and per-node ",[14,1327,1328],{},"options",", which only templates get. ",[14,1331,1187],{},[14,1333,1200],{},[14,1335,1191],{}," are the same object, the one the plugin's other hooks get, and composables such as ",[14,1338,1339],{},"memo()"," work there. A plugin defined with ",[14,1342,821],{},[14,1344,824],{}," runs its templates before its own visit hooks, with a resolver fixed when the walk starts. Each node reaches every plugin in plugin order before the walk moves on. When a visit hook throws, Kubb stops that plugin, reports ",[14,1347,1230],{},", and runs the other plugins to the end. For the schema and operation hooks, the diagnostic names the node it failed on.",[1140,1350,778],{"id":1351},"file-hook-payloads",[10,1353,1354,1355,1357,1358,1360],{},"When you listen to ",[14,1356,758],{},", you get ",[14,1359,763],{}," after each file is printed and handed to the storage.",[23,1362,1363,1373],{},[26,1364,1365],{},[29,1366,1367,1370],{},[32,1368,1369],{},"Field",[32,1371,1372],{},"Holds",[39,1374,1375,1385],{},[29,1376,1377,1382],{},[44,1378,1379],{},[14,1380,1381],{},"source",[44,1383,1384],{},"The text before any output pass.",[29,1386,1387,1391],{},[44,1388,1389],{},[14,1390,769],{},[44,1392,1393,1394,1396,1397,1400],{},"What the storage held at that path, or ",[14,1395,773],{}," when the path was empty or ",[14,1398,1399],{},"output.clean"," emptied its folder.",{"title":1402,"searchDepth":1403,"depth":1403,"links":1404},"",5,[1405,1407,1408,1409,1410,1411,1412],{"id":104,"depth":1406,"text":105},2,{"id":401,"depth":1406,"text":402},{"id":411,"depth":1406,"text":412},{"id":560,"depth":1406,"text":561},{"id":828,"depth":1406,"text":829},{"id":1031,"depth":1406,"text":1032},{"id":1137,"depth":1406,"text":1138,"children":1413},[1414,1416,1417],{"id":1142,"depth":1415,"text":1143},3,{"id":1234,"depth":1415,"text":1235},{"id":1351,"depth":1415,"text":778},"Every kubb:* hook a build fires, its payload, and when it fires. Listen with kubb.hooks.hook(name, handler) or from a plugin's hooks map.","md",{"layout":1421,"title":5,"description":1418,"outline":1422,"order":1423,"navigation":1424},"doc",[1406,1415],11,{"title":1425,"icon":1426},"Lifecycle hooks","i-iconoir-refresh-double",{"layout":1421,"outline":1428},[1406,1415],{"title":1425,"icon":1426},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks",{"title":5,"description":1418},{"loc":1430},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fhooks.md","docs\u002F5.x\u002Freference\u002Fkit\u002Fhooks","cr1eKDWFukMebmXPFrIVmaSdCoW3DXAbk1BgHKyqUfk",1795989037918,"2e8b4c62-5b8c-4587-97c0-530d08a9bd53"]