@cedarjs/vite 7.0.0-canary.2983 → 7.0.0-canary.2985

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":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,iBA0a3B"}
1
+ {"version":3,"file":"buildApp.d.ts","sourceRoot":"","sources":["../src/buildApp.ts"],"names":[],"mappings":"AA6DA,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,EAAE,CAAC,EAAE,OAAO,CAAA;CACb;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,EAClC,OAAe,EACf,SAA0B,EAC1B,EAAU,GACX,GAAE,oBAAyB,iBAsa3B"}
package/dist/buildApp.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  applySrcAlias
21
21
  } from "@cedarjs/internal/dist/build/api.js";
22
22
  import { findApiFiles } from "@cedarjs/internal/dist/files.js";
23
- import { getConfig, getPaths, projectSideIsEsm } from "@cedarjs/project-config";
23
+ import { getConfig, getPaths } from "@cedarjs/project-config";
24
24
  import { generateDiffSourceMap } from "./lib/generateDiffSourceMap.js";
25
25
  import { getWorkspacePackageAliases } from "./lib/workspacePackageAliases.js";
26
26
  import { cedarAutoImportsPlugin } from "./plugins/vite-plugin-cedar-auto-import.js";
@@ -60,8 +60,6 @@ async function buildCedarApp({
60
60
  };
61
61
  }
