({ configPath }: NextPluginOptions)
| 15 | let contentlayerInitialized = false |
| 16 | |
| 17 | const runContentlayerDev = async ({ configPath }: NextPluginOptions) => { |
| 18 | if (contentlayerInitialized) return |
| 19 | contentlayerInitialized = true |
| 20 | |
| 21 | await pipe( |
| 22 | core.getConfigWatch({ configPath }), |
| 23 | S.tapSkipFirstRight(() => T.log(`Contentlayer config change detected. Updating type definitions and data...`)), |
| 24 | S.tapRight((config) => (config.source.options.disableImportAliasWarning ? T.unit : T.fork(core.validateTsconfig))), |
| 25 | S.chainSwitchMapEitherRight((config) => core.generateDotpkgStream({ config, verbose: false, isDev: true })), |
| 26 | S.tap(E.fold((error) => T.log(errorToString(error)), core.logGenerateInfo)), |
| 27 | S.runDrain, |
| 28 | runMain, |
| 29 | ) |
| 30 | } |
| 31 | |
| 32 | const runContentlayerBuild = async ({ configPath }: NextPluginOptions) => { |
| 33 | if (contentlayerInitialized) return |
no test coverage detected
searching dependent graphs…