Skip to content

Allow typstx's debug information to be disabled #40

@HPCesia

Description

@HPCesia

The dependency typstx outputs a lot of hast debug information during build. This debugging information should be able to be turned off.

The debug information was introduced in this commit. I found the commit by add codes below to astro.config.mjs and run pnpm build in an Astro project installed astro-typst.

const originalLog = console.log;
console.log = function (...args) {
  originalLog(...args);
  console.trace();
};
part of outputs
Get HastElementContent.
result {
  children: [
    {
      children: [Array],
      properties: {},
      tagName: 'p',
      type: 'element'
    },
  ],
  properties: {},
  tagName: 'body',
  type: 'element',
  data: { jsxImports: [] }
}
Trace
    at console.log (/home/hpcesia/Development/tybios/astro.config.ts:25:11)
    at file:///home/hpcesia/Development/tybios/node_modules/.pnpm/typstx@0.0.1-beta.1/node_modules/typstx/lib/core.js:222:13
    at wrapped (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.js:160:27)
    at next (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.js:86:23)
    at Object.run (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/trough@2.2.0/node_modules/trough/lib/index.js:57:5)
    at executor (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js:901:20)
    at apply.run (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js:884:19)
    at executor (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js:737:12)
    at new Promise ()
    at apply.process (file:///home/hpcesia/Development/tybios/node_modules/.pnpm/unified@11.0.5/node_modules/unified/lib/index.js:720:47)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions