@cedarjs/vite 0.7.2-next.2 → 0.7.2-next.50
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/api/vite-plugin-cedar-vitest-api-preset.d.ts +2 -0
- package/dist/api/vite-plugin-cedar-vitest-api-preset.d.ts.map +1 -0
- package/dist/api/vite-plugin-cedar-vitest-api-preset.js +17 -0
- package/dist/bundled/react-server-dom-webpack.server.js +4 -4
- package/dist/cjs/api/vite-plugin-cedar-vitest-api-preset.js +37 -0
- package/dist/cjs/index.js +5 -1
- package/dist/cjs/lib/getMergedConfig.js +9 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/lib/getMergedConfig.d.ts +2 -2
- package/dist/lib/getMergedConfig.d.ts.map +1 -1
- package/dist/lib/getMergedConfig.js +9 -0
- package/package.json +15 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite-plugin-cedar-vitest-api-preset.d.ts","sourceRoot":"","sources":["../../src/api/vite-plugin-cedar-vitest-api-preset.ts"],"names":[],"mappings":"AAQA,wBAAgB,iBAAiB,kEAOhC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
autoImportsPlugin,
|
|
3
|
+
cedarVitestApiConfigPlugin,
|
|
4
|
+
trackDbImportsPlugin
|
|
5
|
+
} from "@cedarjs/testing/api/vitest";
|
|
6
|
+
import { cedarjsDirectoryNamedImportPlugin } from "../plugins/vite-plugin-cedarjs-directory-named-import.js";
|
|
7
|
+
function cedarVitestPreset() {
|
|
8
|
+
return [
|
|
9
|
+
cedarVitestApiConfigPlugin(),
|
|
10
|
+
autoImportsPlugin(),
|
|
11
|
+
cedarjsDirectoryNamedImportPlugin(),
|
|
12
|
+
trackDbImportsPlugin()
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
cedarVitestPreset
|
|
17
|
+
};
|
|
@@ -1280,13 +1280,13 @@ var require_react_dom_production_min = __commonJS({
|
|
|
1280
1280
|
return null == a || "http://www.w3.org/1999/xhtml" === a ? kb(b) : "http://www.w3.org/2000/svg" === a && "foreignObject" === b ? "http://www.w3.org/1999/xhtml" : a;
|
|
1281
1281
|
}
|
|
1282
1282
|
var mb;
|
|
1283
|
-
var nb = function(a) {
|
|
1283
|
+
var nb = (function(a) {
|
|
1284
1284
|
return "undefined" !== typeof MSApp && MSApp.execUnsafeLocalFunction ? function(b, c, d, e) {
|
|
1285
1285
|
MSApp.execUnsafeLocalFunction(function() {
|
|
1286
1286
|
return a(b, c, d, e);
|
|
1287
1287
|
});
|
|
1288
1288
|
} : a;
|
|
1289
|
-
}(function(a, b) {
|
|
1289
|
+
})(function(a, b) {
|
|
1290
1290
|
if ("http://www.w3.org/2000/svg" !== a.namespaceURI || "innerHTML" in a) a.innerHTML = b;
|
|
1291
1291
|
else {
|
|
1292
1292
|
mb = mb || document.createElement("div");
|
|
@@ -30746,7 +30746,7 @@ var require_react_server_dom_webpack_server_node_unbundled_development = __commo
|
|
|
30746
30746
|
"use strict";
|
|
30747
30747
|
var import_react_dom = __toESM(require_react_dom());
|
|
30748
30748
|
var import_react = __toESM(require_react_shared_subset());
|
|
30749
|
-
"production" !== process.env.NODE_ENV && function() {
|
|
30749
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
30750
30750
|
function _defineProperty(obj, key, value) {
|
|
30751
30751
|
key in obj ? Object.defineProperty(obj, key, {
|
|
30752
30752
|
value,
|
|
@@ -33398,7 +33398,7 @@ var require_react_server_dom_webpack_server_node_unbundled_development = __commo
|
|
|
33398
33398
|
}
|
|
33399
33399
|
};
|
|
33400
33400
|
};
|
|
33401
|
-
}();
|
|
33401
|
+
})();
|
|
33402
33402
|
}
|
|
33403
33403
|
});
|
|
33404
33404
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var vite_plugin_cedar_vitest_api_preset_exports = {};
|
|
20
|
+
__export(vite_plugin_cedar_vitest_api_preset_exports, {
|
|
21
|
+
cedarVitestPreset: () => cedarVitestPreset
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(vite_plugin_cedar_vitest_api_preset_exports);
|
|
24
|
+
var import_vitest = require("@cedarjs/testing/api/vitest");
|
|
25
|
+
var import_vite_plugin_cedarjs_directory_named_import = require("../plugins/vite-plugin-cedarjs-directory-named-import.js");
|
|
26
|
+
function cedarVitestPreset() {
|
|
27
|
+
return [
|
|
28
|
+
(0, import_vitest.cedarVitestApiConfigPlugin)(),
|
|
29
|
+
(0, import_vitest.autoImportsPlugin)(),
|
|
30
|
+
(0, import_vite_plugin_cedarjs_directory_named_import.cedarjsDirectoryNamedImportPlugin)(),
|
|
31
|
+
(0, import_vitest.trackDbImportsPlugin)()
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
+
0 && (module.exports = {
|
|
36
|
+
cedarVitestPreset
|
|
37
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -45,6 +45,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
45
45
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"), 1);
|
|
46
46
|
var import_babel_config = require("@cedarjs/babel-config");
|
|
47
47
|
var import_project_config = require("@cedarjs/project-config");
|
|
48
|
+
var import_vitest = require("@cedarjs/testing/web/vitest");
|
|
48
49
|
var import_vite_plugin_cedar_cell = require("./plugins/vite-plugin-cedar-cell.js");
|
|
49
50
|
var import_vite_plugin_cedar_entry_injection = require("./plugins/vite-plugin-cedar-entry-injection.js");
|
|
50
51
|
var import_vite_plugin_cedar_html_env = require("./plugins/vite-plugin-cedar-html-env.js");
|
|
@@ -63,7 +64,7 @@ var import_vite_plugin_cedarjs_job_path_injector = require("./plugins/vite-plugi
|
|
|
63
64
|
var import_vite_plugin_jsx_loader2 = require("./plugins/vite-plugin-jsx-loader.js");
|
|
64
65
|
var import_vite_plugin_merged_config2 = require("./plugins/vite-plugin-merged-config.js");
|
|
65
66
|
var import_vite_plugin_swap_apollo_provider2 = require("./plugins/vite-plugin-swap-apollo-provider.js");
|
|
66
|
-
function cedar() {
|
|
67
|
+
function cedar({ mode } = {}) {
|
|
67
68
|
const rwConfig = (0, import_project_config.getConfig)();
|
|
68
69
|
const rscEnabled = rwConfig.experimental?.rsc?.enabled;
|
|
69
70
|
const webSideDefaultBabelConfig = (0, import_babel_config.getWebSideDefaultBabelConfig)();
|
|
@@ -78,6 +79,9 @@ function cedar() {
|
|
|
78
79
|
}) : webSideDefaultBabelConfig.overrides
|
|
79
80
|
};
|
|
80
81
|
return [
|
|
82
|
+
mode === "test" && (0, import_vitest.cedarJsRouterImportTransformPlugin)(),
|
|
83
|
+
mode === "test" && (0, import_vitest.createAuthImportTransformPlugin)(),
|
|
84
|
+
mode === "test" && (0, import_vitest.autoImportsPlugin)(),
|
|
81
85
|
(0, import_vite_plugin_cedar_node_polyfills.cedarNodePolyfills)(),
|
|
82
86
|
(0, import_vite_plugin_cedar_html_env.cedarHtmlEnvPlugin)(),
|
|
83
87
|
(0, import_vite_plugin_cedar_entry_injection.cedarEntryInjectionPlugin)(),
|
|
@@ -141,6 +141,15 @@ function getMergedConfig(rwConfig, rwPaths) {
|
|
|
141
141
|
global: "globalThis"
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
+
},
|
|
145
|
+
ssr: {
|
|
146
|
+
// `@cedarjs/testing` is not externalized in order to support
|
|
147
|
+
// `import.meta.glob`, which we use in one of the files in the package
|
|
148
|
+
noExternal: env.mode === "test" ? ["@cedarjs/testing"] : []
|
|
149
|
+
},
|
|
150
|
+
test: {
|
|
151
|
+
globals: false,
|
|
152
|
+
environment: "jsdom"
|
|
144
153
|
}
|
|
145
154
|
};
|
|
146
155
|
return (0, import_vite.mergeConfig)(defaultRwViteConfig, userConfig);
|
package/dist/index.d.ts
CHANGED
|
@@ -9,10 +9,13 @@ export { cedarjsJobPathInjectorPlugin } from './plugins/vite-plugin-cedarjs-job-
|
|
|
9
9
|
export { cedarTransformJsAsJsx } from './plugins/vite-plugin-jsx-loader.js';
|
|
10
10
|
export { cedarMergedConfig } from './plugins/vite-plugin-merged-config.js';
|
|
11
11
|
export { cedarSwapApolloProvider } from './plugins/vite-plugin-swap-apollo-provider.js';
|
|
12
|
+
type PluginOptions = {
|
|
13
|
+
mode?: string | undefined;
|
|
14
|
+
};
|
|
12
15
|
/**
|
|
13
16
|
* Pre-configured vite plugin, with required config for CedarJS apps.
|
|
14
17
|
*/
|
|
15
|
-
export declare function cedar(): PluginOption[];
|
|
18
|
+
export declare function cedar({ mode }?: PluginOptions): PluginOption[];
|
|
16
19
|
/** @deprecated Please use the named `cedar` export instead */
|
|
17
20
|
export default cedar;
|
|
18
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAmBxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,+CAA+C,CAAA;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AACzF,OAAO,EAAE,iCAAiC,EAAE,MAAM,yDAAyD,CAAA;AAC3G,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAA;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,EAAE,uBAAuB,EAAE,MAAM,+CAA+C,CAAA;AAEvF,KAAK,aAAa,GAAG;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,EAAE,IAAI,EAAE,GAAE,aAAkB,GAAG,YAAY,EAAE,CAqClE;AAED,8DAA8D;AAC9D,eAAe,KAAK,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import react from "@vitejs/plugin-react";
|
|
2
2
|
import { getWebSideDefaultBabelConfig } from "@cedarjs/babel-config";
|
|
3
3
|
import { getConfig } from "@cedarjs/project-config";
|
|
4
|
+
import {
|
|
5
|
+
autoImportsPlugin,
|
|
6
|
+
cedarJsRouterImportTransformPlugin,
|
|
7
|
+
createAuthImportTransformPlugin
|
|
8
|
+
} from "@cedarjs/testing/web/vitest";
|
|
4
9
|
import { cedarCellTransform } from "./plugins/vite-plugin-cedar-cell.js";
|
|
5
10
|
import { cedarEntryInjectionPlugin } from "./plugins/vite-plugin-cedar-entry-injection.js";
|
|
6
11
|
import { cedarHtmlEnvPlugin } from "./plugins/vite-plugin-cedar-html-env.js";
|
|
@@ -19,7 +24,7 @@ import { cedarjsJobPathInjectorPlugin } from "./plugins/vite-plugin-cedarjs-job-
|
|
|
19
24
|
import { cedarTransformJsAsJsx as cedarTransformJsAsJsx2 } from "./plugins/vite-plugin-jsx-loader.js";
|
|
20
25
|
import { cedarMergedConfig as cedarMergedConfig2 } from "./plugins/vite-plugin-merged-config.js";
|
|
21
26
|
import { cedarSwapApolloProvider as cedarSwapApolloProvider2 } from "./plugins/vite-plugin-swap-apollo-provider.js";
|
|
22
|
-
function cedar() {
|
|
27
|
+
function cedar({ mode } = {}) {
|
|
23
28
|
const rwConfig = getConfig();
|
|
24
29
|
const rscEnabled = rwConfig.experimental?.rsc?.enabled;
|
|
25
30
|
const webSideDefaultBabelConfig = getWebSideDefaultBabelConfig();
|
|
@@ -34,6 +39,9 @@ function cedar() {
|
|
|
34
39
|
}) : webSideDefaultBabelConfig.overrides
|
|
35
40
|
};
|
|
36
41
|
return [
|
|
42
|
+
mode === "test" && cedarJsRouterImportTransformPlugin(),
|
|
43
|
+
mode === "test" && createAuthImportTransformPlugin(),
|
|
44
|
+
mode === "test" && autoImportsPlugin(),
|
|
37
45
|
cedarNodePolyfills(),
|
|
38
46
|
cedarHtmlEnvPlugin(),
|
|
39
47
|
cedarEntryInjectionPlugin(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfigEnv,
|
|
1
|
+
import type { ConfigEnv, ViteUserConfig } from 'vitest/config';
|
|
2
2
|
import type { Config, Paths } from '@cedarjs/project-config';
|
|
3
3
|
/**
|
|
4
4
|
* This function will merge in the default Redwood Vite config passed into the
|
|
@@ -7,5 +7,5 @@ import type { Config, Paths } from '@cedarjs/project-config';
|
|
|
7
7
|
* Note that returning plugins in this function will have no effect on the
|
|
8
8
|
* build
|
|
9
9
|
*/
|
|
10
|
-
export declare function getMergedConfig(rwConfig: Config, rwPaths: Paths): (userConfig:
|
|
10
|
+
export declare function getMergedConfig(rwConfig: Config, rwPaths: Paths): (userConfig: ViteUserConfig, env: ConfigEnv) => ViteUserConfig;
|
|
11
11
|
//# sourceMappingURL=getMergedConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMergedConfig.d.ts","sourceRoot":"","sources":["../../src/lib/getMergedConfig.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getMergedConfig.d.ts","sourceRoot":"","sources":["../../src/lib/getMergedConfig.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAO5D;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,gBAC1C,cAAc,OAAO,SAAS,KAAG,cAAc,CA2IpE"}
|
|
@@ -112,6 +112,15 @@ function getMergedConfig(rwConfig, rwPaths) {
|
|
|
112
112
|
global: "globalThis"
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
+
},
|
|
116
|
+
ssr: {
|
|
117
|
+
// `@cedarjs/testing` is not externalized in order to support
|
|
118
|
+
// `import.meta.glob`, which we use in one of the files in the package
|
|
119
|
+
noExternal: env.mode === "test" ? ["@cedarjs/testing"] : []
|
|
120
|
+
},
|
|
121
|
+
test: {
|
|
122
|
+
globals: false,
|
|
123
|
+
environment: "jsdom"
|
|
115
124
|
}
|
|
116
125
|
};
|
|
117
126
|
return mergeConfig(defaultRwViteConfig, userConfig);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/vite",
|
|
3
|
-
"version": "0.7.2-next.
|
|
3
|
+
"version": "0.7.2-next.50+a096cc0c6",
|
|
4
4
|
"description": "Vite configuration package for CedarJS",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
"default": "./dist/cjs/index.js"
|
|
22
22
|
}
|
|
23
23
|
},
|
|
24
|
+
"./api": {
|
|
25
|
+
"types": "./dist/api/vite-plugin-cedar-vitest-api-preset.d.ts",
|
|
26
|
+
"default": "./dist/api/vite-plugin-cedar-vitest-api-preset.js"
|
|
27
|
+
},
|
|
24
28
|
"./client": {
|
|
25
29
|
"require": "./dist/cjs/client.js",
|
|
26
30
|
"import": "./dist/client.js"
|
|
@@ -59,13 +63,14 @@
|
|
|
59
63
|
"@babel/generator": "7.27.5",
|
|
60
64
|
"@babel/parser": "7.27.5",
|
|
61
65
|
"@babel/traverse": "7.27.4",
|
|
62
|
-
"@cedarjs/auth": "0.7.2-next.
|
|
63
|
-
"@cedarjs/babel-config": "0.7.2-next.
|
|
64
|
-
"@cedarjs/cookie-jar": "0.7.2-next.
|
|
65
|
-
"@cedarjs/internal": "0.7.2-next.
|
|
66
|
-
"@cedarjs/project-config": "0.7.2-next.
|
|
67
|
-
"@cedarjs/server-store": "0.7.2-next.
|
|
68
|
-
"@cedarjs/
|
|
66
|
+
"@cedarjs/auth": "0.7.2-next.50+a096cc0c6",
|
|
67
|
+
"@cedarjs/babel-config": "0.7.2-next.50+a096cc0c6",
|
|
68
|
+
"@cedarjs/cookie-jar": "0.7.2-next.50+a096cc0c6",
|
|
69
|
+
"@cedarjs/internal": "0.7.2-next.50+a096cc0c6",
|
|
70
|
+
"@cedarjs/project-config": "0.7.2-next.50+a096cc0c6",
|
|
71
|
+
"@cedarjs/server-store": "0.7.2-next.50+a096cc0c6",
|
|
72
|
+
"@cedarjs/testing": "0.7.2-next.50+a096cc0c6",
|
|
73
|
+
"@cedarjs/web": "0.7.2-next.50+a096cc0c6",
|
|
69
74
|
"@swc/core": "1.13.3",
|
|
70
75
|
"@vitejs/plugin-react": "4.3.4",
|
|
71
76
|
"@whatwg-node/fetch": "0.9.21",
|
|
@@ -105,12 +110,12 @@
|
|
|
105
110
|
"memfs": "4.17.2",
|
|
106
111
|
"publint": "0.3.12",
|
|
107
112
|
"rollup": "4.24.0",
|
|
108
|
-
"tsx": "4.20.
|
|
113
|
+
"tsx": "4.20.4",
|
|
109
114
|
"typescript": "5.6.2",
|
|
110
115
|
"vitest": "3.2.4"
|
|
111
116
|
},
|
|
112
117
|
"publishConfig": {
|
|
113
118
|
"access": "public"
|
|
114
119
|
},
|
|
115
|
-
"gitHead": "
|
|
120
|
+
"gitHead": "a096cc0c68ba5371661ed5ea0e11a0ad10f61a21"
|
|
116
121
|
}
|