[]previous and next page

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: The file: specifier of a tarball: relative to from when 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 file npm run local:install -- <app> --restore in the ShadowJS repository reads to put the registry ranges back.
  • overrideField: Where the manager reads overrides from.
  • overridesFor: Maps every packed package to its file: specifier.
  • packageNameProblem: Why name cannot be a new package's name, or undefined when npm accepts it: lowercase, no spaces, URL-safe, at most 214 characters, optionally scoped, and not a name npm reserves.
  • parseArgs: Parses argv (without the program name).
  • parseManifest: Validates the parsed content of a manifest.json.
  • projectFiles: Every file of the generated project, keyed by relative path.
  • resolveOptions: Fills in defaults and the implications between choices: - ui needs Tailwind, so it turns Tailwind on; - Clerk needs sign-in routes and Convex a page for its sample data, so a spa with either gets the router; - a Dusk-based template always has a router; - content, dashboard and api build in Vitest and ESLint (and dashboard shadow-ui with Tailwind), and refuse the add-ons that do not fit them (for example Convex, or Tailwind for api).
  • 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 into directory.
  • 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 write undefined into a manifest.
  • writeProject: Writes a file map below directory.

Classes#

Interfaces#

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 pass win32 to 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.