Skip to content

Conversation

andrewbranch
Copy link
Member

Fixing breakages from microsoft/TypeScript#62338

Not Fixed

babel-plugin-glaze

Typings for glaze are broken when respecting package.json exports. The last publish was 5+ years ago.

Fixed

array-normalize, fs-extra, hot-formula-parser

These were dual ESM/CJS packages using a bit of a hack to test the ESM and CJS entrypoints, which broke when respecting package.json exports. Converted them to --module node16 and fixed test imports.

cypress-dotenv, dotenv-safe

These had a dependency on an old version of dotenv that has typings that are broken when respecting package.json exports. In reality, the dependency should have been a peerDependency. Updated their self versions, moved dependency to peerDependency with version matching the implementation package, and added a devDependency version to ensure the one installed for testing has working types.

dotenv-defaults

This one has a true dependency on dotenv, but the latest version of dotenv-defaults requires a dotenv version greater than the one where typings were fixed. Updated the self version and dependency version.

expect-puppeteer

Tests exercised await import, which behaves differently with/without esModuleInterop, which is implied by bundler. Set esModuleInterop to true in tsconfig.

ltx

Typings intended to reflect a dual ESM/CJS package but wasn’t quite right. Had to move a lot of stuff around and use nested package.json files, which I'm not sure DT-tools can handle currently, but we should add support if needed, because there's no other way to do this correctly.

@DangerBotOSS
Copy link

Formatting

The following files are not formatted:

  1. types/ltx/lib/DOMElement.d.ts
  2. types/ltx/lib/tag.d.ts

Consider running pnpm dprint fmt on these files to make review easier.

Generated by 🚫 dangerJS against 6ab0c44

@Renegade334
Copy link
Contributor

Regarding ltx, what's the difference in behaviour between just keeping the entire package as de facto CJS as it is currently, versus subtyping specific paths as type: module? Does the compiler look to the @types package structure to work out what import pattern it needs to emit when targeting the JS module?

@andrewbranch
Copy link
Member Author

The first change I had to make to make the tests compile was adding the "./src/*" and "./lib/*" exports mappings that the implementation package has. Since those are exposed in the public API (I didn’t check whether they are documented as public, but by merit of being in exports and the tests importing them, I consider them public), it means that someone in CJS could now do

import parsers = require("ltx/src/parsers.js")

and if those files are not correctly marked as ESM, that require would be allowed in --module node16 and node18, where it should fail due to require(esm) being disallowed.

@andrewbranch
Copy link
Member Author

Where is @typescript-bot? 🤔

@jakebailey
Copy link
Member

The bot does not respond to PRs sent from the repo itself, only forks. It's a bug. I'm going to quick capture a test to understand why it's breaking before I forget.

@jakebailey
Copy link
Member

The test implies it should be replying, so it's possibly some other permission problem with the token...

@jakebailey
Copy link
Member

@typescript-bot hello

@typescript-bot
Copy link
Contributor

typescript-bot commented Aug 29, 2025

@andrewbranch Thank you for submitting this PR!

This is a live comment that I will keep updated.

