oidc-spa 8.3.6 → 8.3.8
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/core/StateDataCookie.d.ts +34 -0
- package/core/StateDataCookie.js +142 -0
- package/core/StateDataCookie.js.map +1 -0
- package/core/createOidc.js +25 -9
- package/core/createOidc.js.map +1 -1
- package/core/earlyInit.d.ts +0 -1
- package/core/earlyInit.js +4 -12
- package/core/earlyInit.js.map +1 -1
- package/core/loginOrGoToAuthServer.d.ts +1 -0
- package/core/loginOrGoToAuthServer.js +20 -9
- package/core/loginOrGoToAuthServer.js.map +1 -1
- package/entrypoint.d.ts +0 -1
- package/entrypoint.js +1 -3
- package/entrypoint.js.map +1 -1
- package/esm/core/StateDataCookie.d.ts +34 -0
- package/esm/core/StateDataCookie.js +135 -0
- package/esm/core/StateDataCookie.js.map +1 -0
- package/esm/core/createOidc.js +25 -9
- package/esm/core/createOidc.js.map +1 -1
- package/esm/core/earlyInit.d.ts +0 -1
- package/esm/core/earlyInit.js +4 -12
- package/esm/core/earlyInit.js.map +1 -1
- package/esm/core/loginOrGoToAuthServer.d.ts +1 -0
- package/esm/core/loginOrGoToAuthServer.js +20 -9
- package/esm/core/loginOrGoToAuthServer.js.map +1 -1
- package/esm/entrypoint.d.ts +0 -1
- package/esm/entrypoint.js +0 -1
- package/esm/entrypoint.js.map +1 -1
- package/esm/tanstack-start/react/createOidcSpaApi.js +2 -0
- package/esm/tanstack-start/react/createOidcSpaApi.js.map +1 -1
- package/esm/tanstack-start/react/index.d.ts +1 -1
- package/esm/tanstack-start/react/index.js +1 -1
- package/esm/tanstack-start/react/index.js.map +1 -1
- package/esm/tanstack-start/react/withOidcSpaServerEntry.d.ts +5 -0
- package/esm/tanstack-start/react/withOidcSpaServerEntry.js +38 -0
- package/esm/tanstack-start/react/withOidcSpaServerEntry.js.map +1 -0
- package/package.json +1 -1
- package/src/core/StateDataCookie.ts +217 -0
- package/src/core/createOidc.ts +34 -8
- package/src/core/earlyInit.ts +3 -15
- package/src/core/loginOrGoToAuthServer.ts +25 -9
- package/src/entrypoint.ts +0 -1
- package/src/tanstack-start/react/createOidcSpaApi.tsx +3 -0
- package/src/tanstack-start/react/index.ts +1 -1
- package/src/tanstack-start/react/withOidcSpaServerEntry.ts +60 -0
- package/src/vite-plugin/handleClientEntrypoint.ts +10 -67
- package/src/vite-plugin/handleServerEntrypoint.ts +129 -0
- package/src/vite-plugin/transformTanstackRouterCreateFileRoute.ts +0 -64
- package/src/vite-plugin/utils.ts +64 -0
- package/src/vite-plugin/vite-plugin.ts +31 -10
- package/vite-plugin/handleClientEntrypoint.d.ts +7 -5
- package/vite-plugin/handleClientEntrypoint.js +16 -62
- package/vite-plugin/handleClientEntrypoint.js.map +1 -1
- package/vite-plugin/handleServerEntrypoint.d.ts +12 -0
- package/vite-plugin/handleServerEntrypoint.js +113 -0
- package/vite-plugin/handleServerEntrypoint.js.map +1 -0
- package/vite-plugin/transformTanstackRouterCreateFileRoute.js +0 -39
- package/vite-plugin/transformTanstackRouterCreateFileRoute.js.map +1 -1
- package/vite-plugin/utils.d.ts +12 -0
- package/vite-plugin/utils.js +88 -0
- package/vite-plugin/utils.js.map +1 -0
- package/vite-plugin/vite-plugin.d.ts +1 -1
- package/vite-plugin/vite-plugin.js +21 -5
- package/vite-plugin/vite-plugin.js.map +1 -1
- package/core/requiredPostHydrationReplaceNavigationUrl.d.ts +0 -6
- package/core/requiredPostHydrationReplaceNavigationUrl.js +0 -12
- package/core/requiredPostHydrationReplaceNavigationUrl.js.map +0 -1
- package/esm/core/requiredPostHydrationReplaceNavigationUrl.d.ts +0 -6
- package/esm/core/requiredPostHydrationReplaceNavigationUrl.js +0 -8
- package/esm/core/requiredPostHydrationReplaceNavigationUrl.js.map +0 -1
- package/esm/tanstack-start/react/withHandlingOidcPostLoginNavigation.d.ts +0 -2
- package/esm/tanstack-start/react/withHandlingOidcPostLoginNavigation.js +0 -36
- package/esm/tanstack-start/react/withHandlingOidcPostLoginNavigation.js.map +0 -1
- package/src/core/requiredPostHydrationReplaceNavigationUrl.ts +0 -11
- package/src/tanstack-start/react/withHandlingOidcPostLoginNavigation.tsx +0 -46
|
@@ -4,8 +4,6 @@ import { babelParser, babelTraverse, babelTypes as t } from "../vendor/build-run
|
|
|
4
4
|
const DISABLE_SSR_SPECIFIER = "__disableSsrIfLoginEnforced";
|
|
5
5
|
const DISABLE_SSR_SOURCE = "oidc-spa/react-tanstack-start";
|
|
6
6
|
const CREATE_FILE_ROUTE_IDENTIFIER = "createFileRoute";
|
|
7
|
-
const POST_LOGIN_IMPORT_SPECIFIER = "withHandlingOidcPostLoginNavigation";
|
|
8
|
-
const POST_LOGIN_IMPORT_SOURCE = "oidc-spa/react-tanstack-start";
|
|
9
7
|
|
|
10
8
|
type TransformParams = {
|
|
11
9
|
code: string;
|
|
@@ -38,9 +36,7 @@ export function transformCreateFileRoute(params: TransformParams): TransformResu
|
|
|
38
36
|
const magicString = new MagicString(code);
|
|
39
37
|
let hasCreateFileRouteImport = false;
|
|
40
38
|
let hasEnableImport = false;
|
|
41
|
-
let hasPostLoginImport = false;
|
|
42
39
|
let requiresEnableImport = false;
|
|
43
|
-
let requiresPostLoginImport = false;
|
|
44
40
|
let lastImportEnd: number | undefined;
|
|
45
41
|
let mutated = false;
|
|
46
42
|
|
|
@@ -79,18 +75,6 @@ export function transformCreateFileRoute(params: TransformParams): TransformResu
|
|
|
79
75
|
hasEnableImport = true;
|
|
80
76
|
}
|
|
81
77
|
}
|
|
82
|
-
|
|
83
|
-
if (sourceValue === POST_LOGIN_IMPORT_SOURCE) {
|
|
84
|
-
if (
|
|
85
|
-
path.node.specifiers.some(
|
|
86
|
-
specifier =>
|
|
87
|
-
t.isImportSpecifier(specifier) &&
|
|
88
|
-
t.isIdentifier(specifier.imported, { name: POST_LOGIN_IMPORT_SPECIFIER })
|
|
89
|
-
)
|
|
90
|
-
) {
|
|
91
|
-
hasPostLoginImport = true;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
78
|
},
|
|
95
79
|
CallExpression(path) {
|
|
96
80
|
const callee = path.get("callee");
|
|
@@ -128,33 +112,6 @@ export function transformCreateFileRoute(params: TransformParams): TransformResu
|
|
|
128
112
|
}
|
|
129
113
|
}
|
|
130
114
|
|
|
131
|
-
const innerArgs = callee.node.arguments ?? [];
|
|
132
|
-
const isRootRoute =
|
|
133
|
-
innerArgs.length > 0 && t.isStringLiteral(innerArgs[0]) && innerArgs[0].value === "/";
|
|
134
|
-
|
|
135
|
-
if (isRootRoute) {
|
|
136
|
-
const componentProp = findComponentProperty(configNode);
|
|
137
|
-
if (componentProp) {
|
|
138
|
-
const valueNode = componentProp.value as t.Expression;
|
|
139
|
-
|
|
140
|
-
if (!isWrappedWithHandling(valueNode)) {
|
|
141
|
-
const start = valueNode.start ?? undefined;
|
|
142
|
-
const end = valueNode.end ?? undefined;
|
|
143
|
-
|
|
144
|
-
if (typeof start === "number" && typeof end === "number") {
|
|
145
|
-
const original = code.slice(start, end);
|
|
146
|
-
magicString.overwrite(
|
|
147
|
-
start,
|
|
148
|
-
end,
|
|
149
|
-
`${POST_LOGIN_IMPORT_SPECIFIER}(${original})`
|
|
150
|
-
);
|
|
151
|
-
requiresPostLoginImport = true;
|
|
152
|
-
localMutated = true;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
115
|
if (localMutated) {
|
|
159
116
|
mutated = true;
|
|
160
117
|
}
|
|
@@ -171,12 +128,6 @@ export function transformCreateFileRoute(params: TransformParams): TransformResu
|
|
|
171
128
|
importStatements.push(`import { ${DISABLE_SSR_SPECIFIER} } from "${DISABLE_SSR_SOURCE}";`);
|
|
172
129
|
}
|
|
173
130
|
|
|
174
|
-
if (requiresPostLoginImport && !hasPostLoginImport) {
|
|
175
|
-
importStatements.push(
|
|
176
|
-
`import { ${POST_LOGIN_IMPORT_SPECIFIER} } from "${POST_LOGIN_IMPORT_SOURCE}";`
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
131
|
if (importStatements.length > 0) {
|
|
181
132
|
const insertionPoint = lastImportEnd ?? 0;
|
|
182
133
|
const prefix = insertionPoint === 0 ? "" : "\n";
|
|
@@ -190,15 +141,6 @@ export function transformCreateFileRoute(params: TransformParams): TransformResu
|
|
|
190
141
|
};
|
|
191
142
|
}
|
|
192
143
|
|
|
193
|
-
function findComponentProperty(node: t.ObjectExpression): t.ObjectProperty | undefined {
|
|
194
|
-
return node.properties.find(
|
|
195
|
-
prop =>
|
|
196
|
-
t.isObjectProperty(prop) &&
|
|
197
|
-
((t.isIdentifier(prop.key) && prop.key.name === "component") ||
|
|
198
|
-
(t.isStringLiteral(prop.key) && prop.key.value === "component"))
|
|
199
|
-
) as t.ObjectProperty | undefined;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
144
|
function objectContainsLoaderOrBeforeLoad(node: t.ObjectExpression): boolean {
|
|
203
145
|
return node.properties.some(prop => {
|
|
204
146
|
if (!t.isObjectProperty(prop)) {
|
|
@@ -218,12 +160,6 @@ function objectContainsLoaderOrBeforeLoad(node: t.ObjectExpression): boolean {
|
|
|
218
160
|
});
|
|
219
161
|
}
|
|
220
162
|
|
|
221
|
-
function isWrappedWithHandling(node: t.Node): boolean {
|
|
222
|
-
return (
|
|
223
|
-
t.isCallExpression(node) && t.isIdentifier(node.callee, { name: POST_LOGIN_IMPORT_SPECIFIER })
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
163
|
function isCandidateFile(id: string): boolean {
|
|
228
164
|
if (id.includes("node_modules")) {
|
|
229
165
|
return false;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import * as path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { normalizePath } from "vite";
|
|
5
|
+
|
|
6
|
+
export function resolveCandidate({
|
|
7
|
+
root,
|
|
8
|
+
subDirectories,
|
|
9
|
+
filenames
|
|
10
|
+
}: {
|
|
11
|
+
root: string;
|
|
12
|
+
subDirectories: string[];
|
|
13
|
+
filenames: string[];
|
|
14
|
+
}): string | undefined {
|
|
15
|
+
for (const subDirectory of subDirectories) {
|
|
16
|
+
for (const filename of filenames) {
|
|
17
|
+
const candidate = path.resolve(root, subDirectory, filename);
|
|
18
|
+
if (existsSync(candidate)) {
|
|
19
|
+
return candidate;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function resolvePackageFile(packageName: string, segments: string[]): string {
|
|
27
|
+
const pkgPath = require.resolve(`${packageName}/package.json`);
|
|
28
|
+
return path.resolve(path.dirname(pkgPath), ...segments);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function normalizeAbsolute(filePath: string): string {
|
|
32
|
+
return normalizePath(filePath);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function splitId(id: string): { path: string; queryParams: URLSearchParams } {
|
|
36
|
+
const queryIndex = id.indexOf("?");
|
|
37
|
+
if (queryIndex === -1) {
|
|
38
|
+
return { path: id, queryParams: new URLSearchParams() };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const pathPart = id.slice(0, queryIndex);
|
|
42
|
+
const queryString = id.slice(queryIndex + 1);
|
|
43
|
+
return { path: pathPart, queryParams: new URLSearchParams(queryString) };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function normalizeRequestPath(id: string): string {
|
|
47
|
+
let requestPath = id;
|
|
48
|
+
|
|
49
|
+
if (requestPath.startsWith("\0")) {
|
|
50
|
+
requestPath = requestPath.slice(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (requestPath.startsWith("/@fs/")) {
|
|
54
|
+
requestPath = requestPath.slice("/@fs/".length);
|
|
55
|
+
} else if (requestPath.startsWith("file://")) {
|
|
56
|
+
requestPath = fileURLToPath(requestPath);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (path.isAbsolute(requestPath) || requestPath.startsWith(".")) {
|
|
60
|
+
return normalizePath(requestPath);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return normalizePath(requestPath);
|
|
64
|
+
}
|
|
@@ -2,15 +2,13 @@ import type { Plugin, TransformResult } from "vite";
|
|
|
2
2
|
import { assert } from "../tools/tsafe/assert";
|
|
3
3
|
import type { Param0 } from "../tools/tsafe/Param0";
|
|
4
4
|
import type { oidcEarlyInit } from "../entrypoint";
|
|
5
|
-
import {
|
|
5
|
+
import { createHandleClientEntrypoint } from "./handleClientEntrypoint";
|
|
6
|
+
import { createHandleServerEntrypoint } from "./handleServerEntrypoint";
|
|
6
7
|
import { manageOptimizedDeps } from "./manageOptimizedDeps";
|
|
7
8
|
import { transformCreateFileRoute } from "./transformTanstackRouterCreateFileRoute";
|
|
8
9
|
import { getProjectType, type ProjectType } from "./projectType";
|
|
9
10
|
|
|
10
|
-
export type OidcSpaVitePluginParams = Omit<
|
|
11
|
-
Param0<typeof oidcEarlyInit>,
|
|
12
|
-
"isPostLoginRedirectManual" | "BASE_URL"
|
|
13
|
-
>;
|
|
11
|
+
export type OidcSpaVitePluginParams = Omit<Param0<typeof oidcEarlyInit>, "BASE_URL">;
|
|
14
12
|
|
|
15
13
|
export function oidcSpa(
|
|
16
14
|
params: OidcSpaVitePluginParams = {
|
|
@@ -19,7 +17,12 @@ export function oidcSpa(
|
|
|
19
17
|
freezeWebSocket: true
|
|
20
18
|
}
|
|
21
19
|
) {
|
|
22
|
-
let
|
|
20
|
+
let load_handleClientEntrypoint:
|
|
21
|
+
| ReturnType<typeof createHandleClientEntrypoint>["load_handleClientEntrypoint"]
|
|
22
|
+
| undefined = undefined;
|
|
23
|
+
let load_handleServerEntrypoint:
|
|
24
|
+
| ReturnType<typeof createHandleServerEntrypoint>["load_handleServerEntrypoint"]
|
|
25
|
+
| undefined = undefined;
|
|
23
26
|
|
|
24
27
|
let projectType: ProjectType | undefined = undefined;
|
|
25
28
|
|
|
@@ -44,11 +47,16 @@ export function oidcSpa(
|
|
|
44
47
|
pluginNames: resolvedConfig.plugins.map(({ name }) => name)
|
|
45
48
|
});
|
|
46
49
|
|
|
47
|
-
|
|
50
|
+
load_handleClientEntrypoint = createHandleClientEntrypoint({
|
|
48
51
|
oidcSpaVitePluginParams: params,
|
|
49
52
|
resolvedConfig,
|
|
50
53
|
projectType
|
|
51
|
-
});
|
|
54
|
+
}).load_handleClientEntrypoint;
|
|
55
|
+
|
|
56
|
+
load_handleServerEntrypoint = createHandleServerEntrypoint({
|
|
57
|
+
resolvedConfig,
|
|
58
|
+
projectType
|
|
59
|
+
}).load_handleServerEntrypoint;
|
|
52
60
|
},
|
|
53
61
|
transform(code, id) {
|
|
54
62
|
let transformed: TransformResult | null = null;
|
|
@@ -69,10 +77,23 @@ export function oidcSpa(
|
|
|
69
77
|
return transformed;
|
|
70
78
|
},
|
|
71
79
|
async load(id) {
|
|
72
|
-
|
|
80
|
+
{
|
|
81
|
+
assert(load_handleClientEntrypoint !== undefined);
|
|
82
|
+
|
|
83
|
+
const r = await load_handleClientEntrypoint({
|
|
84
|
+
id,
|
|
85
|
+
pluginContext: this
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (r !== null) {
|
|
89
|
+
return r;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
73
92
|
|
|
74
93
|
{
|
|
75
|
-
|
|
94
|
+
assert(load_handleServerEntrypoint !== undefined);
|
|
95
|
+
|
|
96
|
+
const r = await load_handleServerEntrypoint({
|
|
76
97
|
id,
|
|
77
98
|
pluginContext: this
|
|
78
99
|
});
|
|
@@ -2,11 +2,13 @@ import type { OidcSpaVitePluginParams } from "./vite-plugin";
|
|
|
2
2
|
import type { ResolvedConfig } from "vite";
|
|
3
3
|
import type { PluginContext } from "rollup";
|
|
4
4
|
import type { ProjectType } from "./projectType";
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function createHandleClientEntrypoint(params: {
|
|
6
6
|
oidcSpaVitePluginParams: OidcSpaVitePluginParams;
|
|
7
7
|
resolvedConfig: ResolvedConfig;
|
|
8
8
|
projectType: ProjectType;
|
|
9
|
-
}):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
}): {
|
|
10
|
+
load_handleClientEntrypoint: (params: {
|
|
11
|
+
id: string;
|
|
12
|
+
pluginContext: PluginContext;
|
|
13
|
+
}) => Promise<null | string>;
|
|
14
|
+
};
|
|
@@ -33,13 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.createHandleClientEntrypoint = createHandleClientEntrypoint;
|
|
37
37
|
const node_fs_1 = require("node:fs");
|
|
38
|
-
const node_fs_2 = require("node:fs");
|
|
39
38
|
const path = __importStar(require("node:path"));
|
|
40
|
-
const node_url_1 = require("node:url");
|
|
41
|
-
const vite_1 = require("vite");
|
|
42
39
|
const assert_1 = require("../tools/tsafe/assert");
|
|
40
|
+
const utils_1 = require("./utils");
|
|
43
41
|
const ORIGINAL_QUERY_PARAM = "oidc-spa-original";
|
|
44
42
|
const GENERIC_ENTRY_CANDIDATES = ["src/main.tsx", "src/main.ts", "src/main.jsx", "src/main.js"];
|
|
45
43
|
const REACT_ROUTER_ENTRY_CANDIDATES = [
|
|
@@ -49,16 +47,16 @@ const REACT_ROUTER_ENTRY_CANDIDATES = [
|
|
|
49
47
|
"entry.client.js"
|
|
50
48
|
];
|
|
51
49
|
const TANSTACK_ENTRY_CANDIDATES = ["client.tsx", "client.ts", "client.jsx", "client.js"];
|
|
52
|
-
function
|
|
50
|
+
function createHandleClientEntrypoint(params) {
|
|
53
51
|
const { oidcSpaVitePluginParams, resolvedConfig, projectType } = params;
|
|
54
52
|
const entryResolution = resolveEntryForProject({
|
|
55
53
|
config: resolvedConfig,
|
|
56
54
|
projectType
|
|
57
55
|
});
|
|
58
|
-
async function
|
|
56
|
+
async function load_handleClientEntrypoint(params) {
|
|
59
57
|
const { id, pluginContext } = params;
|
|
60
|
-
const { path: rawPath, queryParams } = splitId(id);
|
|
61
|
-
const normalizedRequestPath = normalizeRequestPath(rawPath);
|
|
58
|
+
const { path: rawPath, queryParams } = (0, utils_1.splitId)(id);
|
|
59
|
+
const normalizedRequestPath = (0, utils_1.normalizeRequestPath)(rawPath);
|
|
62
60
|
if (!normalizedRequestPath) {
|
|
63
61
|
return null;
|
|
64
62
|
}
|
|
@@ -80,7 +78,6 @@ function createLoadHandleEntrypoint(params) {
|
|
|
80
78
|
` freezeWebSocket: ${freezeWebSocket},`,
|
|
81
79
|
` freezePromise: ${freezePromise},`,
|
|
82
80
|
` safeMode: ${safeMode},`,
|
|
83
|
-
` isPostLoginRedirectManual: ${projectType === "tanstack-start"},`,
|
|
84
81
|
` BASE_URL: "${resolvedConfig.base}"`,
|
|
85
82
|
`});`,
|
|
86
83
|
``,
|
|
@@ -92,25 +89,25 @@ function createLoadHandleEntrypoint(params) {
|
|
|
92
89
|
.join("\n");
|
|
93
90
|
return stubSourceCache;
|
|
94
91
|
}
|
|
95
|
-
return
|
|
92
|
+
return { load_handleClientEntrypoint };
|
|
96
93
|
}
|
|
97
94
|
function resolveEntryForProject({ config, projectType }) {
|
|
98
95
|
const root = config.root;
|
|
99
96
|
switch (projectType) {
|
|
100
97
|
case "tanstack-start": {
|
|
101
|
-
const candidate = resolveCandidate({
|
|
98
|
+
const candidate = (0, utils_1.resolveCandidate)({
|
|
102
99
|
root,
|
|
103
100
|
subDirectories: ["src"],
|
|
104
101
|
filenames: TANSTACK_ENTRY_CANDIDATES
|
|
105
102
|
});
|
|
106
103
|
const entryPath = candidate ??
|
|
107
|
-
resolvePackageFile("@tanstack/react-start", [
|
|
104
|
+
(0, utils_1.resolvePackageFile)("@tanstack/react-start", [
|
|
108
105
|
"dist",
|
|
109
106
|
"plugin",
|
|
110
107
|
"default-entry",
|
|
111
108
|
"client.tsx"
|
|
112
109
|
]);
|
|
113
|
-
const normalized = normalizeAbsolute(entryPath);
|
|
110
|
+
const normalized = (0, utils_1.normalizeAbsolute)(entryPath);
|
|
114
111
|
const resolution = {
|
|
115
112
|
absolutePath: entryPath,
|
|
116
113
|
normalizedPath: normalized,
|
|
@@ -119,19 +116,19 @@ function resolveEntryForProject({ config, projectType }) {
|
|
|
119
116
|
return resolution;
|
|
120
117
|
}
|
|
121
118
|
case "react-router-framework": {
|
|
122
|
-
const candidate = resolveCandidate({
|
|
119
|
+
const candidate = (0, utils_1.resolveCandidate)({
|
|
123
120
|
root,
|
|
124
121
|
subDirectories: ["app"],
|
|
125
122
|
filenames: REACT_ROUTER_ENTRY_CANDIDATES
|
|
126
123
|
});
|
|
127
124
|
const entryPath = candidate ??
|
|
128
|
-
resolvePackageFile("@react-router/dev", [
|
|
125
|
+
(0, utils_1.resolvePackageFile)("@react-router/dev", [
|
|
129
126
|
"dist",
|
|
130
127
|
"config",
|
|
131
128
|
"defaults",
|
|
132
129
|
"entry.client.tsx"
|
|
133
130
|
]);
|
|
134
|
-
const normalized = normalizeAbsolute(entryPath);
|
|
131
|
+
const normalized = (0, utils_1.normalizeAbsolute)(entryPath);
|
|
135
132
|
const resolution = {
|
|
136
133
|
absolutePath: entryPath,
|
|
137
134
|
normalizedPath: normalized,
|
|
@@ -140,13 +137,13 @@ function resolveEntryForProject({ config, projectType }) {
|
|
|
140
137
|
return resolution;
|
|
141
138
|
}
|
|
142
139
|
case "other": {
|
|
143
|
-
const candidate = resolveCandidate({
|
|
140
|
+
const candidate = (0, utils_1.resolveCandidate)({
|
|
144
141
|
root,
|
|
145
142
|
subDirectories: ["."],
|
|
146
143
|
filenames: GENERIC_ENTRY_CANDIDATES
|
|
147
144
|
});
|
|
148
145
|
(0, assert_1.assert)(candidate !== undefined);
|
|
149
|
-
const normalized = normalizeAbsolute(candidate);
|
|
146
|
+
const normalized = (0, utils_1.normalizeAbsolute)(candidate);
|
|
150
147
|
const resolution = {
|
|
151
148
|
absolutePath: candidate,
|
|
152
149
|
normalizedPath: normalized,
|
|
@@ -160,49 +157,6 @@ function resolveEntryForProject({ config, projectType }) {
|
|
|
160
157
|
}
|
|
161
158
|
function loadOriginalModule(entry, context) {
|
|
162
159
|
entry.watchFiles.forEach(file => context.addWatchFile(file));
|
|
163
|
-
return
|
|
164
|
-
}
|
|
165
|
-
function resolveCandidate({ root, subDirectories, filenames }) {
|
|
166
|
-
for (const subDirectory of subDirectories) {
|
|
167
|
-
for (const filename of filenames) {
|
|
168
|
-
const candidate = path.resolve(root, subDirectory, filename);
|
|
169
|
-
if ((0, node_fs_1.existsSync)(candidate)) {
|
|
170
|
-
return candidate;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
return undefined;
|
|
175
|
-
}
|
|
176
|
-
function resolvePackageFile(packageName, segments) {
|
|
177
|
-
const pkgPath = require.resolve(`${packageName}/package.json`);
|
|
178
|
-
return path.resolve(path.dirname(pkgPath), ...segments);
|
|
179
|
-
}
|
|
180
|
-
function normalizeAbsolute(filePath) {
|
|
181
|
-
return (0, vite_1.normalizePath)(filePath);
|
|
182
|
-
}
|
|
183
|
-
function splitId(id) {
|
|
184
|
-
const queryIndex = id.indexOf("?");
|
|
185
|
-
if (queryIndex === -1) {
|
|
186
|
-
return { path: id, queryParams: new URLSearchParams() };
|
|
187
|
-
}
|
|
188
|
-
const pathPart = id.slice(0, queryIndex);
|
|
189
|
-
const queryString = id.slice(queryIndex + 1);
|
|
190
|
-
return { path: pathPart, queryParams: new URLSearchParams(queryString) };
|
|
191
|
-
}
|
|
192
|
-
function normalizeRequestPath(id) {
|
|
193
|
-
let requestPath = id;
|
|
194
|
-
if (requestPath.startsWith("\0")) {
|
|
195
|
-
requestPath = requestPath.slice(1);
|
|
196
|
-
}
|
|
197
|
-
if (requestPath.startsWith("/@fs/")) {
|
|
198
|
-
requestPath = requestPath.slice("/@fs/".length);
|
|
199
|
-
}
|
|
200
|
-
else if (requestPath.startsWith("file://")) {
|
|
201
|
-
requestPath = (0, node_url_1.fileURLToPath)(requestPath);
|
|
202
|
-
}
|
|
203
|
-
if (path.isAbsolute(requestPath) || requestPath.startsWith(".")) {
|
|
204
|
-
return (0, vite_1.normalizePath)(requestPath);
|
|
205
|
-
}
|
|
206
|
-
return (0, vite_1.normalizePath)(requestPath);
|
|
160
|
+
return node_fs_1.promises.readFile(entry.absolutePath, "utf8");
|
|
207
161
|
}
|
|
208
162
|
//# sourceMappingURL=handleClientEntrypoint.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleClientEntrypoint.js","sourceRoot":"","sources":["../src/vite-plugin/handleClientEntrypoint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"handleClientEntrypoint.js","sourceRoot":"","sources":["../src/vite-plugin/handleClientEntrypoint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,oEAgEC;AAhGD,qCAAyC;AACzC,gDAAkC;AAClC,kDAA+C;AAG/C,mCAMiB;AAQjB,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEjD,MAAM,wBAAwB,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC,CAAC;AAEhG,MAAM,6BAA6B,GAAG;IAClC,kBAAkB;IAClB,iBAAiB;IACjB,kBAAkB;IAClB,iBAAiB;CACpB,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;AAEzF,SAAgB,4BAA4B,CAAC,MAI5C;IACG,MAAM,EAAE,uBAAuB,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAExE,MAAM,eAAe,GAAG,sBAAsB,CAAC;QAC3C,MAAM,EAAE,cAAc;QACtB,WAAW;KACd,CAAC,C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jectType } from "./projectType";
|
|
4
|
+
export declare function createHandleServerEntrypoint(params: {
|
|
5
|
+
resolvedConfig: ResolvedConfig;
|
|
6
|
+
projectType: ProjectType;
|
|
7
|
+
}): {
|
|
8
|
+
load_handleServerEntrypoint: (params: {
|
|
9
|
+
id: string;
|
|
10
|
+
pluginContext: PluginContext;
|
|
11
|
+
}) => Promise<null | string>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.createHandleServerEntrypoint = createHandleServerEntrypoint;
|
|
37
|
+
const node_fs_1 = require("node:fs");
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const assert_1 = require("../tools/tsafe/assert");
|
|
40
|
+
const utils_1 = require("./utils");
|
|
41
|
+
const ORIGINAL_QUERY_PARAM = "oidc-spa-original";
|
|
42
|
+
function createHandleServerEntrypoint(params) {
|
|
43
|
+
const { resolvedConfig, projectType } = params;
|
|
44
|
+
const entryResolution = resolveEntryForProject({
|
|
45
|
+
config: resolvedConfig,
|
|
46
|
+
projectType
|
|
47
|
+
});
|
|
48
|
+
async function load_handleServerEntrypoint(params) {
|
|
49
|
+
if (entryResolution === undefined) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const { id, pluginContext } = params;
|
|
53
|
+
const { path: rawPath, queryParams } = (0, utils_1.splitId)(id);
|
|
54
|
+
const normalizedRequestPath = (0, utils_1.normalizeRequestPath)(rawPath);
|
|
55
|
+
if (!normalizedRequestPath) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
if (normalizedRequestPath !== entryResolution.normalizedPath) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const isOriginalRequest = queryParams.getAll(ORIGINAL_QUERY_PARAM).includes("true");
|
|
62
|
+
if (isOriginalRequest) {
|
|
63
|
+
return loadOriginalModule(entryResolution, pluginContext);
|
|
64
|
+
}
|
|
65
|
+
entryResolution.watchFiles.forEach(file => pluginContext.addWatchFile(file));
|
|
66
|
+
const stubSourceCache = [
|
|
67
|
+
`import serverEntry_original from "./${path.basename(entryResolution.absolutePath)}?${ORIGINAL_QUERY_PARAM}=true";`,
|
|
68
|
+
`import { __withOidcSpaServerEntry } from "oidc-spa/react-tanstack-start";`,
|
|
69
|
+
``,
|
|
70
|
+
`const serverEntry = __withOidcSpaServerEntry(serverEntry_original);`,
|
|
71
|
+
``,
|
|
72
|
+
`export default serverEntry;`
|
|
73
|
+
].join("\n");
|
|
74
|
+
return stubSourceCache;
|
|
75
|
+
}
|
|
76
|
+
return { load_handleServerEntrypoint };
|
|
77
|
+
}
|
|
78
|
+
function resolveEntryForProject({ config, projectType }) {
|
|
79
|
+
const root = config.root;
|
|
80
|
+
switch (projectType) {
|
|
81
|
+
case "tanstack-start": {
|
|
82
|
+
const candidate = (0, utils_1.resolveCandidate)({
|
|
83
|
+
root,
|
|
84
|
+
subDirectories: ["src"],
|
|
85
|
+
filenames: ["server.ts", "server.js", "server.tsx", "server.jsx"]
|
|
86
|
+
});
|
|
87
|
+
const entryPath = candidate ??
|
|
88
|
+
(0, utils_1.resolvePackageFile)("@tanstack/react-start", [
|
|
89
|
+
"dist",
|
|
90
|
+
"plugin",
|
|
91
|
+
"default-entry",
|
|
92
|
+
"server.ts"
|
|
93
|
+
]);
|
|
94
|
+
const normalized = (0, utils_1.normalizeAbsolute)(entryPath);
|
|
95
|
+
const resolution = {
|
|
96
|
+
absolutePath: entryPath,
|
|
97
|
+
normalizedPath: normalized,
|
|
98
|
+
watchFiles: [entryPath]
|
|
99
|
+
};
|
|
100
|
+
return resolution;
|
|
101
|
+
}
|
|
102
|
+
case "react-router-framework":
|
|
103
|
+
case "other":
|
|
104
|
+
return undefined;
|
|
105
|
+
default:
|
|
106
|
+
(0, assert_1.assert)(false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function loadOriginalModule(entry, context) {
|
|
110
|
+
entry.watchFiles.forEach(file => context.addWatchFile(file));
|
|
111
|
+
return node_fs_1.promises.readFile(entry.absolutePath, "utf8");
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=handleServerEntrypoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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