Skip to content

Revert unapproved knip and moduleResolution PRs#299

Merged
brianmhunt merged 2 commits intomainfrom
revert/knip-and-module-resolution
Apr 13, 2026
Merged

Revert unapproved knip and moduleResolution PRs#299
brianmhunt merged 2 commits intomainfrom
revert/knip-and-module-resolution

Conversation

@brianmhunt
Copy link
Copy Markdown
Member

@brianmhunt brianmhunt commented Apr 13, 2026

Summary

Reverts two PRs that were merged without required review approval:

Why revert

  1. Neither PR was reviewed or approved before merge. Branch protection now requires approval.
  2. They break existing work. The Jasmine-to-Mocha migration (PR Complete Jasmine to Mocha test migration #266, 20K lines, fully tested) cannot merge cleanly because these PRs changed moduleResolution and type exports in ways that conflict with the migration.
  3. They introduced regressions. JsxObserver has type errors on main right now from the knip PR's type hierarchy changes.
  4. They mix concerns. Add knip linter and fix all unused dependencies and exports #234 bundles linter config, CI workflows, verbatimModuleSyntax, type refactoring, and export changes into one 56-file PR. Pc/switch module resolution #289 bundles moduleResolution, dts generation, and package.json export changes into one 40-file PR.

Path forward

Both PRs contain useful work that should be re-landed as properly scoped, reviewed PRs:

  • knip config + CI workflow (standalone)
  • verbatimModuleSyntax + type import fixes (standalone)
  • moduleResolution: "bundler" + dts sync tooling (standalone)
  • Unused export cleanup (standalone, after the above land)

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Refactor
    • Consolidated TypeScript type distribution into compiled outputs; types no longer published separately in packages
    • Simplified build process by removing dependency cycle detection and automated type synchronization
    • Updated module resolution strategy from bundler to node10 with helper imports enabled
    • Refined public API surface across provider and utility packages for consistency
    • Migrated ESLint configuration to ES module syntax

Brian M Hunt added 2 commits April 13, 2026 09:31
This reverts commit 0068527, reversing
changes made to ad24da6.
…ion"

This reverts commit ad24da6, reversing
changes made to c610534.
Copilot AI review requested due to automatic review settings April 13, 2026 13:31
@brianmhunt
Copy link
Copy Markdown
Member Author

To be clear: the knip and moduleResolution work is valuable and should come back. The issue is sequencing and review.

Once the Mocha migration (#266) lands and the test infrastructure is homogenized, we can re-land these as focused, reviewable PRs — one concern per PR, each properly approved. That's the right order: stabilize the test foundation first, then layer infrastructure changes on top.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 13, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR removes distributed .d.ts type declaration files from package exports and published artifacts, eliminates the DTS synchronization pipeline, removes dependency-cycle CI workflows, and refactors type imports throughout the codebase. Individual packages no longer export TypeScript types conditions and no longer publish types/ directories.

Changes

Cohort / File(s) Summary
CI and Build Configuration
.github/workflows/dependency-cycle.yml, Makefile, knip.json
Removed dependency-cycle workflow, eliminated knip and lerna-check Makefile targets, and deleted knip configuration file.
TypeScript Build Pipeline
tsconfig.dts.json, tsconfig.json, tools/sync-dts.mjs
Changed DTS output from per-package sync pattern to single aggregated declaration file; removed sync-dts.mjs tool; updated compiler options (added ignoreDeprecations, changed module resolution to node10, enabled importHelpers).
Root Configuration
.gitignore, eslint.config.js, package.json
Removed type-related gitignore patterns, migrated ESLint config to ES modules, added globals dependency and removed knip dependency.
Package Manifests (30+ packages)
builds/knockout/package.json, builds/reference/package.json, packages/*/package.json, tools/repackage.mjs
Consistently removed types/ from files arrays, removed exports["."].types entries, and added tslib dependency across all affected packages.
Type System Refactoring
packages/utils/src/interfaces.ts, packages/utils/src/index.ts, packages/utils/src/options.ts
Removed interfaces.ts file (deleted ProviderBase, KnockoutUtils, BindingAccessors, ArrayAndObjectUtils type exports); updated options.ts to reference new type locations; removed type re-exports from index.
Observable and Subscription Changes
packages/observable/src/Subscription.ts, packages/observable/src/index.ts, packages/observable/src/extenders.ts, packages/observable/src/subscribable.ts
Changed Subscription from named to default export; removed Subscription type re-export from index; exported previously private extender functions; changed Subscription import to default import in subscribable.
Provider API Updates
packages/provider/src/Provider.ts, packages/provider/src/BindingHandlerObject.ts, packages/bind/src/applyBindings.ts, packages/builder/src/Builder.ts
Removed ProviderBase interface, introduced standalone BindingAccessors type in Provider module, updated type references from utils to local/builder definitions; changed Builder.ts exported types to remove intersections with utility types.
Binding Context and Type Imports
packages/bind/src/bindingContext.ts, packages/bind/src/bindingEvent.ts, packages/lifecycle/src/LifeCycle.ts, packages/observable/src/observableArray.ts, packages/binding.template/src/nativeTemplateEngine.ts
Updated type imports from type-only to value imports; changed BindingContext.ko type from KnockoutUtils to KnockoutInstance; exported MaybeComputed and MaybeObservableArray type aliases.
Provider Subpackage Updates
packages/provider.mustache/src/AttributeMustacheProvider.ts, packages/provider.mustache/src/mustacheParser.ts, packages/build/src/applyBindings.ts, packages/reference/src/common.ts
Updated method signatures to accept wider types; exported previously private generator functions; enabled previously commented-out CommonJS export.
Utils and Component Utilities
packages/utils/src/dom/virtualElements.ts, packages/utils.jsx/src/JsxObserver.ts, packages/utils.jsx/src/index.ts, packages/provider.component/spec/customElementBehaviors.ts
Added hasBindingValue export; added default export for JsxObserver and updated re-export pattern; changed Observable type import from type-only to value in spec.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Add knip linter and fix all unused dependencies and exports #234: This PR directly undoes key changes from PR #234—removing the knip workflow, knip.json configuration, Makefile knip/lerna-check targets, and several type/interface refactors (packages/utils/src/interfaces.ts removals).
  • Pc/switch module resolution #289: Both PRs modify the same type-declaration pipeline and configuration files (tools/sync-dts.mjs, Makefile, tsconfig.dts.json, and package.json exports), but in opposite directions—this PR removes what PR #289 added.
  • TS) Enable "strictBindCallApply" #225: Both PRs modify provider API and related type/signature changes (packages/provider/src/Provider.ts, BindingAccessors, and ProviderBase-related updates).

Poem

🐰 The types once scattered in folders deep,
Now bundled as one in the build to keep,
No sync dance needed, no scattered files,
Just one declaration to make us smile,
The pipeline simplified, exports refined—
A cleaner TypeScript world we find!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main objective: reverting two previously merged PRs (knip and moduleResolution-related changes) that lacked required review approval.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert/knip-and-module-resolution

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread eslint.config.js
@@ -1,29 +1,30 @@
const pluginJs = require('@eslint/js')
const tseslint = require('typescript-eslint')
import globals from "globals";
import { removeNode } from './disposal'
import { tagNameLower } from './info'
import * as domData from './data'
import options from '../options'
@brianmhunt brianmhunt merged commit dd67164 into main Apr 13, 2026
8 of 9 checks passed
@brianmhunt brianmhunt deleted the revert/knip-and-module-resolution branch April 13, 2026 13:36
@brianmhunt
Copy link
Copy Markdown
Member Author

@phillipc I'll look at knip & the other PR right after jasmine is out of the repo

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reverts two previously merged but unapproved changesets that introduced knip, TypeScript config/module-resolution changes, d.ts tooling changes, and widespread package export/type-surface edits that conflicted with ongoing work and caused regressions.

Changes:

  • Reverts TypeScript configuration/tooling changes (module resolution, d.ts generation approach, removal of sync-dts tooling).
  • Removes knip configuration and the dependency-cycle GitHub Actions workflow.
  • Restores/adjusts multiple package manifests and source exports/types across many packages.

Reviewed changes

Copilot reviewed 61 out of 64 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
tsconfig.json Restores non-bundler module resolution; toggles TS compiler options.
tsconfig.dts.json Changes declaration emit configuration to a single bundled outFile.
tools/sync-dts.mjs Removes the declaration sync script previously used by make dts.
tools/repackage.mjs Updates standardized package.json shape (removes types export/files).
packages/utils/src/options.ts Switches option typings to @tko/provider / @tko/builder types.
packages/utils/src/interfaces.ts Removes local shared type definitions (ProviderBase/KnockoutUtils/etc).
packages/utils/src/index.ts Removes re-export of deleted interfaces.ts types.
packages/utils/src/dom/virtualElements.ts Adds options import and new hasBindingValue export.
packages/utils/package.json Removes types/ packaging and adds tslib.
packages/utils.parser/package.json Removes types/ packaging and adds tslib.
packages/utils.jsx/src/JsxObserver.ts Adds default export for JsxObserver.
packages/utils.jsx/src/index.ts Switches JsxObserver re-export to default-based form.
packages/utils.jsx/package.json Removes types/ packaging and adds tslib.
packages/utils.functionrewrite/package.json Removes types/ packaging and adds tslib.
packages/utils.component/package.json Removes types/ packaging and adds tslib.
packages/provider/src/Provider.ts Removes dependency on @tko/utils ProviderBase types; adjusts class/type defs.
packages/provider/src/BindingHandlerObject.ts Loosens method typing.
packages/provider/package.json Removes types/ packaging; changes dependencies (notably).
packages/provider.virtual/package.json Removes types/ packaging and adds tslib.
packages/provider.native/package.json Removes types/ packaging; changes dependencies (notably).
packages/provider.mustache/src/mustacheParser.ts Exports parsing generators (innerParse, parseOuterMatch).
packages/provider.mustache/src/AttributeMustacheProvider.ts Adjusts direct binding helper signature/return.
packages/provider.mustache/package.json Removes types/ packaging; adjusts dependencies.
packages/provider.multi/package.json Removes types/ packaging and adds tslib.
packages/provider.databind/package.json Removes types/ packaging and adds tslib.
packages/provider.component/spec/customElementBehaviors.ts Updates observable imports used in specs.
packages/provider.component/package.json Removes types/ packaging and adds tslib.
packages/provider.bindingstring/package.json Removes types/ packaging and adds tslib.
packages/provider.attr/package.json Removes types/ packaging and adds tslib.
packages/observable/src/Subscription.ts Converts Subscription to a default export.
packages/observable/src/subscribable.ts Updates Subscription import to match default export.
packages/observable/src/observableArray.ts Exposes MaybeObservableArray type.
packages/observable/src/index.ts Removes exported Subscription type from the public entrypoint.
packages/observable/src/extenders.ts Changes types/imports; exports extender functions.
packages/observable/package.json Removes types/ packaging and adds tslib.
packages/lifecycle/src/LifeCycle.ts Adjusts Observable import form.
packages/lifecycle/package.json Removes types/ packaging and adds tslib.
packages/filter.punches/package.json Removes types/ packaging and adds tslib.
packages/computed/src/proxy.ts Removes @internal markers on exported helpers.
packages/computed/src/computed.ts Exposes MaybeComputed type.
packages/computed/package.json Removes types/ packaging and adds tslib.
packages/builder/src/Builder.ts Inlines/expands utility typings; updates Knockout instance type composition.
packages/builder/package.json Removes types/ packaging; adjusts dependencies (notably).
packages/binding.template/src/nativeTemplateEngine.ts Adjusts TemplateOptions import form.
packages/binding.template/spec/nativeTemplateEngineBehaviors.ts Updates observable imports used in specs.
packages/binding.template/package.json Removes types/ packaging and adds tslib.
packages/binding.if/package.json Removes types/ packaging; adjusts dependencies.
packages/binding.foreach/package.json Removes types/ packaging; adjusts dependencies.
packages/binding.core/package.json Removes types/ packaging and adds tslib.
packages/binding.component/package.json Removes types/ packaging; adjusts dependencies (notably).
packages/bind/src/bindingEvent.ts Changes Subscription typing import to a deep import.
packages/bind/src/bindingContext.ts Adjusts Knockout instance typing and callback import form.
packages/bind/src/applyBindings.ts Changes computed type/value imports and Provider typing.
packages/bind/package.json Removes types/ packaging; adds @tko/provider + tslib.
package.json Removes knip devDependency; adds globals devDependency.
package-lock.json Updates lockfile for removed/added dependencies (notably knip removal).
Makefile Removes knip targets; changes dts generation command.
knip.json Removes knip configuration file.
eslint.config.js Converts ESLint config to ESM-style syntax and adjusts ignores/rules.
builds/reference/src/common.ts Restores CommonJS module.exports assignment.
builds/reference/package.json Removes types/ packaging and adds tslib.
builds/knockout/package.json Removes types/ packaging and adds tslib.
.gitignore Stops ignoring per-package types folders and removes .codex ignore.
.github/workflows/dependency-cycle.yml Removes knip-based dependency cycle workflow.


import { computed } from '@tko/computed'
import type { Observable } from '@tko/observable'
import { Observable } from '@tko/observable'
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observable is exported from @tko/observable as a type-only export, so importing it as a value (import { Observable }) will fail type-checking (and may generate an unused runtime import). Switch this to a type-only import.

Suggested change
import { Observable } from '@tko/observable'
import type { Observable } from '@tko/observable'

Copilot uses AI. Check for mistakes.
import type { Observable } from '@tko/observable'

import { type Computed, computed } from '@tko/computed'
import { Computed, computed } from '@tko/computed'
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computed is a type-only export from @tko/computed (see packages/computed/src/index.ts). Importing it as a value will cause a TypeScript error. Use a type-only import for Computed and keep computed as the value import.

Suggested change
import { Computed, computed } from '@tko/computed'
import { computed } from '@tko/computed'
import type { Computed } from '@tko/computed'

Copilot uses AI. Check for mistakes.
import { contextAncestorBindingInfo } from './bindingEvent'

import type { BindingContextExtendCallback } from './applyBindings'
import { BindingContextExtendCallback } from './applyBindings'
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BindingContextExtendCallback is exported as a type-only export from ./applyBindings. Importing it as a value will fail type-checking. Change this to import type { BindingContextExtendCallback } ....

Suggested change
import { BindingContextExtendCallback } from './applyBindings'
import type { BindingContextExtendCallback } from './applyBindings'

Copilot uses AI. Check for mistakes.
@@ -1,5 +1,5 @@
import { makeArray, parseHtmlFragment } from '@tko/utils'
import { templateEngine, type TemplateOptions } from './templateEngine'
import { templateEngine, TemplateOptions } from './templateEngine'
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TemplateOptions is a TypeScript interface (type-only). Importing it as a value (import { ... TemplateOptions }) will fail type-checking. Use import type { TemplateOptions } (and keep templateEngine as the value import).

Suggested change
import { templateEngine, TemplateOptions } from './templateEngine'
import { templateEngine } from './templateEngine'
import type { TemplateOptions } from './templateEngine'

Copilot uses AI. Check for mistakes.
import { applyBindings } from '@tko/bind'

import { observable, type ObservableArray, observableArray } from '@tko/observable'
import { observable, ObservableArray, observableArray } from '@tko/observable'
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObservableArray is exported from @tko/observable as a type-only export, so importing it as a runtime value will fail type-checking. This should remain a type-only import (type ObservableArray).

Suggested change
import { observable, ObservableArray, observableArray } from '@tko/observable'
import { observable, type ObservableArray, observableArray } from '@tko/observable'

Copilot uses AI. Check for mistakes.
Comment on lines 7 to 16
"dependencies": {
"@tko/bind": "^4.0.0",
"@tko/lifecycle": "^4.0.0",
"@tko/observable": "^4.0.0",
"@tko/provider": "^4.0.0",
"@tko/utils": "^4.0.0",
"@tko/utils.component": "^4.0.0",
"@tko/utils.jsx": "^4.0.0",
"@tko/provider.native": "^4.0.0"
"tslib": "^2.2.0"
},
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tko/binding.component source imports NativeProvider from @tko/provider.native (see src/componentBinding.ts), but @tko/provider.native is no longer listed in dependencies. This will break runtime for consumers. Add @tko/provider.native back to dependencies (or adjust the implementation to not require it).

Copilot uses AI. Check for mistakes.
Comment on lines 1 to 5
import { domData } from '@tko/utils'
import { subscribable } from '@tko/observable'
import type { Subscribable, SubscriptionCallback, Subscription } from '@tko/observable'
import type { Subscribable, SubscriptionCallback } from '@tko/observable'
import type Subscription from '@tko/observable/src/Subscription'

Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses a deep import into another package’s source tree (@tko/observable/src/Subscription). With package exports and publish-time file lists, this path is very likely not resolvable for consumers generating types. Prefer importing Subscription from the public @tko/observable entrypoint (re-export the type there if needed) or avoid naming the concrete type in the signature.

Copilot uses AI. Check for mistakes.
Comment on lines 16 to 19
import { tagNameLower } from './info'
import * as domData from './data'
import options from '../options'

Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options is imported but never used in this file, which adds noise and can trigger unused-import checks in stricter toolchains. Remove the import or use it if it’s intended for side effects.

Copilot uses AI. Check for mistakes.
Comment thread Makefile
$(NODE) tools/sync-dts.mjs .dts-tmp packages,builds/reference
rm -rf .dts-tmp
$(NPX) tsc --build tsconfig.dts.json

Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The knip target was removed, but repo docs (e.g. AGENTS.md lists make knip) still reference it, which will confuse contributors/CI usage. Either keep a stub knip target (that explains it was reverted) or update the documentation in the same PR to match the new Makefile targets.

Suggested change
knip:
@echo "The 'knip' target was removed/reverted and is kept here only as a compatibility stub."
@echo "Please use the current Makefile targets documented for this repository instead."

Copilot uses AI. Check for mistakes.
Comment on lines +1 to 3
import { Provider } from '@tko/provider'
import type { KnockoutInstance } from '@tko/builder'

Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provider is only used as a type annotation in this file. Importing it as a value (import { Provider } ...) can introduce an unnecessary runtime dependency/side effects in the emitted JS depending on the build pipeline. Prefer import type { Provider } from '@tko/provider' here.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dae7816ab2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tsconfig.dts.json
Comment on lines 8 to +13
"exclude": [
"node_modules",
"builds/knockout",
"builds",
"docs",
"tools",
"**/spec/**",
"tko.io"
"**/spec/**"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Exclude docs app from declaration build inputs

This change drops tko.io from tsconfig.dts.json's exclude list, so make dts now picks up tko.io/src/**/*.ts (for example content.config.ts) during declaration generation. The root workspace only installs packages/* and builds/*, and the docs app depends on Astro-specific modules, so declaration generation fails on missing docs-only imports instead of producing library typings. Please add tko.io back to exclude (or use a narrow include) so the dts build only covers publishable library code.

Useful? React with 👍 / 👎.

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.

2 participants