@cedarjs/prerender 3.1.1 → 3.1.2-next.126

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":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AAoCA,UAAU,OAAO;IACf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAmIlD"}
1
+ {"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AAoCA,UAAU,OAAO;IACf,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAEhB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAqJlD"}
@@ -78,6 +78,24 @@ async function buildAndImport(options) {
78
78
  ...getPathsFromTypeScriptConfig(tsConfigs.web, webBase)
79
79
  ]
80
80
  }),
81
+ // Handle JSON imports (e.g. .cedar/gqlorm-schema.json)
82
+ {
83
+ name: "json",
84
+ transform(code, id) {
85
+ if (!id.endsWith(".json")) {
86
+ return null;
87
+ }
88
+ try {
89
+ const parsed = JSON.parse(code);
90
+ return {
91
+ code: `export default ${JSON.stringify(parsed)}`,
92
+ map: { mappings: "" }
93
+ };
94
+ } catch {
95
+ return null;
96
+ }
97
+ }
98
+ },
81
99
  ignoreHtmlAndCssImportsPlugin(),
82
100
  cellTransformPlugin(),
83
101
  cedarjsRoutesAutoLoaderPlugin(),
@@ -108,6 +108,24 @@ async function buildAndImport(options) {
108
108
  ...(0, import_internal.getPathsFromTypeScriptConfig)(tsConfigs.web, webBase)
109
109
  ]
110
110
  }),
111
+ // Handle JSON imports (e.g. .cedar/gqlorm-schema.json)
112
+ {
113
+ name: "json",
114
+ transform(code, id) {
115
+ if (!id.endsWith(".json")) {
116
+ return null;
117
+ }
118
+ try {
119
+ const parsed = JSON.parse(code);
120
+ return {
121
+ code: `export default ${JSON.stringify(parsed)}`,
122
+ map: { mappings: "" }
123
+ };
124
+ } catch {
125
+ return null;
126
+ }
127
+ }
128
+ },
111
129
  (0, import_rollup_plugin_cedarjs_ignore_html_and_css_imports.ignoreHtmlAndCssImportsPlugin)(),
112
130
  (0, import_rollup_plugin_cedarjs_cell.cellTransformPlugin)(),
113
131
  (0, import_rollup_plugin_cedarjs_routes_auto_loader.cedarjsRoutesAutoLoaderPlugin)(),
