@o3co/create-auth-policy-verifier
v0.3.1
Published
Scaffold a new o3co/auth.policy-verifier project from the standalone template
Downloads
138
Readme
@o3co/create-auth-policy-verifier
CLI scaffolder for auth.policy-verifier. Generates a new standalone server project from the built-in template.
Usage
npx @o3co/create-auth-policy-verifier <project-name> [--dir <dir-name>]<project-name> may be either a scoped npm name (@scope/pkg) or an unscoped name (pkg).
Unscoped example:
npx @o3co/create-auth-policy-verifier my-verifier
cd my-verifier
npm install
npm run debugScoped example (directory defaults to the package portion):
npx @o3co/create-auth-policy-verifier @my-org/auth.policy-verifier
cd auth.policy-verifier
npm install
npm run debugOverride the directory name with --dir:
npx @o3co/create-auth-policy-verifier @my-org/auth.policy-verifier --dir verifier
cd verifierWhat It Does
- Validates
<project-name>(see Validation Rules). - Derives the target directory name:
--dir <value>if given, else the unscoped part of a scoped name, else the name itself. - Aborts with an error if the target directory already exists.
- Copies
templates/standalone/to the target directory, excludingnode_modules/anddist/. - Rewrites
package.json: setsnameto<project-name>verbatim (scope-preserving), removesprivate, and replacesworkspace:*dependency versions with published semver versions fromtemplates/versions.json. - Prints next-step instructions.
Validation Rules
<project-name> must match one of:
- Unscoped:
^[a-z0-9][a-z0-9-._~]*$ - Scoped:
^@[a-z0-9][a-z0-9-._~]*/[a-z0-9][a-z0-9-._~]*$
Both forms must be non-empty, not . or .., and ≤ 214 characters.
--dir <value> must match the unscoped pattern above (same constraints).
Known Limitations
The bundled template's README.md / README.ja.md still carry the upstream title @o3co/auth-policy-verifier-standalone. When generating a scoped project, that title will not match your package.json name; edit it manually if it matters for your use case.
Generated Structure
<project-name>/
├── config/
│ └── application.conf # HOCON config (env var overrides)
├── src/
│ └── main.mts # Composition root — loads config and starts server
├── Dockerfile
├── Makefile
├── docker-compose.yml
├── docker-compose.test.yml
├── package.json
└── tsconfig.jsonProgrammatic API
The scaffolder also exports its internals for programmatic use:
import { scaffold, main } from "@o3co/create-auth-policy-verifier";| Export | Signature | Description |
|---|---|---|
| scaffold | (targetDir: string, projectName: string): void | Copies the template and rewrites package.json |
| main | (): void | CLI entry point — parses process.argv and calls scaffold |
See Also
@o3co/auth-policy-verifier-standalone— the template that this tool generates@o3co/auth.policy-verifier.server— Express app factory used by the generated project
