@editframe/nextjs-plugin 0.51.1 → 0.51.3
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/index.cjs +31 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +31 -9
- package/dist/index.js.map +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -12,7 +12,9 @@ const getEditframeClient = () => {
|
|
|
12
12
|
};
|
|
13
13
|
let serverStarted = false;
|
|
14
14
|
function withEditframe(options, nextConfig = {}) {
|
|
15
|
-
const port = options.port ??
|
|
15
|
+
const port = options.port ?? 3099;
|
|
16
|
+
const nextPort = process.env.NEXT_PORT ?? process.env.PORT ?? "3000";
|
|
17
|
+
const publicOrigin = options.nextOrigin ?? `http://localhost:${nextPort}`;
|
|
16
18
|
if (process.env.NODE_ENV !== "production" && !serverStarted) {
|
|
17
19
|
serverStarted = true;
|
|
18
20
|
const assetFns = {
|
|
@@ -29,7 +31,8 @@ function withEditframe(options, nextConfig = {}) {
|
|
|
29
31
|
});
|
|
30
32
|
const server = (0, _editframe_dev_server.createEditframeDevServer)({
|
|
31
33
|
...options,
|
|
32
|
-
handleRemoteUrls: true
|
|
34
|
+
handleRemoteUrls: true,
|
|
35
|
+
publicOrigin
|
|
33
36
|
}, assetFns, efHandlers);
|
|
34
37
|
server.listen(port, () => {
|
|
35
38
|
console.log(`[editframe] dev server listening on http://localhost:${port}`);
|
|
@@ -54,13 +57,32 @@ function withEditframe(options, nextConfig = {}) {
|
|
|
54
57
|
afterFiles: [],
|
|
55
58
|
fallback: []
|
|
56
59
|
};
|
|
57
|
-
const efRules = [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
const efRules = [
|
|
61
|
+
{
|
|
62
|
+
source: "/api/v1/:path*",
|
|
63
|
+
destination: `http://localhost:${port}/api/v1/:path*`
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
source: "/@ef-clear-cache",
|
|
67
|
+
destination: `http://localhost:${port}/@ef-clear-cache`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
source: "/@ef-sign-url",
|
|
71
|
+
destination: `http://localhost:${port}/@ef-sign-url`
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
source: "/@ef-write-snapshot",
|
|
75
|
+
destination: `http://localhost:${port}/@ef-write-snapshot`
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
source: "/@ef-compare-snapshot",
|
|
79
|
+
destination: `http://localhost:${port}/@ef-compare-snapshot`
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
source: "/@ef-compare-two-images",
|
|
83
|
+
destination: `http://localhost:${port}/@ef-compare-two-images`
|
|
84
|
+
}
|
|
85
|
+
];
|
|
64
86
|
if (Array.isArray(userRules)) return [...efRules, ...userRules];
|
|
65
87
|
return {
|
|
66
88
|
beforeFiles: [...efRules, ...userRules.beforeFiles ?? []],
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Client","version"],"sources":["../src/index.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Client","version"],"sources":["../src/index.ts"],"mappings":";;;;;;AAgCA,MAAM,2BAA2B;CAC/B,MAAM,QAAQ,QAAQ,IAAI;CAC1B,MAAM,SAAS,QAAQ,IAAI;AAC3B,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,4CAA4C;AAE9D,QAAO,IAAIA,eAAAA,OAAO,OAAO,OAAO;;AAGlC,IAAI,gBAAgB;AAEpB,SAAgB,cACd,SACA,aAAyB,EAAE,EACf;CACZ,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,WAAW,QAAQ,IAAI,aAAa,QAAQ,IAAI,Q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G,SAAS,GAAG,UAAU;AAGnC,UAAO;IACL,aAAa,CAAC,GAAG,SAAS,GAAI,UAAU,eAAe,EAAE,CAAE;IAC3D,YAAY,UAAU,cAAc,EAAE;IACtC,UAAU,UAAU,YAAY,EAAE;IACnC;;EAEJ"}
|
package/dist/index.d.cts
CHANGED
|
@@ -4,8 +4,16 @@ import { NextConfig } from "next";
|
|
|
4
4
|
interface WithEditframeOptions {
|
|
5
5
|
root: string;
|
|
6
6
|
cacheRoot: string;
|
|
7
|
-
/** Port for the sidecar dev server. Defaults to
|
|
7
|
+
/** Port for the sidecar dev server. Defaults to 3099. */
|
|
8
8
|
port?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The public-facing origin of the Next.js dev server.
|
|
11
|
+
* Defaults to http://localhost:3000 (or $PORT / $NEXT_PORT if set).
|
|
12
|
+
* Used to embed the correct base URL in JIT manifest endpoint templates
|
|
13
|
+
* so the browser fetches segments through the Next.js rewrite proxy
|
|
14
|
+
* rather than directly from the sidecar port.
|
|
15
|
+
*/
|
|
16
|
+
nextOrigin?: string;
|
|
9
17
|
}
|
|
10
18
|
declare function withEditframe(options: WithEditframeOptions, nextConfig?: NextConfig): NextConfig;
|
|
11
19
|
//#endregion
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,16 @@ import { NextConfig } from "next";
|
|
|
4
4
|
interface WithEditframeOptions {
|
|
5
5
|
root: string;
|
|
6
6
|
cacheRoot: string;
|
|
7
|
-
/** Port for the sidecar dev server. Defaults to
|
|
7
|
+
/** Port for the sidecar dev server. Defaults to 3099. */
|
|
8
8
|
port?: number;
|
|
9
|
+
/**
|
|
10
|
+
* The public-facing origin of the Next.js dev server.
|
|
11
|
+
* Defaults to http://localhost:3000 (or $PORT / $NEXT_PORT if set).
|
|
12
|
+
* Used to embed the correct base URL in JIT manifest endpoint templates
|
|
13
|
+
* so the browser fetches segments through the Next.js rewrite proxy
|
|
14
|
+
* rather than directly from the sidecar port.
|
|
15
|
+
*/
|
|
16
|
+
nextOrigin?: string;
|
|
9
17
|
}
|
|
10
18
|
declare function withEditframe(options: WithEditframeOptions, nextConfig?: NextConfig): NextConfig;
|
|
11
19
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,9 @@ const getEditframeClient = () => {
|
|
|
11
11
|
};
|
|
12
12
|
let serverStarted = false;
|
|
13
13
|
function withEditframe(options, nextConfig = {}) {
|
|
14
|
-
const port = options.port ??
|
|
14
|
+
const port = options.port ?? 3099;
|
|
15
|
+
const nextPort = process.env.NEXT_PORT ?? process.env.PORT ?? "3000";
|
|
16
|
+
const publicOrigin = options.nextOrigin ?? `http://localhost:${nextPort}`;
|
|
15
17
|
if (process.env.NODE_ENV !== "production" && !serverStarted) {
|
|
16
18
|
serverStarted = true;
|
|
17
19
|
const assetFns = {
|
|
@@ -28,7 +30,8 @@ function withEditframe(options, nextConfig = {}) {
|
|
|
28
30
|
});
|
|
29
31
|
const server = createEditframeDevServer({
|
|
30
32
|
...options,
|
|
31
|
-
handleRemoteUrls: true
|
|
33
|
+
handleRemoteUrls: true,
|
|
34
|
+
publicOrigin
|
|
32
35
|
}, assetFns, efHandlers);
|
|
33
36
|
server.listen(port, () => {
|
|
34
37
|
console.log(`[editframe] dev server listening on http://localhost:${port}`);
|
|
@@ -53,13 +56,32 @@ function withEditframe(options, nextConfig = {}) {
|
|
|
53
56
|
afterFiles: [],
|
|
54
57
|
fallback: []
|
|
55
58
|
};
|
|
56
|
-
const efRules = [
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
const efRules = [
|
|
60
|
+
{
|
|
61
|
+
source: "/api/v1/:path*",
|
|
62
|
+
destination: `http://localhost:${port}/api/v1/:path*`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
source: "/@ef-clear-cache",
|
|
66
|
+
destination: `http://localhost:${port}/@ef-clear-cache`
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
source: "/@ef-sign-url",
|
|
70
|
+
destination: `http://localhost:${port}/@ef-sign-url`
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
source: "/@ef-write-snapshot",
|
|
74
|
+
destination: `http://localhost:${port}/@ef-write-snapshot`
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
source: "/@ef-compare-snapshot",
|
|
78
|
+
destination: `http://localhost:${port}/@ef-compare-snapshot`
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
source: "/@ef-compare-two-images",
|
|
82
|
+
destination: `http://localhost:${port}/@ef-compare-two-images`
|
|
83
|
+
}
|
|
84
|
+
];
|
|
63
85
|
if (Array.isArray(userRules)) return [...efRules, ...userRules];
|
|
64
86
|
return {
|
|
65
87
|
beforeFiles: [...efRules, ...userRules.beforeFiles ?? []],
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"mappings":";;;;;AAgCA,MAAM,2BAA2B;CAC/B,MAAM,QAAQ,QAAQ,IAAI;CAC1B,MAAM,SAAS,QAAQ,IAAI;AAC3B,KAAI,CAAC,MACH,OAAM,IAAI,MAAM,4CAA4C;AAE9D,QAAO,IAAI,OAAO,OAAO,OAAO;;AAGlC,IAAI,gBAAgB;AAEpB,SAAgB,cACd,SACA,aAAyB,EAAE,EACf;CACZ,MAAM,OAAO,QAAQ,QAAQ;CAC7B,MAAM,WAAW,QAAQ,IAAI,aAAa,QAAQ,IAAI,QAAQ;CAC9D,MAAM,eAAe,QAAQ,cAAc,oBAAoB;AAE/D,KAAI,QAAQ,IAAI,aAAa,gBAAgB,CAAC,eAAe;AAC3D,kBAAgB;EAEhB,MAAM,WAAW;GACf;GACA;GACA;GACA;GACA;GACA;GACD;EAED,MAAM,aAAa,qBAAqB;GACtC;GACA,WAAW;GACZ,CAAC;EAEF,MAAM,SAAS,yBACb;GAAE,GAAG;GAAS,kBAAkB;GAAM;GAAc,EACpD,UACA,WACD;AAED,SAAO,OAAO,YAAY;AACxB,WAAQ,IAAI,wDAAwD,OAAO;IAC3E;AAEF,SAAO,GAAG,UAAU,QAA+B;AACjD,OAAI,IAAI,SAAS,cAAc;AAC7B,YAAQ,KAAK,oBAAoB,KAAK,0CAA0C;AAChF,oBAAgB;SAEhB,OAAM;IAER;;CAGJ,MAAM,eAAe,WAAW;AAEhC,QAAO;EACL,GAAG;EAEH,KAAK;GACH,GAAG,WAAW;GACd,wBAAwB;GACzB;EAED,MAAM,WAAW;GACf,MAAM,YACJ,OAAO,iBAAiB,aACpB,MAAM,cAAc,GACpB;IAAE,aAAa,EAAE;IAAE,YAAY,EAAE;IAAE,UAAU,EAAE;IAAE;GAEvD,MAAM,UAAU;IACd;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACD;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACD;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACD;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACD;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACD;KACE,QAAQ;KACR,aAAa,oBAAoB,KAAK;KACvC;IACF;AAED,OAAI,MAAM,QAAQ,UAAU,CAC1B,QAAO,CAAC,GAAG,SAAS,GAAG,UAAU;AAGnC,UAAO;IACL,aAAa,CAAC,GAAG,SAAS,GAAI,UAAU,eAAe,EAAE,CAAE;IAC3D,YAAY,UAAU,cAAc,EAAE;IACtC,UAAU,UAAU,YAAY,EAAE;IACnC;;EAEJ"}
|
package/dist/version.cjs
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@editframe/nextjs-plugin",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.3",
|
|
4
4
|
"description": "Editframe Next.js plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"author": "",
|
|
17
17
|
"license": "SEE LICENSE IN LICENSE-FULL.md",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@editframe/api": "0.51.
|
|
20
|
-
"@editframe/assets": "0.51.
|
|
21
|
-
"@editframe/dev-server": "0.51.
|
|
19
|
+
"@editframe/api": "0.51.3",
|
|
20
|
+
"@editframe/assets": "0.51.3",
|
|
21
|
+
"@editframe/dev-server": "0.51.3"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"next": ">=14.0.0"
|