NPM-PACKAGE: Move @microsoft/kiota to ESM-only (lift of #7441)#7963
Open
gavinbarron wants to merge 5 commits into
Open
NPM-PACKAGE: Move @microsoft/kiota to ESM-only (lift of #7441)#7963gavinbarron wants to merge 5 commits into
gavinbarron wants to merge 5 commits into
Conversation
Lifts PR #7441 (deinok) onto current main, with fixes so the build, unit tests, lint and extension webpack bundling all pass. - Ship ESM only (drop dual CJS/ESM build, tsconfig.cjs/esm.json) - Relocate remaining root modules into lib/ so the imported runtime.json is emitted to dist by tsc (removes the copy-files.js script) - Use explicit .js import specifiers under module/moduleResolution nodenext - Point CI runtimeFilePath at vscode/packages/npm-package/lib/runtime.json Fixes over the original PR: - Add .js extension to vscode-jsonrpc/node imports so they resolve under nodenext ESM (was TS2307; also unblocked cascading implicit-any errors) - Update tests/unit/install.spec.ts import to ../../lib/install - Preserve current main package.json version and dependencies Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Code Coverage OverviewLanguages: C# C# / code-coverage/dotnetThe overall coverage in commit c9d997a in the Show a code coverage summary of the most covered files.
Updated |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lifts #7441 (by @deinok) onto current
mainand fixes the issues that kept it from building, so CI automations can run against a clean state.The npm package
@microsoft/kiotamoves to ESM-only:tsconfig.cjs.json/tsconfig.esm.json, singletsconfig.jsonwithmodule/moduleResolution: nodenext.config,connect,install,types,utils,runtime.json) intolib/. Becauseruntime.jsonis now underrootDir,tscemits it todist/, so thescripts/copy-files.jscopy step is no longer needed and was removed.package.json: single.export,"type": "module",main/typespoint atdist/index.js/dist/index.d.ts,filestrimmed todist.ci-build.yml,build-vscode-extension.yml):runtimeFilePathnow points atvscode/packages/npm-package/lib/runtime.json.Fixes on top of the original PR
vscode-jsonrpc/nodedid not resolve undernodenext(TS2307) because that CJS dependency has noexportsmap, so extensionless ESM subpath resolution fails. Added the explicit.js(vscode-jsonrpc/node.js) to all 12 importers. This also unblocked cascadingimplicit anyerrors inremoveItem.ts. The specifier is valid under Node ESM, webpack, and jest.tests/unit/install.spec.tsstill imported../../install; updated to../../lib/install(the original PR missed this file).mainpackage.json version and dependencies (the original PR carried a stale1.30.0bump — version is managed by CI).vscode/package-lock.jsonvianpm install; it was already consistent, so there is no lockfile diff.Validation
npm run build(both packages) — ✅ npm-packagetscbuild + extension webpack bundle succeed;dist/runtime.jsonis emitted.npm run test:unit --w=@microsoft/kiota— ✅ 11 suites / 18 tests pass.npm run lint— ✅ 0 errors (only pre-existing enum-naming warnings intypes.ts).