zudoku 0.34.2 → 0.34.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.
@@ -1,30 +1,28 @@
1
- import express from "express";
2
1
  import path from "node:path";
3
- import { joinUrl } from "../../lib/util/joinUrl.js";
2
+ import { preview as vitePreview } from "vite";
4
3
  import { getViteConfig } from "../../vite/config.js";
5
4
  import { printDiagnosticsToConsole } from "../common/output.js";
6
- import { findAvailablePort } from "../common/utils/ports.js";
7
5
  export const DEFAULT_PREVIEW_PORT = 4000;
8
6
  export async function preview(argv) {
9
7
  const dir = path.resolve(process.cwd(), argv.dir);
10
- const distDir = path.join(dir, "dist");
11
8
  const viteConfig = await getViteConfig(dir, {
12
9
  command: "serve",
13
10
  mode: "production",
11
+ isPreview: true,
14
12
  });
15
- printDiagnosticsToConsole("Starting build preview server");
16
- printDiagnosticsToConsole("");
17
- const port = await findAvailablePort(argv.port ?? DEFAULT_PREVIEW_PORT);
18
- const app = express();
19
- app.use(express.static(distDir, { extensions: ["html"] }));
20
- const server = app.listen(port, () => {
21
- const url = joinUrl(`http://localhost:${port}`, viteConfig.base);
22
- printDiagnosticsToConsole(`Build preview server running at: ${url}`);
23
- printDiagnosticsToConsole("Press Ctrl+C to stop");
13
+ const server = await vitePreview({
14
+ ...viteConfig,
15
+ appType: "mpa", // to serve the static generated files
16
+ preview: {
17
+ port: argv.port ?? DEFAULT_PREVIEW_PORT,
18
+ },
24
19
  });
20
+ printDiagnosticsToConsole("");
21
+ printDiagnosticsToConsole(`Build preview server running at: ${server.resolvedUrls?.local[0]}`);
22
+ printDiagnosticsToConsole("Press Ctrl+C to stop");
25
23
  await new Promise((resolve) => {
26
- const exit = () => {
27
- server.close();
24
+ const exit = async () => {
25
+ await server.close();
28
26
  resolve();
29
27
  };
30
28
  process.on("SIGINT", exit);
@@ -1 +1 @@
1
- {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/cli/preview/handler.ts"],"names":[],"mappings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C;IAEH,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC;QAC/B,GAAG,UAAU;QACb,OAAO,EAAE,KAAK,EAAE,sCAAsC;QACtD,OAAO,EAAE;YACP,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,oBAAoB;SACxC;KACF,CAAC,CAAC;IAEH,yBAAyB,CAAC,EAAE,CAAC,CAAC;IAC9B,yBAAyB,CACvB,oCAAoC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CACpE,CAAC;IACF,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;IAElD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;QAClC,MAAM,IAAI,GAAG,KAAK,IAAI,EAAE;YACtB,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QAC5B,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QACtC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;QACvC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,4 +1,3 @@
1
1
  import type { PropsWithChildren } from "react";
2
- import "./Stepper.css";
3
2
  declare const Stepper: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
4
3
  export { Stepper };
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "./Stepper.css";
2
+ // "stepper" class is defined in main.css
3
3
  const Stepper = ({ children }) => {
4
4
  return _jsx("div", { className: "stepper", children: children });
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../../../src/lib/ui/Stepper.tsx"],"names":[],"mappings":";AACA,OAAO,eAAe,CAAC;AAEvB,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAClD,OAAO,cAAK,SAAS,EAAC,SAAS,YAAE,QAAQ,GAAO,CAAC;AACnD,CAAC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"Stepper.js","sourceRoot":"","sources":["../../../src/lib/ui/Stepper.tsx"],"names":[],"mappings":";AAEA,yCAAyC;AACzC,MAAM,OAAO,GAAG,CAAC,EAAE,QAAQ,EAAqB,EAAE,EAAE;IAClD,OAAO,cAAK,SAAS,EAAC,SAAS,YAAE,QAAQ,GAAO,CAAC;AACnD,CAAC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Stepper.js","sources":["../../src/lib/ui/Stepper.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\nimport \"./Stepper.css\";\n\nconst Stepper = ({ children }: PropsWithChildren) => {\n return <div className=\"stepper\">{children}</div>;\n};\n\nexport { Stepper };\n"],"names":["Stepper","children","jsx"],"mappings":";AAGA,MAAMA,IAAU,CAAC,EAAE,UAAAC,QACTC,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,WAAW,UAAAD,EAAS,CAAA;"}
1
+ {"version":3,"file":"Stepper.js","sources":["../../src/lib/ui/Stepper.tsx"],"sourcesContent":["import type { PropsWithChildren } from \"react\";\n\n// \"stepper\" class is defined in main.css\nconst Stepper = ({ children }: PropsWithChildren) => {\n return <div className=\"stepper\">{children}</div>;\n};\n\nexport { Stepper };\n"],"names":["Stepper","children","jsx"],"mappings":";AAGA,MAAMA,IAAU,CAAC,EAAE,UAAAC,QACTC,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,WAAW,UAAAD,EAAS,CAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.34.2",
3
+ "version": "0.34.3",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
package/src/app/main.css CHANGED
@@ -239,61 +239,96 @@
239
239
  }
240
240
 
241
241
  /* Theme */
242
+ :root {
243
+ --background: 0 0% 100%;
244
+ --foreground: 240 10% 3.9%;
245
+ --card: 0 0% 100%;
246
+ --card-foreground: 240 10% 3.9%;
247
+ --popover: 0 0% 100%;
248
+ --popover-foreground: 240 10% 3.9%;
249
+ --primary: 240 5.9% 10%;
250
+ --primary-foreground: 0 0% 98%;
251
+ --secondary: 240 4.8% 95.9%;
252
+ --secondary-foreground: 240 5.9% 10%;
253
+ --muted: 240 4.8% 95.9%;
254
+ --muted-foreground: 240 3.8% 46.1%;
255
+ --accent: 240 4.8% 95.9%;
256
+ --accent-foreground: 240 5.9% 10%;
257
+ --destructive: 0 84.2% 60.2%;
258
+ --destructive-foreground: 0 0% 98%;
259
+ --border: 240 5.9% 95%;
260
+ --input: 240 5.9% 90%;
261
+ --ring: 240 5.9% 10%;
262
+ --radius: 0.75rem;
263
+ --chart-1: 12 76% 61%;
264
+ --chart-2: 173 58% 39%;
265
+ --chart-3: 197 37% 24%;
266
+ --chart-4: 43 74% 66%;
267
+ --chart-5: 27 87% 67%;
268
+ }
242
269
 
243
- @layer base {
244
- :root {
245
- --background: 0 0% 100%;
246
- --foreground: 240 10% 3.9%;
247
- --card: 0 0% 100%;
248
- --card-foreground: 240 10% 3.9%;
249
- --popover: 0 0% 100%;
250
- --popover-foreground: 240 10% 3.9%;
251
- --primary: 240 5.9% 10%;
252
- --primary-foreground: 0 0% 98%;
253
- --secondary: 240 4.8% 95.9%;
254
- --secondary-foreground: 240 5.9% 10%;
255
- --muted: 240 4.8% 95.9%;
256
- --muted-foreground: 240 3.8% 46.1%;
257
- --accent: 240 4.8% 95.9%;
258
- --accent-foreground: 240 5.9% 10%;
259
- --destructive: 0 84.2% 60.2%;
260
- --destructive-foreground: 0 0% 98%;
261
- --border: 240 5.9% 95%;
262
- --input: 240 5.9% 90%;
263
- --ring: 240 5.9% 10%;
264
- --radius: 0.75rem;
265
- --chart-1: 12 76% 61%;
266
- --chart-2: 173 58% 39%;
267
- --chart-3: 197 37% 24%;
268
- --chart-4: 43 74% 66%;
269
- --chart-5: 27 87% 67%;
270
- }
270
+ .dark {
271
+ --background: 240 10% 3.9%;
272
+ --foreground: 0 0% 98%;
273
+ --card: 240 10% 3.9%;
274
+ --card-foreground: 0 0% 98%;
275
+ --popover: 240 10% 3.9%;
276
+ --popover-foreground: 0 0% 98%;
277
+ --primary: 0 0% 98%;
278
+ --primary-foreground: 240 5.9% 10%;
279
+ --secondary: 240 3.7% 15.9%;
280
+ --secondary-foreground: 0 0% 98%;
281
+ --muted: 240 3.7% 15.9%;
282
+ --muted-foreground: 240 5% 64.9%;
283
+ --accent: 240 3.7% 15.9%;
284
+ --accent-foreground: 0 0% 98%;
285
+ --destructive: 0 62.8% 30.6%;
286
+ --destructive-foreground: 0 0% 98%;
287
+ --border: 240 3.7% 15.9%;
288
+ --input: 240 3.7% 15.9%;
289
+ --ring: 240 4.9% 83.9%;
290
+ --chart-1: 220 70% 50%;
291
+ --chart-2: 160 60% 45%;
292
+ --chart-3: 30 80% 55%;
293
+ --chart-4: 280 65% 60%;
294
+ --chart-5: 340 75% 55%;
295
+ }
296
+ }
271
297
 
272
- .dark {
273
- --background: 240 10% 3.9%;
274
- --foreground: 0 0% 98%;
275
- --card: 240 10% 3.9%;
276
- --card-foreground: 0 0% 98%;
277
- --popover: 240 10% 3.9%;
278
- --popover-foreground: 0 0% 98%;
279
- --primary: 0 0% 98%;
280
- --primary-foreground: 240 5.9% 10%;
281
- --secondary: 240 3.7% 15.9%;
282
- --secondary-foreground: 0 0% 98%;
283
- --muted: 240 3.7% 15.9%;
284
- --muted-foreground: 240 5% 64.9%;
285
- --accent: 240 3.7% 15.9%;
286
- --accent-foreground: 0 0% 98%;
287
- --destructive: 0 62.8% 30.6%;
288
- --destructive-foreground: 0 0% 98%;
289
- --border: 240 3.7% 15.9%;
290
- --input: 240 3.7% 15.9%;
291
- --ring: 240 4.9% 83.9%;
292
- --chart-1: 220 70% 50%;
293
- --chart-2: 160 60% 45%;
294
- --chart-3: 30 80% 55%;
295
- --chart-4: 280 65% 60%;
296
- --chart-5: 340 75% 55%;
297
- }
298
+ @layer components {
299
+ .stepper > ol {
300
+ --bullet-size: 1.75rem;
301
+ --line-spacing: 0.25rem;
302
+ @apply flex flex-col list-none p-0 m-0;
303
+ counter-reset: step-counter;
304
+ }
305
+
306
+ .stepper > ol > li {
307
+ @apply relative ps-12 pb-6 my-0;
308
+ counter-increment: step-counter;
309
+ }
310
+
311
+ .stepper > ol > li:last-child {
312
+ @apply pb-0;
313
+ }
314
+
315
+ /* Bullet with number */
316
+ .stepper > ol > li::before {
317
+ @apply absolute left-0 flex items-center justify-center size-[--bullet-size];
318
+ @apply bg-muted/80 border border-border text-muted-foreground text-[calc(var(--bullet-size)/2)] font-semibold rounded-full;
319
+ content: counter(step-counter);
320
+ }
321
+
322
+ /* Vertical line */
323
+ .stepper > ol > li::after {
324
+ @apply absolute content-[''] w-[2px] bg-border -translate-x-1/2;
325
+ left: calc(var(--bullet-size) / 2);
326
+ top: calc(var(--bullet-size) + var(--line-spacing));
327
+ height: calc(100% - var(--bullet-size) - (2 * var(--line-spacing)));
328
+ }
329
+
330
+ .stepper > ol > li > :first-child {
331
+ @apply mt-0 pt-0;
332
+ transform: translateY(calc((var(--bullet-size) - 1lh) / 2));
298
333
  }
299
334
  }
@@ -1,6 +1,6 @@
1
1
  import type { PropsWithChildren } from "react";
2
- import "./Stepper.css";
3
2
 
3
+ // "stepper" class is defined in main.css
4
4
  const Stepper = ({ children }: PropsWithChildren) => {
5
5
  return <div className="stepper">{children}</div>;
6
6
  };
package/lib/zudoku.css DELETED
@@ -1 +0,0 @@
1
- @tailwind components;@layer components{.stepper>ol{--bullet-size: 1.75rem;--line-spacing: .25rem;@apply flex flex-col list-none p-0 m-0;counter-reset:step-counter}.stepper>ol>li{@apply relative ps-12 pb-6 my-0;counter-increment:step-counter}.stepper>ol>li:last-child{@apply pb-0;}.stepper>ol>li:before{@apply absolute left-0 flex items-center justify-center size-[--bullet-size];@apply bg-muted/80 border border-border text-muted-foreground text-[calc(var(--bullet-size)/2)] font-semibold rounded-full;content:counter(step-counter)}.stepper>ol>li:after{@apply absolute content-[""] w-[2px] bg-border -translate-x-1/2;left:calc(var(--bullet-size) / 2);top:calc(var(--bullet-size) + var(--line-spacing));height:calc(100% - var(--bullet-size) - (2 * var(--line-spacing)))}.stepper>ol>li>:first-child{@apply mt-0 pt-0;transform:translateY(calc((var(--bullet-size) - 1lh) / 2))}}
@@ -1,43 +0,0 @@
1
- @tailwind components;
2
-
3
- @layer components {
4
- .stepper {
5
- /* @apply mb-6; */
6
- }
7
-
8
- .stepper > ol {
9
- --bullet-size: 1.75rem;
10
- --line-spacing: 0.25rem;
11
- @apply flex flex-col list-none p-0 m-0;
12
- counter-reset: step-counter;
13
- }
14
-
15
- .stepper > ol > li {
16
- @apply relative ps-12 pb-6 my-0;
17
- counter-increment: step-counter;
18
- }
19
-
20
- .stepper > ol > li:last-child {
21
- @apply pb-0;
22
- }
23
-
24
- /* Bullet with number */
25
- .stepper > ol > li::before {
26
- @apply absolute left-0 flex items-center justify-center size-[--bullet-size];
27
- @apply bg-muted/80 border border-border text-muted-foreground text-[calc(var(--bullet-size)/2)] font-semibold rounded-full;
28
- content: counter(step-counter);
29
- }
30
-
31
- /* Vertical line */
32
- .stepper > ol > li::after {
33
- @apply absolute content-[''] w-[2px] bg-border -translate-x-1/2;
34
- left: calc(var(--bullet-size) / 2);
35
- top: calc(var(--bullet-size) + var(--line-spacing));
36
- height: calc(100% - var(--bullet-size) - (2 * var(--line-spacing)));
37
- }
38
-
39
- .stepper > ol > li > :first-child {
40
- @apply mt-0 pt-0;
41
- transform: translateY(calc((var(--bullet-size) - 1lh) / 2));
42
- }
43
- }