v0.12.0

bknd-io/bkndv0.12.0May 1, 2025by dswbx

AI Summary

This release adds a command-line tool to generate TypeScript types, introduces bcrypt password hashing, and enforces stricter media permissions.

Key Highlights

  • Generate Types command: `npx bknd types`
  • Bcrypt password hashing strategy
  • Media permissions enforcement for Guard enabled apps

New Features

  • Type generation CLI
  • Bcrypt strategy
  • Media permission checks

Full Release Notes

## Generate Types (https://github.com/bknd-io/bknd/pull/166)
Whether you define your data structure using the prototype functions or prefer to visually construct it using the Admin UI, you can now let bknd generate types for all your entities by running:

```sh
npx bknd types
```

Make sure to include the generated type definition to your `tsconfig.json`:
```jsonc
{
  // ...
  "include": ["bknd-types.d.ts", /* ... */]
}
```

## Bcrypt hashing (https://github.com/bknd-io/bknd/pull/147)
Along with the previous options of "plain" and "sha256", you can now use "bcrypt" as your password strategy hash:
![CleanShot 2025-05-01 at 10 26 17](https://github.com/user-attachments/assets/978aab89-8af9-4376-92df-89a52085e683)

## Media permissions (https://github.com/bknd-io/bknd/pull/142)
Security is important, and so now when having the Guard enabled, your users' role must include permissions to read, list, upload and delete media files. If you had an admin role with `implicit_allow` enabled, the new permissions are applied automatically. 

## Other Changes
* cleanup: replace console.log/warn with $console, remove commented-out code by @dswbx in https://github.com/bknd-io/bknd/pull/141
* adjust typebox imports and enable TS incremental by @dswbx in https://github.com/bknd-io/bknd/pull/146
* update admin basepath handling and window context integration by @dswbx in https://github.com/bknd-io/bknd/pull/155
* update dependencies in package.json by @dswbx in https://github.com/bknd-io/bknd/pull/156
* add validation logs and improve data validation handling by @dswbx in https://github.com/bknd-io/bknd/pull/157
* modify MediaApi to support custom fetch implementation, defaults to native fetch by @dswbx in https://github.com/bknd-io/bknd/pull/158
* trigger repository-find-[one|many]-[before|after] based on limit by @dswbx in https://github.com/bknd-io/bknd/pull/160
* refactor error handling in authenticator and password strategy by @dswbx in https://github.com/bknd-io/bknd/pull/161
* add disableSubmitOnError prop to NativeForm and export getFlashMessage by @dswbx in https://github.com/bknd-io/bknd/pull/162
* update imports to adjust nodeTestRunner path and remove unused export by @dswbx in https://github.com/bknd-io/bknd/pull/163
* fix sync events not awaited by @dswbx in https://github.com/bknd-io/bknd/pull/164
* Dropzone: extract DropzoneInner and unify state management with zustand by @dswbx in https://github.com/bknd-io/bknd/pull/165
* replace LiquidJs rendering with simplified renderer by @dswbx in https://github.com/bknd-io/bknd/pull/167

**Full Changelog**: https://github.com/bknd-io/bknd/compare/v0.11.2...v0.12.0