Skip to content

Latest commit

 

History

History
221 lines (150 loc) · 17.5 KB

File metadata and controls

221 lines (150 loc) · 17.5 KB

[Unreleased]

Features

  • core: add 0 vs 0.0 heuristic for integer/decimal type inference

The AST scanner now infers INTEGER or DECIMAL types based on numeric literal patterns:

  • Numeric literals without decimal point (e.g., 0, 1, 42) → INTEGER
  • Numeric literals with decimal point (e.g., 0.0, 4.5, 1.0) → DECIMAL

This enhancement minimizes the need for field helpers while maintaining type precision.

Examples:

Before (required field helpers):

class Product extends SmrtObject {
  quantity = integer();  // Required for INTEGER column
  price = decimal();     // Required for DECIMAL column
}

After (TypeScript types work):

class Product extends SmrtObject {
  quantity: number = 0;    // → INTEGER (no decimal point)
  price: number = 0.0;     // → DECIMAL (has decimal point)
}

Field helpers still needed for:

  • Relationships: categoryId = foreignKey(Category)
  • Constraints: name = text({ required: true, maxLength: 100 })
  • Nullable decimals: price = decimal({ nullable: true })

Edge cases:

  • 1.0 → DECIMAL (has decimal point)
  • 0. → DECIMAL (has decimal point)
  • 1e10 → INTEGER (no decimal point in literal)

Backward compatibility:

  • Field helpers (integer(), decimal()) still work and take priority
  • Non-breaking change - existing code continues to work

0.7.1 (2025-10-31)

Bug Fixes

0.7.0 (2025-10-31)

Features

  • cli: extract CLI functionality into standalone package (#142) (8f1d71e), closes #135

0.6.1 (2025-10-30)

Bug Fixes

0.6.0 (2025-10-30)

Bug Fixes

BREAKING CHANGES

  • core: SMRT objects must now use Field helpers (text(), decimal(), integer(), boolean(), datetime(), etc.) instead of relying on runtime type inference from property initializers.

Before:

class Product extends SmrtObject {
  name: string = '';
  price: number = 0;
}

After:

class Product extends SmrtObject {
  name = text();
  price = decimal();
}

Changes:

  • registry.ts: Removed primitive type inference logic (lines 277-363)
  • registry.ts: Field detection now only accepts Field helper instances
  • All test files: Updated to use Field helpers explicitly
  • issue-65-nullable-fields.test.ts: Now uses decimal({ nullable: true })

Test results:

0.5.0 (2025-10-30)

Bug Fixes

Code Refactoring

BREAKING CHANGES

  • core: SmrtObject base class no longer includes name field. All SMRT objects must explicitly define name/title/label fields if needed. Slug generation now uses fallback chain: title → label → id (not name).

Note: Packages already compliant (no changes needed):

  • assets: All classes had explicit name = ''
  • places: Both classes had explicit name fields
  • profiles: All relevant classes had explicit name = text({ required: true })
  • products: Product and Category already had explicit name = ''

Test Results:

  • All tests pass (457 passing, 19 skipped)
  • core: Numeric nullable fields now need explicit Field helpers. For numeric fields that can be null, use explicit field definitions: latitude = decimal({ nullable: true })

This is safer than auto-inferring all nullables as decimal.

1.3.1 (2025-10-29)

Bug Fixes

  • core: replace SQLite-specific INSERT OR REPLACE with portable upsert (#100) (e37b706), closes #99

1.3.0 (2025-10-28)

Bug Fixes

  • cli: prevent spinner crash in non-TTY environments (#81) (f19ab7b), closes #80
  • core: add fallback chain for slug generation (#94) (490cea3)
  • core: add schema/utils export to package.json (4df0dc4)
  • core: always use plural collection names in virtual modules (a84cc49), closes #66
  • core: DuckDB schema transformation and connection sharing (#91) (d2877fe), closes #89
  • core: exclude base class properties from schema to prevent circular serialization (#76) (54389ad), closes #75
  • core: generate and export manifest files during package builds (89b66f7), closes #65 #65
  • core: handle readonly properties in loadDataFromDb (ed4940f), closes #62 #61
  • core: handle readonly properties in object initialization (72e6e01)
  • core: prevent node:crypto from bundling in federation builds (80bfdda), closes #58
  • core: simplify system tables initialization tracking (#77) (1900d31), closes #308 #309 #310 #35 #35 #35
  • core: use schema-based detection for inherited Date fields (#88) (9098346), closes #87
  • enable rollupTypes to preserve type-only exports in builds (44ea125), closes #56
  • github-actions: correct package name in triage workflow (751dbbf), closes #70
  • places: add explicit name field to PlaceType model (bfca923), closes #57
  • places: update PlaceType test to use async generateSchema from schema/utils (3f3c35a)
  • svelte: resolve SSR errors in layout and weather components (#95) (b0c02a1)
  • vite-plugin: correct virtual module type generation (fc054d1), closes #66
  • vite-plugin: restore backward-compatible API signatures (#74) (922f8c5), closes #67

Features

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Note: This project intentionally uses 0.x.x versioning to indicate pre-1.0 maturity. Version 1.0.0 will be released when the API is considered stable and production-ready.

[0.4.0] - 2025-10-22

Changed

  • Version Reset: Reset version from 1.2.4 back to 0.4.0 to accurately reflect pre-1.0 maturity status
  • Removed all 1.x.x releases and tags from Git history
  • Updated semantic-release configuration to maintain 0.x.x versioning until API stability

Context

The framework was inadvertently bumped to 1.x.x versions through automated releases. Since the framework is still in active development with potential breaking changes, we've reset to 0.x.x versioning. This better reflects the current state of the project and follows semantic versioning conventions for pre-release software.

All functionality from versions 1.0.0 through 1.2.4 has been preserved - only the version number has changed to align with project maturity.

Recent Features (preserved from 1.x releases)

  • Fixed schema inheritance, browser exports, aliasing, and exports in core and profiles packages
  • Resolved TypeScript type errors across multiple packages
  • Improved documentation build process and deployment workflow
  • Enhanced CI/CD pipeline reliability
  • Fixed conditional exports in Vite configuration
  • Updated package naming to @happyvertical/* namespace
  • Configured GitHub Packages publishing
  • Added workflow SOPs and code review automation
  • Implemented comprehensive testing standards

For version history prior to the reset, see Git commit history before tag v0.4.0.