@recursica/adapter-tester 1.1.0 → 2.0.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.
@@ -1 +1 @@
1
- {"version":3,"file":"config-B0Eop8Az.cjs","sources":["../src/config.ts"],"sourcesContent":["export interface AdapterTarget {\n /** Human-readable name used in test titles, report labels, and artifact filenames. */\n name: string;\n /** Base URL the target's Storybook instance is served from. */\n url: string;\n /**\n * Marks this target as the visual/token source of truth every other target\n * is compared against. Exactly one target in a config must set this true.\n */\n sourceOfTruth?: boolean;\n}\n\nexport interface AdapterTesterConfig {\n targets: AdapterTarget[];\n /** Global pixel-diff threshold applied to every story comparison. */\n diffThresholdPixels: number;\n /**\n * Story ids (matched by prefix) that get `relaxedThresholdPixels` instead\n * of `diffThresholdPixels`, for components with acceptable cross-library\n * structural variation (e.g. native control widgets).\n */\n relaxedThresholdStoryIds?: string[];\n /** Pixel-diff threshold applied to `relaxedThresholdStoryIds`. */\n relaxedThresholdPixels?: number;\n /**\n * Storybook entry title categories excluded from the comparison — an\n * entry is excluded if its title equals one of these or starts with\n * `\"<value>/\"`. Defaults to [\"Theme\", \"Tokens\", \"Introduction\"]:\n * `@recursica/storybook-template`'s own default token/theme demo stories\n * (which every adapter's Storybook inherits automatically) plus each\n * adapter's own onboarding \"Introduction\" stories — neither has a\n * cross-adapter counterpart to diff against.\n */\n excludeTitlePrefixes?: string[];\n}\n\nexport function defineAdapterTesterConfig(\n config: AdapterTesterConfig,\n): AdapterTesterConfig {\n const sourceOfTruthCount = config.targets.filter(\n (target) => target.sourceOfTruth,\n ).length;\n if (sourceOfTruthCount !== 1) {\n throw new Error(\n `adapter-tester config must mark exactly one target as sourceOfTruth (found ${sourceOfTruthCount})`,\n );\n }\n return config;\n}\n\nexport function getSourceOfTruth(config: AdapterTesterConfig): AdapterTarget {\n const sourceOfTruth = config.targets.find((target) => target.sourceOfTruth);\n if (!sourceOfTruth) {\n throw new Error(\n \"adapter-tester config has no target marked sourceOfTruth\",\n );\n }\n return sourceOfTruth;\n}\n"],"names":["defineAdapterTesterConfig","config","sourceOfTruthCount","target","getSourceOfTruth","sourceOfTruth"],"mappings":"aAoCO,SAASA,EACdC,EACqB,CACrB,MAAMC,EAAqBD,EAAO,QAAQ,OACvCE,GAAWA,EAAO,aAAA,EACnB,OACF,GAAID,IAAuB,EACzB,MAAM,IAAI,MACR,8EAA8EA,CAAkB,GAAA,EAGpG,OAAOD,CACT,CAEO,SAASG,EAAiBH,EAA4C,CAC3E,MAAMI,EAAgBJ,EAAO,QAAQ,KAAME,GAAWA,EAAO,aAAa,EAC1E,GAAI,CAACE,EACH,MAAM,IAAI,MACR,0DAAA,EAGJ,OAAOA,CACT"}
1
+ {"version":3,"file":"config-B0Eop8Az.cjs","sources":["../src/config.ts"],"sourcesContent":["export interface AdapterTarget {\n /** Human-readable name used in test titles, report labels, and artifact filenames. */\n name: string;\n /** Base URL the target's Storybook instance is served from. */\n url: string;\n /**\n * Marks this target as the visual/token source of truth every other target\n * is compared against. Exactly one target in a config must set this true.\n */\n sourceOfTruth?: boolean;\n}\n\nexport interface AdapterTesterConfig {\n targets: AdapterTarget[];\n /** Global pixel-diff threshold applied to every story comparison. */\n diffThresholdPixels: number;\n /**\n * Story ids (matched by prefix) that get `relaxedThresholdPixels` instead\n * of `diffThresholdPixels`, for components with acceptable cross-library\n * structural variation (e.g. native control widgets).\n */\n relaxedThresholdStoryIds?: string[];\n /** Pixel-diff threshold applied to `relaxedThresholdStoryIds`. */\n relaxedThresholdPixels?: number;\n /**\n * Storybook entry title categories excluded from the comparison — an\n * entry is excluded if its title equals one of these or starts with\n * `\"<value>/\"`. Defaults to [\"Theme\", \"Tokens\", \"Introduction\"]:\n * `@recursica/storybook-template`'s own default token/theme demo stories\n * (which every adapter's Storybook inherits automatically) plus each\n * adapter's own onboarding \"Introduction\" stories — neither has a\n * cross-adapter counterpart to diff against.\n */\n excludeTitlePrefixes?: string[];\n}\n\nexport function defineAdapterTesterConfig(\n config: AdapterTesterConfig,\n): AdapterTesterConfig {\n const sourceOfTruthCount = config.targets.filter(\n (target) => target.sourceOfTruth,\n ).length;\n if (sourceOfTruthCount !== 1) {\n throw new Error(\n `adapter-tester config must mark exactly one target as sourceOfTruth (found ${sourceOfTruthCount})`,\n );\n }\n return config;\n}\n\nexport function getSourceOfTruth(config: AdapterTesterConfig): AdapterTarget {\n const sourceOfTruth = config.targets.find((target) => target.sourceOfTruth);\n if (!sourceOfTruth) {\n throw new Error(\"adapter-tester config has no target marked sourceOfTruth\");\n }\n return sourceOfTruth;\n}\n"],"names":["defineAdapterTesterConfig","config","sourceOfTruthCount","target","getSourceOfTruth","sourceOfTruth"],"mappings":"aAoCO,SAASA,EACdC,EACqB,CACrB,MAAMC,EAAqBD,EAAO,QAAQ,OACvCE,GAAWA,EAAO,aAAA,EACnB,OACF,GAAID,IAAuB,EACzB,MAAM,IAAI,MACR,8EAA8EA,CAAkB,GAAA,EAGpG,OAAOD,CACT,CAEO,SAASG,EAAiBH,EAA4C,CAC3E,MAAMI,EAAgBJ,EAAO,QAAQ,KAAME,GAAWA,EAAO,aAAa,EAC1E,GAAI,CAACE,EACH,MAAM,IAAI,MAAM,0DAA0D,EAE5E,OAAOA,CACT"}
@@ -11,13 +11,11 @@ function o(t) {
11
11
  function u(t) {
12
12
  const r = t.targets.find((e) => e.sourceOfTruth);
13
13
  if (!r)
14
- throw new Error(
15
- "adapter-tester config has no target marked sourceOfTruth"
16
- );
14
+ throw new Error("adapter-tester config has no target marked sourceOfTruth");
17
15
  return r;
18
16
  }
19
17
  export {
20
18
  o as d,
21
19
  u as g
22
20
  };
23
- //# sourceMappingURL=config-CKgyDyNF.js.map
21
+ //# sourceMappingURL=config-CDxTeSAY.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config-CKgyDyNF.js","sources":["../src/config.ts"],"sourcesContent":["export interface AdapterTarget {\n /** Human-readable name used in test titles, report labels, and artifact filenames. */\n name: string;\n /** Base URL the target's Storybook instance is served from. */\n url: string;\n /**\n * Marks this target as the visual/token source of truth every other target\n * is compared against. Exactly one target in a config must set this true.\n */\n sourceOfTruth?: boolean;\n}\n\nexport interface AdapterTesterConfig {\n targets: AdapterTarget[];\n /** Global pixel-diff threshold applied to every story comparison. */\n diffThresholdPixels: number;\n /**\n * Story ids (matched by prefix) that get `relaxedThresholdPixels` instead\n * of `diffThresholdPixels`, for components with acceptable cross-library\n * structural variation (e.g. native control widgets).\n */\n relaxedThresholdStoryIds?: string[];\n /** Pixel-diff threshold applied to `relaxedThresholdStoryIds`. */\n relaxedThresholdPixels?: number;\n /**\n * Storybook entry title categories excluded from the comparison — an\n * entry is excluded if its title equals one of these or starts with\n * `\"<value>/\"`. Defaults to [\"Theme\", \"Tokens\", \"Introduction\"]:\n * `@recursica/storybook-template`'s own default token/theme demo stories\n * (which every adapter's Storybook inherits automatically) plus each\n * adapter's own onboarding \"Introduction\" stories — neither has a\n * cross-adapter counterpart to diff against.\n */\n excludeTitlePrefixes?: string[];\n}\n\nexport function defineAdapterTesterConfig(\n config: AdapterTesterConfig,\n): AdapterTesterConfig {\n const sourceOfTruthCount = config.targets.filter(\n (target) => target.sourceOfTruth,\n ).length;\n if (sourceOfTruthCount !== 1) {\n throw new Error(\n `adapter-tester config must mark exactly one target as sourceOfTruth (found ${sourceOfTruthCount})`,\n );\n }\n return config;\n}\n\nexport function getSourceOfTruth(config: AdapterTesterConfig): AdapterTarget {\n const sourceOfTruth = config.targets.find((target) => target.sourceOfTruth);\n if (!sourceOfTruth) {\n throw new Error(\n \"adapter-tester config has no target marked sourceOfTruth\",\n );\n }\n return sourceOfTruth;\n}\n"],"names":["defineAdapterTesterConfig","config","sourceOfTruthCount","target","getSourceOfTruth","sourceOfTruth"],"mappings":"AAoCO,SAASA,EACdC,GACqB;AACrB,QAAMC,IAAqBD,EAAO,QAAQ;AAAA,IACxC,CAACE,MAAWA,EAAO;AAAA,EAAA,EACnB;AACF,MAAID,MAAuB;AACzB,UAAM,IAAI;AAAA,MACR,8EAA8EA,CAAkB;AAAA,IAAA;AAGpG,SAAOD;AACT;AAEO,SAASG,EAAiBH,GAA4C;AAC3E,QAAMI,IAAgBJ,EAAO,QAAQ,KAAK,CAACE,MAAWA,EAAO,aAAa;AAC1E,MAAI,CAACE;AACH,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAGJ,SAAOA;AACT;"}
1
+ {"version":3,"file":"config-CDxTeSAY.js","sources":["../src/config.ts"],"sourcesContent":["export interface AdapterTarget {\n /** Human-readable name used in test titles, report labels, and artifact filenames. */\n name: string;\n /** Base URL the target's Storybook instance is served from. */\n url: string;\n /**\n * Marks this target as the visual/token source of truth every other target\n * is compared against. Exactly one target in a config must set this true.\n */\n sourceOfTruth?: boolean;\n}\n\nexport interface AdapterTesterConfig {\n targets: AdapterTarget[];\n /** Global pixel-diff threshold applied to every story comparison. */\n diffThresholdPixels: number;\n /**\n * Story ids (matched by prefix) that get `relaxedThresholdPixels` instead\n * of `diffThresholdPixels`, for components with acceptable cross-library\n * structural variation (e.g. native control widgets).\n */\n relaxedThresholdStoryIds?: string[];\n /** Pixel-diff threshold applied to `relaxedThresholdStoryIds`. */\n relaxedThresholdPixels?: number;\n /**\n * Storybook entry title categories excluded from the comparison — an\n * entry is excluded if its title equals one of these or starts with\n * `\"<value>/\"`. Defaults to [\"Theme\", \"Tokens\", \"Introduction\"]:\n * `@recursica/storybook-template`'s own default token/theme demo stories\n * (which every adapter's Storybook inherits automatically) plus each\n * adapter's own onboarding \"Introduction\" stories — neither has a\n * cross-adapter counterpart to diff against.\n */\n excludeTitlePrefixes?: string[];\n}\n\nexport function defineAdapterTesterConfig(\n config: AdapterTesterConfig,\n): AdapterTesterConfig {\n const sourceOfTruthCount = config.targets.filter(\n (target) => target.sourceOfTruth,\n ).length;\n if (sourceOfTruthCount !== 1) {\n throw new Error(\n `adapter-tester config must mark exactly one target as sourceOfTruth (found ${sourceOfTruthCount})`,\n );\n }\n return config;\n}\n\nexport function getSourceOfTruth(config: AdapterTesterConfig): AdapterTarget {\n const sourceOfTruth = config.targets.find((target) => target.sourceOfTruth);\n if (!sourceOfTruth) {\n throw new Error(\"adapter-tester config has no target marked sourceOfTruth\");\n }\n return sourceOfTruth;\n}\n"],"names":["defineAdapterTesterConfig","config","sourceOfTruthCount","target","getSourceOfTruth","sourceOfTruth"],"mappings":"AAoCO,SAASA,EACdC,GACqB;AACrB,QAAMC,IAAqBD,EAAO,QAAQ;AAAA,IACxC,CAACE,MAAWA,EAAO;AAAA,EAAA,EACnB;AACF,MAAID,MAAuB;AACzB,UAAM,IAAI;AAAA,MACR,8EAA8EA,CAAkB;AAAA,IAAA;AAGpG,SAAOD;AACT;AAEO,SAASG,EAAiBH,GAA4C;AAC3E,QAAMI,IAAgBJ,EAAO,QAAQ,KAAK,CAACE,MAAWA,EAAO,aAAa;AAC1E,MAAI,CAACE;AACH,UAAM,IAAI,MAAM,0DAA0D;AAE5E,SAAOA;AACT;"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,qEAAqE;IACrE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,kEAAkE;IAClE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAUrB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAQ3E"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,qEAAqE;IACrE,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,kEAAkE;IAClE,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;;;;;;;OAQG;IACH,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,mBAAmB,GAC1B,mBAAmB,CAUrB;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAM3E"}
@@ -0,0 +1,8 @@
1
+ import { AdapterTesterConfig } from './config.js';
2
+ import { HarnessWebServerConfig } from './harness/mantineSourceOfTruth.js';
3
+ export interface DevServerOptions {
4
+ /** Port the dev-mode proxy UI itself listens on. Defaults to 6010. */
5
+ port?: number;
6
+ }
7
+ export declare function startDevServer(engineConfig: AdapterTesterConfig, webServers: HarnessWebServerConfig[], options?: DevServerOptions): void;
8
+ //# sourceMappingURL=devServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devServer.d.ts","sourceRoot":"","sources":["../src/devServer.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AA6FhF,MAAM,WAAW,gBAAgB;IAC/B,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAC5B,YAAY,EAAE,mBAAmB,EACjC,UAAU,EAAE,sBAAsB,EAAE,EACpC,OAAO,GAAE,gBAAqB,GAC7B,IAAI,CA4HN"}
@@ -0,0 +1,60 @@
1
+ import { AdapterTesterConfig } from './config.js';
2
+ import { HarnessWebServerConfig } from './harness/mantineSourceOfTruth.js';
3
+ export declare const CONFIG_FILE_NAME = "adapter-tester.config.json";
4
+ interface StorybookTargetFileConfig {
5
+ /** Port the target's Storybook is served on. Auto-detected from this
6
+ * project's own `scripts.storybook` (a `-p <port>`/`--port <port>` flag)
7
+ * when omitted, falling back to Storybook's own default of 6006. */
8
+ port?: number;
9
+ /** Command that boots the target's Storybook. Defaults to `npm run storybook`. */
10
+ command?: string;
11
+ /** Directory the command runs in, relative to the config file. Defaults to "." */
12
+ cwd?: string;
13
+ }
14
+ interface MantineHarnessSourceOfTruthFileConfig {
15
+ /** Default mode: boots a throwaway harness that installs the published
16
+ * `@recursica/mantine-adapter` from npm — no monorepo checkout required. */
17
+ type?: "mantine-harness";
18
+ port?: number;
19
+ mantineAdapterVersion?: string;
20
+ storybookTemplateVersion?: string;
21
+ }
22
+ interface UrlSourceOfTruthFileConfig {
23
+ /** Non-standard mode: points at an already-addressable Storybook — e.g. a
24
+ * sibling workspace package's own Storybook inside this monorepo. */
25
+ type: "url";
26
+ name?: string;
27
+ port: number;
28
+ command?: string;
29
+ cwd?: string;
30
+ }
31
+ type SourceOfTruthFileConfig = MantineHarnessSourceOfTruthFileConfig | UrlSourceOfTruthFileConfig;
32
+ export interface AdapterTesterFileConfig {
33
+ /** Label for this project's own target. Defaults to the unscoped name in
34
+ * this project's package.json (e.g. "@recursica/mui-adapter" -> "mui-adapter"). */
35
+ name?: string;
36
+ storybook?: StorybookTargetFileConfig;
37
+ sourceOfTruth?: SourceOfTruthFileConfig;
38
+ diffThresholdPixels?: number;
39
+ relaxedThresholdStoryIds?: string[];
40
+ relaxedThresholdPixels?: number;
41
+ excludeTitlePrefixes?: string[];
42
+ }
43
+ export interface ResolvedAdapterTesterConfig {
44
+ engineConfig: AdapterTesterConfig;
45
+ webServers: HarnessWebServerConfig[];
46
+ }
47
+ /**
48
+ * Loads `adapter-tester.config.json` from `cwd` (or falls back to defaults
49
+ * when the file doesn't exist) and resolves it into the engine config
50
+ * `runVisualRegression` consumes plus the Playwright `webServer` entries
51
+ * needed to boot both sides of the comparison.
52
+ *
53
+ * Default mode (no `sourceOfTruth`/`storybook` set): compares this project's
54
+ * own Storybook against a throwaway Mantine harness — no monorepo checkout
55
+ * required. Set `sourceOfTruth.type: "url"` for the non-standard mode used
56
+ * to compare sibling workspace packages inside this monorepo.
57
+ */
58
+ export declare function resolveConfig(cwd: string): ResolvedAdapterTesterConfig;
59
+ export {};
60
+ //# sourceMappingURL=fileConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fileConfig.d.ts","sourceRoot":"","sources":["../src/fileConfig.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAIhF,eAAO,MAAM,gBAAgB,+BAA+B,CAAC;AAO7D,UAAU,yBAAyB;IACjC;;wEAEoE;IACpE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,qCAAqC;IAC7C;gFAC4E;IAC5E,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,UAAU,0BAA0B;IAClC;yEACqE;IACrE,IAAI,EAAE,KAAK,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AC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAgHD,8EAA8E;AAC9E,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,kCAAkC,GAC1C,MAAM,CAsBR;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,kCAAkC,GAC1C,sBAAsB,CASxB"}
1
+ {"version":3,"file":"mantineSourceOfTruth.d.ts","sourceRoot":"","sources":["../../src/harness/mantineSourceOfTruth.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,kCAAkC;IACjD;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iFAAiF;IACjF,wBAAwB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB,EAAE,OAAO,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;CACjB;AAgHD,8EAA8E;AAC9E,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,kCAAkC,GAC1C,MAAM,CA0BR;AAED;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,kCAAkC,GAC1C,sBAAsB,CASxB"}
package/dist/index.cjs CHANGED
@@ -1,54 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./config-B0Eop8Az.cjs"),o=require("node:fs"),t=require("node:path"),i="^8.0.0",s="^10.3.3",n="^19.0.0",m={"@storybook/addon-docs":s,"@storybook/addon-a11y":s,"storybook-dark-mode":"^5.0.0"},p={"react-markdown":"^10.1.0"};function l(e){return{name:"adapter-tester-mantine-source-of-truth-harness",private:!0,type:"module",scripts:{storybook:`storybook dev -p ${e.port}`},dependencies:{"@recursica/mantine-adapter":e.mantineAdapterVersion,"@recursica/storybook-template":e.storybookTemplateVersion,"@recursica/official-release":"latest","@recursica/adapter-common":"latest","@mantine/core":i,"@mantine/dates":i,react:n,"react-dom":n,storybook:s,"@storybook/react-vite":s,...m,...p}}}const y=`import { createMainConfig } from "@recursica/storybook-template/main";
2
-
3
- const config = createMainConfig({
4
- stories: [
5
- "../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)",
6
- ],
7
- enableCORS: true,
8
- });
9
-
10
- // react-docgen-typescript can't resolve a TS project for a config file living
11
- // in .storybook/ when the component source it's docgen'ing lives three
12
- // directories down inside node_modules — it throws "Cannot read properties
13
- // of undefined (reading 'fileExists')", which surfaces as a plain 404 on
14
- // preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which
15
- // this harness never renders, so disabling it is a safe workaround (see
16
- // PROPOSAL-installed-package-harness.md, gap 3).
17
- config.typescript = { ...config.typescript, reactDocgen: false };
18
-
19
- export default config;
20
- `,g=`import type { Preview } from "@storybook/react-vite";
21
- import { createPreviewConfig } from "@recursica/storybook-template/preview";
22
- import { MantineProvider } from "@mantine/core";
23
- import "@mantine/core/styles.css";
24
- import "@mantine/dates/styles.css";
25
- import "@recursica/adapter-common/style.css";
26
- import "@recursica/official-release/recursica_variables_scoped.css";
27
- import recursicaTokens from "@recursica/official-release/recursica_tokens.json";
28
- import recursicaBrand from "@recursica/official-release/recursica_brand.json";
29
- import recursicaUIKit from "@recursica/official-release/recursica_ui-kit.json";
30
-
31
- const basePreview = createPreviewConfig({
32
- defaultTheme: "light",
33
- recursicaTokensJsonPath: recursicaTokens,
34
- recursicaBrandJsonPath: recursicaBrand,
35
- recursicaUIKitJsonPath: recursicaUIKit,
36
- });
37
-
38
- const preview: Preview = {
39
- ...basePreview,
40
- decorators: [
41
- (Story) => (
42
- <MantineProvider>
43
- <Story />
44
- </MantineProvider>
45
- ),
46
- ...(basePreview.decorators || []),
47
- ],
48
- };
49
-
50
- export default preview;
51
- `;function c(e){const{dir:r,port:u,mantineAdapterVersion:d="latest",storybookTemplateVersion:f="latest"}=e;return o.mkdirSync(t.join(r,".storybook"),{recursive:!0}),o.writeFileSync(t.join(r,"package.json"),JSON.stringify(l({mantineAdapterVersion:d,storybookTemplateVersion:f,port:u}),null,2)+`
52
- `),o.writeFileSync(t.join(r,".storybook/main.ts"),y),o.writeFileSync(t.join(r,".storybook/preview.tsx"),g),o.writeFileSync(t.join(r,".gitignore"),`node_modules
53
- `),r}function b(e){const r=c(e);return{command:"npm install --no-audit --no-fund && npm run storybook",port:e.port,cwd:r,reuseExistingServer:!process.env.CI,timeout:180*1e3}}exports.defineAdapterTesterConfig=a.defineAdapterTesterConfig;exports.getSourceOfTruth=a.getSourceOfTruth;exports.mantineSourceOfTruthWebServer=b;exports.scaffoldMantineSourceOfTruthHarness=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./config-B0Eop8Az.cjs"),r=require("./mantineSourceOfTruth-DCoJ2dU-.cjs");exports.defineAdapterTesterConfig=e.defineAdapterTesterConfig;exports.getSourceOfTruth=e.getSourceOfTruth;exports.mantineSourceOfTruthWebServer=r.mantineSourceOfTruthWebServer;exports.scaffoldMantineSourceOfTruthHarness=r.scaffoldMantineSourceOfTruthHarness;
54
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/harness/mantineSourceOfTruth.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\n/**\n * Generates a small, throwaway Storybook project that installs\n * `@recursica/mantine-adapter` as a real npm dependency (not a workspace\n * link) and boots a real Storybook from its published `src/**\\/*.stories.tsx`\n * files, using `@recursica/storybook-template`'s exported factories.\n *\n * This lets any repo — including ones that never checked out the Recursica\n * monorepo — run adapter-tester's visual regression suite against Mantine\n * (Recursica's source-of-truth adapter) as one side of the comparison, while\n * the other side is that repo's own already-running local Storybook.\n *\n * See PROPOSAL-installed-package-harness.md for the verified prototype this\n * is built from, and the three upstream gaps it works around.\n */\n\nexport interface MantineSourceOfTruthHarnessOptions {\n /**\n * Directory the harness project is scaffolded into. Regenerated on every\n * call — add it to your .gitignore rather than committing it.\n */\n dir: string;\n /** Port the harness's Storybook dev server boots on. */\n port: number;\n /** npm version/range for @recursica/mantine-adapter. Defaults to \"latest\". */\n mantineAdapterVersion?: string;\n /** npm version/range for @recursica/storybook-template. Defaults to \"latest\". */\n storybookTemplateVersion?: string;\n}\n\nexport interface HarnessWebServerConfig {\n command: string;\n port: number;\n cwd: string;\n reuseExistingServer: boolean;\n timeout: number;\n}\n\n// Peer/dev ranges pinned to what @recursica/mantine-adapter and\n// @recursica/storybook-template themselves require, so the harness can't\n// drift onto an incompatible Mantine or Storybook major version.\nconst MANTINE_CORE_RANGE = \"^8.0.0\";\nconst STORYBOOK_RANGE = \"^10.3.3\";\nconst REACT_RANGE = \"^19.0.0\";\n\n// storybook-template's createMainConfig() defaults its addons list to these\n// three but doesn't declare them as peerDependencies (proposal gap 2) — a\n// harness that skips installing any of them gets a silent \"could not\n// resolve addon\" warning at boot, then a hard runtime crash later when Vite\n// pre-bundles preview.tsx's dependency graph. Installed explicitly here.\nconst DEFAULT_ADDON_DEPENDENCIES = {\n \"@storybook/addon-docs\": STORYBOOK_RANGE,\n \"@storybook/addon-a11y\": STORYBOOK_RANGE,\n \"storybook-dark-mode\": \"^5.0.0\",\n};\n\n// mantine-adapter's Introduction.stories.tsx (Version.tsx/OverStyling.tsx)\n// needs react-markdown, but it's a devDependency there — Storybook-only,\n// never bundled into dist — so an external `npm install` of the published\n// package won't pull it in. The harness boots a real Storybook against\n// src/, so it must provide this itself. Installed explicitly here.\nconst WORKAROUND_DEPENDENCIES = {\n \"react-markdown\": \"^10.1.0\",\n};\n\nfunction harnessPackageJson(options: {\n mantineAdapterVersion: string;\n storybookTemplateVersion: string;\n port: number;\n}) {\n return {\n name: \"adapter-tester-mantine-source-of-truth-harness\",\n private: true,\n type: \"module\",\n scripts: {\n storybook: `storybook dev -p ${options.port}`,\n },\n dependencies: {\n \"@recursica/mantine-adapter\": options.mantineAdapterVersion,\n \"@recursica/storybook-template\": options.storybookTemplateVersion,\n \"@recursica/official-release\": \"latest\",\n \"@recursica/adapter-common\": \"latest\",\n \"@mantine/core\": MANTINE_CORE_RANGE,\n \"@mantine/dates\": MANTINE_CORE_RANGE,\n react: REACT_RANGE,\n \"react-dom\": REACT_RANGE,\n storybook: STORYBOOK_RANGE,\n \"@storybook/react-vite\": STORYBOOK_RANGE,\n ...DEFAULT_ADDON_DEPENDENCIES,\n ...WORKAROUND_DEPENDENCIES,\n },\n };\n}\n\nconst MAIN_TS = `import { createMainConfig } from \"@recursica/storybook-template/main\";\n\nconst config = createMainConfig({\n stories: [\n \"../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)\",\n ],\n enableCORS: true,\n});\n\n// react-docgen-typescript can't resolve a TS project for a config file living\n// in .storybook/ when the component source it's docgen'ing lives three\n// directories down inside node_modules — it throws \"Cannot read properties\n// of undefined (reading 'fileExists')\", which surfaces as a plain 404 on\n// preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which\n// this harness never renders, so disabling it is a safe workaround (see\n// PROPOSAL-installed-package-harness.md, gap 3).\nconfig.typescript = { ...config.typescript, reactDocgen: false };\n\nexport default config;\n`;\n\nconst PREVIEW_TSX = `import type { Preview } from \"@storybook/react-vite\";\nimport { createPreviewConfig } from \"@recursica/storybook-template/preview\";\nimport { MantineProvider } from \"@mantine/core\";\nimport \"@mantine/core/styles.css\";\nimport \"@mantine/dates/styles.css\";\nimport \"@recursica/adapter-common/style.css\";\nimport \"@recursica/official-release/recursica_variables_scoped.css\";\nimport recursicaTokens from \"@recursica/official-release/recursica_tokens.json\";\nimport recursicaBrand from \"@recursica/official-release/recursica_brand.json\";\nimport recursicaUIKit from \"@recursica/official-release/recursica_ui-kit.json\";\n\nconst basePreview = createPreviewConfig({\n defaultTheme: \"light\",\n recursicaTokensJsonPath: recursicaTokens,\n recursicaBrandJsonPath: recursicaBrand,\n recursicaUIKitJsonPath: recursicaUIKit,\n});\n\nconst preview: Preview = {\n ...basePreview,\n decorators: [\n (Story) => (\n <MantineProvider>\n <Story />\n </MantineProvider>\n ),\n ...(basePreview.decorators || []),\n ],\n};\n\nexport default preview;\n`;\n\n/** Writes the harness project's files to `options.dir` without booting it. */\nexport function scaffoldMantineSourceOfTruthHarness(\n options: MantineSourceOfTruthHarnessOptions,\n): string {\n const {\n dir,\n port,\n mantineAdapterVersion = \"latest\",\n storybookTemplateVersion = \"latest\",\n } = options;\n\n mkdirSync(join(dir, \".storybook\"), { recursive: true });\n writeFileSync(\n join(dir, \"package.json\"),\n JSON.stringify(\n harnessPackageJson({ mantineAdapterVersion, storybookTemplateVersion, port }),\n null,\n 2,\n ) + \"\\n\",\n );\n writeFileSync(join(dir, \".storybook/main.ts\"), MAIN_TS);\n writeFileSync(join(dir, \".storybook/preview.tsx\"), PREVIEW_TSX);\n writeFileSync(join(dir, \".gitignore\"), \"node_modules\\n\");\n\n return dir;\n}\n\n/**\n * Scaffolds the harness and returns a Playwright `webServer` entry for it.\n * Spread the result directly into `playwright.config.ts`'s `webServer` array.\n */\nexport function mantineSourceOfTruthWebServer(\n options: MantineSourceOfTruthHarnessOptions,\n): HarnessWebServerConfig {\n const dir = scaffoldMantineSourceOfTruthHarness(options);\n return {\n command: \"npm install --no-audit --no-fund && npm run storybook\",\n port: options.port,\n cwd: dir,\n reuseExistingServer: !process.env.CI,\n timeout: 180 * 1000,\n };\n}\n"],"names":["MANTINE_CORE_RANGE","STORYBOOK_RANGE","REACT_RANGE","DEFAULT_ADDON_DEPENDENCIES","WORKAROUND_DEPENDENCIES","harnessPackageJson","options","MAIN_TS","PREVIEW_TSX","scaffoldMantineSourceOfTruthHarness","dir","port","mantineAdapterVersion","storybookTemplateVersion","mkdirSync","join","writeFileSync","mantineS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L,EAAK,oBAAoB,EAAGH,CAAO,EACtDS,EAAAA,cAAcD,EAAAA,KAAKL,EAAK,wBAAwB,EAAGF,CAAW,EAC9DQ,EAAAA,cAAcD,EAAAA,KAAKL,EAAK,YAAY,EAAG;AAAA,CAAgB,EAEhDA,CACT,CAMO,SAASO,EACdX,EACwB,CACxB,MAAMI,EAAMD,EAAoCH,CAAO,EACvD,MAAO,CACL,QAAS,wDACT,KAAMA,EAAQ,KACd,IAAKI,EACL,oBAAqB,CAAC,QAAQ,IAAI,GAClC,QAAS,IAAM,GAAA,CAEnB"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index.html CHANGED
@@ -165,25 +165,25 @@
165
165
  <body>
166
166
  <div class="pane" id="leftPane">
167
167
  <div class="header">
168
- Mantine Adapter (Source of Truth)
168
+ <span id="sourceOfTruthLabel">Source of Truth</span>
169
169
  <span class="status connected" id="mantineStatus">Connected & Syncing</span>
170
170
  </div>
171
- <!-- Load Mantine via the SAME ORIGIN proxy -->
171
+ <!-- Load the source of truth via the SAME ORIGIN proxy -->
172
172
  <iframe id="mantine" src="/?path=/story/ui-kit-slider--default"></iframe>
173
173
  </div>
174
-
174
+
175
175
  <div class="divider" id="vDivider"></div>
176
-
176
+
177
177
  <div class="pane" id="rightPane">
178
178
  <div class="right-top" id="rightTop">
179
179
  <div class="header">
180
- MUI Adapter (Syncing)
180
+ <span id="targetLabel">Target</span>
181
181
  <span class="status connected" id="muiStatus">Ready</span>
182
182
  </div>
183
- <!-- Spacer to align the view with Mantine's Storybook header (40px) -->
183
+ <!-- Spacer to align the view with the source of truth's Storybook header (40px) -->
184
184
  <div style="height: 40px; flex: 0 0 40px; background-color: #fff; border-bottom: 1px solid #e6e6e6; box-sizing: border-box;"></div>
185
- <!-- Load the bare MUI component preview -->
186
- <iframe id="mui" src="http://localhost:6012/iframe.html?id=ui-kit-slider--default&viewMode=story"></iframe>
185
+ <!-- Load the bare target component preview -->
186
+ <iframe id="mui" src=""></iframe>
187
187
  </div>
188
188
 
189
189
  <div class="h-divider" id="hDivider"></div>
@@ -213,28 +213,33 @@
213
213
  </div>
214
214
 
215
215
  <script>
216
+ // Injected by the dev server — see src/devServer.ts.
217
+ const devConfig = window.__ADAPTER_TESTER__ || { sourceOfTruthName: 'Source of Truth', targetName: 'Target', targetPort: 6012 };
218
+ document.getElementById('sourceOfTruthLabel').textContent = `${devConfig.sourceOfTruthName} (Source of Truth)`;
219
+ document.getElementById('targetLabel').textContent = devConfig.targetName;
220
+
216
221
  const muiIframe = document.getElementById('mui');
217
222
  const mantineIframe = document.getElementById('mantine');
218
223
  const muiStatus = document.getElementById('muiStatus');
219
224
 
220
- // Sync initial iframe sources with outer URL if params exist
225
+ // Sync initial iframe sources with outer URL if params exist, else fall
226
+ // back to a sensible default story so both panes load something on open.
221
227
  const outerParams = new URLSearchParams(window.location.search);
222
- const initialId = outerParams.get('id');
228
+ const initialId = outerParams.get('id') || 'ui-kit-slider--default';
223
229
  const initialArgs = outerParams.get('args');
224
- if (initialId) {
225
- let mSrc = `/?path=/story/${initialId}`;
226
- if (initialArgs) {
227
- mSrc += `&args=${initialArgs}`;
228
- }
229
- mantineIframe.src = mSrc;
230
-
231
- let uSrc = `http://localhost:6012/iframe.html?id=${initialId}&viewMode=story`;
232
- if (initialArgs) {
233
- uSrc += `&args=${initialArgs}`;
234
- }
235
- muiIframe.src = uSrc;
230
+
231
+ let mSrc = `/?path=/story/${initialId}`;
232
+ if (initialArgs) {
233
+ mSrc += `&args=${initialArgs}`;
236
234
  }
237
-
235
+ mantineIframe.src = mSrc;
236
+
237
+ let uSrc = `http://localhost:${devConfig.targetPort}/iframe.html?id=${initialId}&viewMode=story`;
238
+ if (initialArgs) {
239
+ uSrc += `&args=${initialArgs}`;
240
+ }
241
+ muiIframe.src = uSrc;
242
+
238
243
  // Resizers
239
244
  const vDivider = document.getElementById('vDivider');
240
245
  const leftPane = document.getElementById('leftPane');
@@ -435,7 +440,7 @@
435
440
  window.history.replaceState({}, '', outerUrl.pathname + outerUrl.search);
436
441
  }
437
442
 
438
- let muiUrl = `http://localhost:6012/iframe.html?id=${id}&viewMode=story`;
443
+ let muiUrl = `http://localhost:${devConfig.targetPort}/iframe.html?id=${id}&viewMode=story`;
439
444
  if (args) {
440
445
  muiUrl += `&args=${args}`;
441
446
  }
package/dist/index.js CHANGED
@@ -1,120 +1,9 @@
1
- import { d as E, g as P } from "./config-CKgyDyNF.js";
2
- import { mkdirSync as m, writeFileSync as t } from "node:fs";
3
- import { join as o } from "node:path";
4
- const i = "^8.0.0", s = "^10.3.3", a = "^19.0.0", p = {
5
- "@storybook/addon-docs": s,
6
- "@storybook/addon-a11y": s,
7
- "storybook-dark-mode": "^5.0.0"
8
- }, u = {
9
- "react-markdown": "^10.1.0"
10
- };
11
- function f(e) {
12
- return {
13
- name: "adapter-tester-mantine-source-of-truth-harness",
14
- private: !0,
15
- type: "module",
16
- scripts: {
17
- storybook: `storybook dev -p ${e.port}`
18
- },
19
- dependencies: {
20
- "@recursica/mantine-adapter": e.mantineAdapterVersion,
21
- "@recursica/storybook-template": e.storybookTemplateVersion,
22
- "@recursica/official-release": "latest",
23
- "@recursica/adapter-common": "latest",
24
- "@mantine/core": i,
25
- "@mantine/dates": i,
26
- react: a,
27
- "react-dom": a,
28
- storybook: s,
29
- "@storybook/react-vite": s,
30
- ...p,
31
- ...u
32
- }
33
- };
34
- }
35
- const l = `import { createMainConfig } from "@recursica/storybook-template/main";
36
-
37
- const config = createMainConfig({
38
- stories: [
39
- "../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)",
40
- ],
41
- enableCORS: true,
42
- });
43
-
44
- // react-docgen-typescript can't resolve a TS project for a config file living
45
- // in .storybook/ when the component source it's docgen'ing lives three
46
- // directories down inside node_modules — it throws "Cannot read properties
47
- // of undefined (reading 'fileExists')", which surfaces as a plain 404 on
48
- // preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which
49
- // this harness never renders, so disabling it is a safe workaround (see
50
- // PROPOSAL-installed-package-harness.md, gap 3).
51
- config.typescript = { ...config.typescript, reactDocgen: false };
52
-
53
- export default config;
54
- `, y = `import type { Preview } from "@storybook/react-vite";
55
- import { createPreviewConfig } from "@recursica/storybook-template/preview";
56
- import { MantineProvider } from "@mantine/core";
57
- import "@mantine/core/styles.css";
58
- import "@mantine/dates/styles.css";
59
- import "@recursica/adapter-common/style.css";
60
- import "@recursica/official-release/recursica_variables_scoped.css";
61
- import recursicaTokens from "@recursica/official-release/recursica_tokens.json";
62
- import recursicaBrand from "@recursica/official-release/recursica_brand.json";
63
- import recursicaUIKit from "@recursica/official-release/recursica_ui-kit.json";
64
-
65
- const basePreview = createPreviewConfig({
66
- defaultTheme: "light",
67
- recursicaTokensJsonPath: recursicaTokens,
68
- recursicaBrandJsonPath: recursicaBrand,
69
- recursicaUIKitJsonPath: recursicaUIKit,
70
- });
71
-
72
- const preview: Preview = {
73
- ...basePreview,
74
- decorators: [
75
- (Story) => (
76
- <MantineProvider>
77
- <Story />
78
- </MantineProvider>
79
- ),
80
- ...(basePreview.decorators || []),
81
- ],
82
- };
83
-
84
- export default preview;
85
- `;
86
- function k(e) {
87
- const {
88
- dir: r,
89
- port: n,
90
- mantineAdapterVersion: c = "latest",
91
- storybookTemplateVersion: d = "latest"
92
- } = e;
93
- return m(o(r, ".storybook"), { recursive: !0 }), t(
94
- o(r, "package.json"),
95
- JSON.stringify(
96
- f({ mantineAdapterVersion: c, storybookTemplateVersion: d, port: n }),
97
- null,
98
- 2
99
- ) + `
100
- `
101
- ), t(o(r, ".storybook/main.ts"), l), t(o(r, ".storybook/preview.tsx"), y), t(o(r, ".gitignore"), `node_modules
102
- `), r;
103
- }
104
- function v(e) {
105
- const r = k(e);
106
- return {
107
- command: "npm install --no-audit --no-fund && npm run storybook",
108
- port: e.port,
109
- cwd: r,
110
- reuseExistingServer: !process.env.CI,
111
- timeout: 180 * 1e3
112
- };
113
- }
1
+ import { d as t, g as a } from "./config-CDxTeSAY.js";
2
+ import { m as o, s } from "./mantineSourceOfTruth-BiSfXKff.js";
114
3
  export {
115
- E as defineAdapterTesterConfig,
116
- P as getSourceOfTruth,
117
- v as mantineSourceOfTruthWebServer,
118
- k as scaffoldMantineSourceOfTruthHarness
4
+ t as defineAdapterTesterConfig,
5
+ a as getSourceOfTruth,
6
+ o as mantineSourceOfTruthWebServer,
7
+ s as scaffoldMantineSourceOfTruthHarness
119
8
  };
120
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/harness/mantineSourceOfTruth.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\n/**\n * Generates a small, throwaway Storybook project that installs\n * `@recursica/mantine-adapter` as a real npm dependency (not a workspace\n * link) and boots a real Storybook from its published `src/**\\/*.stories.tsx`\n * files, using `@recursica/storybook-template`'s exported factories.\n *\n * This lets any repo — including ones that never checked out the Recursica\n * monorepo — run adapter-tester's visual regression suite against Mantine\n * (Recursica's source-of-truth adapter) as one side of the comparison, while\n * the other side is that repo's own already-running local Storybook.\n *\n * See PROPOSAL-installed-package-harness.md for the verified prototype this\n * is built from, and the three upstream gaps it works around.\n */\n\nexport interface MantineSourceOfTruthHarnessOptions {\n /**\n * Directory the harness project is scaffolded into. Regenerated on every\n * call — add it to your .gitignore rather than committing it.\n */\n dir: string;\n /** Port the harness's Storybook dev server boots on. */\n port: number;\n /** npm version/range for @recursica/mantine-adapter. Defaults to \"latest\". */\n mantineAdapterVersion?: string;\n /** npm version/range for @recursica/storybook-template. Defaults to \"latest\". */\n storybookTemplateVersion?: string;\n}\n\nexport interface HarnessWebServerConfig {\n command: string;\n port: number;\n cwd: string;\n reuseExistingServer: boolean;\n timeout: number;\n}\n\n// Peer/dev ranges pinned to what @recursica/mantine-adapter and\n// @recursica/storybook-template themselves require, so the harness can't\n// drift onto an incompatible Mantine or Storybook major version.\nconst MANTINE_CORE_RANGE = \"^8.0.0\";\nconst STORYBOOK_RANGE = \"^10.3.3\";\nconst REACT_RANGE = \"^19.0.0\";\n\n// storybook-template's createMainConfig() defaults its addons list to these\n// three but doesn't declare them as peerDependencies (proposal gap 2) — a\n// harness that skips installing any of them gets a silent \"could not\n// resolve addon\" warning at boot, then a hard runtime crash later when Vite\n// pre-bundles preview.tsx's dependency graph. Installed explicitly here.\nconst DEFAULT_ADDON_DEPENDENCIES = {\n \"@storybook/addon-docs\": STORYBOOK_RANGE,\n \"@storybook/addon-a11y\": STORYBOOK_RANGE,\n \"storybook-dark-mode\": \"^5.0.0\",\n};\n\n// mantine-adapter's Introduction.stories.tsx (Version.tsx/OverStyling.tsx)\n// needs react-markdown, but it's a devDependency there — Storybook-only,\n// never bundled into dist — so an external `npm install` of the published\n// package won't pull it in. The harness boots a real Storybook against\n// src/, so it must provide this itself. Installed explicitly here.\nconst WORKAROUND_DEPENDENCIES = {\n \"react-markdown\": \"^10.1.0\",\n};\n\nfunction harnessPackageJson(options: {\n mantineAdapterVersion: string;\n storybookTemplateVersion: string;\n port: number;\n}) {\n return {\n name: \"adapter-tester-mantine-source-of-truth-harness\",\n private: true,\n type: \"module\",\n scripts: {\n storybook: `storybook dev -p ${options.port}`,\n },\n dependencies: {\n \"@recursica/mantine-adapter\": options.mantineAdapterVersion,\n \"@recursica/storybook-template\": options.storybookTemplateVersion,\n \"@recursica/official-release\": \"latest\",\n \"@recursica/adapter-common\": \"latest\",\n \"@mantine/core\": MANTINE_CORE_RANGE,\n \"@mantine/dates\": MANTINE_CORE_RANGE,\n react: REACT_RANGE,\n \"react-dom\": REACT_RANGE,\n storybook: STORYBOOK_RANGE,\n \"@storybook/react-vite\": STORYBOOK_RANGE,\n ...DEFAULT_ADDON_DEPENDENCIES,\n ...WORKAROUND_DEPENDENCIES,\n },\n };\n}\n\nconst MAIN_TS = `import { createMainConfig } from \"@recursica/storybook-template/main\";\n\nconst config = createMainConfig({\n stories: [\n \"../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)\",\n ],\n enableCORS: true,\n});\n\n// react-docgen-typescript can't resolve a TS project for a config file living\n// in .storybook/ when the component source it's docgen'ing lives three\n// directories down inside node_modules — it throws \"Cannot read properties\n// of undefined (reading 'fileExists')\", which surfaces as a plain 404 on\n// preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which\n// this harness never renders, so disabling it is a safe workaround (see\n// PROPOSAL-installed-package-harness.md, gap 3).\nconfig.typescript = { ...config.typescript, reactDocgen: false };\n\nexport default config;\n`;\n\nconst PREVIEW_TSX = `import type { Preview } from \"@storybook/react-vite\";\nimport { createPreviewConfig } from \"@recursica/storybook-template/preview\";\nimport { MantineProvider } from \"@mantine/core\";\nimport \"@mantine/core/styles.css\";\nimport \"@mantine/dates/styles.css\";\nimport \"@recursica/adapter-common/style.css\";\nimport \"@recursica/official-release/recursica_variables_scoped.css\";\nimport recursicaTokens from \"@recursica/official-release/recursica_tokens.json\";\nimport recursicaBrand from \"@recursica/official-release/recursica_brand.json\";\nimport recursicaUIKit from \"@recursica/official-release/recursica_ui-kit.json\";\n\nconst basePreview = createPreviewConfig({\n defaultTheme: \"light\",\n recursicaTokensJsonPath: recursicaTokens,\n recursicaBrandJsonPath: recursicaBrand,\n recursicaUIKitJsonPath: recursicaUIKit,\n});\n\nconst preview: Preview = {\n ...basePreview,\n decorators: [\n (Story) => (\n <MantineProvider>\n <Story />\n </MantineProvider>\n ),\n ...(basePreview.decorators || []),\n ],\n};\n\nexport default preview;\n`;\n\n/** Writes the harness project's files to `options.dir` without booting it. */\nexport function scaffoldMantineSourceOfTruthHarness(\n options: MantineSourceOfTruthHarnessOptions,\n): string {\n const {\n dir,\n port,\n mantineAdapterVersion = \"latest\",\n storybookTemplateVersion = \"latest\",\n } = options;\n\n mkdirSync(join(dir, \".storybook\"), { recursive: true });\n writeFileSync(\n join(dir, \"package.json\"),\n JSON.stringify(\n harnessPackageJson({ mantineAdapterVersion, storybookTemplateVersion, port }),\n null,\n 2,\n ) + \"\\n\",\n );\n writeFileSync(join(dir, \".storybook/main.ts\"), MAIN_TS);\n writeFileSync(join(dir, \".storybook/preview.tsx\"), PREVIEW_TSX);\n writeFileSync(join(dir, \".gitignore\"), \"node_modules\\n\");\n\n return dir;\n}\n\n/**\n * Scaffolds the harness and returns a Playwright `webServer` entry for it.\n * Spread the result directly into `playwright.config.ts`'s `webServer` array.\n */\nexport function mantineSourceOfTruthWebServer(\n options: MantineSourceOfTruthHarnessOptions,\n): HarnessWebServerConfig {\n const dir = scaffoldMantineSourceOfTruthHarness(options);\n return {\n command: \"npm install --no-audit --no-fund && npm run storybook\",\n port: options.port,\n cwd: dir,\n reuseExistingServer: !process.env.CI,\n timeout: 180 * 1000,\n };\n}\n"],"names":["MANTINE_CORE_RANGE","STORYBOOK_RANGE","REACT_RANGE","DEFAULT_ADDON_DEPENDENCIES","WORKAROUND_DEPENDENCIES","harnessPackageJson","options","MAIN_TS","PREVIEW_TSX","scaffoldMantineSourceOfTruthHarness","dir","port","mantineAdapterVersion","storybookTemplateVersion","mkdirSync","join","writeFileSync","mantineSourceOfTruthWebServer"],"mappings":";;;AA2CA,MAAMA,IAAqB,UACrBC,IAAkB,WAClBC,IAAc,WAOdC,IAA6B;AAAA,EACjC,yBAAyBF;AAAA,EACzB,yBAAyBA;AAAA,EACzB,uBAAuB;AACzB,GAOMG,IAA0B;AAAA,EAC9B,kBAAkB;AACpB;AAEA,SAASC,EAAmBC,GAIzB;AACD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,oBAAoBA,EAAQ,IAAI;AAAA,IAAA;AAAA,IAE7C,cAAc;AAAA,MACZ,8BAA8BA,EAAQ;AAAA,MACtC,iCAAiCA,EAAQ;AAAA,MACzC,+BAA+B;AAAA,MAC/B,6BAA6B;AAAA,MAC7B,iBAAiBN;AAAA,MACjB,kBAAkBA;AAAA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AA,EAAA;AAEnB;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,121 @@
1
+ import { mkdirSync as m, writeFileSync as t } from "node:fs";
2
+ import { join as o } from "node:path";
3
+ const i = "^8.0.0", s = "^10.3.3", a = "^19.0.0", p = {
4
+ "@storybook/addon-docs": s,
5
+ "@storybook/addon-a11y": s,
6
+ "storybook-dark-mode": "^5.0.0"
7
+ }, u = {
8
+ "react-markdown": "^10.1.0"
9
+ };
10
+ function l(e) {
11
+ return {
12
+ name: "adapter-tester-mantine-source-of-truth-harness",
13
+ private: !0,
14
+ type: "module",
15
+ scripts: {
16
+ storybook: `storybook dev -p ${e.port}`
17
+ },
18
+ dependencies: {
19
+ "@recursica/mantine-adapter": e.mantineAdapterVersion,
20
+ "@recursica/storybook-template": e.storybookTemplateVersion,
21
+ "@recursica/official-release": "latest",
22
+ "@recursica/adapter-common": "latest",
23
+ "@mantine/core": i,
24
+ "@mantine/dates": i,
25
+ react: a,
26
+ "react-dom": a,
27
+ storybook: s,
28
+ "@storybook/react-vite": s,
29
+ ...p,
30
+ ...u
31
+ }
32
+ };
33
+ }
34
+ const f = `import { createMainConfig } from "@recursica/storybook-template/main";
35
+
36
+ const config = createMainConfig({
37
+ stories: [
38
+ "../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)",
39
+ ],
40
+ enableCORS: true,
41
+ });
42
+
43
+ // react-docgen-typescript can't resolve a TS project for a config file living
44
+ // in .storybook/ when the component source it's docgen'ing lives three
45
+ // directories down inside node_modules — it throws "Cannot read properties
46
+ // of undefined (reading 'fileExists')", which surfaces as a plain 404 on
47
+ // preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which
48
+ // this harness never renders, so disabling it is a safe workaround (see
49
+ // PROPOSAL-installed-package-harness.md, gap 3).
50
+ config.typescript = { ...config.typescript, reactDocgen: false };
51
+
52
+ export default config;
53
+ `, y = `import type { Preview } from "@storybook/react-vite";
54
+ import { createPreviewConfig } from "@recursica/storybook-template/preview";
55
+ import { MantineProvider } from "@mantine/core";
56
+ import "@mantine/core/styles.css";
57
+ import "@mantine/dates/styles.css";
58
+ import "@recursica/adapter-common/style.css";
59
+ import "@recursica/official-release/recursica_variables_scoped.css";
60
+ import recursicaTokens from "@recursica/official-release/recursica_tokens.json";
61
+ import recursicaBrand from "@recursica/official-release/recursica_brand.json";
62
+ import recursicaUIKit from "@recursica/official-release/recursica_ui-kit.json";
63
+
64
+ const basePreview = createPreviewConfig({
65
+ defaultTheme: "light",
66
+ recursicaTokensJsonPath: recursicaTokens,
67
+ recursicaBrandJsonPath: recursicaBrand,
68
+ recursicaUIKitJsonPath: recursicaUIKit,
69
+ });
70
+
71
+ const preview: Preview = {
72
+ ...basePreview,
73
+ decorators: [
74
+ (Story) => (
75
+ <MantineProvider>
76
+ <Story />
77
+ </MantineProvider>
78
+ ),
79
+ ...(basePreview.decorators || []),
80
+ ],
81
+ };
82
+
83
+ export default preview;
84
+ `;
85
+ function k(e) {
86
+ const {
87
+ dir: r,
88
+ port: n,
89
+ mantineAdapterVersion: c = "latest",
90
+ storybookTemplateVersion: d = "latest"
91
+ } = e;
92
+ return m(o(r, ".storybook"), { recursive: !0 }), t(
93
+ o(r, "package.json"),
94
+ JSON.stringify(
95
+ l({
96
+ mantineAdapterVersion: c,
97
+ storybookTemplateVersion: d,
98
+ port: n
99
+ }),
100
+ null,
101
+ 2
102
+ ) + `
103
+ `
104
+ ), t(o(r, ".storybook/main.ts"), f), t(o(r, ".storybook/preview.tsx"), y), t(o(r, ".gitignore"), `node_modules
105
+ `), r;
106
+ }
107
+ function g(e) {
108
+ const r = k(e);
109
+ return {
110
+ command: "npm install --no-audit --no-fund && npm run storybook",
111
+ port: e.port,
112
+ cwd: r,
113
+ reuseExistingServer: !process.env.CI,
114
+ timeout: 180 * 1e3
115
+ };
116
+ }
117
+ export {
118
+ g as m,
119
+ k as s
120
+ };
121
+ //# sourceMappingURL=mantineSourceOfTruth-BiSfXKff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mantineSourceOfTruth-BiSfXKff.js","sources":["../src/harness/mantineSourceOfTruth.ts"],"sourcesContent":["import { mkdirSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\n/**\n * Generates a small, throwaway Storybook project that installs\n * `@recursica/mantine-adapter` as a real npm dependency (not a workspace\n * link) and boots a real Storybook from its published `src/**\\/*.stories.tsx`\n * files, using `@recursica/storybook-template`'s exported factories.\n *\n * This lets any repo — including ones that never checked out the Recursica\n * monorepo — run adapter-tester's visual regression suite against Mantine\n * (Recursica's source-of-truth adapter) as one side of the comparison, while\n * the other side is that repo's own already-running local Storybook.\n *\n * See PROPOSAL-installed-package-harness.md for the verified prototype this\n * is built from, and the three upstream gaps it works around.\n */\n\nexport interface MantineSourceOfTruthHarnessOptions {\n /**\n * Directory the harness project is scaffolded into. Regenerated on every\n * call — add it to your .gitignore rather than committing it.\n */\n dir: string;\n /** Port the harness's Storybook dev server boots on. */\n port: number;\n /** npm version/range for @recursica/mantine-adapter. Defaults to \"latest\". */\n mantineAdapterVersion?: string;\n /** npm version/range for @recursica/storybook-template. Defaults to \"latest\". */\n storybookTemplateVersion?: string;\n}\n\nexport interface HarnessWebServerConfig {\n command: string;\n port: number;\n cwd: string;\n reuseExistingServer: boolean;\n timeout: number;\n}\n\n// Peer/dev ranges pinned to what @recursica/mantine-adapter and\n// @recursica/storybook-template themselves require, so the harness can't\n// drift onto an incompatible Mantine or Storybook major version.\nconst MANTINE_CORE_RANGE = \"^8.0.0\";\nconst STORYBOOK_RANGE = \"^10.3.3\";\nconst REACT_RANGE = \"^19.0.0\";\n\n// storybook-template's createMainConfig() defaults its addons list to these\n// three but doesn't declare them as peerDependencies (proposal gap 2) — a\n// harness that skips installing any of them gets a silent \"could not\n// resolve addon\" warning at boot, then a hard runtime crash later when Vite\n// pre-bundles preview.tsx's dependency graph. Installed explicitly here.\nconst DEFAULT_ADDON_DEPENDENCIES = {\n \"@storybook/addon-docs\": STORYBOOK_RANGE,\n \"@storybook/addon-a11y\": STORYBOOK_RANGE,\n \"storybook-dark-mode\": \"^5.0.0\",\n};\n\n// mantine-adapter's Introduction.stories.tsx (Version.tsx/OverStyling.tsx)\n// needs react-markdown, but it's a devDependency there — Storybook-only,\n// never bundled into dist — so an external `npm install` of the published\n// package won't pull it in. The harness boots a real Storybook against\n// src/, so it must provide this itself. Installed explicitly here.\nconst WORKAROUND_DEPENDENCIES = {\n \"react-markdown\": \"^10.1.0\",\n};\n\nfunction harnessPackageJson(options: {\n mantineAdapterVersion: string;\n storybookTemplateVersion: string;\n port: number;\n}) {\n return {\n name: \"adapter-tester-mantine-source-of-truth-harness\",\n private: true,\n type: \"module\",\n scripts: {\n storybook: `storybook dev -p ${options.port}`,\n },\n dependencies: {\n \"@recursica/mantine-adapter\": options.mantineAdapterVersion,\n \"@recursica/storybook-template\": options.storybookTemplateVersion,\n \"@recursica/official-release\": \"latest\",\n \"@recursica/adapter-common\": \"latest\",\n \"@mantine/core\": MANTINE_CORE_RANGE,\n \"@mantine/dates\": MANTINE_CORE_RANGE,\n react: REACT_RANGE,\n \"react-dom\": REACT_RANGE,\n storybook: STORYBOOK_RANGE,\n \"@storybook/react-vite\": STORYBOOK_RANGE,\n ...DEFAULT_ADDON_DEPENDENCIES,\n ...WORKAROUND_DEPENDENCIES,\n },\n };\n}\n\nconst MAIN_TS = `import { createMainConfig } from \"@recursica/storybook-template/main\";\n\nconst config = createMainConfig({\n stories: [\n \"../node_modules/@recursica/mantine-adapter/src/**/*.stories.@(js|jsx|mjs|ts|tsx)\",\n ],\n enableCORS: true,\n});\n\n// react-docgen-typescript can't resolve a TS project for a config file living\n// in .storybook/ when the component source it's docgen'ing lives three\n// directories down inside node_modules — it throws \"Cannot read properties\n// of undefined (reading 'fileExists')\", which surfaces as a plain 404 on\n// preview.tsx. Docgen only powers Storybook's Controls/Docs tables, which\n// this harness never renders, so disabling it is a safe workaround (see\n// PROPOSAL-installed-package-harness.md, gap 3).\nconfig.typescript = { ...config.typescript, reactDocgen: false };\n\nexport default config;\n`;\n\nconst PREVIEW_TSX = `import type { Preview } from \"@storybook/react-vite\";\nimport { createPreviewConfig } from \"@recursica/storybook-template/preview\";\nimport { MantineProvider } from \"@mantine/core\";\nimport \"@mantine/core/styles.css\";\nimport \"@mantine/dates/styles.css\";\nimport \"@recursica/adapter-common/style.css\";\nimport \"@recursica/official-release/recursica_variables_scoped.css\";\nimport recursicaTokens from \"@recursica/official-release/recursica_tokens.json\";\nimport recursicaBrand from \"@recursica/official-release/recursica_brand.json\";\nimport recursicaUIKit from \"@recursica/official-release/recursica_ui-kit.json\";\n\nconst basePreview = createPreviewConfig({\n defaultTheme: \"light\",\n recursicaTokensJsonPath: recursicaTokens,\n recursicaBrandJsonPath: recursicaBrand,\n recursicaUIKitJsonPath: recursicaUIKit,\n});\n\nconst preview: Preview = {\n ...basePreview,\n decorators: [\n (Story) => (\n <MantineProvider>\n <Story />\n </MantineProvider>\n ),\n ...(basePreview.decorators || []),\n ],\n};\n\nexport default preview;\n`;\n\n/** Writes the harness project's files to `options.dir` without booting it. */\nexport function scaffoldMantineSourceOfTruthHarness(\n options: MantineSourceOfTruthHarnessOptions,\n): string {\n const {\n dir,\n port,\n mantineAdapterVersion = \"latest\",\n storybookTemplateVersion = \"latest\",\n } = options;\n\n mkdirSync(join(dir, \".storybook\"), { recursive: true });\n writeFileSync(\n join(dir, \"package.json\"),\n JSON.stringify(\n harnessPackageJson({\n mantineAdapterVersion,\n storybookTemplateVersion,\n port,\n }),\n null,\n 2,\n ) + \"\\n\",\n );\n writeFileSync(join(dir, \".storybook/main.ts\"), MAIN_TS);\n writeFileSync(join(dir, \".storybook/preview.tsx\"), PREVIEW_TSX);\n writeFileSync(join(dir, \".gitignore\"), \"node_modules\\n\");\n\n return dir;\n}\n\n/**\n * Scaffolds the harness and returns a Playwright `webServer` entry for it.\n * Spread the result directly into `playwright.config.ts`'s `webServer` array.\n */\nexport function mantineSourceOfTruthWebServer(\n options: MantineSourceOfTruthHarnessOptions,\n): HarnessWebServerConfig {\n const dir = scaffoldMantineSourceOfTruthHarness(options);\n return {\n command: \"npm install --no-audit --no-fund && npm run storybook\",\n port: options.port,\n cwd: dir,\n reuseExistingServer: !process.env.CI,\n timeout: 180 * 1000,\n };\n}\n"],"names":["MANTINE_CORE_RANGE","STORYBOOK_RANGE","REACT_RANGE","DEFAULT_ADDON_DEPENDENCIES","WORKAROUND_DEPENDENCIES","harnessPackageJson","options","MAIN_TS","PREVIEW_TSX","scaffoldMantineSourceOfTruthHarness","dir","port","mantineAdapterVersion","storybookTemplateVersion","mkdirSync","join","writeFileSync","mantineSourceOfTruthWebServer"],"mappings":";;AA2CA,MAAMA,IAAqB,UACrBC,IAAkB,WAClBC,IAAc,WAOdC,IAA6B;AAAA,EACjC,yBAAyBF;AAAA,EACzB,yBAAyBA;AAAA,EACzB,uBAAuB;AACzB,GAOMG,IAA0B;AAAA,EAC9B,kBAAkB;AACpB;AAEA,SAASC,EAAmBC,GAIzB;AACD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA,MACP,WAAW,oBAAoBA,EAAQ,IAAI;AAAA,IAAA;AAAA,IAE7C,cAAc;AAAA,MACZ,8BAA8BA,EAAQ;AAAA,MACtC,iCAAiCA,EAAQ;AAAA,MACzC,+BAA+B;AAAA,MAC/B,6BAA6B;AAAA,MAC7B,iBAAiBN;AAAA,MACjB,kBAAkBA;AAAA,MAClB,OAAOE;AAAA,MACP,aAAaA;AAAA,MACb,WAAWD;AAAA,MACX,yBAAyBA;AAAA,MACzB,GAAGE;AAAA,MACH,GAAGC;AAAA,IAAA;AAAA,EACL;AAEJ;AAEA,MAAMG,IAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GAq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