@cedarjs/vite 1.0.0-canary.12571 → 1.0.0-canary.12573
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/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 +14 -9
|
@@ -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
|
+
};
|
|
@@ -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": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.12573+95b61c8a9",
|
|
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"
|
|
@@ -60,13 +64,14 @@
|
|
|
60
64
|
"@babel/generator": "7.27.5",
|
|
61
65
|
"@babel/parser": "7.27.5",
|
|
62
66
|
"@babel/traverse": "7.27.4",
|
|
63
|
-
"@cedarjs/auth": "1.0.0-canary.
|
|
64
|
-
"@cedarjs/babel-config": "1.0.0-canary.
|
|
65
|
-
"@cedarjs/cookie-jar": "1.0.0-canary.
|
|
66
|
-
"@cedarjs/internal": "1.0.0-canary.
|
|
67
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
68
|
-
"@cedarjs/server-store": "1.0.0-canary.
|
|
69
|
-
"@cedarjs/
|
|
67
|
+
"@cedarjs/auth": "1.0.0-canary.12573",
|
|
68
|
+
"@cedarjs/babel-config": "1.0.0-canary.12573",
|
|
69
|
+
"@cedarjs/cookie-jar": "1.0.0-canary.12573",
|
|
70
|
+
"@cedarjs/internal": "1.0.0-canary.12573",
|
|
71
|
+
"@cedarjs/project-config": "1.0.0-canary.12573",
|
|
72
|
+
"@cedarjs/server-store": "1.0.0-canary.12573",
|
|
73
|
+
"@cedarjs/testing": "1.0.0-canary.12573",
|
|
74
|
+
"@cedarjs/web": "1.0.0-canary.12573",
|
|
70
75
|
"@swc/core": "1.13.3",
|
|
71
76
|
"@vitejs/plugin-react": "4.3.4",
|
|
72
77
|
"@whatwg-node/fetch": "0.9.21",
|
|
@@ -110,5 +115,5 @@
|
|
|
110
115
|
"typescript": "5.6.2",
|
|
111
116
|
"vitest": "3.2.4"
|
|
112
117
|
},
|
|
113
|
-
"gitHead": "
|
|
118
|
+
"gitHead": "95b61c8a992cc1dfefe6bbd57cac079168e1f1fe"
|
|
114
119
|
}
|