create-shadow-app
The 47 exports of create-shadow-app: 22 functions, 1 class, 11 interfaces, 5 types and 8 consts.
Everything create-shadow-app exports, from the TSDoc of its entry point.
Functions#
applyLocal: Switches every ShadowJS dependency of a project to its tarball.buildProject: Composes a project.candidateName: The directory's last segment, lowercased and with every character a package name cannot hold turned into-.enabledAddons: The names of the add-ons that are on, in canonical order.fileSpec: Thefile:specifier of a tarball: relative tofromwhen it is near, absolute otherwise (a path that climbs three levels is harder to read than the absolute one).inspectTarget: Looks at the target without changing it.isValidPackageName: True for names npm accepts for a new package: see packageNameProblem.localState: The content of.shadowjs-local.json, the state filenpm run local:install -- <app> --restorein the ShadowJS repository reads to put the registry ranges back.overrideField: Where the manager reads overrides from.overridesFor: Maps every packed package to itsfile:specifier.packageNameProblem: Whynamecannot be a new package's name, orundefinedwhen npm accepts it: lowercase, no spaces, URL-safe, at most 214 characters, optionally scoped, and not a name npm reserves.parseArgs: Parsesargv(without the program name).parseManifest: Validates the parsed content of amanifest.json.projectFiles: Every file of the generated project, keyed by relative path.resolveOptions: Fills in defaults and the implications between choices: -uineeds Tailwind, so it turns Tailwind on; - Clerk needs sign-in routes and Convex a page for its sample data, so aspawith either gets the router; - a Dusk-based template always has a router; -content,dashboardandapibuild in Vitest and ESLint (anddashboardshadow-ui with Tailwind), and refuse the add-ons that do not fit them (for example Convex, or Tailwind forapi).resolveTarget: Resolves the directory argument against the working directory.safeJoin: Joins a project-relative file path to the target, refusing anything that could land outside it: absolute paths, drive letters,..segments, NUL bytes and backslashes.scaffold: Writes a new project intodirectory.tarballName: npm's own tarball file name.toPackageName: Turns a directory name into a valid package name.versionOf: Looks a version up and fails loudly when the name is unknown, so a typo in a template cannot silently writeundefinedinto a manifest.writeProject: Writes a file map belowdirectory.
Classes#
UsageError: A refused input.
Interfaces#
AddonInfo: Description of an add-on for prompts and help.LocalManifest: Themanifest.jsonthatnpm run pack:localwrites next to the tarballs.LocalPack: Use ShadowJS from local tarballs instead of the registry (see ScaffoldOptions.local).LocalResult: What applyLocal produces.PackedPackage: One ShadowJS package packed into a tarball bynpm run pack:local.ParsedArgs: The parsed command line.Project: A composed project.ResolvedOptions: ScaffoldOptions with every choice made.ScaffoldOptions: The choices for a generated project.ScaffoldResult: What scaffold wrote.WriteResult: What was written.
Types#
AddonName: The add-ons.PackageManager: The JavaScript package managers a generated project can be installed with.PathApi: The path functions of one platform; tests passwin32to check Windows rules on any machine.TargetState: The state of the target directory before writing.TemplateName: The starting points.
Constants#
ADDONS: All add-ons, in the canonical order they are applied.FRAMEWORK_PACKAGES: The ShadowJS packages a generated project can depend on.FRAMEWORK_RANGE: Range written for every@shadow-js/*package of the 1.x release line.FRAMEWORK_REQUIRES: The ShadowJS packages each package needs installed next to it (its dependencies and peers).PACKAGE_MANAGERS: Every supported package manager.TEMPLATES: Every template, in the order the prompt lists them.THIRD_PARTY_VERSIONS: Third-party packages and the exact version each is pinned to.VERSIONS: Versions of everything a generated app depends on: ShadowJS packages as FRAMEWORK_RANGE, third-party tools as exact pins.