mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
common/replay-headless could not build: esbuild could not resolve
"insights-js/rrweb-types". The subpath does not exist. insights-js resolves to
@hanzo/insights, whose tarball keeps those modules at
lib/src/extensions/replay/types/ and publishes no exports map, so nothing maps
the short name onto them. Upstream gets away with the same import because there
posthog-js is a workspace package with source layout; here it is a registry
tarball.
The types are published on their own as @hanzo/insights-rrweb-types and
@hanzo/insights-rrweb. frontend already depended on both and reached them
through two tsconfig paths entries; the replay packages had neither the
dependency nor the mapping, so they were the half of the tree the alias did not
cover.
Rather than widen the alias to a second place, this removes it: every import
names the package that provides it, and both replay packages declare what they
use.
62 imports in 44 files insights-js/rrweb* -> @hanzo/insights-rrweb*
tsconfig.json two paths entries dropped, no longer referenced
replay-shared/headless declare @hanzo/insights-rrweb{,-types} 0.0.26
replay-headless drops insights-js: nothing in it referenced insights-js
jest.config.js transformIgnorePatterns follows the real package, or
the ESM it exists to let through stops being transformed
Latent since the 08-01 rebase brought these packages and these imports in
together; surfaced today when c5f6b5940 started COPYing them into the image, so
turbo began building what nodejs already declared as a dependency.
Co-authored-by: Hanzo Dev <[email protected]>
15 lines
662 B
JavaScript
15 lines
662 B
JavaScript
module.exports = {
|
|
transform: {
|
|
'^.+\\.[cm]?[jt]s$': ['@swc/jest'],
|
|
},
|
|
// The rrweb packages ship ESM; let them through to the transform.
|
|
transformIgnorePatterns: ['node_modules/(?!.*@hanzo/insights-rrweb)'],
|
|
testEnvironment: 'node',
|
|
// Wraps the describe/it/test globals to enforce .test_quarantine.json jest entries.
|
|
setupFilesAfterEnv: ['../../frontend/jest.quarantine.ts'],
|
|
clearMocks: true,
|
|
testMatch: ['<rootDir>/src/**/*.test.ts'],
|
|
// CI sets JEST_JUNIT_OUTPUT_DIR to collect junit for the Trunk quarantine gate.
|
|
reporters: process.env.JEST_JUNIT_OUTPUT_DIR ? ['default', 'jest-junit'] : ['default'],
|
|
}
|