Files
Cato d528260d49 feat(auth): CJS ./auth/password and one new-password field on reset (0.9.1) (#37)
* feat(auth): CommonJS build of ./auth/password; reset form asks for the new password once, in the same field as sign-up

* feat(auth): PasswordField as its own entry for products with their own pages

* fix(styles): the eye's room applies to any input in the box

* feat(auth): ./auth/hash, bcrypt over SHA-256 with verify-and-rehash of old hashes

* feat(auth): PasswordField accepts name and placeholder
2026-10-28 03:54:02 +01:00

19 lines
641 B
JavaScript

// CommonJS copies of the entries a CommonJS backend needs. ./auth/password is
// two constants and one function with no imports; ./auth/hash imports only
// node:crypto. Both come from the same src files as the ESM build, so the
// copies cannot differ from it.
import { copyFileSync } from "node:fs";
import { build } from "esbuild";
for (const name of ["password", "hash"]) {
await build({
entryPoints: [`src/auth/${name}.ts`],
outfile: `dist/auth/${name}.cjs`,
format: "cjs",
platform: "node",
target: "es2022",
logLevel: "warning",
});
copyFileSync(`dist/auth/${name}.d.ts`, `dist/auth/${name}.d.cts`);
}