@zenuml/core 3.49.3 → 3.49.5

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
@@ -49,20 +49,16 @@ bun dev
49
49
 
50
50
  ## CI/CD
51
51
 
52
- CI/CD is done with GitHub Actions. The workflow is defined in `.github/workflows/*.yml`.
52
+ CI/CD is done with GitHub Actions (`.github/workflows/`):
53
53
 
54
- ## gh-pages.yml
54
+ - **`cd.yml`** — runs on every push and pull request: lint + unit tests (`test`),
55
+ Playwright E2E (`e2e`, via `e2e.yml`), then — only if both pass — publishes
56
+ `@zenuml/core` to npm (on `main`) and deploys the demo site to Cloudflare
57
+ Workers (production on `main`, staging otherwise). See [DEPLOYMENT.md](./DEPLOYMENT.md).
58
+ - **`e2e.yml`** — reusable Playwright workflow, called by `cd.yml` or run manually.
59
+ - **`update-snapshots.yml`** — manually triggered; regenerates Linux visual snapshots.
55
60
 
56
- This workflow has two jobs: `build` -> `deploy`.
57
-
58
- ```text
59
- test -> npm publish
60
- -> cy tests
61
- -> build site -> deploy gh-pages
62
- ```
63
-
64
- This workflow is triggered on every push to the `main` branch.
65
- It will build the project and publish the `dist` folder to the `gh-pages` branch.
61
+ The DSL syntax reference lives at [docs/DSL_SYNTAX.md](./docs/DSL_SYNTAX.md).
66
62
 
67
63
  ## Put localhost on the internet
68
64
 
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env bun
2
2
  import antlr4 from 'antlr4';
3
- import pino from 'pino';
4
3
  import { marked } from 'marked';
5
4
  import { mkdirSync, writeFileSync, readFileSync, statSync, watch } from 'node:fs';
6
5
  import { resolve, dirname, extname, basename, join } from 'node:path';
@@ -9768,51 +9767,38 @@ function OrderedParticipants(rootContext) {
9768
9767
  });
9769
9768
  }
9770
9769
 
9771
- const logger = pino({
9772
- level: "warn"
9773
- });
9774
9770
  const LEVELS = ["log", "trace", "debug", "info", "warn", "error"];
9775
- const PINO_LEVEL = {
9776
- log: "info",
9777
- trace: "trace",
9778
- debug: "debug",
9779
- info: "info",
9780
- warn: "warn",
9781
- error: "error"
9771
+ const LEVEL_WEIGHT = {
9772
+ trace: 10,
9773
+ debug: 20,
9774
+ log: 30,
9775
+ info: 30,
9776
+ warn: 40,
9777
+ error: 50
9782
9778
  };
9783
- function isEnabled(target, level) {
9784
- const loggerTarget = target;
9785
- return loggerTarget.isLevelEnabled?.(PINO_LEVEL[level]) ?? true;
9786
- }
9787
- function bind(target, level) {
9788
- const consoleFn = level in console ? console[level] : console.log;
9789
- target[level] = (...args) => {
9790
- if (isEnabled(target, level)) {
9791
- consoleFn(...args);
9792
- }
9793
- };
9794
- }
9795
- function bind2(target, level, prefix) {
9796
- const consoleFn = level in console ? console[level] : console.log;
9797
- target[level] = (...args) => {
9798
- if (isEnabled(target, level)) {
9799
- consoleFn(prefix[0], prefix[1], ...args);
9800
- }
9801
- };
9802
- }
9803
- function prettify(target) {
9804
- LEVELS.forEach((level) => bind(target, level));
9805
- const childFn = target.child;
9806
- target.child = function(opts) {
9807
- const child = childFn.call(target, opts);
9808
- LEVELS.forEach(
9809
- (level) => bind2(child, level, ["%c" + (opts.name || ""), "color: #00f"])
9810
- );
9811
- return child;
9812
- };
9813
- return target;
9779
+ const THRESHOLD = LEVEL_WEIGHT.warn;
9780
+ function consoleFn(level) {
9781
+ const fn = console[level];
9782
+ return typeof fn === "function" ? fn.bind(console) : console.log.bind(console);
9783
+ }
9784
+ function createLogger(prefix) {
9785
+ const logger = {};
9786
+ for (const level of LEVELS) {
9787
+ const fn = consoleFn(level);
9788
+ logger[level] = (...args) => {
9789
+ if (LEVEL_WEIGHT[level] >= THRESHOLD) {
9790
+ if (prefix) {
9791
+ fn(prefix[0], prefix[1], ...args);
9792
+ } else {
9793
+ fn(...args);
9794
+ }
9795
+ }
9796
+ };
9797
+ }
9798
+ logger.child = (opts) => createLogger(["%c" + (opts.name || ""), "color: #00f"]);
9799
+ return logger;
9814
9800
  }
9815
- const rootLogger = prettify(logger);
9801
+ const rootLogger = createLogger();
9816
9802
 
9817
9803
  function Dual(p, v) {
9818
9804
  return { position: p, velocity: v };