-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…#30922) ### Proposed Changes * Add Providers, Custom Hooks to consume DotContentAnalytics ### Checklist - [x] Tests - [ ] Translations - [ ] Security Implications Contemplated (add notes if applicable) ### Additional Info ** any additional useful context or info ** ### Screenshots Pageview + Custom Track Event https://github.com/user-attachments/assets/e4ab4554-70bd-4d52-abde-38dddad3be49
- Loading branch information
Showing
49 changed files
with
7,884 additions
and
6,321 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@nx/react/babel", | ||
{ | ||
"runtime": "automatic", | ||
"useBuiltIns": "usage" | ||
} | ||
] | ||
], | ||
"plugins": [] | ||
} |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,21 @@ | ||
/* eslint-disable */ | ||
import { readFileSync } from 'fs'; | ||
|
||
// Reading the SWC compilation config and remove the "exclude" | ||
// for the test files to be compiled by SWC | ||
const { exclude: _, ...swcJestConfig } = JSON.parse(readFileSync(`${__dirname}/.swcrc`, 'utf-8')); | ||
|
||
// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves. | ||
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude" | ||
if (swcJestConfig.swcrc === undefined) { | ||
swcJestConfig.swcrc = false; | ||
} | ||
|
||
// Uncomment if using global setup/teardown files being transformed via swc | ||
// https://nx.dev/nx-api/jest/documents/overview#global-setupteardown-with-nx-libraries | ||
// jest needs EsModule Interop to find the default exported setup/teardown functions | ||
// swcJestConfig.module.noInterop = false; | ||
|
||
export default { | ||
displayName: 'analytics', | ||
displayName: 'sdk-analytics', | ||
preset: '../../../jest.preset.js', | ||
transform: { | ||
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig] | ||
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest', | ||
'^.+\\.[tj]sx?$': [ | ||
'babel-jest', | ||
{ | ||
presets: ['@nx/react/babel'], | ||
plugins: [ | ||
['@babel/plugin-proposal-private-methods', { loose: true }], | ||
['@babel/plugin-proposal-private-property-in-object', { loose: true }], | ||
['@babel/plugin-proposal-class-properties', { loose: true }] | ||
] | ||
} | ||
] | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
testEnvironment: 'jsdom', | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], | ||
coverageDirectory: '../../../coverage/libs/sdk/analytics' | ||
}; |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export * from './lib/analytics'; | ||
export * from './lib/react'; |
Oops, something went wrong.