storybook-framework-cedarjs 5.0.3 → 5.0.4-next.167
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/dist/mocks/MockProviders.js +2 -2
- package/dist/preset.d.ts.map +1 -1
- package/dist/preset.js +17 -18
- package/package.json +7 -7
|
@@ -2,11 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { LocationProvider } from "@cedarjs/router";
|
|
3
3
|
import { useAuth } from "@cedarjs/testing/auth";
|
|
4
4
|
import { RedwoodProvider } from "@cedarjs/web";
|
|
5
|
-
import {
|
|
5
|
+
import { CedarApolloProvider } from "@cedarjs/web/apollo/CedarApolloProvider";
|
|
6
6
|
import { MockParamsProvider } from "./MockParamsProvider.js";
|
|
7
7
|
import UserRoutes from "~__CEDAR__USER_ROUTES_FOR_MOCK";
|
|
8
8
|
const MockProviders = ({ children }) => {
|
|
9
|
-
return /* @__PURE__ */ React.createElement(RedwoodProvider, { titleTemplate: "%PageTitle | %AppTitle" }, /* @__PURE__ */ React.createElement(
|
|
9
|
+
return /* @__PURE__ */ React.createElement(RedwoodProvider, { titleTemplate: "%PageTitle | %AppTitle" }, /* @__PURE__ */ React.createElement(CedarApolloProvider, { useAuth }, /* @__PURE__ */ React.createElement(UserRoutes, null), /* @__PURE__ */ React.createElement(LocationProvider, null, /* @__PURE__ */ React.createElement(MockParamsProvider, null, children))));
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
MockProviders
|
package/dist/preset.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAWtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAGvC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAKpE,CAAA;AAID,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../src/preset.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAWtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,CAGvC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,oBAAoB,CAKpE,CAAA;AAID,eAAO,MAAM,SAAS,EAAE,eAAe,CAAC,WAAW,CAmLlD,CAAA"}
|
package/dist/preset.js
CHANGED
|
@@ -85,8 +85,8 @@ const viteFinal = async (config) => {
|
|
|
85
85
|
// resolve.alias redirects them in the transform pipeline, but esbuild
|
|
86
86
|
// (dep optimizer) ignores resolve.alias. Without this, Vite discovers
|
|
87
87
|
// them on the first page load and triggers a mid-session reload, which
|
|
88
|
-
// tears down the StorybookProvider's
|
|
89
|
-
//
|
|
88
|
+
// tears down the StorybookProvider's Apollo context and breaks
|
|
89
|
+
// nested-Cell stories. These are structural deps of @cedarjs/web
|
|
90
90
|
// itself, so this list is valid for all Cedar apps, not just the test
|
|
91
91
|
// project.
|
|
92
92
|
include: [
|
|
@@ -103,8 +103,8 @@ const viteFinal = async (config) => {
|
|
|
103
103
|
// Pre-bundle node-polyfill shims so Vite doesn't discover them
|
|
104
104
|
// mid-session when storybook-framework-cedarjs (which uses
|
|
105
105
|
// nodePolyfills()) is first rendered. Without this, each shim
|
|
106
|
-
// triggers a separate optimized-deps reload that tears down
|
|
107
|
-
//
|
|
106
|
+
// triggers a separate optimized-deps reload that tears down the
|
|
107
|
+
// Apollo provider and breaks nested-Cell stories.
|
|
108
108
|
"vite-plugin-node-polyfills/shims/buffer",
|
|
109
109
|
"vite-plugin-node-polyfills/shims/global",
|
|
110
110
|
"vite-plugin-node-polyfills/shims/process",
|
|
@@ -115,15 +115,15 @@ const viteFinal = async (config) => {
|
|
|
115
115
|
"@cedarjs/testing/web/MockRouter.js",
|
|
116
116
|
"@cedarjs/testing/auth",
|
|
117
117
|
"graphql-tag",
|
|
118
|
-
// Pre-bundle @cedarjs/web so there is only one instance of
|
|
119
|
-
//
|
|
120
|
-
// the Vite transform pipeline can each
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
// error when a Cell is nested inside another story.
|
|
118
|
+
// Pre-bundle @cedarjs/web so there is only one instance of the
|
|
119
|
+
// modules that hold Apollo's React context. Without this, the
|
|
120
|
+
// pre-bundled dep graph and the Vite transform pipeline can each
|
|
121
|
+
// produce their own copy of a module, so CedarApolloProvider sets
|
|
122
|
+
// Apollo's context in one copy while a Cell's useQuery reads from
|
|
123
|
+
// the other, breaking Cells nested inside another story.
|
|
125
124
|
"@cedarjs/web",
|
|
126
|
-
"@cedarjs/web/apollo"
|
|
125
|
+
"@cedarjs/web/apollo",
|
|
126
|
+
"@cedarjs/web/apollo/CedarApolloProvider"
|
|
127
127
|
],
|
|
128
128
|
esbuildOptions: {
|
|
129
129
|
plugins: [
|
|
@@ -136,12 +136,11 @@ const viteFinal = async (config) => {
|
|
|
136
136
|
//
|
|
137
137
|
// We must NOT return the real Cell file contents here. If esbuild
|
|
138
138
|
// follows the Cell's imports (e.g. createCell from @cedarjs/web),
|
|
139
|
-
// it pulls
|
|
140
|
-
// separately from the @cedarjs/web chunk.
|
|
141
|
-
// distinct
|
|
142
|
-
//
|
|
143
|
-
//
|
|
144
|
-
// GraphQLHooksProvider".
|
|
139
|
+
// it pulls the modules holding Apollo's React context into their
|
|
140
|
+
// own pre-bundled chunk separately from the @cedarjs/web chunk.
|
|
141
|
+
// That produces two distinct context instances, so the context
|
|
142
|
+
// set by CedarApolloProvider is invisible to the Cell's
|
|
143
|
+
// useQuery, breaking every Cell story.
|
|
145
144
|
//
|
|
146
145
|
// Instead we synthesize a stub module: we scan the source for
|
|
147
146
|
// exported names and re-export them as empty stubs, plus add a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storybook-framework-cedarjs",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4-next.167",
|
|
4
4
|
"description": "Storybook for CedarJS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Storybook",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"test:watch": "vitest watch"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@cedarjs/testing": "5.0.
|
|
52
|
+
"@cedarjs/testing": "5.0.4-next.167",
|
|
53
53
|
"@rollup/pluginutils": "5.4.0",
|
|
54
54
|
"@storybook/addon-essentials": "8.6.14",
|
|
55
55
|
"@storybook/builder-vite": "8.6.18",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"empathic": "2.0.1",
|
|
58
58
|
"magic-string": "0.30.21",
|
|
59
59
|
"react-docgen": "7.1.1",
|
|
60
|
-
"tsconfig-paths": "
|
|
60
|
+
"tsconfig-paths": "4.2.0",
|
|
61
61
|
"unplugin-auto-import": "19.3.0",
|
|
62
62
|
"vite-plugin-node-polyfills": "0.26.0"
|
|
63
63
|
},
|
|
@@ -65,12 +65,12 @@
|
|
|
65
65
|
"@storybook/types": "8.6.14",
|
|
66
66
|
"@types/node": "24.10.4",
|
|
67
67
|
"typescript": "5.9.3",
|
|
68
|
-
"vite": "7.3.
|
|
69
|
-
"vitest": "
|
|
68
|
+
"vite": "7.3.6",
|
|
69
|
+
"vitest": "4.1.10"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@cedarjs/project-config": "5.0.
|
|
73
|
-
"@cedarjs/router": "5.0.
|
|
72
|
+
"@cedarjs/project-config": "5.0.4-next.167",
|
|
73
|
+
"@cedarjs/router": "5.0.4-next.167",
|
|
74
74
|
"react": "18.3.1",
|
|
75
75
|
"react-dom": "18.3.1",
|
|
76
76
|
"storybook": "8.6.18"
|