@cedarjs/vite 7.0.0-canary.2984 → 7.0.0-canary.2989
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/buildApp.d.ts.map
CHANGED
|
@@ -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,
|
|
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
|
|
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(
|
|
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
|
|
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,
|
|
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
|
|
18
|
+
const wrapped = applyHandlerAlsWrapping(code);
|
|
21
19
|
return wrapped ? { code: wrapped, map: null } : null;
|
|
22
20
|
}
|
|
23
21
|
};
|
|
24
22
|
}
|
|
25
|
-
function applyHandlerAlsWrapping(code
|
|
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
|
|
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);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "7.0.0-canary.
|
|
3
|
+
"version": "7.0.0-canary.2989",
|
|
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.
|
|
56
|
-
"@cedarjs/api-server": "7.0.0-canary.
|
|
57
|
-
"@cedarjs/babel-config": "7.0.0-canary.
|
|
58
|
-
"@cedarjs/context": "7.0.0-canary.
|
|
59
|
-
"@cedarjs/graphql-server": "7.0.0-canary.
|
|
60
|
-
"@cedarjs/internal": "7.0.0-canary.
|
|
61
|
-
"@cedarjs/jobs": "7.0.0-canary.
|
|
62
|
-
"@cedarjs/project-config": "7.0.0-canary.
|
|
63
|
-
"@cedarjs/server-store": "7.0.0-canary.
|
|
64
|
-
"@cedarjs/structure": "7.0.0-canary.
|
|
65
|
-
"@cedarjs/testing": "7.0.0-canary.
|
|
55
|
+
"@cedarjs/api": "7.0.0-canary.2989",
|
|
56
|
+
"@cedarjs/api-server": "7.0.0-canary.2989",
|
|
57
|
+
"@cedarjs/babel-config": "7.0.0-canary.2989",
|
|
58
|
+
"@cedarjs/context": "7.0.0-canary.2989",
|
|
59
|
+
"@cedarjs/graphql-server": "7.0.0-canary.2989",
|
|
60
|
+
"@cedarjs/internal": "7.0.0-canary.2989",
|
|
61
|
+
"@cedarjs/jobs": "7.0.0-canary.2989",
|
|
62
|
+
"@cedarjs/project-config": "7.0.0-canary.2989",
|
|
63
|
+
"@cedarjs/server-store": "7.0.0-canary.2989",
|
|
64
|
+
"@cedarjs/structure": "7.0.0-canary.2989",
|
|
65
|
+
"@cedarjs/testing": "7.0.0-canary.2989",
|
|
66
66
|
"@swc/core": "1.16.0",
|
|
67
67
|
"@universal-deploy/store": "^0.2.1",
|
|
68
68
|
"@universal-deploy/vite": "^0.1.9",
|
|
@@ -81,7 +81,6 @@
|
|
|
81
81
|
"isbot": "5.2.1",
|
|
82
82
|
"magic-string": "0.30.21",
|
|
83
83
|
"oxc-parser": "0.144.0",
|
|
84
|
-
"react": "19.2.3",
|
|
85
84
|
"react-server-dom-webpack": "19.2.7",
|
|
86
85
|
"unimport": "5.7.0",
|
|
87
86
|
"unplugin-auto-import": "19.3.0",
|
|
@@ -93,10 +92,10 @@
|
|
|
93
92
|
"yargs-parser": "21.1.1"
|
|
94
93
|
},
|
|
95
94
|
"devDependencies": {
|
|
96
|
-
"@cedarjs/auth": "7.0.0-canary.
|
|
97
|
-
"@cedarjs/framework-tools": "7.0.0-canary.
|
|
98
|
-
"@cedarjs/router": "7.0.0-canary.
|
|
99
|
-
"@cedarjs/web": "7.0.0-canary.
|
|
95
|
+
"@cedarjs/auth": "7.0.0-canary.2989",
|
|
96
|
+
"@cedarjs/framework-tools": "7.0.0-canary.2989",
|
|
97
|
+
"@cedarjs/router": "7.0.0-canary.2989",
|
|
98
|
+
"@cedarjs/web": "7.0.0-canary.2989",
|
|
100
99
|
"@dr.pogodin/react-helmet": "2.0.4",
|
|
101
100
|
"@hyrious/esbuild-plugin-commonjs": "0.2.6",
|
|
102
101
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
@@ -110,15 +109,19 @@
|
|
|
110
109
|
"concurrently": "9.2.4",
|
|
111
110
|
"memfs": "4.68.1",
|
|
112
111
|
"publint": "0.3.23",
|
|
112
|
+
"react": "19.2.3",
|
|
113
|
+
"react-dom": "19.2.3",
|
|
113
114
|
"rollup": "4.60.4",
|
|
114
115
|
"ts-dedent": "2.3.0",
|
|
115
116
|
"typescript": "5.9.3",
|
|
116
117
|
"vitest": "4.1.10"
|
|
117
118
|
},
|
|
118
119
|
"peerDependencies": {
|
|
119
|
-
"@cedarjs/auth": "7.0.0-canary.
|
|
120
|
-
"@cedarjs/router": "7.0.0-canary.
|
|
121
|
-
"@cedarjs/web": "7.0.0-canary.
|
|
120
|
+
"@cedarjs/auth": "7.0.0-canary.2989",
|
|
121
|
+
"@cedarjs/router": "7.0.0-canary.2989",
|
|
122
|
+
"@cedarjs/web": "7.0.0-canary.2989",
|
|
123
|
+
"react": "19.2.3",
|
|
124
|
+
"react-dom": "19.2.3"
|
|
122
125
|
},
|
|
123
126
|
"engines": {
|
|
124
127
|
"node": ">=24"
|