Skip to content

Conversation

@allouis
Copy link
Contributor

@allouis allouis commented Oct 22, 2025

Prompt 1:

Convert the url-utils package to TypeScript. Break the commits down into easily reviewable and small changes. We can leave the tests as JS for now - so we know that the package still passes the existing tests.

Prompt 2 & 3:

Why do we sometimes use export = Thing and sometimes export default Thing?

Let's converge on a single way of exporting, rather than multiple - if one is more flexible than the other, then we should use that

Prompt 4:

The CI is failing

claude added 14 commits October 22, 2025 03:25
- Add tsconfig.json with strict TypeScript configuration
- Add TypeScript and type dependencies to package.json
- Configure build scripts for TypeScript compilation
- Update main entry point to dist/index.js
- Add .gitignore for build artifacts

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Convert is-ssl.js to TypeScript with proper return type
- Convert deduplicate-double-slashes.js to TypeScript
- Convert strip-subdirectory-from-path.js to TypeScript
- Convert deduplicate-subdirectory.js to TypeScript

These are the simplest utility functions with clear inputs and outputs.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Convert url-join.js to TypeScript with proper interface
- Convert replace-permalink.js with Resource interface
- Convert absolute-to-relative.js with options interface
- Convert relative-to-absolute.js with options interface
- Convert absolute-to-transform-ready.js with options interface

Added proper type definitions for all function parameters and return types.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Convert relative-to-transform-ready.js to TypeScript
- Convert transform-ready-to-absolute.js to TypeScript
- Convert transform-ready-to-relative.js to TypeScript
- Convert to-transform-ready.js to TypeScript

Added proper interfaces for options and type definitions.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Convert html-transform.js to TypeScript with proper interfaces
- Convert html-relative-to-absolute.js to TypeScript
- Convert html-absolute-to-relative.js to TypeScript
- Convert html-absolute-to-transform-ready.js to TypeScript
- Convert html-relative-to-transform-ready.js to TypeScript
- Convert html-to-transform-ready.js to TypeScript

Added type definitions for transform functions and options.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…ript

- Convert markdown-transform.js to TypeScript with proper interfaces
- Convert markdown-relative-to-absolute.js to TypeScript
- Convert markdown-absolute-to-relative.js to TypeScript
- Convert markdown-absolute-to-transform-ready.js to TypeScript
- Convert markdown-relative-to-transform-ready.js to TypeScript
- Convert markdown-to-transform-ready.js to TypeScript

Added type definitions for transform functions and remark AST nodes.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Mobiledoc utilities:
- Convert mobiledoc-transform.js to TypeScript
- Convert mobiledoc-to-transform-ready.js to TypeScript
- Convert mobiledoc-relative-to-absolute.js to TypeScript
- Convert mobiledoc-absolute-to-relative.js to TypeScript
- Convert mobiledoc-relative-to-transform-ready.js to TypeScript
- Convert mobiledoc-absolute-to-transform-ready.js to TypeScript

Lexical utilities:
- Convert lexical-transform.js to TypeScript
- Convert lexical-to-transform-ready.js to TypeScript
- Convert lexical-relative-to-absolute.js to TypeScript
- Convert lexical-absolute-to-relative.js to TypeScript
- Convert lexical-relative-to-transform-ready.js to TypeScript
- Convert lexical-absolute-to-transform-ready.js to TypeScript

Added proper type definitions for transform functions, options interfaces, and JSON structures.

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

Co-Authored-By: Claude <noreply@anthropic.com>
…cript

- Convert plaintext-to-transform-ready.js to TypeScript
- Convert plaintext-relative-to-transform-ready.js to TypeScript
- Convert plaintext-absolute-to-transform-ready.js to TypeScript

Added proper type definitions and interfaces for plaintext URL transformations.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Convert lib/utils/index.js to TypeScript
- Import all utility functions with proper TypeScript syntax
- Export all utilities as a single object

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

Co-Authored-By: Claude <noreply@anthropic.com>
…Script

- Convert lib/UrlUtils.js to TypeScript with comprehensive type definitions
- Add interfaces for UrlUtilsOptions, UrlUtilsConfig, TransformOptions, and UrlForData
- Add proper method overloads for methods with optional itemPath parameter
- Convert index.js to TypeScript
- Maintain full backward compatibility with JavaScript API

All public methods now have proper TypeScript signatures and type safety.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix module imports in UrlUtils.ts to use CommonJS require
- Export all option interfaces to allow type naming in declarations
- Fix type narrowing issues in functions with overloaded parameters
- Add explicit return type to _utils getter
- Convert some exports from export= to export default for compatibility
- Fix null/undefined handling in optional parameters

All TypeScript compilation errors resolved, build succeeds.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add TypeScript parser configuration for .ts files
- Disable conflicting ESLint rules for TypeScript
- Allows linting to work with both JS and TS files

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

Co-Authored-By: Claude <noreply@anthropic.com>
Previously the codebase used a mix of `export =` and `export default`.
This standardizes on `export default` throughout for consistency and
better ES6 module compatibility.

Changes:
- Convert all `export = Thing` to `export default Thing`
- Update all imports from `import x = require('./y')` to `import x from './y'`
- Affects 37+ files including all utilities and main classes

All tests passing, build succeeds.

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Add .eslintignore to exclude dist/ directory from linting
- Disable no-dupe-class-members for TypeScript (method overloads)
- Disable filename convention rules for TypeScript files

These rules were causing CI failures because:
1. TypeScript compiler output in dist/ doesn't follow linting rules
2. TypeScript method overloads are flagged as duplicate class members
3. TypeScript files use different naming conventions than JS files

Linting now passes, all tests passing.

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

Co-Authored-By: Claude <noreply@anthropic.com>
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.

3 participants