@mostajs/orm-cli 0.6.2 → 0.6.3

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.
Files changed (2) hide show
  1. package/bin/mostajs.sh +16 -3
  2. package/package.json +1 -1
package/bin/mostajs.sh CHANGED
@@ -3947,7 +3947,7 @@ run_subcommand() {
3947
3947
  local cli_dir
3948
3948
  cli_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
3949
3949
  detect_project
3950
- [[ ${#DETECTED_TYPES[@]} -eq 0 ]] && { err "No schema found. Bootstrap needs a prisma/schema.prisma (or OpenAPI/JSONSchema)."; exit 1; }
3950
+ [[ ${#DETECTED_TYPES[@]} -eq 0 ]] && { err "No schema found. Bootstrap needs a prisma/schema.prisma, OpenAPI/JSONSchema, or schemas.mjs/schemas.ts."; exit 1; }
3951
3951
 
3952
3952
  local BS_OK_CODEMOD=0 BS_OK_DEPS=0 BS_OK_CONVERT=0 BS_OK_DDL=0
3953
3953
 
@@ -3980,10 +3980,23 @@ run_subcommand() {
3980
3980
  prisma) input="$PRISMA_SCHEMA" ;;
3981
3981
  openapi) input="$OPENAPI_FILE" ;;
3982
3982
  jsonschema) input="${JSON_SCHEMAS[0]}" ;;
3983
+ native) input="$NATIVE_SCHEMA" ;;
3983
3984
  esac
3984
3985
 
3985
- if run_adapter_convert "$type" "$input" "$GENERATED_DIR/entities.ts" && \
3986
- [[ -s "$GENERATED_DIR/entities.json" || -s "$GENERATED_DIR/entities.ts" ]]; then
3986
+ local convert_ok=0
3987
+ if [[ "$type" == "native" ]]; then
3988
+ if run_native_convert "$input" "$GENERATED_DIR/entities.ts" && \
3989
+ [[ -s "$GENERATED_DIR/entities.json" || -s "$GENERATED_DIR/entities.ts" ]]; then
3990
+ convert_ok=1
3991
+ fi
3992
+ else
3993
+ if run_adapter_convert "$type" "$input" "$GENERATED_DIR/entities.ts" && \
3994
+ [[ -s "$GENERATED_DIR/entities.json" || -s "$GENERATED_DIR/entities.ts" ]]; then
3995
+ convert_ok=1
3996
+ fi
3997
+ fi
3998
+
3999
+ if [[ $convert_ok -eq 1 ]]; then
3987
4000
  BS_OK_CONVERT=1
3988
4001
  ok " schema converted → $GENERATED_DIR/entities.json"
3989
4002
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mostajs/orm-cli",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Universal CLI to integrate @mostajs/orm into any project — one-shot `mostajs bootstrap` migrates a Prisma project (codemod + deps + schema convert + DDL) to 13 databases with zero code change.",
5
5
  "author": "Dr Hamid MADANI <drmdh@msn.com>",
6
6
  "license": "AGPL-3.0-or-later",