development-monorepo-pnpm skill: initial import
Full-stack pnpm + Turborepo monorepo skill, independent of the separate backend and frontend monorepo skills it draws on. Repository shape is split four ways at the top level: applications-backend, applications-frontend, packages-backend, packages-frontend — so a path states which runtime a file ends up in. Defaults: NestJS for backend services, React with IBM Carbon Design for browser applications; the project's stated architecture overrides both. Covers workspace globs, the Turborepo pipeline, filtered validation, blast-radius checks, Module Federation, turbo prune image builds, and Helm. Documents one sanctioned cross-boundary dependency: API contract types owned by the backend, imported type-only by the frontend. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import type { ExampleItem, ExampleResult } from "./types.js";
|
||||
|
||||
/**
|
||||
* Wraps a value in an ExampleResult with an ISO timestamp.
|
||||
*/
|
||||
export const wrapResult = <T>(data: T): ExampleResult<T> => ({
|
||||
data,
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Finds an item by id from a list.
|
||||
* Returns undefined when not found.
|
||||
*/
|
||||
export const findById = (
|
||||
items: ExampleItem[],
|
||||
id: string,
|
||||
): ExampleItem | undefined => items.find((item) => item.id === id);
|
||||
|
||||
/**
|
||||
* Converts an ExampleItem to a display string.
|
||||
*/
|
||||
export const toDisplayString = (item: ExampleItem): string =>
|
||||
`[${item.id}] ${item.name}: ${item.value}`;
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from "./types.js";
|
||||
export * from "./example-utils.js";
|
||||
@@ -0,0 +1,10 @@
|
||||
export type ExampleItem = {
|
||||
id: string;
|
||||
name: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type ExampleResult<T> = {
|
||||
data: T;
|
||||
timestamp: string;
|
||||
};
|
||||
Reference in New Issue
Block a user