@mushi-mushi/core 1.14.0 → 1.15.0

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/CONTRIBUTING.md CHANGED
@@ -63,7 +63,7 @@ packages/
63
63
  verify/ Fix verification (BSL)
64
64
  apps/
65
65
  admin/ Admin dashboard (React + Tailwind)
66
- docs/ Documentation site (planned)
66
+ docs/ Documentation site (Nextra — apps/docs)
67
67
  tooling/
68
68
  eslint-config/ Shared ESLint flat config
69
69
  tsconfig/ Shared TypeScript configs
@@ -81,6 +81,28 @@ tooling/
81
81
  ```
82
82
  6. Open a pull request
83
83
 
84
+ ### Documentation (docs-as-code)
85
+
86
+ If your PR changes **user-visible SDK or CLI behavior**, update docs in the **same PR**:
87
+
88
+ | Surface | When to update |
89
+ | --- | --- |
90
+ | `packages/*/README.md` | npm-facing install/API/config changes for that package |
91
+ | `apps/docs/content/**/*.mdx` | Long-form guides, quickstarts, admin console docs |
92
+ | Root `README.md` | Marketing stats only when counts change — run `pnpm check:docs-stats` |
93
+
94
+ Guardrails (run locally before pushing):
95
+
96
+ ```bash
97
+ pnpm check:docs-stats # root README stat badges
98
+ pnpm check:sdk-version-matrix # apps/docs/content/sdks/index.mdx versions
99
+ pnpm check:internal-doc-links # dead /foo links in MDX
100
+ pnpm check:bundle-docs # @mushi-mushi/web size-limit vs README
101
+ pnpm gen:llms-txt # regenerate apps/docs/public/llms.txt after nav changes
102
+ ```
103
+
104
+ README changes on npm packages only appear on [npmjs.com](https://www.npmjs.com) after the next **Changesets publish**.
105
+
84
106
  ## Changesets
85
107
 
86
108
  We use [Changesets](https://github.com/changesets/changesets) for versioning. If your PR modifies a published package (`core`, `web`, `react`, `vue`, `svelte`, `angular`, `react-native`, `cli`, `mcp`), add a changeset:
package/dist/index.cjs CHANGED
@@ -579,20 +579,27 @@ function formatPretty(entry) {
579
579
  function formatJson(entry) {
580
580
  return JSON.stringify(entry);
581
581
  }
582
- function emit(level, formatted) {
583
- switch (level) {
584
- case "error":
585
- case "fatal":
582
+ function makeEmitter(destination) {
583
+ if (destination === "stderr") {
584
+ return (level, formatted) => {
586
585
  console.error(formatted);
587
- break;
588
- case "warn":
589
- console.warn(formatted);
590
- break;
591
- default:
592
- console.log(formatted);
586
+ };
593
587
  }
588
+ return (level, formatted) => {
589
+ switch (level) {
590
+ case "error":
591
+ case "fatal":
592
+ console.error(formatted);
593
+ break;
594
+ case "warn":
595
+ console.warn(formatted);
596
+ break;
597
+ default:
598
+ console.log(formatted);
599
+ }
600
+ };
594
601
  }
595
- function buildLogger(scope, minLevel, baseMeta, formatter) {
602
+ function buildLogger(scope, minLevel, baseMeta, formatter, emit) {
596
603
  let currentLevel = minLevel;
597
604
  function log(level, msg, meta) {
598
605
  if (LEVEL_VALUE[level] < LEVEL_VALUE[currentLevel]) return;
@@ -617,7 +624,8 @@ function buildLogger(scope, minLevel, baseMeta, formatter) {
617
624
  `${scope}:${childScope}`,
618
625
  currentLevel,
619
626
  { ...baseMeta, ...childMeta },
620
- formatter
627
+ formatter,
628
+ emit
621
629
  );
622
630
  },
623
631
  setLevel(level) {
@@ -630,11 +638,13 @@ function createLogger(options) {
630
638
  scope,
631
639
  level = "info",
632
640
  meta = {},
633
- format = "auto"
641
+ format = "auto",
642
+ destination = "stdout"
634
643
  } = options;
635
644
  const resolvedFormat = format === "auto" ? detectFormat() : format;
636
645
  const formatter = resolvedFormat === "json" ? formatJson : formatPretty;
637
- return buildLogger(scope, level, meta, formatter);
646
+ const emit = makeEmitter(destination);
647
+ return buildLogger(scope, level, meta, formatter, emit);
638
648
  }
639
649
  var noopLogger = {
640
650
  debug: () => {