Custom and local templates
ness new can create an application from an official starter, an npm package, or a directory on the local filesystem.
Local directoryβ
Pass a relative, absolute, home-relative, or file: path:
ness new my-app --template ./templates/company-app
ness new my-app --template /Users/me/templates/company-app
ness new my-app --template ~/templates/company-app
ness new my-app --template file:../company-app
A direct template directory must contain app/:
company-app/
βββ app/
β βββ root.tsx
β βββ routes/
βββ public/
βββ ness.config.mjs
βββ tsconfig.json
βββ Dockerfile
TypeScript is detected automatically from tsconfig.json. Ness generates the destination package.json, installs the framework dependencies, and copies the remaining files.
Package-style templateβ
For a template that can also be published to npm, place application files inside template/:
company-template/
βββ package.json
βββ template.json
βββ template/
βββ app/
βββ public/
βββ ness.config.mjs
{
"name": "@company/ness-template",
"type": "module",
"files": ["template", "template.json"],
"ness": {
"template": "template"
}
}
The ness.template field is optional when the directory is named template.
Package customizationsβ
Use template.json to add dependencies, scripts, and supported package metadata:
{
"package": {
"description": "Company web application",
"scripts": {
"storybook": "storybook dev -p 6006"
},
"dependencies": {
"@company/ui": "^2.0.0"
},
"devDependencies": {
"storybook": "^10.0.0"
}
}
}
Ness preserves the generated application name, version, ESM mode, private flag, and Node requirement. It merges dependencies, development dependencies, optional and peer dependencies, and scripts; Browserslist, ESLint configuration, and npm overrides are copied whole.
The prettier field is also copied into the generated package.json, so formatting rules do not require a separate .prettierrc file.
Copy safetyβ
The following development artifacts are never copied from a local template:
node_modules,.git,.npmignore,build,dist,deploy,.react-router, and.ness- npm, pnpm, Yarn, and Bun lock files
- source
package.jsonandtemplate.json
The application directory cannot be placed inside the source template directory, preventing recursive copies.
npm registry templateβ
Published scoped packages can be used directly:
ness new my-app --template @company/ness-template
Unscoped aliases continue to resolve through the ness-template-* convention:
ness new my-app --template commerce
# Installs ness-template-commerce