Thank you for contributing! This guide covers how to add new templates and improve existing ones.
- Node.js >= 20.9.0
- pnpm >= 9.0.0
- TypeScript >= 5.3.0
git clone https://github.com/objectstack-ai/templates.git
cd templates
pnpm installmkdir -p templates/my-app/src{
"name": "@templates/my-app",
"version": "1.0.0",
"type": "module",
"description": "Short description of your app",
"license": "MIT",
"scripts": {
"build": "tsc && objectstack compile",
"typecheck": "tsc --noEmit",
"dev": "objectstack dev"
},
"dependencies": {
"@objectstack/spec": "^3.0.8"
},
"devDependencies": {
"@objectstack/cli": "^3.0.8",
"typescript": "^5.9.3"
},
"objectstack": {
"category": "app",
"minVersion": "3.0.0",
"permissions": ["data:read", "data:write"]
}
}{
"extends": "../../base.tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "./src"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}Create src/my_entity.object.ts:
import { ObjectSchema, Field } from '@objectstack/spec/data';
export const MyEntity = ObjectSchema.create({
name: 'my_entity',
label: 'My Entity',
pluralLabel: 'My Entities',
icon: 'cube',
fields: {
name: Field.text({ label: 'Name', required: true }),
description: Field.textarea({ label: 'Description' }),
},
enable: {
searchable: true,
},
});Create src/plugin.ts exporting a plugin object with objects, apps, triggers, and actions.
import { defineStack } from '@objectstack/spec';
import { MyAppPlugin } from './src/plugin.js';
export default defineStack({
manifest: {
id: 'com.templates.my-app',
namespace: 'my_app',
version: '1.0.0',
type: 'plugin',
name: 'My App',
description: 'Short description',
},
plugins: [MyAppPlugin],
});Add path aliases for the new template in both files.
Add your template to the appropriate phase.
-
pnpm typecheck— zero TypeScript errors -
pnpm test— all tests pass -
pnpm lint— no ESLint errors - README.md added to the template directory
- CHANGELOG.md added to the template directory
-
objectstackmetadata inpackage.json(category, minVersion, permissions) - Template listed in root
README.md -
ROADMAP.mdupdated
- Use
ObjectSchema.create()for all business objects - Follow the
{entity}.object.tsnaming convention - Use
Field.*helpers from@objectstack/spec/data - Prefer named exports