Skip to content

chore: support extensionless TypeScript imports - #45

Merged
AbdelrahmanBayoumi merged 2 commits into
mainfrom
chore/extensionless-imports
Nov 4, 2026
Merged

AbdelrahmanBayoumi merged 2 commits into
mainfrom
chore/extensionless-imports

Conversation

@AbdelrahmanBayoumi

Copy link
Copy Markdown
Member

ملخص التغيير (Summary)

Allow TypeScript source imports such as import { setCharAt } from '../utils' instead of explicit .js paths. Static relative imports and barrel exports are extensionless; type-only imports explicitly use import type.

  • Keep native tsc for ES5 CommonJS and use pinned tsdown@0.21.10 for unbundled ES2020 ESM JavaScript and declarations with Node-compatible .js specifiers.
  • Use tsdown.config.mts to explicitly identify the build configuration as ESM.
  • Prevent Webpack's loaders from overwriting standalone declaration output.
  • Extend artifact checks for emitted imports, external NodeNext consumers, and public definition/source maps. Update contributing guidance and the Unreleased changelog only.

التوافق (Compatibility)

Public package entry paths, named/default exports, ArabicServices method names, and text-processing logic remain intact. CJS, ESM, browser UMD, and declarations are exercised; no runtime dependency is added.

Known observable differences: tsdown synthesizes ArabicServices.constants and .utils namespace objects in ESM. Their prototype, extensibility, and property descriptors differ from native ESM namespaces, although values/function identities are retained. No reliance on those descriptors was found in the inspected local API/website consumers; this is not proof about all external consumers.

Selected function and declaration maps resolve to source. Three generated JS facade maps and two declaration facade maps are empty; the generated Rolldown runtime helper has no map. These limitations remain visible in artifact checks.

التحقق (Validation)

  • npm run format:check
  • npm run lint
  • npm test completed 119 source tests and the full build, then hit a 10-second npm pack --dry-run timeout in one artifact test (17/18 passed). An artifact retry under portable Node 22.18 repeated that timeout.
  • Subsequent npm run test:artifacts -- --maxWorkers=1 --no-file-parallelism: 18/18 passed, including package and tree-shaking checks. No tests or timeouts were changed.
  • Standalone npm pack --dry-run --ignore-scripts --json: passed (134 files).
  • Direct config build under portable Node 22.18: passed without MODULE_TYPELESS_PACKAGE_JSON; no global Node upgrade.
  • git diff --check
  • Documentation and Unreleased updated; published release history preserved.

Validation is local on Windows. Cross-platform/older-runtime matrices and CI results have not been verified. The existing Node 22.17 build-tool deprecation warning remains separate from the resolved config-module warning.

@AbdelrahmanBayoumi
AbdelrahmanBayoumi merged commit ce12381 into main Nov 4, 2026
4 checks passed
@AbdelrahmanBayoumi AbdelrahmanBayoumi mentioned this pull request Nov 4, 2026
6 tasks done
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