The kit. Drop into any GSC Next.js frontend; everything that's not domain content lives here. Wraps @limitless/ui primitives with the app-shaped patterns we keep reimplementing: layout, auth, data display, forms, feedback, navigation. Phase 1 ships the package skeleton: - package.json with 14 sub-exports (./layout · ./auth · ./auth/server · ./auth/middleware · ./shell · ./shell/server · ./data · ./forms · ./feedback · ./navigation · ./api · ./utils + the root and ./css). - Empty module stubs so the import map resolves while later phases fill in real surface area. - Canonical CSS bundle at @gsc/web-kit/css — all.min.css + sidebar-overrides.css + the seven layout-3 background images, copied from chronos and committed in one place so no app has to ship the 1MB sidecar on its own anymore. - tsc-based build + a postbuild script that mirrors @limitless/ui: emits .js + .d.ts, copies styles/, rewrites bare ESM imports to include .js extensions. - Peer deps on next, react, react-dom, bootstrap. - Hard deps on @limitless/ui (file: dep), next-auth, next-intl, zod. Build verified: tsc emits, all 14 export paths resolve under dist/. No functional code yet — Phase 2 lands AppLayout / createAuth / fetchShellConfig and the gscCRM pilot cuts over. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
51 lines
1.6 KiB
Markdown
51 lines
1.6 KiB
Markdown
# `@gsc/web-kit`
|
|
|
|
App skeleton for GSC Next.js frontends. Wraps `@limitless/ui` primitives into a pre-configured layout + auth + data/forms/feedback stack so apps just write their domain pages.
|
|
|
|
See the implementation plan in the parent repo for the full module map. This is a `file:` dep consumed by every GSC frontend.
|
|
|
|
## Install (in a consumer app)
|
|
|
|
```jsonc
|
|
// package.json
|
|
{
|
|
"dependencies": {
|
|
"@gsc/web-kit": "file:../../../templates/gsc-web-kit"
|
|
}
|
|
}
|
|
```
|
|
|
|
## Layered architecture
|
|
|
|
```
|
|
your app
|
|
└── @gsc/web-kit ← this package (layout, auth, data, forms…)
|
|
└── @limitless/ui ← Bootstrap-flavoured primitives
|
|
└── bootstrap
|
|
```
|
|
|
|
## Sub-exports
|
|
|
|
```ts
|
|
import "@gsc/web-kit/css"; // CSS bundle (layout-3 + JetBrains Mono)
|
|
import { AppLayout } from "@gsc/web-kit/layout";
|
|
import { createAuth } from "@gsc/web-kit/auth/server";
|
|
import { fetchShellConfig } from "@gsc/web-kit/shell/server";
|
|
import { EntityList } from "@gsc/web-kit/data";
|
|
import { Form, TextField } from "@gsc/web-kit/forms";
|
|
import { useToast } from "@gsc/web-kit/feedback";
|
|
import { Breadcrumbs } from "@gsc/web-kit/navigation";
|
|
import { createApiClient } from "@gsc/web-kit/api";
|
|
import { formatCurrency } from "@gsc/web-kit/utils";
|
|
```
|
|
|
|
## Phases
|
|
|
|
| Phase | Scope | Status |
|
|
|---|---|---|
|
|
| 1 | Package scaffold + CSS bundle + sub-export stubs | **in progress** |
|
|
| 2 | layout · auth · shell — usable end-to-end with shell-api | planned |
|
|
| 3 | data · forms — EntityList, Form, DefineAction | planned |
|
|
| 4 | feedback · navigation · api · utils | planned |
|
|
| 5 | Roll out to gscCRM / gscChronos / gscAdmin / gscPortal | planned |
|