62
62
  if (workspace.includes("api")) {
63
- const isEsm = projectSideIsEsm("api");
64
- const format = isEsm ? "es" : "cjs";
65
63
  const apiFiles = findApiFiles();
66
64
  const input = {};
67
65
  for (const f of apiFiles) {
@@ -77,7 +75,7 @@ async function buildCedarApp({
77
75
  rollupOptions: {
78
76
  input,
79
77
  output: {
80
- format,
78
+ format: "es",
81
79
  preserveModules: true,
82
80
  preserveModulesRoot: cedarPaths.api.src,
83
81
  entryFileNames: "[name].js",
@@ -256,9 +254,7 @@ async function buildCedarApp({
256
254
  plugins.push(cedarDirectoryNamedImportPlugin());
257
255
  plugins.push(cedarOtelWrappingPlugin());
258
256
  plugins.push(cedarjsJobPathInjectorPlugin());
259
- plugins.push(
260
- handlerAlsWrappingPlugin({ projectIsEsm: projectSideIsEsm("api") })
261
- );
257
+ plugins.push(handlerAlsWrappingPlugin());
262
258
  }
263
259
  plugins.push(cedarMockCellDataPlugin());
264
260
  if (workspace.includes("api")) {
@@ -25,9 +25,7 @@ import type { Plugin } from 'vite';
25
25
  * This replaces `babel-plugin-handler-als-wrapping` for Vite builds.
26
26
  * The babel plugin is still used for Jest and prerender.
27
27
  */
28
- export declare function handlerAlsWrappingPlugin({ projectIsEsm, }?: {
29
- projectIsEsm?: boolean;
30
- }): Plugin;
28
+ export declare function handlerAlsWrappingPlugin(): Plugin;
31
29
  /**
32
30
  * Wraps the `handler` export of an API function file with an async context
33
31
  * store guard. Returns the transformed code, or `null` if the file does not
@@ -38,7 +36,5 @@ export declare function handlerAlsWrappingPlugin({ projectIsEsm, }?: {
38
36
  * function so it can be applied from build pipelines that don't go through
39
37
  * Vite's plugin pipeline (e.g. the legacy esbuild API build).
40
38
  */
41
- export declare function applyHandlerAlsWrapping(code: string, { projectIsEsm }?: {
42
- projectIsEsm?: boolean;
43
- }): string | null;
39
+ export declare function applyHandlerAlsWrapping(code: string): string | null;
44
40
  //# sourceMappingURL=vite-plugin-handler-als-wrapping.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vite-plugin-handler-als-wrapping.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-handler-als-wrapping.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,YAAoB,GACrB,GAAE;IACD,YAAY,CAAC,EAAE,OAAO,CAAA;CAClB,GAAG,MAAM,CAuBd;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,EACZ,EAAE,YAAoB,EAAE,GAAE;IAAE,YAAY,CAAC,EAAE,OAAO,CAAA;CAAO,GACxD,MAAM,GAAG,IAAI,CAsDf"}
1
+ {"version":3,"file":"vite-plugin-handler-als-wrapping.d.ts","sourceRoot":"","sources":["../../src/plugins/vite-plugin-handler-als-wrapping.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AAKlC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAuBjD;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAkDnE"}
@@ -1,9 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { normalizePath } from "vite";
3
3
  import { getPaths } from "@cedarjs/project-config";
4
- function handlerAlsWrappingPlugin({
5
- projectIsEsm = false
6
- } = {}) {
4
+ function handlerAlsWrappingPlugin() {
7
5
  return {
8
6
  name: "handler-als-wrapping",
9
7
  transform(code, id) {
@@ -17,12 +15,12 @@ function handlerAlsWrappingPlugin({
17
15
  if (!normalizePath(id).startsWith(functionsDir + "/")) {
18
16
  return null;
19
17
  }
20
- const wrapped = applyHandlerAlsWrapping(code, { projectIsEsm });
18
+ const wrapped = applyHandlerAlsWrapping(code);
21
19
  return wrapped ? { code: wrapped, map: null } : null;
22
20
  }
23
21
  };
24
22
  }
25
- function applyHandlerAlsWrapping(code, { projectIsEsm = false } = {}) {
23
+ function applyHandlerAlsWrapping(code) {
26
24
  const handlerRe = /^export\s+(?:const|let|var)\s+handler(?:[^=]|=>)*?=(?![>=])/m;
27
25
  const handlerMatch = handlerRe.exec(code);
28
26
  if (!handlerMatch) {
@@ -30,8 +28,7 @@ function applyHandlerAlsWrapping(code, { projectIsEsm = false } = {}) {
30
28
  }
31
29
  const afterEquals = code.slice(handlerMatch.index + handlerMatch[0].length).trimStart();
32
30
  const isAsync = /^async(?:\s*[\(\*]|\s+function)/.test(afterEquals);
33
- const storePath = projectIsEsm ? "@cedarjs/context/dist/store.js" : "@cedarjs/context/dist/store";
34
- const importStatement = `import { getAsyncStoreInstance as __cedar_getAsyncStoreInstance } from '${storePath}'
31
+ const importStatement = `import { getAsyncStoreInstance as __cedar_getAsyncStoreInstance } from '@cedarjs/context/dist/store.js'
35
32
  `;
36
33
  const handlerStart = handlerMatch.index;
37
34
  const before = code.slice(0, handlerStart);
@@ -4,9 +4,14 @@ import type { ServerAuthState } from '@cedarjs/auth/dist/AuthProvider/ServerAuth
4
4
  import type { TagDescriptor } from '@cedarjs/web';
5
5
  import type { MiddlewareResponse } from '@cedarjs/web/middleware';
6
6
  import type { ServerEntryType } from '../types.js';
7
+ interface FallbackDocumentProps {
8
+ css: string[];
9
+ meta: TagDescriptor[];
10
+ children?: React.ReactNode;
11
+ }
7
12
  interface RenderToStreamArgs {
8
13
  ServerEntry: ServerEntryType;
9
- FallbackDocument: React.FunctionComponent;
14
+ FallbackDocument: React.FunctionComponent<FallbackDocumentProps>;
10
15
  currentUrl: URL;
11
16
  metaTags: TagDescriptor[];
12
17
  cssLinks: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"streamHelpers.d.ts","sourceRoot":"","sources":["../../src/streaming/streamHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,OAAO,KAAK,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EAAE,MAAM,aAAa,CAAA;AAYlD,UAAU,qBAAqB;IAC7B,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,UAAU,kBAAkB;IAC1B,WAAW,EAAE,eAAe,CAAA;IAC5B,gBAAgB,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAA;IAChE,UAAU,EAAE,GAAG,CAAA;IACf,QAAQ,EAAE,aAAa,EAAE,CAAA;IACzB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,MAAM,EAAE,OAAO,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,eAAe,CAAA;CAC3B;AAED,UAAU,aAAa;IACrB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAA;CAC/B;AA2BD,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,kBAAkB,EACzB,aAAa,EAAE,kBAAkB,EACjC,aAAa,EAAE,aAAa,EAC5B,aAAa,CAAC,EAAE,aAAa,qBAgM9B"}
@@ -137,7 +137,7 @@ async function reactRenderToStreamResponse(mwRes, renderOptions, streamOptions,
137
137
  console.error("\u{1F53B} Failed to render shell");
138
138
  streamOptions.onError?.(e);
139
139
  const fallbackShell = await renderToReadableStream(
140
- FallbackDocument({
140
+ createElement(FallbackDocument, {
141
141
  children: null,
142
142
  css: cssLinks,
143
143
  meta: metaTags
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/vite",
3
- "version": "7.0.0-canary.2983",
3
+ "version": "7.0.0-canary.2985",
4
4
  "description": "Vite configuration package for CedarJS",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,17 +52,17 @@
52
52
  "@babel/parser": "7.29.8",
53
53
  "@babel/traverse": "7.29.8",
54
54
  "@babel/types": "7.29.8",
55
- "@cedarjs/api": "7.0.0-canary.2983",
56
- "@cedarjs/api-server": "7.0.0-canary.2983",
57
- "@cedarjs/babel-config": "7.0.0-canary.2983",
58
- "@cedarjs/context": "7.0.0-canary.2983",
59
- "@cedarjs/graphql-server": "7.0.0-canary.2983",
60
- "@cedarjs/internal": "7.0.0-canary.2983",
61
- "@cedarjs/jobs": "7.0.0-canary.2983",
62
- "@cedarjs/project-config": "7.0.0-canary.2983",
63
- "@cedarjs/server-store": "7.0.0-canary.2983",
64
- "@cedarjs/structure": "7.0.0-canary.2983",
65
- "@cedarjs/testing": "7.0.0-canary.2983",
55
+ "@cedarjs/api": "7.0.0-canary.2985",
56
+ "@cedarjs/api-server": "7.0.0-canary.2985",
57
+ "@cedarjs/babel-config": "7.0.0-canary.2985",
58
+ "@cedarjs/context": "7.0.0-canary.2985",
59
+ "@cedarjs/graphql-server": "7.0.0-canary.2985",
60
+ "@cedarjs/internal": "7.0.0-canary.2985",
61
+ "@cedarjs/jobs": "7.0.0-canary.2985",
62
+ "@cedarjs/project-config": "7.0.0-canary.2985",
63
+ "@cedarjs/server-store": "7.0.0-canary.2985",
64
+ "@cedarjs/structure": "7.0.0-canary.2985",
65
+ "@cedarjs/testing": "7.0.0-canary.2985",
66
66
  "@swc/core": "1.16.0",
67
67
  "@universal-deploy/store": "^0.2.1",
68
68
  "@universal-deploy/vite": "^0.1.9",
@@ -93,10 +93,10 @@
93
93
  "yargs-parser": "21.1.1"
94
94
  },
95
95
  "devDependencies": {
96
- "@cedarjs/auth": "7.0.0-canary.2983",
97
- "@cedarjs/framework-tools": "7.0.0-canary.2983",
98
- "@cedarjs/router": "7.0.0-canary.2983",
99
- "@cedarjs/web": "7.0.0-canary.2983",
96
+ "@cedarjs/auth": "7.0.0-canary.2985",
97
+ "@cedarjs/framework-tools": "7.0.0-canary.2985",
98
+ "@cedarjs/router": "7.0.0-canary.2985",
99
+ "@cedarjs/web": "7.0.0-canary.2985",
100
100
  "@dr.pogodin/react-helmet": "2.0.4",
101
101
  "@hyrious/esbuild-plugin-commonjs": "0.2.6",
102
102
  "@jridgewell/trace-mapping": "0.3.31",
@@ -104,7 +104,7 @@
104
104
  "@types/aws-lambda": "8.10.162",
105
105
  "@types/busboy": "^1",
106
106
  "@types/express": "4",
107
- "@types/react": "^18.2.55",
107
+ "@types/react": "^19.2.0",
108
108
  "@types/ws": "^8",
109
109
  "@types/yargs-parser": "21.0.3",
110
110
  "concurrently": "9.2.4",
@@ -116,9 +116,9 @@
116
116
  "vitest": "4.1.10"
117
117
  },
118
118
  "peerDependencies": {
119
- "@cedarjs/auth": "7.0.0-canary.2983",
120
- "@cedarjs/router": "7.0.0-canary.2983",
121
- "@cedarjs/web": "7.0.0-canary.2983"
119
+ "@cedarjs/auth": "7.0.0-canary.2985",
120
+ "@cedarjs/router": "7.0.0-canary.2985",
121
+ "@cedarjs/web": "7.0.0-canary.2985"
122
122
  },
123
123
  "engines": {
124
124
  "node": ">=24"