create-fn-code-blocks
v0.1.5
Published
Scaffold a new [Fn-Code-Blocks](https://www.npmjs.com/package/@fn-code-blocks/core) project. One command gets you a working project with typed, language-agnostic function composition — TypeScript and Python out of the box.
Readme
create-fn-code-blocks
Scaffold a new Fn-Code-Blocks project. One command gets you a working project with typed, language-agnostic function composition — TypeScript and Python out of the box.
Usage
npx create-fn-code-blocks my-projectThis creates a new directory with everything wired up:
my-project/
├── fn-code-blocks.config.ts # Configuration
├── package.json # Single dependency: @fn-code-blocks/core
├── .devcontainer/ # Dev Container config
├── .vscode/launch.json # Debug configurations
├── src/
│ ├── functions/
│ │ ├── ts_hello_world/ # TypeScript example function + test
│ │ ├── py_hello_world/ # Python example function + test
│ │ └── shared/ # Cross-function utilities
│ └── routes/
│ └── hello.ts # Example route composing both functions
└── .gitignorePrerequisites
Your local machine needs:
- Docker Desktop — runs the development environment
- VS Code — editor
- VS Code extension: Dev Containers (ID:
ms-vscode-remote.remote-containers) - Node.js — only for this initial scaffold command
After scaffolding
code my-project # Open in VS Code
# Click "Reopen in Container" # Dev Container builds, setup runs automatically
npm run dev # All services start
# Visit http://localhost:3000/hello # WorkingThe Dev Container installs Node 24 and Python 3.12 — matching production exactly. Dependencies install automatically via postCreateCommand. No manual setup needed.
What it generates
| File | Purpose |
|---|---|
| fn-code-blocks.config.ts | Project configuration (env, logging, runtimes) |
| package.json | Scripts and @fn-code-blocks/core dependency |
| .devcontainer/ | Dev Container with TypeScript and Python runtimes |
| .vscode/launch.json | Debug configs for orchestrator, runtimes, and tests |
| src/functions/*/ | Two hello world functions (TS, Python) with tests |
| src/routes/hello.ts | Example route calling both functions in parallel |
| README.md | Getting started guide |
| FRAMEWORK.md files | In-place documentation for functions, routes, and shared utilities |
| pyproject.toml | Pytest configuration |
| .gitignore | Ignores node_modules/, .venv/, .fn-code-blocks/, etc. |
Next steps after scaffolding
- Add a function: create
src/functions/my_function/index.ts(or.py) - Add a route: create
src/routes/my_route.ts - Run tests:
npm test - See
src/functions/FRAMEWORK.mdfor templates and rules
Full documentation: @fn-code-blocks/core
License
MIT
