diff --git a/networkProxy/package.json b/networkProxy/package.json index 4e3828f9c..4c08a2ffc 100644 --- a/networkProxy/package.json +++ b/networkProxy/package.json @@ -1,6 +1,6 @@ { "name": "@openreplay/network-proxy", - "version": "1.0.4", + "version": "1.0.5", "description": "this library helps us to create proxy objects for fetch, XHR and beacons for proper request tracking.", "main": "dist/index.js", "module": "dist/index.js", @@ -8,6 +8,7 @@ "files": [ "dist" ], + "type": "module", "scripts": { "build": "tsc", "test": "vitest", diff --git a/tracker/tracker/.yarn/install-state.gz b/tracker/tracker/.yarn/install-state.gz index 424179e09..27c2c8219 100644 Binary files a/tracker/tracker/.yarn/install-state.gz and b/tracker/tracker/.yarn/install-state.gz differ diff --git a/tracker/tracker/package.json b/tracker/tracker/package.json index a815ba4f7..001187da3 100644 --- a/tracker/tracker/package.json +++ b/tracker/tracker/package.json @@ -1,7 +1,7 @@ { "name": "@openreplay/tracker", "description": "The OpenReplay tracker main package", - "version": "15.0.0", + "version": "15.0.1", "keywords": [ "logging", "replay" @@ -26,16 +26,19 @@ }, "files": [ "dist/lib/**/*", - "dist/cjs/**/*" + "dist/cjs/**/*", + "dist/types/**/*" ], "main": "./dist/cjs/index.js", "module": "./dist/lib/index.js", "types": "./dist/lib/main/index.d.ts", "scripts": { "lint": "eslint src --ext .ts,.js --fix --quiet", - "clean": "rm -Rf build && rm -Rf lib && rm -Rf cjs", + "clean": "rm -Rf build && rm -Rf dist", "build:common": "tsc -b src/common", - "build": "yarn run clean && rollup --config rollup.config.js", + "compile": "tsc --project src/main/tsconfig.json", + "create-types": "mkdir dist/lib/ dist/cjs && cp -r dist/types/* dist/lib/ && cp -r dist/types/* dist/cjs/", + "build": "yarn run clean && yarn compile && yarn create-types && rollup --config rollup.config.js", "lint-front": "lint-staged", "test": "jest --coverage=false", "test:ci": "jest --coverage=true", @@ -46,6 +49,7 @@ "@babel/core": "^7.26.0", "@jest/globals": "^29.7.0", "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^28.0.1", "@rollup/plugin-node-resolve": "^15.3.0", "@rollup/plugin-replace": "^6.0.1", "@rollup/plugin-terser": "0.4.4", @@ -67,7 +71,7 @@ }, "dependencies": { "@medv/finder": "^3.2.0", - "@openreplay/network-proxy": "^1.0.4", + "@openreplay/network-proxy": "^1.0.5", "error-stack-parser": "^2.0.6", "error-stack-parser-es": "^0.1.5", "fflate": "^0.8.2", diff --git a/tracker/tracker/rollup.config.js b/tracker/tracker/rollup.config.js index cedc7d3c2..9b09c574c 100644 --- a/tracker/tracker/rollup.config.js +++ b/tracker/tracker/rollup.config.js @@ -3,6 +3,7 @@ import typescript from '@rollup/plugin-typescript' import terser from '@rollup/plugin-terser' import replace from '@rollup/plugin-replace' import { rollup } from 'rollup' +import commonjs from '@rollup/plugin-commonjs'; import { createRequire } from 'module' const require = createRequire(import.meta.url) const packageConfig = require('./package.json') @@ -12,7 +13,6 @@ export default async () => { const commonPlugins = [ resolve(), - // terser(), replace({ preventAssignment: true, values: { @@ -23,7 +23,7 @@ export default async () => { ] return [ { - input: 'src/main/index.ts', + input: 'build/main/index.js', output: { dir: 'dist/lib', format: 'es', @@ -32,13 +32,10 @@ export default async () => { }, plugins: [ ...commonPlugins, - typescript({ - tsconfig: 'src/main/tsconfig.json', - }), ], }, { - input: 'src/main/index.ts', + input: 'build/main/index.js', output: { dir: 'dist/cjs', format: 'cjs', @@ -47,9 +44,7 @@ export default async () => { }, plugins: [ ...commonPlugins, - typescript({ - tsconfig: 'src/main/tsconfig-cjs.json', - }), + commonjs(), ], }, ] diff --git a/tracker/tracker/src/main/app/nodes/maintainer.ts b/tracker/tracker/src/main/app/nodes/maintainer.ts index 7ed905efe..cbc33de0d 100644 --- a/tracker/tracker/src/main/app/nodes/maintainer.ts +++ b/tracker/tracker/src/main/app/nodes/maintainer.ts @@ -8,7 +8,7 @@ function processMapInBatches( const iterator = map.entries() function processNextBatch() { - const batch = [] + const batch: any[] = [] let result = iterator.next() while (!result.done && batch.length < batchSize) { diff --git a/tracker/tracker/src/main/modules/console.ts b/tracker/tracker/src/main/modules/console.ts index 2e74bcfb2..efdd3be88 100644 --- a/tracker/tracker/src/main/modules/console.ts +++ b/tracker/tracker/src/main/modules/console.ts @@ -49,7 +49,7 @@ function printObject(arg: any): string { return `Array(${length})[${values}]` } if (typeof arg === 'object') { - const res = [] + const res: string[] = [] let i = 0 for (const k in arg) { if (++i === 10) { diff --git a/tracker/tracker/src/main/tsconfig-cjs.json b/tracker/tracker/src/main/tsconfig-cjs.json deleted file mode 100644 index 75713d695..000000000 --- a/tracker/tracker/src/main/tsconfig-cjs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "moduleResolution": "Node", - "declarationDir": "../../dist/cjs" - }, -} \ No newline at end of file diff --git a/tracker/tracker/src/main/tsconfig.json b/tracker/tracker/src/main/tsconfig.json index d71416b5c..cba19b814 100644 --- a/tracker/tracker/src/main/tsconfig.json +++ b/tracker/tracker/src/main/tsconfig.json @@ -4,6 +4,6 @@ "allowSyntheticDefaultImports": true, "lib": ["es2020", "dom"], "declaration": true, - "declarationDir": "../../dist/lib", - }, + "declarationDir": "../../dist/types", + } } diff --git a/tracker/tracker/tsconfig-base.json b/tracker/tracker/tsconfig-base.json index 1a48551d5..f5aea83cf 100644 --- a/tracker/tracker/tsconfig-base.json +++ b/tracker/tracker/tsconfig-base.json @@ -1,17 +1,18 @@ { "compilerOptions": { "rootDir": "src", - "noImplicitAny": true, - "noImplicitThis": true, + "noImplicitAny": false, + "noImplicitThis": false, "strictNullChecks": true, - "alwaysStrict": true, + "alwaysStrict": false, "target": "es2020", "lib": ["DOM", "ES2020"], - "module": "NodeNext", - "moduleResolution": "NodeNext", + "module": "ES2022", + "moduleResolution": "node", "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "resolveJsonModule": true + "resolveJsonModule": true, + "outDir": "build" }, - "exclude": ["**/*.test.ts"], + "exclude": ["**/*.test.ts"] }