8 packages in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 A DT maintainer needs to approve changes that affect more than one package

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 7 days.


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 73574,
  "author": "andrewbranch",
  "headCommitOid": "6ab0c44470843dd7d2245bcd1974988e5df53522",
  "mergeBaseOid": "fe9f2bfc7c6569a075c68ed4cb1a1e0a3d900d00",
  "lastPushDate": "2025-08-28T22:10:13.000Z",
  "lastActivityDate": "2025-08-29T16:16:02.000Z",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "array-normalize",
      "kind": "edit",
      "files": [
        {
          "path": "types/array-normalize/array-normalize-tests.mts",
          "kind": "test"
        },
        {
          "path": "types/array-normalize/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "cypress-dotenv",
      "kind": "edit",
      "files": [
        {
          "path": "types/cypress-dotenv/package.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-packagejson) and not moving towards it (check: `peerDependencies`)"
        }
      ],
      "owners": [
        "daikiojm",
        "peterblazejewicz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "dotenv-defaults",
      "kind": "edit",
      "files": [
        {
          "path": "types/dotenv-defaults/package.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "peterblazejewicz"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "dotenv-safe",
      "kind": "edit",
      "files": [
        {
          "path": "types/dotenv-safe/package.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-packagejson) and not moving towards it (check: `peerDependencies`)"
        }
      ],
      "owners": [
        "krenor"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Popular"
    },
    {
      "name": "expect-puppeteer",
      "kind": "edit",
      "files": [
        {
          "path": "types/expect-puppeteer/expect-puppeteer-tests.ts",
          "kind": "test"
        },
        {
          "path": "types/expect-puppeteer/tsconfig.json",
          "kind": "package-meta",
          "suspect": "not [the expected form](https://github.com/DefinitelyTyped/DefinitelyTyped#user-content-tsconfigjson) and not moving towards it (check: `compilerOptions.esModuleInterop`)"
        }
      ],
      "owners": [
        "tkrotoff",
        "jfm710"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "fs-extra",
      "kind": "edit",
      "files": [
        {
          "path": "types/fs-extra/test/fs-extra-tests-module.mts",
          "kind": "test"
        },
        {
          "path": "types/fs-extra/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "alan-agius4",
        "midknight41",
        "shiftkey",
        "mees-",
        "jrockwood",
        "sangdth",
        "ffflorian",
        "peterblazejewicz",
        "NotWoods",
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    },
    {
      "name": "hot-formula-parser",
      "kind": "edit",
      "files": [
        {
          "path": "types/hot-formula-parser/hot-formula-parser-tests.mts",
          "kind": "test"
        },
        {
          "path": "types/hot-formula-parser/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "joao-mbn"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    },
    {
      "name": "ltx",
      "kind": "edit",
      "files": [
        {
          "path": "types/ltx/lib/DOMElement.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/Element.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/JSONify.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/Parser.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/clone.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/createElement.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/equal.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/escape.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/is.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/ltx.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/ltx/lib/parse.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/libxmljs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/ltx.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/node-expat.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/node-xml.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/sax-js.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/parsers/saxes.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/stringify.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/tag.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/lib/tagString.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/ltx-tests.mts",
          "kind": "test"
        },
        {
          "path": "types/ltx/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/ltx/src/DOMElement.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/Element.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/JSONify.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/Parser.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/clone.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/createElement.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/equal.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/escape.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/is.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/ltx.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/package.json",
          "kind": "package-meta-ok"
        },
        {
          "path": "types/ltx/src/parse.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/libxmljs.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/ltx.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/node-expat.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/node-xml.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/sax-js.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/parsers/saxes.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/stringify.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/tag.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/src/tagString.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/ltx/tsconfig.json",
          "kind": "package-meta-ok"
        }
      ],
      "owners": [
        "BendingBender"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Well-liked by everyone"
    }
  ],
  "reviews": [],
  "mainBotCommentID": 3235348553,
  "ciResult": "pass"
}

@typescript-bot
Copy link
Contributor

🔔 @BendingBender @daikiojm @peterblazejewicz @krenor @tkrotoff @jfm710 @alan-agius4 @midknight41 @shiftkey @mees- @jrockwood @sangdth @ffflorian @NotWoods @joao-mbn — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this to Needs Maintainer Review in Pull Request Status Board Aug 29, 2025
Copy link
Member

@jakebailey jakebailey Aug 29, 2025

Choose a reason for hiding this comment

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

dt-tools definitely can't handle this one; this will be skipped entirely in the built package, and probably break linting?

Copy link
Member

Choose a reason for hiding this comment

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

Break linting as in, it will probably think these are script files (like we have a sub package in the node dirs)

@jakebailey
Copy link
Member

I would honestly just delete babel-plugin-glaze, babel-plugin-glaze hasn't been updated in 5 years either, so if it's blocking us, oh well.

@Renegade334
Copy link
Contributor

It looks like ltx has actually just removed the CJS side of the package (xmppjs/ltx#160), it just hasn't been published yet.

Is the easiest thing just to wait for this to hit a published version, and then update DT accordingly, rather than necessitating a change to the tooling?

@Renegade334
Copy link
Contributor

Alternatively, with that being the case, would it be easier to make a "legal fiction" change now, and fix the exports map while still assuming a CJS module (as the types do currently), since the package can be updated to a proper type: module soon anyway when that change is published?

It feels like chasing the edge case (submodule exports from a package that uses nested package.json stubs to change the module type of specific subpaths) for one specific and soon-not-to-exist example probably isn't worth the effort?

@andrewbranch
Copy link
Member Author

Yeah, I can probably find a less disruptive way to make ltx compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Maintainer Review
Development

Successfully merging this pull request may close these issues.

5 participants