@cedarjs/prerender 1.0.0-canary.12471 → 1.0.0-canary.12473
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/build-and-import/buildAndImport.d.ts +10 -1
- package/dist/build-and-import/buildAndImport.d.ts.map +1 -1
- package/dist/build-and-import/buildAndImport.js +10 -10
- package/dist/runPrerender.d.ts.map +1 -1
- package/dist/runPrerender.js +0 -1
- package/package.json +8 -8
- package/dist/build-and-import/types.d.ts +0 -36
- package/dist/build-and-import/types.d.ts.map +0 -1
- package/dist/build-and-import/types.js +0 -16
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
interface Options {
|
|
2
|
+
/** The filepath to bundle and require */
|
|
3
|
+
filepath: string;
|
|
4
|
+
/**
|
|
5
|
+
* Preserve compiled temporary file for debugging
|
|
6
|
+
* Default to `process.env.BUNDLE_REQUIRE_PRESERVE`
|
|
7
|
+
*/
|
|
8
|
+
preserveTemporaryFile?: boolean;
|
|
9
|
+
}
|
|
2
10
|
export declare function buildAndImport(options: Options): Promise<Record<string, React.FunctionComponent>>;
|
|
11
|
+
export {};
|
|
3
12
|
//# sourceMappingURL=buildAndImport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildAndImport.d.ts","sourceRoot":"","sources":["../../src/build-and-import/buildAndImport.ts"],"names":[],"mappings":"AAsCA,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,CAiIlD"}
|
|
@@ -37,7 +37,6 @@ var import_plugin_alias = __toESM(require("@rollup/plugin-alias"));
|
|
|
37
37
|
var import_plugin_commonjs = __toESM(require("@rollup/plugin-commonjs"));
|
|
38
38
|
var import_plugin_node_resolve = require("@rollup/plugin-node-resolve");
|
|
39
39
|
var import_plugin_replace = __toESM(require("@rollup/plugin-replace"));
|
|
40
|
-
var import_load_tsconfig = require("load-tsconfig");
|
|
41
40
|
var import_rollup = require("rollup");
|
|
42
41
|
var import_unplugin = __toESM(require("unimport/unplugin"));
|
|
43
42
|
var import_project_config = require("@cedarjs/project-config");
|
|
@@ -60,14 +59,17 @@ async function buildAndImport(options) {
|
|
|
60
59
|
if (!(0, import_utils.isValidJsFile)(options.filepath)) {
|
|
61
60
|
throw new Error(`${options.filepath} is not a valid JS file`);
|
|
62
61
|
}
|
|
63
|
-
|
|
64
|
-
const
|
|
62
|
+
console.log("options", options);
|
|
63
|
+
const tsConfigs = (0, import_internal.parseTypeScriptConfigFiles)();
|
|
64
|
+
console.log(
|
|
65
|
+
"tsConfigs.web?.data.compilerOptions",
|
|
66
|
+
tsConfigs.web?.compilerOptions
|
|
67
|
+
);
|
|
65
68
|
const resolvePaths = tsconfigPathsToRegExp(
|
|
66
|
-
|
|
69
|
+
tsConfigs.web?.compilerOptions?.paths || {}
|
|
67
70
|
);
|
|
68
71
|
const config = (0, import_project_config.getConfig)();
|
|
69
72
|
const useTrustedDocumentsGqlTag = config.graphql.trustedDocuments;
|
|
70
|
-
const tsConfigs = (0, import_internal.parseTypeScriptConfigFiles)();
|
|
71
73
|
const webBase = (0, import_project_config.getPaths)().web.base;
|
|
72
74
|
const outDir = import_node_path.default.join((0, import_project_config.getPaths)().web.dist, "__prerender");
|
|
73
75
|
if (!import_node_fs.default.existsSync(outDir)) {
|
|
@@ -83,10 +85,8 @@ async function buildAndImport(options) {
|
|
|
83
85
|
external: ["react", "react-dom"],
|
|
84
86
|
plugins: [
|
|
85
87
|
(0, import_rollup_plugin_cedarjs_external.externalPlugin)({
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
filepath: options.filepath,
|
|
89
|
-
externalNodeModules: options.externalNodeModules
|
|
88
|
+
notExternal: resolvePaths,
|
|
89
|
+
filepath: options.filepath
|
|
90
90
|
}),
|
|
91
91
|
(0, import_plugin_node_resolve.nodeResolve)({
|
|
92
92
|
preferBuiltins: true,
|
|
@@ -116,7 +116,7 @@ async function buildAndImport(options) {
|
|
|
116
116
|
(0, import_rollup_plugin_cedarjs_directory_named_imports.cedarjsDirectoryNamedImportPlugin)(),
|
|
117
117
|
(0, import_rollup_plugin_cedarjs_prerender_media_imports.cedarjsPrerenderMediaImportsPlugin)(),
|
|
118
118
|
(0, import_plugin_commonjs.default)(),
|
|
119
|
-
(0, import_rollup_plugin_cedarjs_typescript.typescriptPlugin)(options.filepath,
|
|
119
|
+
(0, import_rollup_plugin_cedarjs_typescript.typescriptPlugin)(options.filepath, tsConfigs.web),
|
|
120
120
|
import_unplugin.default.rollup({
|
|
121
121
|
imports: [
|
|
122
122
|
// import React from 'react'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runPrerender.d.ts","sourceRoot":"","sources":["../src/runPrerender.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAuP7C,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,gCAGtB,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"runPrerender.d.ts","sourceRoot":"","sources":["../src/runPrerender.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAuP7C,UAAU,eAAe;IACvB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACrC,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,eAAO,MAAM,YAAY,gCAGtB,eAAe,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CA4GzC,CAAA;AAGD,eAAO,MAAM,wBAAwB,mBACnB,MAAM,WACb,MAAM,SAchB,CAAA"}
|
package/dist/runPrerender.js
CHANGED
|
@@ -209,7 +209,6 @@ const runPrerender = async ({
|
|
|
209
209
|
outDir: prerenderDistPath
|
|
210
210
|
});
|
|
211
211
|
const required = await (0, import_buildAndImport.buildAndImport)({
|
|
212
|
-
cwd: (0, import_project_config.getPaths)().web.base,
|
|
213
212
|
filepath: entryPath,
|
|
214
213
|
preserveTemporaryFile: true
|
|
215
214
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/prerender",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.12473+bcfdd7059",
|
|
4
4
|
"description": "RedwoodJS prerender",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"test:watch": "vitest watch"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@cedarjs/babel-config": "1.0.0-canary.
|
|
44
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
45
|
-
"@cedarjs/router": "1.0.0-canary.
|
|
46
|
-
"@cedarjs/structure": "1.0.0-canary.
|
|
47
|
-
"@cedarjs/web": "1.0.0-canary.
|
|
43
|
+
"@cedarjs/babel-config": "1.0.0-canary.12473",
|
|
44
|
+
"@cedarjs/project-config": "1.0.0-canary.12473",
|
|
45
|
+
"@cedarjs/router": "1.0.0-canary.12473",
|
|
46
|
+
"@cedarjs/structure": "1.0.0-canary.12473",
|
|
47
|
+
"@cedarjs/web": "1.0.0-canary.12473",
|
|
48
48
|
"@rollup/plugin-alias": "5.1.1",
|
|
49
49
|
"@rollup/plugin-commonjs": "28.0.6",
|
|
50
50
|
"@rollup/plugin-node-resolve": "16.0.1",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"unimport": "5.0.1"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@cedarjs/framework-tools": "1.0.0-canary.
|
|
64
|
+
"@cedarjs/framework-tools": "1.0.0-canary.12473",
|
|
65
65
|
"@types/mime-types": "2.1.4",
|
|
66
66
|
"babel-plugin-tester": "11.0.4",
|
|
67
67
|
"concurrently": "8.2.2",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"react": "react",
|
|
79
79
|
"react-dom": "react-dom"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "bcfdd70599a065577d82eb3cba99f36b08ec15cd"
|
|
82
82
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { RollupOptions } from 'rollup';
|
|
2
|
-
export interface Options {
|
|
3
|
-
cwd?: string;
|
|
4
|
-
/** The filepath to bundle and require */
|
|
5
|
-
filepath: string;
|
|
6
|
-
/** rollup options */
|
|
7
|
-
rollupOptions?: RollupOptions & {
|
|
8
|
-
watch?: undefined | never;
|
|
9
|
-
};
|
|
10
|
-
/** External packages */
|
|
11
|
-
external?: (string | RegExp)[];
|
|
12
|
-
/** Not external packages */
|
|
13
|
-
notExternal?: (string | RegExp)[];
|
|
14
|
-
/**
|
|
15
|
-
* Automatically mark node_modules as external
|
|
16
|
-
* @default true - `false` when `filepath` is in node_modules
|
|
17
|
-
*/
|
|
18
|
-
externalNodeModules?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* A custom tsconfig path to read `paths` option
|
|
21
|
-
*
|
|
22
|
-
* Set to `false` to disable tsconfig
|
|
23
|
-
* Or provide a `TsconfigRaw` object
|
|
24
|
-
*/
|
|
25
|
-
tsconfig?: string | any | false;
|
|
26
|
-
/**
|
|
27
|
-
* Preserve compiled temporary file for debugging
|
|
28
|
-
* Default to `process.env.BUNDLE_REQUIRE_PRESERVE`
|
|
29
|
-
*/
|
|
30
|
-
preserveTemporaryFile?: boolean;
|
|
31
|
-
/** Provide bundle format explicitly to skip the default format inference */
|
|
32
|
-
format?: 'cjs' | 'esm';
|
|
33
|
-
/** Returns the name of the output file */
|
|
34
|
-
getOutputFile?: (filepath: string, format: 'cjs' | 'esm', randomId: string) => string;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/build-and-import/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAE3C,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAA;IAGhB,qBAAqB;IACrB,aAAa,CAAC,EAAE,aAAa,GAAG;QAC9B,KAAK,CAAC,EAAE,SAAS,GAAG,KAAK,CAAA;KAC1B,CAAA;IAED,wBAAwB;IACxB,QAAQ,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAE9B,4BAA4B;IAC5B,WAAW,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAEjC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,KAAK,CAAA;IAE/B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAE/B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,CAAA;IAEtB,0CAA0C;IAC1C,aAAa,CAAC,EAAE,CACd,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,KAAK,GAAG,KAAK,EACrB,QAAQ,EAAE,MAAM,KACb,MAAM,CAAA;CACZ"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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 __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var types_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(types_exports);
|