Skip to content

Commit 31e44bc

Browse files
committed
chore: release v3.0.6
1 parent 054c6aa commit 31e44bc

134 files changed

Lines changed: 21423 additions & 39 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/changelog.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,59 @@
22

33
All notable changes to KickJS are documented here.
44

5+
# Release v3.0.6
6+
7+
## New Features
8+
9+
- feat(http): per-module prefix: false to skip apiPrefix + version ([cd26f41](https://github.com/forinda/kick-js/commit/cd26f41052f22172b8d7d3058867be5479682544)) — [@forinda](https://github.com/forinda)
10+
- feat(http): allow apiPrefix: false to mount routes without prefix ([550bc37](https://github.com/forinda/kick-js/commit/550bc37fe5fe2e74dd7f4c3fa36883c270e616db)) — [@forinda](https://github.com/forinda)
11+
- feat: add inertia example app and list inertia in kick new multi-select ([882bd09](https://github.com/forinda/kick-js/commit/882bd091a14b07d7884c0c09be000edc003b695d)) — [@forinda](https://github.com/forinda)
12+
- feat(inertia): add middleware, adapter, and context augmentation ([e15ec97](https://github.com/forinda/kick-js/commit/e15ec978c296c6253c524e3ca7fd345fa8548bbd)) — [@forinda](https://github.com/forinda)
13+
- feat(inertia): add core Inertia class and ServerRenderer ([ff9ff35](https://github.com/forinda/kick-js/commit/ff9ff35ff097ab954f7dfd280dc6ce4f8a36498e)) — [@forinda](https://github.com/forinda)
14+
- feat(inertia): add symbols, types, prop helpers, and defineInertiaConfig ([f08e83e](https://github.com/forinda/kick-js/commit/f08e83ed3515f745267517fc63245d29731aeeb5)) — [@forinda](https://github.com/forinda)
15+
- feat(inertia): scaffold @forinda/kickjs-inertia package ([52868ea](https://github.com/forinda/kick-js/commit/52868ea905b33547cfdc66aba242ce7e1271ac66)) — [@forinda](https://github.com/forinda)
16+
17+
## Bug Fixes
18+
19+
- fix(inertia): migrate example to @forinda/kickjs and fix lazy ctx.inertia ([5007290](https://github.com/forinda/kick-js/commit/5007290891bd2ab9ea40bc24f2e29b4ed30aee2a)) — [@forinda](https://github.com/forinda)
20+
- fix(inertia): suppress Vite dynamic import warning in ServerRenderer ([e09a92c](https://github.com/forinda/kick-js/commit/e09a92c8a398e89d8f63e98480bcf715a4461c69)) — [@forinda](https://github.com/forinda)
21+
- fix(http): remove redundant port log in dev mode ([30935cf](https://github.com/forinda/kick-js/commit/30935cfbb3ceba101c232a3c7b87b4dc139023b4)) — [@forinda](https://github.com/forinda)
22+
- fix(vite): respect explicit server.port from user vite.config ([7f670e4](https://github.com/forinda/kick-js/commit/7f670e4431b9eaac3fe1c1b16de554981e88094f)) — [@forinda](https://github.com/forinda)
23+
- fix(inertia): intercept writeHead for 302→303 rewrite ([e9cd208](https://github.com/forinda/kick-js/commit/e9cd208acbab3a74504c88ea27cec332cd7b131e)) — [@forinda](https://github.com/forinda)
24+
- fix(http): log actual Vite port in dev mode ([64e1d9f](https://github.com/forinda/kick-js/commit/64e1d9f7d1556dc8e263f13acdc6b06b9ef6dc60)) — [@forinda](https://github.com/forinda)
25+
- fix(vite): silence unused parameter warnings in core plugin ([a546773](https://github.com/forinda/kick-js/commit/a5467737d224b738fda5330c16fdf84d4f706742)) — [@forinda](https://github.com/forinda)
26+
- fix(vite): read PORT from .env and inject as server.port ([247620e](https://github.com/forinda/kick-js/commit/247620eb2f3fb5c02d71eca3077129f6c2e09e3c)) — [@forinda](https://github.com/forinda)
27+
- fix(inertia): add RequestContext interface augmentation for typed ctx.inertia ([d172b3e](https://github.com/forinda/kick-js/commit/d172b3ee89a4d7e3c6efc7558e2eb9c8d19ecbf0)) — [@forinda](https://github.com/forinda)
28+
- fix: resolve remaining typecheck errors and add typecheck to pre-commit hook ([169f2ac](https://github.com/forinda/kick-js/commit/169f2acaa02aa26dd56f8f52e01cca7bf98a65ce)) — [@forinda](https://github.com/forinda)
29+
- fix(auth): resolve typecheck errors for bcrypt import and JWKS response type ([30e5e9d](https://github.com/forinda/kick-js/commit/30e5e9df002fece337797298807a9c4511bdb0c3)) — [@forinda](https://github.com/forinda)
30+
- fix(inertia): use type assertion for createViteRuntime import ([fd31f7c](https://github.com/forinda/kick-js/commit/fd31f7ce59e67039babee4bd1dbf4ed5099a74ef)) — [@forinda](https://github.com/forinda)
31+
32+
## Documentation
33+
34+
- docs: document apiPrefix: false option ([8f6498a](https://github.com/forinda/kick-js/commit/8f6498a2ed36d7f2528a9783717395fed62a464b)) — [@forinda](https://github.com/forinda)
35+
- docs: add inertia guide, update auth/config/architecture docs, fix CLI registry ([69046f4](https://github.com/forinda/kick-js/commit/69046f4f76b7e5543c309e9c8ffeb1776ad472a1)) — [@forinda](https://github.com/forinda)
36+
37+
## Maintenance
38+
39+
- chore: remove @forinda/kickjs-inertia package and example ([054c6aa](https://github.com/forinda/kick-js/commit/054c6aaed561e949626bfa7e8e5530327d2f55ec)) — [@forinda](https://github.com/forinda)
40+
- chore: Update inertia example ([e57c6d7](https://github.com/forinda/kick-js/commit/e57c6d7a1b25a092ffe58c4c2a2371aed98e25ed)) — [@forinda](https://github.com/forinda)
41+
42+
## Contributors
43+
44+
- [forinda](https://github.com/forinda)
45+
46+
## Stats
47+
48+
- **23** commits
49+
- **1** contributor(s)
50+
- **23** packages published
51+
52+
---
53+
54+
**Full Changelog**: https://github.com/forinda/kick-js/compare/v3.0.5...v3.0.6
55+
**Packages**: `@forinda/kickjs-ai`, `@forinda/kickjs-auth`, `@forinda/kickjs-cli`, `@forinda/kickjs-config`, `@forinda/kickjs-core`, `@forinda/kickjs-cron`, `@forinda/kickjs-devtools`, `@forinda/kickjs-drizzle`, `@forinda/kickjs-graphql`, `@forinda/kickjs-http`, `@forinda/kickjs-kickjs`, `@forinda/kickjs-mailer`, `@forinda/kickjs-mcp`, `@forinda/kickjs-multi-tenant`, `@forinda/kickjs-notifications`, `@forinda/kickjs-otel`, `@forinda/kickjs-prisma`, `@forinda/kickjs-queue`, `@forinda/kickjs-swagger`, `@forinda/kickjs-testing`, `@forinda/kickjs-vite`, `@forinda/kickjs-vscode-extension`, `@forinda/kickjs-ws`
56+
57+
558
# Release v3.0.5
659

760
## Bug Fixes

docs/versions/3.0.6/api/auth.md

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# @forinda/kickjs-auth
2+
3+
Pluggable authentication — JWT, API key, OAuth, and Passport.js bridge.
4+
5+
## AuthStrategy
6+
7+
```typescript
8+
interface AuthStrategy {
9+
name: string
10+
validate(req: any): Promise<AuthUser | null> | AuthUser | null
11+
}
12+
```
13+
14+
## AuthUser
15+
16+
```typescript
17+
interface AuthUser {
18+
[key: string]: any
19+
}
20+
```
21+
22+
## Decorators
23+
24+
```typescript
25+
function Authenticated(strategy?: string): ClassDecorator & MethodDecorator
26+
function Public(): MethodDecorator
27+
function Roles(...roles: string[]): MethodDecorator
28+
```
29+
30+
## AuthAdapter
31+
32+
```typescript
33+
class AuthAdapter implements AppAdapter {
34+
constructor(options: AuthAdapterOptions)
35+
}
36+
37+
interface AuthAdapterOptions {
38+
strategies: AuthStrategy[]
39+
defaultPolicy?: 'protected' | 'open'
40+
onUnauthorized?: (req: any, res: any) => void
41+
onForbidden?: (req: any, res: any) => void
42+
}
43+
```
44+
45+
## JwtStrategy
46+
47+
```typescript
48+
class JwtStrategy implements AuthStrategy {
49+
name = 'jwt'
50+
constructor(options: JwtStrategyOptions)
51+
}
52+
53+
interface JwtStrategyOptions {
54+
secret: string | Buffer
55+
algorithms?: string[]
56+
tokenFrom?: 'header' | 'query' | 'cookie'
57+
headerName?: string
58+
headerPrefix?: string
59+
queryParam?: string
60+
cookieName?: string
61+
mapPayload?: (payload: any) => AuthUser
62+
}
63+
```
64+
65+
## ApiKeyStrategy
66+
67+
```typescript
68+
class ApiKeyStrategy implements AuthStrategy {
69+
name = 'api-key'
70+
constructor(options: ApiKeyStrategyOptions)
71+
}
72+
73+
interface ApiKeyStrategyOptions {
74+
keys?: Record<string, ApiKeyUser>
75+
validate?: (key: string) => Promise<AuthUser | null> | AuthUser | null
76+
from?: Array<'header' | 'query'>
77+
headerName?: string
78+
queryParam?: string
79+
}
80+
```
81+
82+
## OAuthStrategy
83+
84+
```typescript
85+
class OAuthStrategy implements AuthStrategy {
86+
name: string // 'oauth-{provider}'
87+
constructor(options: OAuthStrategyOptions)
88+
getAuthorizationUrl(state?: string): string
89+
}
90+
91+
interface OAuthStrategyOptions {
92+
provider: 'google' | 'github' | 'discord' | 'microsoft' | 'custom'
93+
clientId: string
94+
clientSecret: string
95+
callbackUrl: string
96+
endpoints?: OAuthEndpoints
97+
scopes?: string[]
98+
mapProfile?: (profile: any, tokens: OAuthTokens) => AuthUser | Promise<AuthUser>
99+
}
100+
```
101+
102+
## PassportBridge
103+
104+
```typescript
105+
class PassportBridge implements AuthStrategy {
106+
constructor(name: string, passportStrategy: any)
107+
}
108+
```
109+
110+
## Constants
111+
112+
```typescript
113+
const AUTH_USER: symbol // DI token for current user
114+
const AUTH_META: {
115+
AUTHENTICATED: symbol
116+
PUBLIC: symbol
117+
ROLES: symbol
118+
STRATEGY: symbol
119+
}
120+
```

docs/versions/3.0.6/api/cli.md

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# @forinda/kickjs-cli
2+
3+
Command-line interface for scaffolding projects, generating code, and running the dev server.
4+
5+
## Installation
6+
7+
```bash
8+
# Global install
9+
pnpm add -g @forinda/kickjs-cli
10+
11+
# Or use npx
12+
npx @forinda/kickjs-cli new my-api
13+
```
14+
15+
### Link local build (for contributors)
16+
17+
```bash
18+
pnpm build
19+
cd packages/cli && pnpm link --global
20+
```
21+
22+
`kick` now points to your local build. Re-run `pnpm build` after changes.
23+
24+
## CLI Commands
25+
26+
| Command | Alias | Description |
27+
|---------|-------|-------------|
28+
| `kick new <name>` | `kick init` | Create a new KickJS project |
29+
| `kick dev` | | Start dev server with Vite HMR |
30+
| `kick list` | `kick ls` | List all available KickJS packages |
31+
| `kick add <packages...>` | | Install KickJS packages with peer deps |
32+
| `kick generate --list` | `kick g --list` | List all available generators |
33+
| `kick generate module <name>` | `kick g module` | Generate a full DDD module with all layers |
34+
| `kick generate scaffold <name> <fields...>` | `kick g scaffold` | CRUD module from field definitions (`name:type:optional`) |
35+
| `kick generate adapter <name>` | `kick g adapter` | Generate an AppAdapter scaffold |
36+
| `kick generate middleware <name>` | `kick g middleware` | Generate an Express middleware function |
37+
| `kick generate guard <name>` | `kick g guard` | Generate a route guard |
38+
| `kick generate service <name>` | `kick g service` | Generate a `@Service()` class |
39+
| `kick generate controller <name>` | `kick g controller` | Generate a `@Controller()` class with routes |
40+
| `kick generate dto <name>` | `kick g dto` | Generate a Zod DTO schema |
41+
| `kick generate resolver <name>` | `kick g resolver` | Generate a GraphQL `@Resolver` class |
42+
| `kick generate job <name>` | `kick g job` | Generate a `@Job` queue processor |
43+
| `kick generate test <name>` | `kick g test` | Generate a Vitest test scaffold |
44+
| `kick generate config` | `kick g config` | Generate `kick.config.ts` |
45+
| `kick info` | | Print system and framework info |
46+
| `kick inspect` | | Inspect a running KickJS application |
47+
| `kick tinker` | | Interactive REPL |
48+
49+
### Command Options
50+
51+
**kick new [name]** (use `.` for current directory)
52+
- `-d, --directory <dir>` -- Target directory (defaults to project name)
53+
- `--pm <manager>` -- Package manager: `pnpm` | `npm` | `yarn` (prompted if omitted)
54+
- `--git / --no-git` -- Initialize git repository (prompted if omitted)
55+
- `--install / --no-install` -- Install dependencies (prompted if omitted)
56+
57+
**kick dev**
58+
- `-e, --entry <file>` -- Entry file (default: `src/index.ts`)
59+
- `-p, --port <port>` -- Port number
60+
61+
**kick g module**
62+
- `--pattern <type>` -- Module structure: `rest` | `ddd` | `cqrs` | `minimal` (default: from config or `ddd`)
63+
- `--no-entity` -- Skip entity and value object generation (DDD only)
64+
- `--no-tests` -- Skip test file generation
65+
- `--repo <type>` -- Repository implementation: `inmemory` | `drizzle` | `prisma` (default: from config or `inmemory`)
66+
- `--minimal` -- Shorthand for `--pattern minimal`
67+
- `--modules-dir <dir>` -- Modules directory (default: from config or `src/modules`)
68+
- `-f, --force` -- Overwrite existing files without prompting
69+
70+
**kick g controller / service / dto / guard / middleware**
71+
- `-o, --out <dir>` -- Output directory (overrides `--module`)
72+
- `-m, --module <name>` -- Place inside a module's DDD folder structure
73+
74+
**kick g adapter / resolver / job**
75+
- `-o, --out <dir>` -- Output directory (defaults vary per generator)
76+
77+
## defineConfig
78+
79+
Helper to define a type-safe `kick.config.ts`.
80+
81+
```typescript
82+
function defineConfig(config: KickConfig): KickConfig
83+
```
84+
85+
## KickConfig
86+
87+
```typescript
88+
interface KickConfig {
89+
pattern?: 'rest' | 'ddd' | 'cqrs' | 'minimal'
90+
modules?: {
91+
dir?: string // default: 'src/modules'
92+
repo?: 'drizzle' | 'inmemory' | 'prisma' | { name: string }
93+
pluralize?: boolean // default: true
94+
schemaDir?: string // For Drizzle/Prisma schema files
95+
prismaClientPath?: string // Prisma 7: '@/generated/prisma/client'
96+
}
97+
commands?: KickCommandDefinition[]
98+
style?: {
99+
semicolons?: boolean
100+
quotes?: 'single' | 'double'
101+
trailingComma?: 'all' | 'es5' | 'none'
102+
indent?: number
103+
}
104+
// Deprecated (use modules.* instead)
105+
modulesDir?: string // @deprecated - use modules.dir
106+
defaultRepo?: 'drizzle' | 'inmemory' | 'prisma' // @deprecated - use modules.repo
107+
pluralize?: boolean // @deprecated - use modules.pluralize
108+
schemaDir?: string // @deprecated - use modules.schemaDir
109+
}
110+
```
111+
112+
## KickCommandDefinition
113+
114+
Register custom CLI commands via `kick.config.ts`.
115+
116+
```typescript
117+
interface KickCommandDefinition {
118+
name: string // e.g. 'db:migrate'
119+
description: string
120+
steps: string | string[] // shell command(s) to run
121+
aliases?: string[]
122+
}
123+
```
124+
125+
## Programmatic Exports
126+
127+
Generator functions for use outside the CLI.
128+
129+
```typescript
130+
function generateModule(options: ModuleOptions): Promise<string[]>
131+
function generateScaffold(options: ScaffoldOptions): Promise<string[]>
132+
function generateAdapter(options: { name: string; outDir: string }): Promise<string[]>
133+
function generateMiddleware(options: { name: string; outDir: string }): Promise<string[]>
134+
function generateGuard(options: { name: string; outDir: string }): Promise<string[]>
135+
function generateService(options: { name: string; outDir: string }): Promise<string[]>
136+
function generateController(options: { name: string; outDir: string }): Promise<string[]>
137+
function generateDto(options: { name: string; outDir: string }): Promise<string[]>
138+
function generateResolver(options: { name: string; outDir: string }): Promise<string[]>
139+
function generateJob(options: { name: string; outDir: string; queue?: string }): Promise<string[]>
140+
function generateConfig(options: ConfigOptions): Promise<string[]>
141+
function initProject(options: { name: string; directory: string; packageManager: string }): Promise<void>
142+
function loadKickConfig(cwd: string): Promise<KickConfig | null>
143+
```
144+
145+
### RepoType
146+
147+
```typescript
148+
type RepoType = 'drizzle' | 'inmemory' | 'prisma'
149+
```
150+
151+
## Naming Utilities
152+
153+
```typescript
154+
function toPascalCase(str: string): string
155+
function toCamelCase(str: string): string
156+
function toKebabCase(str: string): string
157+
function pluralize(str: string): string
158+
```

docs/versions/3.0.6/api/config.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Config — moved
2+
3+
The configuration APIs (`defineEnv`, `loadEnv`, `getEnv`, `ConfigService`,
4+
`createConfigService`, `baseEnvSchema`, `resetEnvCache`, `reloadEnv`)
5+
no longer live under `API → Packages` because they are no longer a
6+
standalone package — they ship inside `@forinda/kickjs` itself.
7+
8+
➡️ **See the [Configuration guide](../guide/configuration.md)** for the
9+
full reference and worked examples.
10+
11+
## Quick import map
12+
13+
```ts
14+
// All of these come from the unified package now
15+
import {
16+
defineEnv,
17+
loadEnv,
18+
getEnv,
19+
reloadEnv,
20+
resetEnvCache,
21+
baseEnvSchema,
22+
ConfigService,
23+
createConfigService,
24+
} from '@forinda/kickjs'
25+
```
26+
27+
The Vite-only `envWatchPlugin` moved to `@forinda/kickjs-vite`:
28+
29+
```ts
30+
import { envWatchPlugin } from '@forinda/kickjs-vite'
31+
```
32+
33+
::: warning Deprecated package
34+
`@forinda/kickjs-config` still exists as a thin re-export shim for one
35+
release so existing apps don't break — it will be **removed in v3**.
36+
Migrate to `@forinda/kickjs` now.
37+
38+
`.env` file loading is provided by [`dotenv`](https://github.com/motdotla/dotenv),
39+
which is now an **optional peer dependency** of `@forinda/kickjs`. New
40+
projects scaffolded with `kick new` get it pre-installed; existing apps
41+
that rely on `.env` files should add it explicitly:
42+
43+
```bash
44+
pnpm add dotenv
45+
```
46+
47+
Apps that load env via the shell, Docker, or a secret manager don't need
48+
`dotenv` at all.
49+
:::

0 commit comments

Comments
 (0)