azurenoops / azurenoops/spin_agent
tech-debt(m365): Fix ESM/CommonJS config and TypeScript compile errors in M365 Teams Extension
- Dominant language
- C#
- Stars
- 3
- Forks
- 1
- Avg merge
- 18h 9m
- Merged PRs (30d)
- 43
Description
## Summary
The M365 Teams Extension (`extensions/m365/**`) has two pre-existing build failures that currently cause the `M365 Teams Extension` CI job to fail on every run:
1. **ESM/CommonJS config** — `extensions/m365/package.json` is missing `"type": "commonjs"`. Node 20+ ESM resolver intercepts `.ts` files before `ts-node`'s CommonJS require hook can handle them, causing `ERR_UNKNOWN_FILE_EXTENSION`. Fix proposed in PR #843.
2. **TypeScript compile errors** — `npm run build` fails with TS compile errors independent of the ESM issue.
## Context
- **Pre-existing failure** — both failures were present before the DEF-001 merge (commit b0cc765 / PR #828). They have no bearing on core auth correctness.
- The `m365-test` CI job was marked `continue-on-error: true` on 2026-08-26 so it no longer gates the deploy pipeline for the core app.
- PR #843 (`hotfix/m365-commonjs`) addresses the ESM/package.json piece; TypeScript errors are a separate workstream.
- Related: issue #822 (DEF-001 — dashboard auth — P0 already fixed and deploying to staging).
## Work Required
- [ ] Merge or cherry-pick PR #843 (`"type": "commonjs"` fix) to resolve the Node 20 ESM test-runner failure
- [ ] Audit and fix all TypeScript compile errors in `extensions/m365/` (strict mode, missing type declarations, etc.)
- [ ] Verify `npm run build && npm test` both pass locally in `extensions/m365/`
- [ ] Re-enable the `m365-test` job as a blocking required gate once both issues are green
- [ ] Remove `continue-on-error: true` from the job at that point
## Acceptance Criteria
- `npm ci && npm run build && npm test` exits 0 in `extensions/m365/`
- The `M365 Teams Extension` CI job passes on a push to main without `continue-on-error`
- No regressions in any other CI job
## References
- PR #843: fix(m365): add type=commonjs to unblock M365 Teams Extension CI job
- Issue #822: [DEF-001] Dashboard auth fix
- CI job: `m365-test` in `.github/workflows/ci.yml`
- Extension path: `extensions/m365/**`
Contributor guide
Research direction
Start in extensions/m365/package.json and run npm ci && npm run build && npm test there to reproduce both failures. Review the m365-test job in .github/workflows/ci.yml and the referenced PR #843, then audit the reported TypeScript errors. Done means the build and tests pass and the CI job can run as a required gate without continue-on-error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, nodejs, typescript
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100