@@ -48,7 +48,7 @@ async function createViteServer(customConfig = {}) {
48
48
  plugins: [
49
49
  (0, import_vite_plugin_cedar_import_dir.cedarImportDirPlugin)(),
50
50
  (0, import_vite_plugin_cedar_auto_import.cedarAutoImportsPlugin)(),
51
- (0, import_vite2.cedarjsDirectoryNamedImportPlugin)(),
51
+ (0, import_vite2.cedarjsResolveCedarStyleImportsPlugin)(),
52
52
  (0, import_vite2.cedarCellTransform)(),
53
53
  (0, import_vite2.cedarjsJobPathInjectorPlugin)(),
54
54
  (0, import_vite2.cedarSwapApolloProvider)()
package/dist/cjs/index.js CHANGED
@@ -13,9 +13,9 @@ var __copyProps = (to, from, except, desc) => {
13
13
  };
14
14
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
15
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
- var src_exports = {};
17
- module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./runPrerender.js"), module.exports);
16
+ var index_exports = {};
17
+ module.exports = __toCommonJS(index_exports);
18
+ __reExport(index_exports, require("./runPrerender.js"), module.exports);
19
19
  // Annotate the CommonJS export names for ESM import in node:
20
20
  0 && (module.exports = {
21
21
  ...require("./runPrerender.js")
@@ -5,7 +5,7 @@ import { installSourcemapsSupport } from "vite-node/source-map";
5
5
  import { getPaths } from "@cedarjs/project-config";
6
6
  import {
7
7
  cedarCellTransform,
8
- cedarjsDirectoryNamedImportPlugin,
8
+ cedarjsResolveCedarStyleImportsPlugin,
9
9
  cedarjsJobPathInjectorPlugin,
10
10
  cedarSwapApolloProvider
11
11
  } from "@cedarjs/vite";
@@ -30,7 +30,7 @@ async function createViteServer(customConfig = {}) {
30
30
  plugins: [
31
31
  cedarImportDirPlugin(),
32
32
  cedarAutoImportsPlugin(),
33
- cedarjsDirectoryNamedImportPlugin(),
33
+ cedarjsResolveCedarStyleImportsPlugin(),
34
34
  cedarCellTransform(),
35
35
  cedarjsJobPathInjectorPlugin(),
36
36
  cedarSwapApolloProvider()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/prerender",
3
- "version": "3.1.1",
3
+ "version": "3.1.2-next.126+e7fa625a39",
4
4
  "description": "CedarJS prerender",
5
5
  "repository": {
6
6
  "type": "git",
@@ -67,35 +67,35 @@
67
67
  "test:watch": "vitest watch"
68
68
  },
69
69
  "dependencies": {
70
- "@ast-grep/napi": "0.42.0",
70
+ "@ast-grep/napi": "0.42.1",
71
71
  "@babel/generator": "7.29.1",
72
72
  "@babel/parser": "7.29.2",
73
73
  "@babel/traverse": "7.29.0",
74
- "@cedarjs/babel-config": "3.1.1",
75
- "@cedarjs/project-config": "3.1.1",
76
- "@cedarjs/router": "3.1.1",
77
- "@cedarjs/structure": "3.1.1",
78
- "@cedarjs/vite": "3.1.1",
79
- "@cedarjs/web": "3.1.1",
74
+ "@cedarjs/babel-config": "3.1.2-next.126+e7fa625a39",
75
+ "@cedarjs/project-config": "3.1.2-next.126+e7fa625a39",
76
+ "@cedarjs/router": "3.1.2-next.126+e7fa625a39",
77
+ "@cedarjs/structure": "3.1.2-next.126+e7fa625a39",
78
+ "@cedarjs/vite": "3.1.2-next.126+e7fa625a39",
79
+ "@cedarjs/web": "3.1.2-next.126+e7fa625a39",
80
80
  "@rollup/plugin-alias": "5.1.1",
81
81
  "@rollup/plugin-commonjs": "28.0.9",
82
82
  "@rollup/plugin-node-resolve": "16.0.3",
83
83
  "@rollup/plugin-replace": "6.0.3",
84
- "@swc/core": "1.15.21",
84
+ "@swc/core": "1.15.24",
85
85
  "@whatwg-node/fetch": "0.10.13",
86
86
  "babel-plugin-ignore-html-and-css-imports": "0.1.0",
87
87
  "cheerio": "1.2.0",
88
- "graphql": "16.13.1",
88
+ "graphql": "16.13.2",
89
89
  "mime-types": "2.1.35",
90
- "rollup": "4.60.0",
90
+ "rollup": "4.60.1",
91
91
  "rollup-plugin-swc3": "0.12.1",
92
92
  "unimport": "5.7.0",
93
93
  "unplugin-auto-import": "19.3.0",
94
- "vite": "5.4.21",
94
+ "vite": "7.3.2",
95
95
  "vite-node": "3.2.4"
96
96
  },
97
97
  "devDependencies": {
98
- "@cedarjs/framework-tools": "0.0.0",
98
+ "@cedarjs/framework-tools": "3.1.2-next.126",
99
99
  "@types/mime-types": "2.1.4",
100
100
  "@types/react": "^18.2.55",
101
101
  "babel-plugin-tester": "11.0.4",
@@ -119,5 +119,5 @@
119
119
  "react": "react",
120
120
  "react-dom": "react-dom"
121
121
  },
122
- "gitHead": "daccdd356942396c8037bd53c8e945255e4c8fdb"
122
+ "gitHead": "e7fa625a39d829a9078bd5b8237e93ec1a8745be"
123
123
  }