Skip to content

feat: Remove generateTsConfig option from ts-proto module#108

Merged
connerohnesorge merged 3 commits into
mainfrom
feat/remove-ts-proto-generatetsconfig
Dec 24, 2025
Merged

feat: Remove generateTsConfig option from ts-proto module#108
connerohnesorge merged 3 commits into
mainfrom
feat/remove-ts-proto-generatetsconfig

Conversation

@connerohnesorge
Copy link
Copy Markdown
Owner

Summary

Removes the generateTsConfig configuration option from the ts-proto language module as part of architectural cleanup (Spectr change: remove-ts-proto-generatetsconfig).

Why This Change

The generateTsConfig option violated architectural principles by:

  • Scope mismatch: Configuration belongs with source code, not generated code
  • Poor defaults: Generic template doesn't adapt to project-specific needs
  • Maintenance burden: Unnecessary configuration option with low utility
  • Better alternatives: Modern options (protobuf-es) eliminate the need

What Changed

  • ✅ Removed conditional generateTsConfig block from src/languages/js/ts-proto.nix (lines 88-109)
  • ✅ Option definition already removed from src/lib/bufrnix-options.nix in previous work
  • ✅ Converted tasks.md to tasks.jsonc for better Spectr task tracking
  • ✅ Added documentation comments explaining project-managed configuration

Breaking Change

Yes - This removes a public configuration option. Users who rely on generateTsConfig = true will need to:

  • Remove that line from their Nix configuration
  • Create their own tsconfig.json in their project root if needed
  • Or use protobuf-es as the modern recommended approach

Impact

  • Low impact: Option was disabled by default (false)
  • No example usage: No examples in the repository use this option
  • Migration path: Simple removal or manual tsconfig.json creation

Test Plan

  • All 39 examples pass (./test-examples.sh)
  • Quick validation passes (./check-examples.sh)
  • No generation errors in ts-proto examples
  • Code formatting validated (nix fmt)
  • Linting passes (lint)
  • Spectr validation passes (spectr validate remove-ts-proto-generatetsconfig)
  • All TypeScript/JavaScript examples work correctly without the option:
    • js-example, js-es-custom-outputpath, js-grpc-web
    • js-annotations, js-protovalidate, ts-flake-parts
    • multilang-per-files (TypeScript frontend)

Migration Guide

Before (will no longer work):

tsProto = {
  enable = true;
  generateTsConfig = true;
};

After (recommended):

# Option 1: Create tsconfig.json in your project root
tsProto = {
  enable = true;
};

# Option 2: Use modern protobuf-es instead
es = {
  enable = true;
  target = "ts";
};

Related

  • Related change: remove-es-generatepackagejson (similar cleanup for protobuf-es)
  • Spectr proposal: spectr/changes/remove-ts-proto-generatetsconfig/proposal.md

🤖 Generated with Claude Code

connerohnesorge and others added 3 commits December 24, 2025 11:41
This commit removes the `generatePackageJson` configuration option from
Bufrnix's JavaScript/TypeScript language modules. Users are now required to
manage their own package.json files.

## Changes

### Configuration Schema
- Removed `js.packageName` option from bufrnix-options.nix
- Note: `generatePackageJson` options were never added to the schema

### Implementation
- Removed packageName echo from js/default.nix initHooks
- ts-proto.nix and connect.nix already had correct comments

### Examples
- Updated examples/js-es-modules:
  - Removed generatePackageJson and packageName from flake.nix
  - Updated README.md with migration guidance
  - Updated flake.lock
- Updated examples/ts-flake-parts:
  - Removed generatePackageJson and packageName from flake.nix
  - Updated README.md with migration guidance

### Documentation
- Removed all generatePackageJson references from:
  - doc/src/content/docs/reference/configuration.mdx
  - doc/src/content/docs/reference/languages.mdx
  - doc/src/content/docs/reference/languages/javascript.mdx
  - doc/src/content/docs/guides/troubleshooting.mdx
- Created migration guide at:
  - doc/src/content/docs/guides/migrating-from-generatepackagejson.mdx

### Spectr
- Converted tasks.md to tasks.jsonc format
- Updated proposal and design documents

## Rationale

- **Focus**: Bufrnix should focus on protobuf generation, not package management
- **Control**: Users have full control over package.json structure
- **Maintenance**: Reduces burden of maintaining hard-coded dependency versions
- **Standard Practice**: Aligns with standard JavaScript/TypeScript workflows

## Breaking Change

Users currently using the removed options must:
1. Remove the configuration options from their flake.nix
2. Create/maintain their own package.json files
3. See the migration guide for details

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Remove the generateTsConfig configuration option from the ts-proto language
module. This option generated a basic tsconfig.json file in the generated code
output directory, which violated architectural principles by placing
configuration in generated code rather than source code.

Changes:
- Removed generateTsConfig conditional block from src/languages/js/ts-proto.nix
- Removed option definition from src/lib/bufrnix-options.nix (already removed)
- Converted tasks.md to tasks.jsonc for better task tracking
- All 39 test examples pass without the option

Breaking Change: Users who relied on generateTsConfig = true will need to
create their own tsconfig.json in their project root or use protobuf-es as
a modern alternative.

Implements: spectr change remove-ts-proto-generatetsconfig

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@connerohnesorge connerohnesorge merged commit 3722a3c into main Dec 24, 2025
4 checks passed
@connerohnesorge connerohnesorge deleted the feat/remove-ts-proto-generatetsconfig branch December 24, 2025 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant