Checkout: forward only the checkout fields, show clear errors, fix the contact form (#16)
Co-authored-by: Michael Czechowski <mail@librete.ch>
This commit was merged in pull request #16.
This commit is contained in:
1 parent
d5dd109c63
commit
d46bc9380e
29 files changed
+1108
-71
No files matched your search
@@ -0,0 +1,6 @@
|
||||
// Loaded by `npm test` through `node --import`. Node runs the .ts sources directly (type stripping), but unlike Vite and Nitro it does
|
||||
// not resolve extensionless relative imports such as `import { … } from "./cmsError"` in a server/utils module.
|
||||
// The hook below retries such an import from a .ts file with ".ts" appended. Test files import sources with explicit .ts paths.
|
||||
import { register } from "node:module";
|
||||
|
||||
register("./resolve-ts.mjs", import.meta.url);
|
||||
@@ -0,0 +1,14 @@
|
||||
// Module resolve hook, registered by ./register.mjs: `./cmsError` imported from a .ts file resolves to `./cmsError.ts`.
|
||||
export async function resolve(specifier, context, nextResolve) {
|
||||
try {
|
||||
return await nextResolve(specifier, context);
|
||||
} catch (error) {
|
||||
const relative = specifier.startsWith("./") || specifier.startsWith("../");
|
||||
if (error?.code !== "ERR_MODULE_NOT_FOUND" || !relative || !context.parentURL?.endsWith(".ts")) throw error;
|
||||
try {
|
||||
return await nextResolve(`${specifier}.ts`, context);
|
||||
} catch {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user