How to use the @canopycanopycanopy/b-ber-logger.info function in @canopycanopycanopy/b-ber-logger

To help you get started, we’ve selected a few @canopycanopycanopy/b-ber-logger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github triplecanopy / b-ber / packages / b-ber-tasks / src / opf / Navigation.js View on Github external
static createSpineStringsFromTemplate() {
    log.info('opf build [spine]')

    const { flattened } = state.spine

    // We add entries to the spine programatically, but then they're
    // also found on the system, so we dedupe them here
    // TODO: but also, this is super confusing ...
    const generatedFiles = remove(flattened, file => file.generated === true)

    generatedFiles.forEach(file => {
      if (!find(flattened, { fileName: file.fileName })) {
        flattened.push(file)
      }
    })

    const spineXML = Spine.items(flattened)
github triplecanopy / b-ber / packages / b-ber-templates / src / Opf / Spine.js View on Github external
if (curr.linear === false) {
        if (state.build === 'mobi') {
          log.info(
            `opf templates/spine omitting non-linear asset [${fileName}] for mobi build`
          )
          return acc
        }

        log.info(`opf templates/spine writing non-linear asset [${fileName}]`)
      }

      if (fileName.match(/figure/)) {
        // TODO: this should be handled more transparently, rn it feels a bit like a side-effect
        // https://github.com/triplecanopy/b-ber/issues/208

        log.info('opf templates/spine writing [loi]')

        if (state.loi.length) {
          return acc.concat(
            state.loi.reduce(
              (acc2, curr2) =>
                acc2.concat(Spine.item({ ...curr2, linear: true })),
              Spine.item(curr)
            )
          )
        }
      }

      return acc.concat(Spine.item(curr))
    }, '')
  }
github triplecanopy / b-ber / packages / b-ber-tasks / src / opf / Navigation.js View on Github external
static createGuideStringsFromTemplate() {
    log.info('opf build [guide]')

    const guideXML = Guide.items(state.guide)

    return Template.render(guideXML, Guide.body())
  }
github triplecanopy / b-ber / packages / b-ber-cli / src / cmd / clean.js View on Github external
if (!d) {
        throw new Error('Specify a directory to remove')
    }

    let dirPath
    try {
        dirPath = path.resolve(process.cwd(), d)
    } catch (err) {
        throw err
    }

    if (!fs.existsSync(dirPath)) {
        throw new Error(`The directory [${dirPath}] does not exist`)
    }

    return clean(dirPath).then(log.info(`remove [${dirPath}]`))
}
github triplecanopy / b-ber / packages / b-ber-tasks / src / opf / Navigation.js View on Github external
static async createTocStringsFromTemplate() {
    log.info('opf build [toc.xhtml]')

    const { toc } = state
    const data = new File({
      contents: Buffer.from(Template.render(Toc.items(toc), Toc.body())),
    })
    const file = [{ name: 'toc.xhtml', data }]
    const [{ contents }] = await getFileObjects(file)

    return contents
  }
github triplecanopy / b-ber / packages / b-ber-tasks / src / scripts / index.js View on Github external
.then(() =>
        log.info(
          'scripts emit [%s]',
          `javascripts${path.sep}${path.basename(output)}`
        )
      )
github triplecanopy / b-ber / packages / b-ber-tasks / src / clean / index.js View on Github external
      .then(() => log.info('clean remove [%s]', state.distDir))
  )
github triplecanopy / b-ber / packages / b-ber-tasks / src / copy / index.js View on Github external
files.forEach(file => {
                    const { size } = fs.statSync(path.join(dir.to, file))

                    log.info('copy [%s - {%d}]', `${baseTo}/${file}`, size)

                    if (size > FILE_SIZE_WARNING_LIMIT) {
                        log.warn(
                            'copy [%s - {%d}] exceeds recommended file size of {%d}',
                            file,
                            size,
                            FILE_SIZE_WARNING_LIMIT
                        )
                    }
                })
            })
github triplecanopy / b-ber / packages / b-ber-tasks / src / cover / index.js View on Github external
.then(() => {
                        log.info('cover generated image [%s]', this.coverImagePath)
                        resolve()
                    })
                    .catch(log.error)
github triplecanopy / b-ber / packages / b-ber-tasks / src / opf / Navigation.js View on Github external
static createEmptyNavDocuments() {
    const navDocs = ['toc.ncx', 'toc.xhtml']

    log.info(`opf build navigation documents [${navDocs.join(', ')}]`)

    const promises = navDocs.map(doc => fs.writeFile(state.dist.ops(doc), ''))
    return Promise.all(promises)
  }

@canopycanopycanopy/b-ber-logger

`b-ber-logger` is b-ber's console logger.

GPL-3.0-or-later
Latest version published 3 months ago

Package Health Score

69 / 100
Full package analysis

Similar packages