outfitter 0.2.7 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -2
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +5 -6
- package/dist/index.js +8 -7
- package/dist/shared/{chunk-x6644tk8.js → chunk-3pwh8ys4.js} +124 -154
- package/package.json +15 -11
- package/dist/actions.d.ts +0 -2
- package/dist/actions.js +0 -35
- package/dist/commands/add.d.ts +0 -54
- package/dist/commands/add.js +0 -16
- package/dist/commands/check-tsdoc.d.ts +0 -22
- package/dist/commands/check-tsdoc.js +0 -8
- package/dist/commands/check.d.ts +0 -91
- package/dist/commands/check.js +0 -14
- package/dist/commands/demo.d.ts +0 -21
- package/dist/commands/demo.js +0 -8
- package/dist/commands/docs-module-loader.d.ts +0 -2
- package/dist/commands/docs-module-loader.js +0 -8
- package/dist/commands/doctor.d.ts +0 -2
- package/dist/commands/doctor.js +0 -25
- package/dist/commands/init.d.ts +0 -7
- package/dist/commands/init.js +0 -32
- package/dist/commands/repo.d.ts +0 -3
- package/dist/commands/repo.js +0 -9
- package/dist/commands/scaffold.d.ts +0 -4
- package/dist/commands/scaffold.js +0 -32
- package/dist/commands/shared-deps.d.ts +0 -21
- package/dist/commands/shared-deps.js +0 -11
- package/dist/commands/upgrade-codemods.d.ts +0 -42
- package/dist/commands/upgrade-codemods.js +0 -15
- package/dist/commands/upgrade-planner.d.ts +0 -58
- package/dist/commands/upgrade-planner.js +0 -8
- package/dist/commands/upgrade-workspace.d.ts +0 -2
- package/dist/commands/upgrade-workspace.js +0 -16
- package/dist/commands/upgrade.d.ts +0 -221
- package/dist/commands/upgrade.js +0 -25
- package/dist/create/index.d.ts +0 -5
- package/dist/create/index.js +0 -30
- package/dist/create/planner.d.ts +0 -3
- package/dist/create/planner.js +0 -22
- package/dist/create/presets.d.ts +0 -3
- package/dist/create/presets.js +0 -12
- package/dist/create/types.d.ts +0 -2
- package/dist/create/types.js +0 -1
- package/dist/engine/blocks.d.ts +0 -3
- package/dist/engine/blocks.js +0 -12
- package/dist/engine/collector.d.ts +0 -2
- package/dist/engine/collector.js +0 -8
- package/dist/engine/config.d.ts +0 -3
- package/dist/engine/config.js +0 -15
- package/dist/engine/dependency-versions.d.ts +0 -12
- package/dist/engine/dependency-versions.js +0 -12
- package/dist/engine/executor.d.ts +0 -3
- package/dist/engine/executor.js +0 -19
- package/dist/engine/index.d.ts +0 -8
- package/dist/engine/index.js +0 -68
- package/dist/engine/names.d.ts +0 -2
- package/dist/engine/names.js +0 -24
- package/dist/engine/post-scaffold.d.ts +0 -3
- package/dist/engine/post-scaffold.js +0 -8
- package/dist/engine/render-plan.d.ts +0 -7
- package/dist/engine/render-plan.js +0 -9
- package/dist/engine/template.d.ts +0 -3
- package/dist/engine/template.js +0 -17
- package/dist/engine/types.d.ts +0 -2
- package/dist/engine/types.js +0 -8
- package/dist/engine/workspace.d.ts +0 -3
- package/dist/engine/workspace.js +0 -20
- package/dist/manifest.d.ts +0 -71
- package/dist/manifest.js +0 -16
- package/dist/output-mode.d.ts +0 -2
- package/dist/output-mode.js +0 -10
- package/dist/shared/outfitter-109s75x0.d.ts +0 -76
- package/dist/shared/outfitter-1fy7byz5.js +0 -170
- package/dist/shared/outfitter-1h7k8xxt.js +0 -29
- package/dist/shared/outfitter-20f6a2n4.js +0 -35
- package/dist/shared/outfitter-344t1r38.js +0 -1
- package/dist/shared/outfitter-4q1zfmvc.js +0 -154
- package/dist/shared/outfitter-4s9meh3j.js +0 -221
- package/dist/shared/outfitter-5akzvppx.js +0 -125
- package/dist/shared/outfitter-5y646xzk.js +0 -301
- package/dist/shared/outfitter-5yjr404v.d.ts +0 -22
- package/dist/shared/outfitter-63gse8fv.js +0 -316
- package/dist/shared/outfitter-6bkqjk86.d.ts +0 -3
- package/dist/shared/outfitter-6fgk6adm.d.ts +0 -40
- package/dist/shared/outfitter-79vfxt6y.js +0 -269
- package/dist/shared/outfitter-7ch26yq8.js +0 -885
- package/dist/shared/outfitter-7r12fj7f.js +0 -30
- package/dist/shared/outfitter-8y2dfx6n.js +0 -11
- package/dist/shared/outfitter-9x1brcmq.js +0 -184
- package/dist/shared/outfitter-a79xrm12.d.ts +0 -17
- package/dist/shared/outfitter-amc4jbs1.d.ts +0 -50
- package/dist/shared/outfitter-bn9c8p2e.js +0 -204
- package/dist/shared/outfitter-bpr28y54.js +0 -70
- package/dist/shared/outfitter-dpj9erew.d.ts +0 -4
- package/dist/shared/outfitter-e9rrfekb.d.ts +0 -51
- package/dist/shared/outfitter-ehp18x1n.js +0 -1
- package/dist/shared/outfitter-f9znfhkn.d.ts +0 -5
- package/dist/shared/outfitter-fhnjpjwc.d.ts +0 -18
- package/dist/shared/outfitter-fn20r49x.d.ts +0 -5
- package/dist/shared/outfitter-h3q6ae6d.d.ts +0 -48
- package/dist/shared/outfitter-ha89qf8q.js +0 -132
- package/dist/shared/outfitter-hsp8vy5m.d.ts +0 -146
- package/dist/shared/outfitter-hvsaxgcp.js +0 -1
- package/dist/shared/outfitter-j833sxws.js +0 -61
- package/dist/shared/outfitter-ksyvwmb5.js +0 -191
- package/dist/shared/outfitter-m3ehh37q.d.ts +0 -22
- package/dist/shared/outfitter-m44n0qzw.js +0 -161
- package/dist/shared/outfitter-mdt37hqm.js +0 -4
- package/dist/shared/outfitter-mt7d1ek2.js +0 -698
- package/dist/shared/outfitter-mtbpabf3.js +0 -91
- package/dist/shared/outfitter-n9g1zk4x.d.ts +0 -66
- package/dist/shared/outfitter-p71qb0f0.js +0 -82
- package/dist/shared/outfitter-pcj9gg2g.js +0 -909
- package/dist/shared/outfitter-pj9vp00r.js +0 -601
- package/dist/shared/outfitter-qakwgrrh.d.ts +0 -4
- package/dist/shared/outfitter-r419zfgs.d.ts +0 -30
- package/dist/shared/outfitter-s7jetkge.d.ts +0 -18
- package/dist/shared/outfitter-ttjr95y9.js +0 -98
- package/dist/shared/outfitter-vh4xgb93.js +0 -35
- package/dist/shared/outfitter-w1j80j1r.js +0 -326
- package/dist/shared/outfitter-xe5mzgdc.js +0 -208
- package/dist/shared/outfitter-ybbazsxq.d.ts +0 -14
- package/dist/shared/outfitter-yraebrmw.d.ts +0 -5
- package/dist/shared/outfitter-yvksv5qb.js +0 -322
- package/dist/shared/outfitter-z0we32cp.d.ts +0 -63
- package/dist/shared/outfitter-z5sx06qe.d.ts +0 -25
- package/dist/shared/outfitter-zwyvewr1.js +0 -36
- package/dist/targets/index.d.ts +0 -4
- package/dist/targets/index.js +0 -29
- package/dist/targets/registry.d.ts +0 -3
- package/dist/targets/registry.js +0 -28
- package/dist/targets/types.d.ts +0 -2
- package/dist/targets/types.js +0 -1
- package/template-versions.json +0 -22
- package/templates/.gitkeep +0 -0
- package/templates/basic/.gitignore.template +0 -30
- package/templates/basic/.lefthook.yml.template +0 -26
- package/templates/basic/package.json.template +0 -46
- package/templates/basic/src/index.ts.template +0 -26
- package/templates/basic/tsconfig.json.template +0 -34
- package/templates/cli/.gitignore.template +0 -4
- package/templates/cli/.lefthook.yml.template +0 -26
- package/templates/cli/README.md.template +0 -35
- package/templates/cli/biome.json.template +0 -4
- package/templates/cli/package.json.template +0 -53
- package/templates/cli/src/cli.ts.template +0 -8
- package/templates/cli/src/index.ts.template +0 -7
- package/templates/cli/src/program.ts.template +0 -31
- package/templates/cli/tsconfig.json.template +0 -34
- package/templates/daemon/.gitignore.template +0 -4
- package/templates/daemon/.lefthook.yml.template +0 -26
- package/templates/daemon/README.md.template +0 -67
- package/templates/daemon/biome.json.template +0 -4
- package/templates/daemon/package.json.template +0 -56
- package/templates/daemon/src/cli.ts.template +0 -96
- package/templates/daemon/src/daemon-main.ts.template +0 -79
- package/templates/daemon/src/daemon.ts.template +0 -11
- package/templates/daemon/src/index.ts.template +0 -7
- package/templates/daemon/tsconfig.json.template +0 -23
- package/templates/full-stack/.gitignore.template +0 -30
- package/templates/full-stack/README.md.template +0 -30
- package/templates/full-stack/apps/cli/package.json.template +0 -39
- package/templates/full-stack/apps/cli/src/cli.ts.template +0 -24
- package/templates/full-stack/apps/cli/src/index.test.ts.template +0 -18
- package/templates/full-stack/apps/cli/src/index.ts.template +0 -5
- package/templates/full-stack/apps/cli/tsconfig.json.template +0 -37
- package/templates/full-stack/apps/mcp/package.json.template +0 -40
- package/templates/full-stack/apps/mcp/src/index.test.ts.template +0 -18
- package/templates/full-stack/apps/mcp/src/index.ts.template +0 -6
- package/templates/full-stack/apps/mcp/src/mcp.ts.template +0 -22
- package/templates/full-stack/apps/mcp/src/server.ts.template +0 -10
- package/templates/full-stack/apps/mcp/tsconfig.json.template +0 -37
- package/templates/full-stack/package.json.template +0 -16
- package/templates/full-stack/packages/core/package.json.template +0 -36
- package/templates/full-stack/packages/core/src/handlers.ts.template +0 -31
- package/templates/full-stack/packages/core/src/index.test.ts.template +0 -30
- package/templates/full-stack/packages/core/src/index.ts.template +0 -8
- package/templates/full-stack/packages/core/src/types.ts.template +0 -13
- package/templates/full-stack/packages/core/tsconfig.json.template +0 -34
- package/templates/library/.gitignore.template +0 -30
- package/templates/library/README.md.template +0 -29
- package/templates/library/bunup.config.ts.template +0 -20
- package/templates/library/package.json.template +0 -55
- package/templates/library/src/handlers.ts.template +0 -31
- package/templates/library/src/index.test.ts.template +0 -35
- package/templates/library/src/index.ts.template +0 -8
- package/templates/library/src/types.ts.template +0 -13
- package/templates/library/tsconfig.json.template +0 -34
- package/templates/mcp/.gitignore.template +0 -4
- package/templates/mcp/.lefthook.yml.template +0 -26
- package/templates/mcp/README.md.template +0 -54
- package/templates/mcp/biome.json.template +0 -4
- package/templates/mcp/package.json.template +0 -53
- package/templates/mcp/src/index.ts.template +0 -7
- package/templates/mcp/src/mcp.ts.template +0 -33
- package/templates/mcp/src/server.ts.template +0 -8
- package/templates/mcp/tsconfig.json.template +0 -23
- package/templates/minimal/.gitignore.template +0 -30
- package/templates/minimal/.lefthook.yml.template +0 -26
- package/templates/minimal/package.json.template +0 -53
- package/templates/minimal/src/index.ts.template +0 -26
- package/templates/minimal/tsconfig.json.template +0 -34
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
{{description}}
|
|
4
|
-
|
|
5
|
-
## Workspace Layout
|
|
6
|
-
|
|
7
|
-
```text
|
|
8
|
-
{{projectName}}/
|
|
9
|
-
├── apps/
|
|
10
|
-
│ ├── cli/ # CLI surface
|
|
11
|
-
│ └── mcp/ # MCP server surface
|
|
12
|
-
└── packages/
|
|
13
|
-
└── core/ # Shared handler layer
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Development
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
# Install dependencies for all workspace members
|
|
20
|
-
bun install
|
|
21
|
-
|
|
22
|
-
# Build all packages
|
|
23
|
-
bun run build
|
|
24
|
-
|
|
25
|
-
# Typecheck all packages
|
|
26
|
-
bun run typecheck
|
|
27
|
-
|
|
28
|
-
# Run all tests
|
|
29
|
-
bun run test
|
|
30
|
-
```
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}-cli",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "CLI surface for {{projectName}}",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"{{projectName}}": "./dist/cli.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.js"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "bun build src/cli.ts --outdir dist --target bun && bun build src/index.ts --outdir dist --target bun --sourcemap",
|
|
19
|
-
"dev": "bun --watch src/cli.ts",
|
|
20
|
-
"test": "bun test",
|
|
21
|
-
"test:watch": "bun test --watch",
|
|
22
|
-
"typecheck": "tsc --noEmit",
|
|
23
|
-
"lint": "biome check .",
|
|
24
|
-
"lint:fix": "biome check . --write",
|
|
25
|
-
"format": "biome format --write .",
|
|
26
|
-
"clean:artifacts": "rm -rf dist .turbo"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"{{packageName}}-core": "workspace:*",
|
|
30
|
-
"@outfitter/cli": "workspace:*",
|
|
31
|
-
"@outfitter/contracts": "workspace:*"
|
|
32
|
-
},
|
|
33
|
-
"devDependencies": {
|
|
34
|
-
"@biomejs/biome": "^2.4.4",
|
|
35
|
-
"@types/bun": "^1.3.9",
|
|
36
|
-
"typescript": "^5.9.3"
|
|
37
|
-
},
|
|
38
|
-
"license": "MIT"
|
|
39
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createContext } from "@outfitter/contracts";
|
|
2
|
-
import { output } from "@outfitter/cli";
|
|
3
|
-
import { createGreeting } from "{{packageName}}-core";
|
|
4
|
-
|
|
5
|
-
export async function runCli(argv: readonly string[] = process.argv): Promise<void> {
|
|
6
|
-
const args = argv.slice(2);
|
|
7
|
-
const name =
|
|
8
|
-
args.find((arg) => !arg.startsWith("-")) ?? "World";
|
|
9
|
-
const excited = args.includes("--excited");
|
|
10
|
-
const result = await createGreeting(
|
|
11
|
-
{ name, excited },
|
|
12
|
-
createContext({ cwd: process.cwd(), env: process.env })
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
if (result.isErr()) {
|
|
16
|
-
throw result.error;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
await output(result.value.message, { mode: "human" });
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
if (import.meta.main) {
|
|
23
|
-
await runCli();
|
|
24
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { createContext } from "@outfitter/contracts";
|
|
3
|
-
import { createGreeting } from "{{packageName}}-core";
|
|
4
|
-
|
|
5
|
-
describe("cli surface", () => {
|
|
6
|
-
test("can use shared core handler", async () => {
|
|
7
|
-
const result = await createGreeting(
|
|
8
|
-
{ name: "CLI", excited: true },
|
|
9
|
-
createContext({ cwd: process.cwd(), env: process.env })
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
expect(result.isOk()).toBe(true);
|
|
13
|
-
if (result.isErr()) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
expect(result.value.message).toBe("Hello, CLI!");
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"lib": ["ESNext"],
|
|
8
|
-
"types": ["@types/bun"],
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"paths": {
|
|
11
|
-
"{{packageName}}-core": ["../../packages/core/src/index.ts"]
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noImplicitAny": true,
|
|
16
|
-
"strictNullChecks": true,
|
|
17
|
-
"noUncheckedIndexedAccess": true,
|
|
18
|
-
"exactOptionalPropertyTypes": true,
|
|
19
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
-
"noImplicitReturns": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
|
|
23
|
-
"declaration": true,
|
|
24
|
-
"declarationMap": true,
|
|
25
|
-
"sourceMap": true,
|
|
26
|
-
"outDir": "./dist",
|
|
27
|
-
|
|
28
|
-
"esModuleInterop": true,
|
|
29
|
-
"forceConsistentCasingInFileNames": true,
|
|
30
|
-
"isolatedModules": true,
|
|
31
|
-
"verbatimModuleSyntax": true,
|
|
32
|
-
"skipLibCheck": true,
|
|
33
|
-
"resolveJsonModule": true
|
|
34
|
-
},
|
|
35
|
-
"include": ["src/**/*"],
|
|
36
|
-
"exclude": ["node_modules", "dist"]
|
|
37
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}-mcp",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "MCP surface for {{projectName}}",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"{{projectName}}-mcp": "./dist/server.js"
|
|
8
|
-
},
|
|
9
|
-
"main": "./dist/index.js",
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./dist/index.d.ts",
|
|
14
|
-
"import": "./dist/index.js"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "bun build src/server.ts --outdir dist --target bun && bun build src/index.ts --outdir dist --target bun --sourcemap",
|
|
19
|
-
"dev": "bun --watch src/server.ts",
|
|
20
|
-
"test": "bun test",
|
|
21
|
-
"test:watch": "bun test --watch",
|
|
22
|
-
"typecheck": "tsc --noEmit",
|
|
23
|
-
"lint": "biome check .",
|
|
24
|
-
"lint:fix": "biome check . --write",
|
|
25
|
-
"format": "biome format --write .",
|
|
26
|
-
"clean:artifacts": "rm -rf dist .turbo"
|
|
27
|
-
},
|
|
28
|
-
"dependencies": {
|
|
29
|
-
"{{packageName}}-core": "workspace:*",
|
|
30
|
-
"@outfitter/contracts": "workspace:*",
|
|
31
|
-
"@outfitter/mcp": "workspace:*",
|
|
32
|
-
"zod": "^4.3.5"
|
|
33
|
-
},
|
|
34
|
-
"devDependencies": {
|
|
35
|
-
"@biomejs/biome": "^2.4.4",
|
|
36
|
-
"@types/bun": "^1.3.9",
|
|
37
|
-
"typescript": "^5.9.3"
|
|
38
|
-
},
|
|
39
|
-
"license": "MIT"
|
|
40
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { createContext } from "@outfitter/contracts";
|
|
3
|
-
import { createGreeting } from "{{packageName}}-core";
|
|
4
|
-
|
|
5
|
-
describe("mcp surface", () => {
|
|
6
|
-
test("can use shared core handler", async () => {
|
|
7
|
-
const result = await createGreeting(
|
|
8
|
-
{ name: "MCP" },
|
|
9
|
-
createContext({ cwd: process.cwd(), env: process.env })
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
expect(result.isOk()).toBe(true);
|
|
13
|
-
if (result.isErr()) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
expect(result.value.message).toBe("Hello, MCP.");
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { createGreeting } from "{{packageName}}-core";
|
|
2
|
-
import { createMcpServer, defineTool } from "@outfitter/mcp";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
const server = createMcpServer({
|
|
6
|
-
name: "{{projectName}}-mcp",
|
|
7
|
-
version: "{{version}}",
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
const greetTool = defineTool({
|
|
11
|
-
name: "greet",
|
|
12
|
-
description: "Generate greeting via shared core handler",
|
|
13
|
-
inputSchema: z.object({
|
|
14
|
-
name: z.string().default("World").describe("Name to greet"),
|
|
15
|
-
excited: z.boolean().default(false),
|
|
16
|
-
}),
|
|
17
|
-
handler: async (input, ctx) => createGreeting(input, ctx),
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
server.registerTool(greetTool);
|
|
21
|
-
|
|
22
|
-
export { server };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"lib": ["ESNext"],
|
|
8
|
-
"types": ["@types/bun"],
|
|
9
|
-
"baseUrl": ".",
|
|
10
|
-
"paths": {
|
|
11
|
-
"{{packageName}}-core": ["../../packages/core/src/index.ts"]
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noImplicitAny": true,
|
|
16
|
-
"strictNullChecks": true,
|
|
17
|
-
"noUncheckedIndexedAccess": true,
|
|
18
|
-
"exactOptionalPropertyTypes": true,
|
|
19
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
-
"noImplicitReturns": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
|
|
23
|
-
"declaration": true,
|
|
24
|
-
"declarationMap": true,
|
|
25
|
-
"sourceMap": true,
|
|
26
|
-
"outDir": "./dist",
|
|
27
|
-
|
|
28
|
-
"esModuleInterop": true,
|
|
29
|
-
"forceConsistentCasingInFileNames": true,
|
|
30
|
-
"isolatedModules": true,
|
|
31
|
-
"verbatimModuleSyntax": true,
|
|
32
|
-
"skipLibCheck": true,
|
|
33
|
-
"resolveJsonModule": true
|
|
34
|
-
},
|
|
35
|
-
"include": ["src/**/*"],
|
|
36
|
-
"exclude": ["node_modules", "dist"]
|
|
37
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "{{version}}",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"workspaces": ["apps/*", "packages/*"],
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "bun run --filter '*' build",
|
|
9
|
-
"dev": "bun run --filter '*' dev",
|
|
10
|
-
"test": "bun run --filter '*' test",
|
|
11
|
-
"typecheck": "bun run --filter '*' typecheck",
|
|
12
|
-
"lint": "bun run --filter '*' lint",
|
|
13
|
-
"lint:fix": "bun run --filter '*' lint:fix",
|
|
14
|
-
"format": "bun run --filter '*' format"
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}-core",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "Shared handlers for {{projectName}}",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"build": "bun build src/index.ts --outdir dist --format=esm && tsc --emitDeclarationOnly --outDir dist",
|
|
16
|
-
"dev": "bun --watch src/index.ts",
|
|
17
|
-
"test": "bun test",
|
|
18
|
-
"test:watch": "bun test --watch",
|
|
19
|
-
"typecheck": "tsc --noEmit",
|
|
20
|
-
"lint": "biome check .",
|
|
21
|
-
"lint:fix": "biome check . --write",
|
|
22
|
-
"format": "biome format --write .",
|
|
23
|
-
"clean:artifacts": "rm -rf dist .turbo"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@outfitter/contracts": "workspace:*",
|
|
27
|
-
"@outfitter/logging": "workspace:*",
|
|
28
|
-
"zod": "^4.3.5"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@biomejs/biome": "^2.4.4",
|
|
32
|
-
"@types/bun": "^1.3.9",
|
|
33
|
-
"typescript": "^5.9.3"
|
|
34
|
-
},
|
|
35
|
-
"license": "MIT"
|
|
36
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Result, ValidationError, type Handler } from "@outfitter/contracts";
|
|
2
|
-
import { createLogger } from "@outfitter/logging";
|
|
3
|
-
import { greetingInputSchema, type Greeting } from "./types.js";
|
|
4
|
-
|
|
5
|
-
const logger = createLogger({ name: "{{projectName}}-core" });
|
|
6
|
-
|
|
7
|
-
export const createGreeting: Handler<unknown, Greeting, ValidationError> = async (
|
|
8
|
-
input,
|
|
9
|
-
ctx
|
|
10
|
-
) => {
|
|
11
|
-
const parsed = greetingInputSchema.safeParse(input);
|
|
12
|
-
if (!parsed.success) {
|
|
13
|
-
return Result.err(
|
|
14
|
-
new ValidationError({
|
|
15
|
-
message: "Invalid greeting input",
|
|
16
|
-
field: "name",
|
|
17
|
-
})
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const suffix = parsed.data.excited ? "!" : ".";
|
|
22
|
-
const greeting: Greeting = {
|
|
23
|
-
message: `Hello, ${parsed.data.name}${suffix}`,
|
|
24
|
-
issuedAt: new Date().toISOString(),
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
logger.info(`Created greeting for ${parsed.data.name}`, {
|
|
28
|
-
requestId: ctx.requestId,
|
|
29
|
-
});
|
|
30
|
-
return Result.ok(greeting);
|
|
31
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { describe, expect, test } from "bun:test";
|
|
2
|
-
import { createContext } from "@outfitter/contracts";
|
|
3
|
-
import { createGreeting } from "./handlers.js";
|
|
4
|
-
|
|
5
|
-
describe("createGreeting", () => {
|
|
6
|
-
test("returns greeting for valid input", async () => {
|
|
7
|
-
const result = await createGreeting(
|
|
8
|
-
{ name: "Outfitter", excited: true },
|
|
9
|
-
createContext({ cwd: process.cwd(), env: process.env })
|
|
10
|
-
);
|
|
11
|
-
|
|
12
|
-
expect(result.isOk()).toBe(true);
|
|
13
|
-
if (result.isErr()) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
expect(result.value.message).toBe("Hello, Outfitter!");
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
test("returns validation error for invalid input", async () => {
|
|
20
|
-
const result = await createGreeting(
|
|
21
|
-
{ name: "" },
|
|
22
|
-
createContext({ cwd: process.cwd(), env: process.env })
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
expect(result.isErr()).toBe(true);
|
|
26
|
-
if (result.isErr()) {
|
|
27
|
-
expect(result.error.name).toBe("ValidationError");
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const greetingInputSchema = z.object({
|
|
4
|
-
name: z.string().min(1, "name is required"),
|
|
5
|
-
excited: z.boolean().default(false),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
export type GreetingInput = z.infer<typeof greetingInputSchema>;
|
|
9
|
-
|
|
10
|
-
export interface Greeting {
|
|
11
|
-
readonly message: string;
|
|
12
|
-
readonly issuedAt: string;
|
|
13
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"module": "ESNext",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"lib": ["ESNext"],
|
|
8
|
-
"types": ["@types/bun"],
|
|
9
|
-
|
|
10
|
-
"strict": true,
|
|
11
|
-
"noImplicitAny": true,
|
|
12
|
-
"strictNullChecks": true,
|
|
13
|
-
"noUncheckedIndexedAccess": true,
|
|
14
|
-
"exactOptionalPropertyTypes": true,
|
|
15
|
-
"noPropertyAccessFromIndexSignature": true,
|
|
16
|
-
"noImplicitReturns": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
|
|
19
|
-
"declaration": true,
|
|
20
|
-
"declarationMap": true,
|
|
21
|
-
"sourceMap": true,
|
|
22
|
-
"outDir": "./dist",
|
|
23
|
-
"rootDir": "./src",
|
|
24
|
-
|
|
25
|
-
"esModuleInterop": true,
|
|
26
|
-
"forceConsistentCasingInFileNames": true,
|
|
27
|
-
"isolatedModules": true,
|
|
28
|
-
"verbatimModuleSyntax": true,
|
|
29
|
-
"skipLibCheck": true,
|
|
30
|
-
"resolveJsonModule": true
|
|
31
|
-
},
|
|
32
|
-
"include": ["src/**/*"],
|
|
33
|
-
"exclude": ["node_modules", "dist"]
|
|
34
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# Dependencies
|
|
2
|
-
node_modules/
|
|
3
|
-
|
|
4
|
-
# Build output
|
|
5
|
-
dist/
|
|
6
|
-
|
|
7
|
-
# IDE
|
|
8
|
-
.idea/
|
|
9
|
-
.vscode/
|
|
10
|
-
*.swp
|
|
11
|
-
*.swo
|
|
12
|
-
|
|
13
|
-
# OS
|
|
14
|
-
.DS_Store
|
|
15
|
-
Thumbs.db
|
|
16
|
-
|
|
17
|
-
# Logs
|
|
18
|
-
*.log
|
|
19
|
-
npm-debug.log*
|
|
20
|
-
|
|
21
|
-
# Environment
|
|
22
|
-
.env
|
|
23
|
-
.env.local
|
|
24
|
-
.env.*.local
|
|
25
|
-
|
|
26
|
-
# Test coverage
|
|
27
|
-
coverage/
|
|
28
|
-
|
|
29
|
-
# Bun
|
|
30
|
-
bun.lockb
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# {{projectName}}
|
|
2
|
-
|
|
3
|
-
{{description}}
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
bun add {{packageName}}
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Development
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
# Install dependencies
|
|
15
|
-
bun install
|
|
16
|
-
|
|
17
|
-
# Build CJS + ESM artifacts
|
|
18
|
-
bun run build
|
|
19
|
-
|
|
20
|
-
# Typecheck
|
|
21
|
-
bun run typecheck
|
|
22
|
-
|
|
23
|
-
# Run tests
|
|
24
|
-
bun run test
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## License
|
|
28
|
-
|
|
29
|
-
MIT
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineWorkspace } from "bunup";
|
|
2
|
-
|
|
3
|
-
export default defineWorkspace(
|
|
4
|
-
[
|
|
5
|
-
{
|
|
6
|
-
name: "{{packageName}}",
|
|
7
|
-
root: ".",
|
|
8
|
-
},
|
|
9
|
-
],
|
|
10
|
-
{
|
|
11
|
-
entry: ["src/**/*.ts", "!src/**/*.test.ts", "!src/**/__tests__/**"],
|
|
12
|
-
sourceBase: "./src",
|
|
13
|
-
format: ["esm", "cjs"],
|
|
14
|
-
dts: true,
|
|
15
|
-
exports: true,
|
|
16
|
-
splitting: true,
|
|
17
|
-
clean: true,
|
|
18
|
-
target: "bun",
|
|
19
|
-
}
|
|
20
|
-
);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{packageName}}",
|
|
3
|
-
"version": "{{version}}",
|
|
4
|
-
"description": "{{description}}",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.cjs",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
12
|
-
"sideEffects": false,
|
|
13
|
-
"exports": {
|
|
14
|
-
".": {
|
|
15
|
-
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.js",
|
|
17
|
-
"require": "./dist/index.cjs"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "bunup",
|
|
22
|
-
"dev": "bun --watch src/index.ts",
|
|
23
|
-
"test": "bun test",
|
|
24
|
-
"test:watch": "bun test --watch",
|
|
25
|
-
"typecheck": "tsc --noEmit",
|
|
26
|
-
"lint": "biome check .",
|
|
27
|
-
"lint:fix": "biome check . --write",
|
|
28
|
-
"format": "biome format --write .",
|
|
29
|
-
"clean:artifacts": "rm -rf dist .turbo",
|
|
30
|
-
"clean": "rm -rf dist"
|
|
31
|
-
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@outfitter/contracts": "workspace:*",
|
|
34
|
-
"@outfitter/logging": "workspace:*",
|
|
35
|
-
"zod": "^4.3.5"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@biomejs/biome": "^2.4.4",
|
|
39
|
-
"@types/bun": "^1.3.9",
|
|
40
|
-
"bunup": "^0.16.29",
|
|
41
|
-
"typescript": "^5.9.3"
|
|
42
|
-
},
|
|
43
|
-
"outfitter": {
|
|
44
|
-
"template": {
|
|
45
|
-
"kind": "library",
|
|
46
|
-
"placement": "packages",
|
|
47
|
-
"surfaces": []
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"engines": {
|
|
51
|
-
"bun": ">=1.3.9"
|
|
52
|
-
},
|
|
53
|
-
"keywords": [],
|
|
54
|
-
"license": "MIT"
|
|
55
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { Result, ValidationError, type Handler } from "@outfitter/contracts";
|
|
2
|
-
import { createLogger } from "@outfitter/logging";
|
|
3
|
-
import { greetingInputSchema, type Greeting } from "./types.js";
|
|
4
|
-
|
|
5
|
-
const logger = createLogger({ name: "{{projectName}}" });
|
|
6
|
-
|
|
7
|
-
export const createGreeting: Handler<unknown, Greeting, ValidationError> = async (
|
|
8
|
-
input,
|
|
9
|
-
ctx
|
|
10
|
-
) => {
|
|
11
|
-
const parsed = greetingInputSchema.safeParse(input);
|
|
12
|
-
if (!parsed.success) {
|
|
13
|
-
return Result.err(
|
|
14
|
-
new ValidationError({
|
|
15
|
-
message: "Invalid greeting input",
|
|
16
|
-
field: "name",
|
|
17
|
-
})
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const suffix = parsed.data.excited ? "!" : ".";
|
|
22
|
-
const greeting: Greeting = {
|
|
23
|
-
message: `Hello, ${parsed.data.name}${suffix}`,
|
|
24
|
-
issuedAt: new Date().toISOString(),
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
logger.info(`Created greeting for ${parsed.data.name}`, {
|
|
28
|
-
requestId: ctx.requestId,
|
|
29
|
-
});
|
|
30
|
-
return Result.ok(greeting);
|
|
31
|
-
};
|