Repository navigation
Conversation
Swap runtime imports of Sequelize/DataTypes from sequelize-typescript to sequelize across createConnection, Dialect and the five dialect modules, renaming DataType.X to DataTypes.X. ModelBuilder now uses a type-only import for IndexOptions/IndexFieldOptions. Move sequelize-typescript from dependencies to an optional peer dependency (kept in devDependencies). TestRunner constructs the sequelize-typescript Sequelize directly, since its tests exercise decorated models. Refs #75 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add scripts/check-no-sequelize-typescript.js to fail the build if the compiled output contains runtime references to sequelize-typescript, and wire it into build via a new check-deps script. Refs #75 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Ship the package as ESM-only: set "type": "module", add an exports map, and require Node >=22.13.0. Move tsconfig to module "nodenext" targeting ES2022 without downlevelIteration, and add .js suffixes to all relative imports. Bump to TypeScript 6.0.x (dependency/peer range >=5.7 <6.1). Update the CLI to yargs(hideBin(process.argv)). Migrate tests to Jest 30 with the ts-jest ESM preset in jest.config.cjs, replace ts-node-dev with tsx, and rename the check-deps guard script to .cjs. Refs #76 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Move the linter to ESLint 10 flat config. Bump eslint to ^10, @stylistic/eslint-plugin to 5 and @typescript-eslint/parser to 8, and drop @types/eslint. eslintDefaultConfig is now a flat config array using @stylistic/* rules with a files matcher. Linter uses overrideConfigFile: true with baseConfig by default and overrideConfigFile: <path> for --lint-file; the ESLint engine is built in lintFiles with cwd set to the common base directory so files outside the process cwd are linted. Legacy .eslintrc* files and configs using extends/env or a string parser fail fast via a pure assertFlatConfig pointing to the ESLint flat-config migration guide. Type IConfig.lintOptions as a new ILintOptions and add unit tests in src/tests/unit/linter.test.ts. Refs #76 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Introduce a createDialect(name) factory and a DialectName type derived from a DIALECT_NAMES tuple, replacing the dialect switch in src/bin/utils.ts. The root barrel src/index.ts now exports an explicit named list (Dialect, createDialect, ModelBuilder, config and metadata types) while Builder, Linter and utils stay private. ModelBuilder.build() and Dialect.buildTablesMetadata now throw errors with a cause instead of calling process.exit(1); the CLI catches them and exits. The SQLite dialect resolves @vscode/sqlite3 from the user's project and passes it as dialectModule, replacing the sqlite3 devDependency with @vscode/sqlite3. The README programmatic example is rewritten and kept identical to a fixture compiled by a unit test. New unit tests cover createDialect and require() of the root entry from CommonJS (no top-level await), and pretest now builds first. Refs #76, #82, #83 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add docs/adr/0001-esm-only-package.md documenting the ESM-only package decision, and refine the Driver glossary term in CONTEXT.md to cover driver resolution and @vscode/sqlite3. Refs #76 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Rewrite the GitHub Actions workflow around discrete jobs: a checks job (install, typecheck, build, unit tests), a sqlite job, a set-matrix job, integration-latest for PRs (postgres:18, mysql:9.7, mariadb:12.3, mssql 2025-latest) and integration-full for the weekly schedule, v* tags and manual dispatch (8 servers), all driven by GitHub services containers, plus a publish job on v* tags with npm provenance and the next tag for prereleases. Replace the per-dialect docker shell scripts with a dialect-neutral wait-for-db.ts run via tsx (retries authenticate, creates the SQL Server database) and a root docker-compose.yml exposing one profile per dialect. Add test:unit, test:sqlite, test:integration and test:<dialect> npm scripts. Ignore output-models/ at any depth. Refs #77 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
… checks Wrap TestRunner in describe.each over output formats (only decorators today, listed in formats.ts), each writing to a per-format output directory. Add compileGeneratedModels.ts to type-check generated output via the TypeScript API (strict tsc --noEmit equivalent), asserting zero diagnostics per dialect. Add a byte-for-byte SQLite golden fixture under sqlite/golden/decorators, regenerated with npm run test:golden:update (GOLDEN_UPDATE=1). Cover lint -L success and legacy-eslintrc fail-fast through the real ModelBuilder build path in the SQLite suite. Refs #77 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Detect a missing output directory in ModelBuilder with a structural isErrnoException guard instead of instanceof Error, so the test harness no longer pre-creates the directory. Drop the identity format hook and local dialect switch from the test harness in favor of createDialect, reuse DIALECT_NAMES in wait-for-db and bundle its retry settings in a RetryPolicy. Export the ESLint migration-guide URL once from Linter and reuse it in tests, rename findCommonBaseDir/getErrorMessage, and trim comments to describe the current code. Rewrite the README lint section for flat config only with a migration-guide link and a copyable example, and have the programmatic-example test extract the example from README.md and assert it matches the compiled fixture. Refs #76 and #77. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- extend metadata types with FK constraints, paranoid/soft-delete, and association detail fields - add pure helpers for referential-action normalization, FK grouping/merging, and soft-delete resolution - introduce a format-neutral DataTypes mapper shared by all five dialects, replacing generatePrecisionSignature and the ENUM non-null assertion - carry the new fields through caseTransformer - cover each helper with unit tests; SQLite golden output unchanged Refs #78 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- add abstract fetchForeignKeysMetadata to Dialect and fetch FK constraints per generated table, skipping views - merge single-column FK constraints into column metadata when the target table is generated and in the same schema, keeping composite, cross-schema and excluded constraints at table level - preserve discovered FK fields when the associations file names the same target - expose a fetchTableHasTrigger hook on Dialect - implement SQLite fetchForeignKeysMetadata via pragma_foreign_key_list with single-column uniqueness detection and synthesized constraint names; stub the other four dialects to return an empty list - stop ModelBuilder from emitting a self-import for self-referencing models - extend the test harness with two-pass database init (reverse-order drops), a Foreign keys block and expectedForeignKeys metadata - add SQLite fixtures for 1:N with rules, self-reference, unique FK, composite FK and a soft-delete table, and regenerate the SQLite golden fixture Refs #78 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- Postgres reads FK constraints from pg_constraint using unnest WITH ORDINALITY and derives single-column uniqueness from pg_index - MySQL and MariaDB share an information_schema query builder in src/dialects/foreignKeys.ts over referential_constraints, key_column_usage and statistics - MySQL/MariaDB fetchTables now mark views so they skip the FK fetch - Add integration fixtures mirroring the SQLite set (units.race_id with explicit rules, employees self-reference, profiles unique FK, order_lines + shipments composite FK, soft_deletes) with expectedForeignKeys per dialect Refs #78 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- DialectMSSQL lists tables from sys.tables with their schema, filtering on the configured schema when set and qualifying column/index queries by it - fetch foreign key constraints from sys.foreign_keys/sys.foreign_key_columns with single-column uniqueness detection - report enabled triggers from sys.triggers via the fetchTableHasTrigger hook - add exported pure buildTableDecoratorProps helper to ModelBuilder that builds the @table options (tableName, schema, timestamps, hasTrigger, comment) - SQL Server models emit schema unconditionally and hasTrigger: true for tables with triggers to avoid identity insert failures - test harness: run setupQueries before the drop pass, add a Schema and triggers block, MSSQL fixtures for the FK set plus an audited trigger table and stg.tenants; shared FK assertion derives onDelete/onUpdate per dialect - CLI/README: --schema applies to Postgres and SQL Server Refs #78 Refs #37 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- add -P/--paranoid CLI flag (requires --timestamps), mapped to IConfigMetadata.paranoid - resolve paranoid once in Dialect.buildTablesMetadata, warning when timestamps are off - detect deleted_at/deletedAt per non-view table, setting paranoid and deletedAt or warning when absent - emit paranoid and deletedAt after timestamps in buildTableDecoratorProps - add createdAt/updatedAt to soft_deletes fixtures and register paranoidTable across all dialects - add Paranoid integration block and cliConfig unit test - document -P in README options and regenerate SQLite soft_deletes golden Refs #78 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
- Consolidate the four dialect-specific foreign key query row interfaces into one IForeignKeyQueryRow with a shared mapForeignKeyQueryRow mapper in src/dialects/foreignKeys.ts - parseEnumValues returns an empty list for non-enum column types - Remove the per-table "no deleted_at column" paranoid warning, keeping only the missing-timestamps warning (per decision ticket #73) - Give SQLite synthesized foreign key constraint names an id suffix on collision via a pure synthesizeSqliteConstraintName - Require valid indexes (indisvalid) in the Postgres uniqueness check - Use requireConnection/isModelRecord guards in the test harness instead of non-null assertions and ts-ignore, and assert the foreign key with the exact fixture constraint name Refs #78 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add detailed, step-by-step plans for phase 5 (association discovery) and phase 6 (native format emitter) so a later session can implement them without re-planning, and link them from a new Phase plans section in the upgrade plan. Refs #79, #80 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
…ints Add a shared foreign-key classifier (classifyForeignKeyConstraint, with skip reasons composite / cross-schema / excluded-target) in src/dialects/foreignKeys.ts, used by applyForeignKeyConstraintsToColumns. Add a pure module src/dialects/associationDiscovery.ts that derives BelongsTo/HasOne/HasMany associations with aliases, foreignKey/targetKey/ sourceKey and onDelete/onUpdate from FK constraints, plus skip warning formatting. Add IConfigMetadata.associations?: boolean and unit tests. Not yet wired into the pipeline. Part of #79. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
…tions Add a pure `applyAssociationsFile` module that merges CSV-defined associations onto the ones discovered from foreign keys: CSV rows replace the discovered association for the same source table and FK column, junction rows remove nothing, extra CSV associations are appended rather than overwriting, and alias collisions drop the discovered entry with a warning. AssociationsParser now exposes `isJunctionForeignKey` on IForeignKey and caches parses per path, returning structural copies. `caseTransformer` becomes copy-on-transform and also transforms alias, foreignKey and targetKey, so repeated calls no longer compound. Not yet wired into Dialect.ts. Part of #79. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
…ociation decorators Extract exported pure helpers in ModelBuilder: resolveAssociationPropertyName (alias when set, else plural/singular of the target model) and buildAssociationDecoratorProps (decorator options in order as, foreignKey, targetKey, sourceKey, onDelete, onUpdate; as only when an alias exists, undefined when empty), plus an AssociationDecoratorOptions type derived from sequelize option types. Promote buildAssociationPropertyDecl to an exported module-level function using them. Associations without an alias render exactly as before, so golden fixtures are unchanged. Adds unit tests in builders.test.ts. Part of #79 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
…ations Add the `associations` yargs boolean (default true; `--no-associations` disables) in the CLI and map it to `metadata.associations: false` in buildConfig. Dialect `buildTablesMetadata` now runs discoverAssociations, warning once per skipped constraint, applies the associations file on top and then the case transform, replacing the inline CSV block. Regenerate the golden fixtures: profiles gains a BelongsTo person, person gains a HasOne profile, and employees gains the self-referencing manager / managerEmployees pair; units and races are unchanged because the associations file replaces the discovered pair. Add cliConfig unit tests. Part of #79. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add an Association discovery describe block exercising discovery per dialect and per format: 1:N units/races with include counts, 1:1 profiles/person HasOne, composite foreign key skip with a console.warn spy, self-reference manager/managerEmployees, and referential actions derived from each dialect's expectedForeignKeys fixture. Cover override by the associations file, associations: false disabling discovery while keeping @foreignkey, and --case CAMEL aliases. Verified on sqlite, postgres, mysql, mariadb and mssql. Part of #79 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Document the --associations option and --no-associations usage, and rewrite the Associations section: discovery on by default, the cardinality rule, skipped foreign key kinds with their warnings, the alias rule with examples, the generated decorator shape, disabling discovery programmatically, and associations file precedence over discovered associations. Existing CSV documentation kept. Part of #79 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Prepares the 13.0.0-beta.2 prerelease on the npm next dist-tag. Publishing happens through the CI publish job when a human pushes the v13.0.0-beta.2 tag. Part of #79 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Map allowNull from !column.notnull instead of !!column.notnull so NOT NULL columns yield allowNull: false and nullable columns allowNull: true. Regenerate the SQLite decorators golden fixtures to reflect the corrected allowNull values. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Introduce a native/decorators output format vocabulary and wire it through the config and CLI so the format can be selected end-to-end. - add src/config/format.ts with FORMATS, Format, DEFAULT_FORMAT and the isFormat, resolveFormat and shouldNoticeIgnoredStrict helpers plus the STRICT_IGNORED_NOTICE message, covered by src/tests/unit/format.test.ts - add the optional format field to IConfig and re-export the vocabulary - add the -F/--format flag (native|decorators, default native), refresh the -R description and fix the yargs handling so -R and --no-strict both yield strict: false - export the format vocabulary from the package entry point and re-export Format/FORMATS from the integration formats helper Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add standalone TypeScript compiler-API helpers in src/builders/utils.ts (isTsExpression, createPropertyValueExpression, buildObjectLiteralExpression, createTypeNodeFromName, createNullableTypeNode, createGenericTypeReference, createIndexedAccessTypeNode, generateTypeOnlyImport, buildDataTypeExpression, PropertyValue) and default-value descriptor helpers in src/builders/defaultValues.ts (parseDefaultValue, buildDefaultValueExpression, DefaultValueDescriptor). Fix a generateNamedImports deprecation by switching to the non-deprecated createImportClause overload. These helpers are standalone: the existing decorators emitter path is unchanged and the decorators golden fixtures are byte-for-byte identical. Covered by new unit tests in src/tests/unit/defaultValues.test.ts and additions to src/tests/unit/builders.test.ts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Introduce the pure descriptor layer consumed by the upcoming native renderer. classifyAttribute, isCreationOptionalColumn, isParanoidColumn, resolvePrimaryKeyAttribute, collectTableIndexes and isPrimaryKeyIndex classify columns and indexes from existing metadata. resolveAssociationWiring, resolveAssociationForeignKey, buildAssociationMixinDeclarations, collectSequelizeImports and collectModelTypeImports describe association wiring and mixins. Add unit tests covering both modules. No ts.factory, renderer or ModelBuilder changes; the decorators emitter path is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add NativeModelRenderer with renderNativeModelFile(table, dialect, tablesByModel), emitting native-style models via ts.factory: declare fields, InferAttributes/InferCreationAttributes, CreationOptional, ForeignKey<Target['key']>, NonAttribute per association, declare static associations, and static initModel(sequelize), with extensionless import type cross-model references. Reuses the step-2 compiler-API helpers/defaultValues and step-3 descriptor modules without duplicating them. Cover the renderer with unit tests over units, races, employees (self-ref), authors_books (junction), data_types and soft_deletes (paranoid), matching the plan's golden samples at printer/AST level. No ModelBuilder or harness wiring; the decorators emitter path and its fixtures are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Render initModels.ts and the index.ts barrel via the compiler API, and introduce the IGeneratedFile abstraction with renderNativeFiles and writeGeneratedFiles for the native output format. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Dispatch build() on resolveFormat(config): the native path renders via renderNativeFiles + writeGeneratedFiles and emits the strict-ignored notice, while the decorators path moves into a private renderDecoratorsFiles with byte-for-byte unchanged behavior. Both paths keep the zero-tables warning; the decorators path warns when the runtime dependency is missing. Extract isErrnoException into src/utils/errors.ts and narrow the lint catch through it. Move resolveAssociationPropertyName into a neutral associationNaming module to break an import cycle, re-exported from ModelBuilder so the public API is unchanged. Add decoratorsDependency for the never-throwing sequelize-typescript missing warning, and set padded-blocks to blocks never, classes and switches always. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
… SQLite golden fixtures
Run the harness over both output formats: buildModels now injects the
iterated format into ModelBuilder, and a format-aware
registerGeneratedModels loads decorators via index.ts + addModels and
native via initModels.ts + initModels(connection). Use per-format
outDirs and an includeTarget helper so native associations (which
always emit as) are matched by { model, as }, plus format-branched
text assertions.
compileGeneratedModels(dir, format) shares a strict base tsconfig with
per-format overrides: decorators keep experimentalDecorators and
emitDecoratorMetadata with useDefineForClassFields false; native uses
no decorator flags with useDefineForClassFields true and compiles
clean under strict mode.
Add the native SQLite golden fixtures in post-lint form.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Document the -F/--format <native|decorators> flag (default native) in the README, fix the -R/--no-strict description, and add an "Output formats" section covering the native default vs decorators, the breaking default change, wiring and consumer snippets, and the decorators missing-dependency warning. Update Strict-mode (decorators-only), Programmatic usage (format option) and Lint (padded-blocks default). Sync the README programmatic fixture to keep the README-sync test green, and add ADR 0002 recording the native-default decision and its consequences. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Add .vscode/launch.json and .vscode/tasks.json with local run/debug configurations for the generator: CLI launch configs running from source via tsx (native, decorators, help, prompted), Jest debug configs (unit, sqlite integration, current file, golden-update), and per-dialect integration debug configs with a preLaunchTask that brings the Docker DB up and waits. Tasks mirror the GitHub Actions CI integration flow (per-dialect and an all-dialects sequential run) plus db lifecycle and unit/sqlite tasks. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Switch the publish job from NPM_TOKEN auth to OIDC trusted publishing. Upgrade npm to latest before publishing, since the pinned Node 22.13 ships npm 10.x while OIDC requires npm >= 11.5.1, and drop the NODE_AUTH_TOKEN env from the Publish step. The job already sets id-token: write and --provenance, and a trusted publisher is configured on npmjs.com for this repo and ci.yml. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1
Bump the version to 13.0.0, revive the changelog with the 13.0.0 entry covering the breaking changes and notable additions, and add the 12-to-13 migration guide.
Retag the tagline so decorators read as opt-in, collapse the migration guidance to a single pointer, and describe Output formats native-first with a full runnable example. Pair Native/Decorators code blocks for every association example (sourced from the golden fixtures), rebuild the table of contents, clarify that Strict mode applies to the decorators format, and sweep version-relative language throughout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #80 — the v13 native output format emitter — on the
v13branch.Adds a
-F/--format native|decoratorsoption (native is the new default) and a TypeScript compiler-API renderer that emits framework-freesequelizemodels —InferAttributes/InferCreationAttributes,CreationOptional,ForeignKey<Target['key']>,NonAttribute,declare static associations,static initModel(sequelize)— plus aninitModels(sequelize)wiring file (with aModelstype) and anindex.tsbarrel. The existingsequelize-typescriptdecorators emitter is preserved and becomes opt-in via--format decorators.Delivered across the 10 planned steps in
docs/plans/v13-phase6-native-emitter.md:-F/--formatCLI flag +IConfig.format(defaultnative);strictignored (with a notice) in native modeModelBuilder.build()onresolveFormat(config)allowNullinversion; fixed yargs--no-strictparsingdescribe.each(FORMATS)) + 16 SQLite native golden fixtures--formatdocs + ADR0002-native-default-output-format.md13.0.0-beta.3Verification
Local (SQLite + unit):
tsc --noEmitclean · 238 unit tests · 76 SQLite integration tests (both formats — strict-tsccompile + runtime assertions) · decorators golden byte-for-byte unchanged. This PR exists to run the full dialect matrix (postgres/mysql/mariadb/mssql) in CI, which cannot run locally.Notes
13.0.0-beta.3to the npmnexttag, a human step needingNPM_TOKEN).notnull=0, so native emitsCreationOptional<number | null>for them (init options still setprimaryKey/autoIncrementand omitallowNull); dialects reportingnotnull=1emitCreationOptional<number>. Documented in ADR 0002.master's current state, this branch may also carry earlier v13 phases (2–5); the phase-6 commits are51d18e8..40555c1.🤖 Generated with Claude Code
https://claude.ai/code/session_01U3gCAgPV4D27TwecuqbBX1