weasyprint-tsx 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,7 +10,7 @@ Write PDFs in TSX. Uses [Bun](https://bun.sh) to bundle your Preact components i
10
10
  ## Quick start
11
11
 
12
12
  ```bash
13
- bunx create-weasyprint-tsx my-doc
13
+ bunx @weasyprint-tsx/create my-doc
14
14
  cd my-doc
15
15
  bun install
16
16
  bun run dev
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weasyprint-tsx",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "bin": {
5
5
  "create-weasyprint-tsx": "bun packages/create/cli.ts",
6
6
  "build-weasyprint-tsx": "bun packages/build/src/cli.ts"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasyprint-tsx/build",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "main": "./src/index.ts",
5
5
  "exports": { ".": "./src/index.ts" },
6
6
  "types": "./src/index.ts",
@@ -11,7 +11,7 @@ export interface Config {
11
11
  stylesheets?: string[];
12
12
  };
13
13
  weasyprint?: {
14
- path: string;
14
+ path?: string;
15
15
  verbose?: boolean;
16
16
  pdf_forms?: boolean;
17
17
  optimize_images?: boolean;
@@ -48,7 +48,7 @@ const defaultConfig = {
48
48
  },
49
49
  } satisfies Config;
50
50
 
51
- export type DConfig = typeof defaultConfig & Config;
51
+ export type DConfig = Config & typeof defaultConfig;
52
52
 
53
53
  export function isObject(item: any) {
54
54
  return item && typeof item === "object" && !Array.isArray(item);
@@ -81,7 +81,7 @@ export async function loadConfig(): Promise<DConfig> {
81
81
  let config = defaultConfig;
82
82
  try {
83
83
  const { default: userConfig } = await import(`${configPath}`);
84
- config = mergeDeep(config, userConfig) as unknown as DConfig;
84
+ config = mergeDeep(config, userConfig) as Config as DConfig;
85
85
  } catch (e) {
86
86
  process.stdout.write(
87
87
  `No config file at ${configPath} found, using default.`,
@@ -17,7 +17,7 @@ export async function devMode(output?: string) {
17
17
  const WATCH_DIRS = cfg.dev.watch.map((p) => join(process.cwd(), p));
18
18
 
19
19
  if (output) cfg.io.output = cfg.io.output ?? output;
20
- process.stdout.write(`Dev: http://localhost:${cfg.dev.port}`);
20
+ process.stdout.write(`Dev: http://localhost:${cfg.dev.port}\n`);
21
21
 
22
22
  let pdfBusy = false;
23
23
  let lastHash: number | BigInt = 0;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weasyprint-tsx/ui",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "exports": {
5
5
  ".": "./src/index.ts"
6
6
  },
@@ -80,7 +80,7 @@ function formatNumber(tex: string | undefined) {
80
80
  });
81
81
  }
82
82
 
83
- export function Eq(props: SymbolProps) {
83
+ export function LtX(props: SymbolProps) {
84
84
  return symbolFactory((_, children) => {
85
85
  return formatNumber(children);
86
86
  })(props);
@@ -1,5 +1,5 @@
1
1
  .ol {
2
- & > .li {
2
+ .li {
3
3
  counter-increment: list-items;
4
4
  &::before {
5
5
  content: var(--ol-marker-pre, "") counter(list-items, decimal)
@@ -5,8 +5,8 @@ export type { CodeBlockProps } from "./CodeBlock";
5
5
  export { DotLine } from "./DotLine";
6
6
  export type { DotLineProps } from "./DotLine";
7
7
  export {
8
- Eq, Equation,
9
- functionFactory, symbolFactory,
8
+ Equation,
9
+ functionFactory, LtX, symbolFactory,
10
10
  underscriptFactory
11
11
  } from "./Equation";
12
12
  export type { EquationProps, SymbolProps } from "./Equation";
package/src/index.tsx CHANGED
@@ -82,11 +82,9 @@ export default function Document() {
82
82
  </UL>
83
83
  </div>
84
84
  <div className="w-1/2">
85
- <H3 color="#1e40af">
86
- Quick start
87
- </H3>
85
+ <H3 color="#1e40af">Quick start</H3>
88
86
  <OL>
89
- <LI>bunx create-weasyprint-tsx my-doc</LI>
87
+ <LI>bunx @weasyprint-tsx/create my-doc</LI>
90
88
  <LI>cd my-doc &amp;&amp; bun install</LI>
91
89
  <LI>bun run dev</LI>
92
90
  </OL>
@@ -1,15 +1,15 @@
1
1
  import { Config } from "./packages/build/src/config";
2
2
 
3
3
  export default {
4
- // io: {
5
- // output: "ReadMe.pdf",
6
- // },
7
-
8
4
  io: {
9
- output: "TestUI.pdf",
10
- input: "testUI/index.tsx",
11
- },
12
- dev: {
13
- watch: ["packages/ui/", "testUI"],
5
+ output: "ReadMe.pdf",
14
6
  },
7
+
8
+ // io: {
9
+ // output: "TestUI.pdf",
10
+ // input: "testUI/index.tsx",
11
+ // },
12
+ // dev: {
13
+ // watch: ["packages/ui/", "testUI"],
14
+ // },
15
15
  } satisfies Config;