From d8249c6b632aaf03ac7ad1ee034bdbfcd5c4fc1c Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:11:39 -0700 Subject: [PATCH 01/16] convert .eslint to esm --- .eslintrc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.eslintrc b/.eslintrc index f33256b3..728df68c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,3 +1,14 @@ { - "extends": "@terascope" + "extends": "@terascope", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + "@typescript-eslint/naming-convention": "off", + "@typescript-eslint/no-duplicate-enum-values": "warn", + "import/extensions": "off", + "import/no-import-module-exports": "off" + }, + "ignorePatterns":[] } From 9f8561a2c4613ac8c267c9b646025ae6e378c253 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:13:05 -0700 Subject: [PATCH 02/16] change yarn to cjs extension --- .yarn/releases/{yarn-1.22.19.js => yarn-1.22.19.cjs} | 0 .yarnrc | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .yarn/releases/{yarn-1.22.19.js => yarn-1.22.19.cjs} (100%) diff --git a/.yarn/releases/yarn-1.22.19.js b/.yarn/releases/yarn-1.22.19.cjs similarity index 100% rename from .yarn/releases/yarn-1.22.19.js rename to .yarn/releases/yarn-1.22.19.cjs diff --git a/.yarnrc b/.yarnrc index 24cd9263..262a0092 100644 --- a/.yarnrc +++ b/.yarnrc @@ -3,4 +3,4 @@ lastUpdateCheck 1695653572310 -yarn-path ".yarn/releases/yarn-1.22.19.js" +yarn-path ".yarn/releases/yarn-1.22.19.cjs" From da73065b794b18d7864a097d9b833bede7a20e3c Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:14:06 -0700 Subject: [PATCH 03/16] update jest config to be esm --- jest.config.js | 29 ++++++++++++--------- packages/standard-asset-apis/jest.config.js | 22 ++++++++-------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/jest.config.js b/jest.config.js index 6e719d14..9b8cae13 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,11 +1,11 @@ -'use strict'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; -const path = require('path'); - -module.exports = { +const dirname = path.dirname(fileURLToPath(import.meta.url)); +export default { verbose: true, testEnvironment: 'node', - setupFilesAfterEnv: ['jest-extended/all', '/test/test.setup.js'], + setupFilesAfterEnv: ['jest-extended/all'], collectCoverage: true, coverageReporters: ['json', 'lcov', 'text', 'html'], coverageDirectory: 'coverage', @@ -22,20 +22,25 @@ module.exports = { testMatch: [ '/test/**/*-spec.{ts,js}', '/test/*-spec.{ts,js}', + + // '/test/routed_sender/schema-spec.{ts,js}', + // '/test/data-generator/fetcher-spec.{ts,js}', + ], moduleNameMapper: { - '^@terascope/file-asset-apis$': path.join(__dirname, '/packages/standard-asset-apis/src/index.ts'), + '^@terascope/standard-asset-apis$': path.join(dirname, '/packages/standard-asset-apis/src/index.ts'), + '^(\\.{1,2}/.*)\\.js$': '$1', }, preset: 'ts-jest', + extensionsToTreatAsEsm: ['.ts'], globals: { ignoreDirectories: ['dist'], - availableExtensions: ['.js', '.ts'] + availableExtensions: ['.js', '.ts', '.mjs'] }, transform: { - testMatch: [ - 'ts-jest', { - tsconfig: './tsconfig.json', - diagnostics: true, - },], + '\\.[jt]sx?$': ['ts-jest', { + isolatedModules: true, + useESM: true + }] }, }; diff --git a/packages/standard-asset-apis/jest.config.js b/packages/standard-asset-apis/jest.config.js index 5c1950e9..d830eaf6 100644 --- a/packages/standard-asset-apis/jest.config.js +++ b/packages/standard-asset-apis/jest.config.js @@ -1,22 +1,22 @@ -'use strict'; - -module.exports = { +export default { verbose: true, testEnvironment: 'node', - setupFilesAfterEnv: ['jest-extended/all', '/test/test.setup.js'], + setupFilesAfterEnv: ['jest-extended/all'], collectCoverage: true, coverageReporters: ['json', 'lcov', 'text', 'html'], coverageDirectory: 'coverage', + extensionsToTreatAsEsm: ['.ts'], testMatch: [ '/test/**/*-spec.{ts,js}', '/test/*-spec.{ts,js}', ], - preset: 'ts-jest', - globals: { - 'ts-jest': { - tsconfig: './tsconfig.json', - diagnostics: true, - pretty: true, - } + transform: { + '\\.[jt]sx?$': ['ts-jest', { + isolatedModules: true, + useESM: true + }] + }, + moduleNameMapper: { + '^(\\.{1,2}/.*)\\.js$': '$1', } }; From eac8bfc83595372a04a51ab49da5ca7f03a5e75d Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:15:04 -0700 Subject: [PATCH 04/16] update @terascope deps and move testing to scripts --- asset/package.json | 7 +- asset/tsconfig.build.json | 4 +- package.json | 15 +- packages/standard-asset-apis/package.json | 3 +- yarn.lock | 190 +++++++++------------- 5 files changed, 93 insertions(+), 126 deletions(-) diff --git a/asset/package.json b/asset/package.json index 3f69ba02..dcb95e43 100644 --- a/asset/package.json +++ b/asset/package.json @@ -3,6 +3,7 @@ "displayName": "Asset", "version": "0.25.1", "private": true, + "type": "module", "description": "Teraslice standard processor asset bundle", "repository": { "type": "git", @@ -21,9 +22,9 @@ }, "dependencies": { "@faker-js/faker": "^8.4.1", - "@terascope/job-components": "^0.75.1", + "@terascope/job-components": "^1.0.1", "@terascope/standard-asset-apis": "^0.7.2", - "@terascope/utils": "^0.59.1", + "@terascope/utils": "^0.59.3", "@types/chance": "^1.1.4", "@types/express": "^4.17.19", "chance": "^1.1.11", @@ -33,7 +34,7 @@ "randexp": "^0.5.3", "short-unique-id": "^5.2.0", "timsort": "^0.3.0", - "ts-transforms": "^0.85.2", + "ts-transforms": "^0.85.3", "tslib": "^2.6.3" }, "engines": { diff --git a/asset/tsconfig.build.json b/asset/tsconfig.build.json index 3b46a1f7..c6da7c99 100644 --- a/asset/tsconfig.build.json +++ b/asset/tsconfig.build.json @@ -3,9 +3,9 @@ "compilerOptions": { "rootDir": "src", "outDir": "dist", - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", - "target": "es2019", + "target": "ESNext", "skipLibCheck": true, "experimentalDecorators": true, "strict": true, diff --git a/package.json b/package.json index 5cc7f290..ed1e0132 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "displayName": "Standard Assets Bundle", "version": "0.25.1", "private": true, + "type": "module", "description": "Teraslice standard processor asset bundle", "workspaces": [ "packages/*", @@ -19,15 +20,15 @@ "lint:fix": "yarn lint --fix", "publish:changed": "./scripts/publish.sh", "setup": "yarn && yarn build --force", - "test": "jest", - "test:all": "yarn workspaces run test", - "test:debug": "env DEBUG=\"${DEBUG:-*teraslice*}\" jest --detectOpenHandles --coverage=false --runInBand", - "test:watch": "jest --coverage=false --notify --watch --onlyChanged" + "test": "NODE_OPTIONS='--experimental-vm-modules' ts-scripts test asset --", + "test:all": "NODE_OPTIONS='--experimental-vm-modules' ts-scripts test", + "test:debug": "NODE_OPTIONS='--experimental-vm-modules' ts-scripts test --debug asset --", + "test:watch": "NODE_OPTIONS='--experimental-vm-modules' ts-scripts test --watch asset --" }, "devDependencies": { "@terascope/eslint-config": "^0.8.0", - "@terascope/job-components": "^0.75.1", - "@terascope/scripts": "0.77.2", + "@terascope/job-components": "^1.0.1", + "@terascope/scripts": "0.77.3", "@terascope/standard-asset-apis": "^0.7.2", "@types/express": "^4.17.19", "@types/jest": "^29.5.12", @@ -39,7 +40,7 @@ "jest": "^29.7.0", "jest-extended": "^4.0.2", "node-notifier": "^10.0.1", - "teraslice-test-harness": "^0.30.0", + "teraslice-test-harness": "^1.0.1", "ts-jest": "^29.1.5", "tslib": "^2.6.3", "typescript": "~5.2.2" diff --git a/packages/standard-asset-apis/package.json b/packages/standard-asset-apis/package.json index 32cd28ce..72225acd 100644 --- a/packages/standard-asset-apis/package.json +++ b/packages/standard-asset-apis/package.json @@ -6,6 +6,7 @@ "homepage": "https://github.com/terascope/standard-assets", "repository": "git@github.com:terascope/standard-assets.git", "license": "MIT", + "type": "module", "author": "Terascope, LLC ", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", @@ -21,7 +22,7 @@ }, "dependencies": { "@sindresorhus/fnv1a": "^2.0.1", - "@terascope/utils": "^0.59.1" + "@terascope/utils": "^0.59.3" }, "devDependencies": { "@types/jest": "^29.5.12", diff --git a/yarn.lock b/yarn.lock index 1e87a359..b9a07c7e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -783,15 +783,15 @@ dependencies: defer-to-connect "^2.0.0" -"@terascope/data-mate@^0.56.2": - version "0.56.2" - resolved "https://registry.yarnpkg.com/@terascope/data-mate/-/data-mate-0.56.2.tgz#51fa9b4ba49e5090acdb9e028e07f61ef3ac7f6d" - integrity sha512-qRidKi3UcUThdzj+y9G160vgxO4X7x1v+5MVS0+pYgyx27kTmZ6LBlrD7aYwbm6TQt6Z4oc9048iMq8pnH5bjg== - dependencies: - "@terascope/data-types" "^0.50.2" - "@terascope/types" "^0.17.2" - "@terascope/utils" "^0.59.2" - "@types/validator" "^13.11.9" +"@terascope/data-mate@^0.56.3": + version "0.56.3" + resolved "https://registry.yarnpkg.com/@terascope/data-mate/-/data-mate-0.56.3.tgz#30f9e599681856a04f55bd53650ca36f82ed675f" + integrity sha512-+WwxIiLTi9N1Tmab2N3b0VrsD2YUnnDyFJe6D9AokMj9luA6Brv+5c58JFfzL8lhFOd3b8/HrSPTdNELgBGiIA== + dependencies: + "@terascope/data-types" "^0.50.3" + "@terascope/types" "^0.17.3" + "@terascope/utils" "^0.59.3" + "@types/validator" "^13.11.10" awesome-phonenumber "^2.70.0" date-fns "^2.30.0" ip-bigint "^3.0.3" @@ -804,16 +804,16 @@ mnemonist "^0.39.8" uuid "^9.0.1" valid-url "^1.0.9" - validator "^13.11.0" - xlucene-parser "^0.58.2" + validator "^13.12.0" + xlucene-parser "^0.58.3" -"@terascope/data-types@^0.50.2": - version "0.50.2" - resolved "https://registry.yarnpkg.com/@terascope/data-types/-/data-types-0.50.2.tgz#63e8d8fb078e67bee82a664a9d5c608e2bc9e1f2" - integrity sha512-VNXyWCkuZQLrgT9oXys3rGsRGyh90ah9JGmAZlrguTgd02UNQEgSYZji7M7kn7SKHnFpzHHwuzqX7kwv++jXfA== +"@terascope/data-types@^0.50.3": + version "0.50.3" + resolved "https://registry.yarnpkg.com/@terascope/data-types/-/data-types-0.50.3.tgz#bda225535b40c45c3c393dcc4155159f14f3db23" + integrity sha512-i60T0nF/nKKF/f9YS/EmFmpDhdLExJfvjg28OerAXQ+eci83+VETlCa3dpsQek7NzdtZ49Fwtx+ab8AVotWeKQ== dependencies: - "@terascope/types" "^0.17.2" - "@terascope/utils" "^0.59.2" + "@terascope/types" "^0.17.3" + "@terascope/utils" "^0.59.3" graphql "^14.7.0" lodash "^4.17.21" yargs "^17.7.2" @@ -833,38 +833,39 @@ eslint-plugin-react "^7.29.4" eslint-plugin-react-hooks "^4.4.0" -"@terascope/fetch-github-release@^0.8.7": - version "0.8.7" - resolved "https://registry.yarnpkg.com/@terascope/fetch-github-release/-/fetch-github-release-0.8.7.tgz#fd8aba265c06704d51a6ab70fd2c656c80f04156" - integrity sha512-m6vpKCUlBYhxlx6BXQoOi0hg/FFZ5Bo/De+MjhDuoFLhR8pMzJxS0Nge8bSIXc1G8Jqmw4g4mkoZOqEb9TmMbQ== +"@terascope/fetch-github-release@^0.8.10": + version "0.8.10" + resolved "https://registry.yarnpkg.com/@terascope/fetch-github-release/-/fetch-github-release-0.8.10.tgz#243b8a50f963f4c2c5771689e2b94e94265db179" + integrity sha512-bTLmiEotEca8YTi+PcvznisIHMEKYLU0Uj322rkbMJlr6LqXFvIKv2dzuwMhSADO7eUeKlC4mXUs8Nt2ftpdWA== dependencies: extract-zip "^2.0.1" - gauge "^3.0.0" got "^11.4.0" multi-progress "^4.0.0" progress "^2.0.3" yargs "^17.2.1" -"@terascope/job-components@^0.75.1": - version "0.75.1" - resolved "https://registry.yarnpkg.com/@terascope/job-components/-/job-components-0.75.1.tgz#74cdd3035414ce56a9762403afc797e0a41827be" - integrity sha512-h8fYs3vBRBHf90q0JJhjNi/QeaJ3whsqNIgu53WnBWrHrlxP3Nfj9bYxoDFf7Ne4w31lDI/6Z5Z69tutEQQ3mA== +"@terascope/job-components@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@terascope/job-components/-/job-components-1.0.1.tgz#8b271a17550aad9d01baa3d9584e6a35adf3d866" + integrity sha512-MsbzVnQf87LkzDI7b75RGBmRrMqchqrCEdBacO0PwJ9OakFWeqmJv8UDolTlRe3zfb3OgfWwhSK7V2jpvdZ+CA== dependencies: - "@terascope/utils" "^0.59.2" + "@terascope/types" "^0.17.3" + "@terascope/utils" "^0.59.3" convict "^6.2.4" convict-format-with-moment "^6.2.0" convict-format-with-validator "^6.2.0" datemath-parser "^1.0.6" + import-meta-resolve "^4.0.0" prom-client "^15.1.2" uuid "^9.0.1" -"@terascope/scripts@0.77.2": - version "0.77.2" - resolved "https://registry.yarnpkg.com/@terascope/scripts/-/scripts-0.77.2.tgz#4f6bea89928d6dfa754a685f8ad4e55e86ce7902" - integrity sha512-XWQTYhz4qYQ5N5zc3P0WQNktnwE6lMuqFHn+4WvU8wayBJtJUp6Ljvq9MTXnf7tkTclFJwBQZv+7flOwuRueiA== +"@terascope/scripts@0.77.3": + version "0.77.3" + resolved "https://registry.yarnpkg.com/@terascope/scripts/-/scripts-0.77.3.tgz#8d3b2f6271527aab336b86a64efac796f2819018" + integrity sha512-y89ygMBL4hjUVKo2r2YrODqEog3SanYi+zLQes1Tlhu5y2qN/mw4jxZlktajGWNClT7vnknp++hlf09JPJIdyw== dependencies: "@kubernetes/client-node" "^0.20.0" - "@terascope/utils" "^0.59.2" + "@terascope/utils" "^0.59.3" codecov "^3.8.3" execa "^5.1.0" fs-extra "^11.2.0" @@ -879,7 +880,7 @@ ms "^2.1.3" package-json "^7.0.0" pkg-up "^3.1.0" - semver "^7.6.1" + semver "^7.6.2" signale "^1.4.0" sort-package-json "~1.57.0" toposort "^2.0.2" @@ -894,19 +895,19 @@ dependencies: bluebird "^3.7.2" -"@terascope/types@^0.17.2": - version "0.17.2" - resolved "https://registry.yarnpkg.com/@terascope/types/-/types-0.17.2.tgz#0e8d13c1249dccb0ccf63e691e253337645a205d" - integrity sha512-GzbxIVjFiViiULc7XK0EiAgT5yubwi2VXvp0wC3ygigTNIsqugncPub2ChpiqTx2JlVGVGJrXPSvPgPTJphYqw== +"@terascope/types@^0.17.3": + version "0.17.3" + resolved "https://registry.yarnpkg.com/@terascope/types/-/types-0.17.3.tgz#a99529ed1dd3aeb28a667e19749e0c2bb34f775f" + integrity sha512-4HtoBwWFcOMvtY1khQTalQIu6EfiQNKFJlagJfL7EWrqa1p968tS0NaqpZD8foIHamVEFQ5m0b4TgJeYHjzUbg== dependencies: prom-client "^15.1.2" -"@terascope/utils@^0.59.1", "@terascope/utils@^0.59.2": - version "0.59.2" - resolved "https://registry.yarnpkg.com/@terascope/utils/-/utils-0.59.2.tgz#0c987c2d307a19abe7e41036c162bc382df741a6" - integrity sha512-CYEfVt7PkkKFdpnnMf0sXfd6dYQdK3SsrKkCuupYvk3nPyP5q1eRzyzX4IS1/KrG3yVsqTKNHLrx8gR/UHUPOw== +"@terascope/utils@^0.59.3": + version "0.59.3" + resolved "https://registry.yarnpkg.com/@terascope/utils/-/utils-0.59.3.tgz#24e91b25833abc324f6038664d6d567fffbe79df" + integrity sha512-q1MFXLe6sfJ7Eybraz90RfI9YnrHSFz9SyWmqIV3yrqyT/+OAzwZ2wy9fX2dHqA6WP69t0LAD1J/n/9Og6JSlg== dependencies: - "@terascope/types" "^0.17.2" + "@terascope/types" "^0.17.3" "@turf/bbox" "^6.4.0" "@turf/bbox-polygon" "^6.4.0" "@turf/boolean-contains" "^6.4.0" @@ -920,7 +921,7 @@ "@turf/invariant" "^6.2.0" "@turf/line-to-polygon" "^6.4.0" "@types/lodash" "^4.14.202" - "@types/validator" "^13.11.9" + "@types/validator" "^13.11.10" awesome-phonenumber "^2.70.0" date-fns "^2.30.0" date-fns-tz "^1.3.7" @@ -941,7 +942,7 @@ mnemonist "^0.39.8" p-map "^4.0.0" shallow-clone "^3.0.1" - validator "^13.11.0" + validator "^13.12.0" "@tootallnate/once@1": version "1.1.2" @@ -1410,10 +1411,10 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== -"@types/validator@^13.11.9": - version "13.11.9" - resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.11.9.tgz#adfe96520b437a0eaa798a475877bf2f75ee402d" - integrity sha512-FCTsikRozryfayPuiI46QzH3fnrOoctTjvOYZkho9BTFLCOZ2rgZJHMOVgCOfttjPJcgOx52EpkY0CMfy87MIw== +"@types/validator@^13.11.10": + version "13.12.0" + resolved "https://registry.yarnpkg.com/@types/validator/-/validator-13.12.0.tgz#1fe4c3ae9de5cf5193ce64717c99ef2fa7d8756f" + integrity sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag== "@types/ws@^8.5.3": version "8.5.10" @@ -1622,11 +1623,6 @@ anymatch@^3.0.3: normalize-path "^3.0.0" picomatch "^2.0.4" -"aproba@^1.0.3 || ^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== - argparse@^1.0.7: version "1.0.10" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" @@ -2181,11 +2177,6 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-support@^1.1.2: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" - integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== - combined-stream@^1.0.6, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" @@ -2218,11 +2209,6 @@ confusing-browser-globals@^1.0.10: resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz#ae40e9b57cdd3915408a2805ebd3a5585608dc81" integrity sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA== -console-control-strings@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" - integrity sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ== - content-disposition@0.5.4: version "0.5.4" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" @@ -3399,21 +3385,6 @@ functions-have-names@^1.2.2, functions-have-names@^1.2.3: resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== -gauge@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" - integrity sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q== - dependencies: - aproba "^1.0.3 || ^2.0.0" - color-support "^1.1.2" - console-control-strings "^1.0.0" - has-unicode "^2.0.1" - object-assign "^4.1.1" - signal-exit "^3.0.0" - string-width "^4.2.3" - strip-ansi "^6.0.1" - wide-align "^1.1.2" - gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -3714,11 +3685,6 @@ has-tostringtag@^1.0.0: dependencies: has-symbols "^1.0.3" -has-unicode@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" - integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== - has@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/has/-/has-1.0.4.tgz#2eb2860e000011dae4f1406a86fe80e530fb2ec6" @@ -3831,6 +3797,11 @@ import-local@^3.0.2: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" +import-meta-resolve@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/import-meta-resolve/-/import-meta-resolve-4.1.0.tgz#f9db8bead9fafa61adb811db77a2bf22c5399706" + integrity sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw== + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -6009,7 +5980,7 @@ semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@^7.6.1: +semver@^7.3.5, semver@^7.3.7, semver@^7.5.3, semver@^7.5.4, semver@^7.6.2: version "7.6.2" resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== @@ -6139,7 +6110,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: +signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -6267,7 +6238,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -6471,12 +6442,12 @@ teeny-request@7.1.1: stream-events "^1.0.5" uuid "^8.0.0" -teraslice-test-harness@^0.30.0: - version "0.30.0" - resolved "https://registry.yarnpkg.com/teraslice-test-harness/-/teraslice-test-harness-0.30.0.tgz#76ee0a3d06ecc3711de16edf58827dc0979b2a46" - integrity sha512-iIY2z2da7ZfzUl9bMXXQy1LwZpOfe2ICGY1fYQmiOl8UfojO4n/AENXHRIgTw2MOj875jwTDUQV+de38RwRdnA== +teraslice-test-harness@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/teraslice-test-harness/-/teraslice-test-harness-1.0.1.tgz#9612a99c66118af63036e4a6fc4a57c58b72a470" + integrity sha512-4dmMHefx7L9VLIF/Yj42QbrggkfHkZtKHI9jZNF0y5dlqRgJ2S7MhuSIq65a6ArjmGGW3XwMKjYWvY8dsiVbIQ== dependencies: - "@terascope/fetch-github-release" "^0.8.7" + "@terascope/fetch-github-release" "^0.8.10" "@terascope/teraslice-op-test-harness" "^1.24.1" decompress "^4.2.1" fs-extra "^11.2.0" @@ -6569,21 +6540,21 @@ ts-jest@^29.1.5: semver "^7.5.3" yargs-parser "^21.0.1" -ts-transforms@^0.85.2: - version "0.85.2" - resolved "https://registry.yarnpkg.com/ts-transforms/-/ts-transforms-0.85.2.tgz#b8ef2c9b46bfb17a1405913fd571a2075ec900bc" - integrity sha512-Ze+pCQ66J03mD/7u+xXg7KRFR/WsprYnhjVzL9Kuqmd/LXofGnnFYBFlrvfxPSvwdW5Ye+mFj/mn4+GdF+Oc2w== +ts-transforms@^0.85.3: + version "0.85.3" + resolved "https://registry.yarnpkg.com/ts-transforms/-/ts-transforms-0.85.3.tgz#c25e20c9f7bb2aaa0a3b2455a74c7780725a804a" + integrity sha512-ZOTl3RwTpHNXsWc29Yb/qbYpvX6YCjMlvOvsDbAHeqolsOVXgofOAYMirE20cFan78di808x4Uodz1rgiwBNZQ== dependencies: - "@terascope/data-mate" "^0.56.2" - "@terascope/types" "^0.17.2" - "@terascope/utils" "^0.59.2" + "@terascope/data-mate" "^0.56.3" + "@terascope/types" "^0.17.3" + "@terascope/utils" "^0.59.3" awesome-phonenumber "^2.70.0" graphlib "^2.1.8" is-ip "^3.1.0" jexl "^2.2.2" nanoid "^3.3.4" valid-url "^1.0.9" - validator "^13.11.0" + validator "^13.12.0" yargs "^17.7.2" tsconfig-paths@^3.14.1: @@ -6832,7 +6803,7 @@ valid-url@^1.0.9: resolved "https://registry.yarnpkg.com/valid-url/-/valid-url-1.0.9.tgz#1c14479b40f1397a75782f115e4086447433a200" integrity sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA== -validator@^13.11.0, validator@^13.6.0: +validator@^13.12.0, validator@^13.6.0: version "13.12.0" resolved "https://registry.yarnpkg.com/validator/-/validator-13.12.0.tgz#7d78e76ba85504da3fee4fd1922b385914d4b35f" integrity sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg== @@ -6950,13 +6921,6 @@ which@^2.0.1, which@^2.0.2: dependencies: isexe "^2.0.0" -wide-align@^1.1.2: - version "1.1.5" - resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3" - integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg== - dependencies: - string-width "^1.0.2 || 2 || 3 || 4" - wordwrap@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" @@ -6989,13 +6953,13 @@ ws@^8.11.0: resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== -xlucene-parser@^0.58.2: - version "0.58.2" - resolved "https://registry.yarnpkg.com/xlucene-parser/-/xlucene-parser-0.58.2.tgz#233aa064cbac512c7a0740d62b20e29a152cf19c" - integrity sha512-smyUVk/L5i9+QheLESLzJzP28PzeWeEDIRIEsNTTrrMqQA2RqHO+3iyghr7V1ReXUG18+mun9AMP7EwS9uAinA== +xlucene-parser@^0.58.3: + version "0.58.3" + resolved "https://registry.yarnpkg.com/xlucene-parser/-/xlucene-parser-0.58.3.tgz#0b53d8c5b4617f8648d64c5b965a668a152783b2" + integrity sha512-0pFlUeP7ox2rKnYkFloyODlt9d52RDiBoPCCmaBT2/TjJIdcxSSJWemuJbdi4Vt0s87QQYbmvYvv9FUm56D8jA== dependencies: - "@terascope/types" "^0.17.2" - "@terascope/utils" "^0.59.2" + "@terascope/types" "^0.17.3" + "@terascope/utils" "^0.59.3" xtend@^4.0.0: version "4.0.2" From 9dba172375e962a2351585da572ae217cbd59902 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:16:04 -0700 Subject: [PATCH 05/16] update tsconfigs to compile for esm --- asset/tsconfig.json | 7 +++++-- packages/standard-asset-apis/tsconfig.json | 5 ++++- tsconfig.json | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/asset/tsconfig.json b/asset/tsconfig.json index 1cac8ba0..7de2bd20 100644 --- a/asset/tsconfig.json +++ b/asset/tsconfig.json @@ -1,8 +1,11 @@ { "extends": "../tsconfig", "compilerOptions": { + "target": "ESNext", + "module": "ESNext", "outDir": "dist", - "rootDir": "src" + "rootDir": "src", + "esModuleInterop": true }, - "include": ["src"] + "include": ["src", "test"] } diff --git a/packages/standard-asset-apis/tsconfig.json b/packages/standard-asset-apis/tsconfig.json index d0c68498..4cffa705 100644 --- a/packages/standard-asset-apis/tsconfig.json +++ b/packages/standard-asset-apis/tsconfig.json @@ -1,8 +1,11 @@ { "extends": "../../tsconfig", "compilerOptions": { + "target": "ESNext", + "module": "ESNext", "outDir": "dist", - "rootDir": "." + "rootDir": ".", + "esModuleInterop": true }, "include": ["src", "test"] } diff --git a/tsconfig.json b/tsconfig.json index f188aba3..4f17a111 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,9 +2,9 @@ "compilerOptions": { "baseUrl": ".", "outDir": "dist", - "module": "commonjs", + "module": "ESNext", "moduleResolution": "node", - "target": "es2019", + "target": "ESNext", "skipLibCheck": true, "strict": true, "noFallthroughCasesInSwitch": true, From 7ea9f1c67ce73836709e29a979e01107b6b1f9b6 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:17:01 -0700 Subject: [PATCH 06/16] remove 'use strict' in setup.js files --- packages/standard-asset-apis/test/test.setup.js | 2 -- test/test.setup.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/packages/standard-asset-apis/test/test.setup.js b/packages/standard-asset-apis/test/test.setup.js index 7aa2867a..f7534b31 100644 --- a/packages/standard-asset-apis/test/test.setup.js +++ b/packages/standard-asset-apis/test/test.setup.js @@ -1,3 +1 @@ -'use strict'; - process.env.NODE_ENV = 'test'; diff --git a/test/test.setup.js b/test/test.setup.js index 7aa2867a..f7534b31 100644 --- a/test/test.setup.js +++ b/test/test.setup.js @@ -1,3 +1 @@ -'use strict'; - process.env.NODE_ENV = 'test'; From a3b50ebe2a5a9e032bdd708de3861fef651806aa Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:18:10 -0700 Subject: [PATCH 07/16] update imports in index.ts file to use .js extensions --- asset/src/index.ts | 122 ++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/asset/src/index.ts b/asset/src/index.ts index 44f51c0c..18f1cfca 100644 --- a/asset/src/index.ts +++ b/asset/src/index.ts @@ -1,93 +1,93 @@ -import Accumulate from './accumulate/processor'; -import AccumulateSchema from './accumulate/schema'; +import Accumulate from './accumulate/processor.js'; +import AccumulateSchema from './accumulate/schema.js'; -import AccumulateByKey from './accumulate_by_key/processor'; -import AccumulateByKeySchema from './accumulate_by_key/schema'; +import AccumulateByKey from './accumulate_by_key/processor.js'; +import AccumulateByKeySchema from './accumulate_by_key/schema.js'; -import AddKey from './add_key/processor'; -import AddKeySchema from './add_key/schema'; +import AddKey from './add_key/processor.js'; +import AddKeySchema from './add_key/schema.js'; -import AddShortId from './add_short_id/processor'; -import AddShortIdSchema from './add_short_id/schema'; +import AddShortId from './add_short_id/processor.js'; +import AddShortIdSchema from './add_short_id/schema.js'; -import CopyField from './copy_field/processor'; -import CopyFieldSchema from './copy_field/schema'; +import CopyField from './copy_field/processor.js'; +import CopyFieldSchema from './copy_field/schema.js'; -import CountByField from './count_by_field/processor'; -import CountByFieldSchema from './count_by_field/schema'; +import CountByField from './count_by_field/processor.js'; +import CountByFieldSchema from './count_by_field/schema.js'; -import DataGeneratorFetcher from './data_generator/fetcher'; -import DataGeneratorSchema from './data_generator/schema'; -import DataGeneratorSlicer from './data_generator/slicer'; +import DataGeneratorFetcher from './data_generator/fetcher.js'; +import DataGeneratorSchema from './data_generator/schema.js'; +import DataGeneratorSlicer from './data_generator/slicer.js'; -import DataWindowToArray from './data_window_to_array/processor'; -import DataWindowToArraySchema from './data_window_to_array/schema'; +import DataWindowToArray from './data_window_to_array/processor.js'; +import DataWindowToArraySchema from './data_window_to_array/schema.js'; -import DateRouter from './date_router/processor'; -import DateRouterSchema from './date_router/schema'; +import DateRouter from './date_router/processor.js'; +import DateRouterSchema from './date_router/schema.js'; -import DebugRoutes from './debug_routes/processor'; -import DebugRoutesSchema from './debug_routes/schema'; +import DebugRoutes from './debug_routes/processor.js'; +import DebugRoutesSchema from './debug_routes/schema.js'; -import Dedupe from './dedupe/processor'; -import DedupeSchema from './dedupe/schema'; +import Dedupe from './dedupe/processor.js'; +import DedupeSchema from './dedupe/schema.js'; -import DropField from './drop_field/processor'; -import DropFieldSchema from './drop_field/schema'; +import DropField from './drop_field/processor.js'; +import DropFieldSchema from './drop_field/schema.js'; -import DropFieldConditional from './drop_field_conditional/processor'; -import DropFieldConditionalSchema from './drop_field_conditional/schema'; +import DropFieldConditional from './drop_field_conditional/processor.js'; +import DropFieldConditionalSchema from './drop_field_conditional/schema.js'; -import Extraction from './extraction/processor'; -import ExtractionSchema from './extraction/schema'; +import Extraction from './extraction/processor.js'; +import ExtractionSchema from './extraction/schema.js'; -import FieldRouter from './field_router/processor'; -import FieldRouterSchema from './field_router/schema'; +import FieldRouter from './field_router/processor.js'; +import FieldRouterSchema from './field_router/schema.js'; -import GroupBy from './group_by/processor'; -import GroupBySchema from './group_by/schema'; +import GroupBy from './group_by/processor.js'; +import GroupBySchema from './group_by/schema.js'; -import HashRouter from './hash_router/processor'; -import HashRouterSchema from './hash_router/schema'; +import HashRouter from './hash_router/processor.js'; +import HashRouterSchema from './hash_router/schema.js'; -import KeyRouter from './key_router/processor'; -import KeyRouterSchema from './key_router/schema'; +import KeyRouter from './key_router/processor.js'; +import KeyRouterSchema from './key_router/schema.js'; -import Match from './match/processor'; -import MatchSchema from './match/schema'; +import Match from './match/processor.js'; +import MatchSchema from './match/schema.js'; -import Output from './output/processor'; -import OutputSchema from './output/schema'; +import Output from './output/processor.js'; +import OutputSchema from './output/schema.js'; -import PostProcess from './post_process/processor'; -import PostProcessSchema from './post_process/schema'; +import PostProcess from './post_process/processor.js'; +import PostProcessSchema from './post_process/schema.js'; -import RemoveKey from './remove_key/processor'; -import RemoveKeySchema from './remove_key/schema'; +import RemoveKey from './remove_key/processor.js'; +import RemoveKeySchema from './remove_key/schema.js'; -import RoutedSender from './routed_sender/processor'; -import RoutedSenderSchema from './routed_sender/schema'; +import RoutedSender from './routed_sender/processor.js'; +import RoutedSenderSchema from './routed_sender/schema.js'; -import Selection from './selection/processor'; -import SelectionSchema from './selection/schema'; +import Selection from './selection/processor.js'; +import SelectionSchema from './selection/schema.js'; -import SetField from './set_field/processor'; -import SetFieldSchema from './set_field/schema'; +import SetField from './set_field/processor.js'; +import SetFieldSchema from './set_field/schema.js'; -import SetKey from './set_key/processor'; -import SetKeySchema from './set_key/schema'; +import SetKey from './set_key/processor.js'; +import SetKeySchema from './set_key/schema.js'; -import Sort from './sort/processor'; -import SortSchema from './sort/schema'; +import Sort from './sort/processor.js'; +import SortSchema from './sort/schema.js'; -import Stdout from './stdout/processor'; -import StdoutSchema from './stdout/schema'; +import Stdout from './stdout/processor.js'; +import StdoutSchema from './stdout/schema.js'; -import Transform from './transform/processor'; -import TransformSchema from './transform/schema'; +import Transform from './transform/processor.js'; +import TransformSchema from './transform/schema.js'; -import Window from './window/processor'; -import WindowSchema from './window/schema'; +import Window from './window/processor.js'; +import WindowSchema from './window/schema.js'; export const ASSETS = { accumulate: { From c6589ed512fe8d9a4686bde0bce69878105ec7dc Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:21:06 -0700 Subject: [PATCH 08/16] convert standard-asset-apis to esm --- packages/standard-asset-apis/src/RoutedSender.ts | 2 +- packages/standard-asset-apis/src/index.ts | 4 ++-- packages/standard-asset-apis/src/routers/DateRouter.ts | 2 +- .../standard-asset-apis/src/routers/FieldRouter.ts | 2 +- packages/standard-asset-apis/src/routers/HashRouter.ts | 2 +- packages/standard-asset-apis/src/routers/KeyRouter.ts | 2 +- packages/standard-asset-apis/src/routers/index.ts | 10 +++++----- packages/standard-asset-apis/test/RoutedSender-spec.ts | 4 ++-- packages/standard-asset-apis/test/index-spec.ts | 2 +- .../test/routers/DateRouter-spec.ts | 2 +- .../test/routers/FieldRouter-spec.ts | 2 +- .../test/routers/HashRouter-spec.ts | 2 +- .../standard-asset-apis/test/routers/KeyRouter-spec.ts | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/standard-asset-apis/src/RoutedSender.ts b/packages/standard-asset-apis/src/RoutedSender.ts index e972add2..d56b0ef8 100644 --- a/packages/standard-asset-apis/src/RoutedSender.ts +++ b/packages/standard-asset-apis/src/RoutedSender.ts @@ -1,7 +1,7 @@ import { DataEntity, pMap, getLast, isInteger, RouteSenderAPI, Logger } from '@terascope/utils'; -import EventEmitter, { once } from 'events'; +import EventEmitter, { once } from 'node:events'; export type BatchOfRecords = readonly (DataEntity[])[]; diff --git a/packages/standard-asset-apis/src/index.ts b/packages/standard-asset-apis/src/index.ts index e1275b62..b645ab6a 100644 --- a/packages/standard-asset-apis/src/index.ts +++ b/packages/standard-asset-apis/src/index.ts @@ -1,2 +1,2 @@ -export * from './routers'; -export * from './RoutedSender'; +export * from './routers/index.js'; +export * from './RoutedSender.js'; diff --git a/packages/standard-asset-apis/src/routers/DateRouter.ts b/packages/standard-asset-apis/src/routers/DateRouter.ts index c94f723c..88dc0de2 100644 --- a/packages/standard-asset-apis/src/routers/DateRouter.ts +++ b/packages/standard-asset-apis/src/routers/DateRouter.ts @@ -1,7 +1,7 @@ import { DataEntity, getValidDate, TSError } from '@terascope/utils'; -import * as I from './interfaces'; +import * as I from './interfaces.js'; const WEEK_IN_MS = 86400 * 7 * 1000; diff --git a/packages/standard-asset-apis/src/routers/FieldRouter.ts b/packages/standard-asset-apis/src/routers/FieldRouter.ts index 7c5bb452..a096a4cd 100644 --- a/packages/standard-asset-apis/src/routers/FieldRouter.ts +++ b/packages/standard-asset-apis/src/routers/FieldRouter.ts @@ -1,5 +1,5 @@ import { DataEntity, toString } from '@terascope/utils'; -import * as I from './interfaces'; +import * as I from './interfaces.js'; /** * A routing algorithm that uses specific field values from a diff --git a/packages/standard-asset-apis/src/routers/HashRouter.ts b/packages/standard-asset-apis/src/routers/HashRouter.ts index a9e51be1..d7023ae8 100644 --- a/packages/standard-asset-apis/src/routers/HashRouter.ts +++ b/packages/standard-asset-apis/src/routers/HashRouter.ts @@ -3,7 +3,7 @@ import { toString } from '@terascope/utils'; import fnv1a from '@sindresorhus/fnv1a'; -import * as I from './interfaces'; +import * as I from './interfaces.js'; /** * A routing algorithm that uses a non-cryptographic hash diff --git a/packages/standard-asset-apis/src/routers/KeyRouter.ts b/packages/standard-asset-apis/src/routers/KeyRouter.ts index 6e64cd65..7ab184e5 100644 --- a/packages/standard-asset-apis/src/routers/KeyRouter.ts +++ b/packages/standard-asset-apis/src/routers/KeyRouter.ts @@ -1,5 +1,5 @@ import { DataEntity, debugLogger } from '@terascope/utils'; -import * as I from './interfaces'; +import * as I from './interfaces.js'; const logger = debugLogger('key_router'); diff --git a/packages/standard-asset-apis/src/routers/index.ts b/packages/standard-asset-apis/src/routers/index.ts index a367d670..552536bb 100644 --- a/packages/standard-asset-apis/src/routers/index.ts +++ b/packages/standard-asset-apis/src/routers/index.ts @@ -1,5 +1,5 @@ -export * from './DateRouter'; -export * from './FieldRouter'; -export * from './HashRouter'; -export * from './interfaces'; -export * from './KeyRouter'; +export * from './DateRouter.js'; +export * from './FieldRouter.js'; +export * from './HashRouter.js'; +export * from './interfaces.js'; +export * from './KeyRouter.js'; diff --git a/packages/standard-asset-apis/test/RoutedSender-spec.ts b/packages/standard-asset-apis/test/RoutedSender-spec.ts index 14925a25..52f3568e 100644 --- a/packages/standard-asset-apis/test/RoutedSender-spec.ts +++ b/packages/standard-asset-apis/test/RoutedSender-spec.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/naming-convention */ import { DataEntity, pDelay, @@ -6,9 +5,10 @@ import { debugLogger } from '@terascope/utils'; import 'jest-extended'; +import { jest } from '@jest/globals'; import { RoutedSender -} from '../src'; +} from '../src/index.js'; const logger = debugLogger('routed-sender-test'); diff --git a/packages/standard-asset-apis/test/index-spec.ts b/packages/standard-asset-apis/test/index-spec.ts index f9491711..490d7871 100644 --- a/packages/standard-asset-apis/test/index-spec.ts +++ b/packages/standard-asset-apis/test/index-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { KeyRouter, -} from '../src'; +} from '../src/index.js'; describe('index', () => { it('should export KeyRouter', () => { diff --git a/packages/standard-asset-apis/test/routers/DateRouter-spec.ts b/packages/standard-asset-apis/test/routers/DateRouter-spec.ts index 9ff6aae3..c636d1b5 100644 --- a/packages/standard-asset-apis/test/routers/DateRouter-spec.ts +++ b/packages/standard-asset-apis/test/routers/DateRouter-spec.ts @@ -3,7 +3,7 @@ import 'jest-extended'; import { DateRouter, DateResolution -} from '../../src'; +} from '../../src/index.js'; describe('DateRouter', () => { it('should work with the default daily', () => { diff --git a/packages/standard-asset-apis/test/routers/FieldRouter-spec.ts b/packages/standard-asset-apis/test/routers/FieldRouter-spec.ts index 89fd5b8e..a1888839 100644 --- a/packages/standard-asset-apis/test/routers/FieldRouter-spec.ts +++ b/packages/standard-asset-apis/test/routers/FieldRouter-spec.ts @@ -2,7 +2,7 @@ import { DataEntity } from '@terascope/utils'; import 'jest-extended'; import { FieldRouter -} from '../../src'; +} from '../../src/index.js'; describe('FieldRouter', () => { it('should work with one field', () => { diff --git a/packages/standard-asset-apis/test/routers/HashRouter-spec.ts b/packages/standard-asset-apis/test/routers/HashRouter-spec.ts index d1ba3baa..30214dc3 100644 --- a/packages/standard-asset-apis/test/routers/HashRouter-spec.ts +++ b/packages/standard-asset-apis/test/routers/HashRouter-spec.ts @@ -2,7 +2,7 @@ import { DataEntity } from '@terascope/utils'; import 'jest-extended'; import { HashRouter -} from '../../src'; +} from '../../src/index.js'; describe('HashRouter', () => { it('should work with one no fields and 4 partitions', () => { diff --git a/packages/standard-asset-apis/test/routers/KeyRouter-spec.ts b/packages/standard-asset-apis/test/routers/KeyRouter-spec.ts index 7ff348cd..3de72057 100644 --- a/packages/standard-asset-apis/test/routers/KeyRouter-spec.ts +++ b/packages/standard-asset-apis/test/routers/KeyRouter-spec.ts @@ -2,7 +2,7 @@ import { DataEntity } from '@terascope/utils'; import 'jest-extended'; import { KeyRouter, KeyRouterCaseOptions, KeyRouterFromOptions -} from '../../src'; +} from '../../src/index.js'; describe('KeyRouter', () => { it('should work with upper case', () => { From 688ed10ce8708cb41642bfc24c684659ed0a86e6 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:24:27 -0700 Subject: [PATCH 09/16] convert asset src to esm --- asset/src/__lib/accumulator-key.ts | 6 ++--- asset/src/__lib/utils.ts | 10 ++++---- asset/src/accumulate/interfaces.ts | 2 +- asset/src/accumulate/processor.ts | 11 +++++---- asset/src/accumulate/schema.ts | 2 +- asset/src/accumulate_by_key/interfaces.ts | 4 ++-- asset/src/accumulate_by_key/processor.ts | 9 ++++---- asset/src/accumulate_by_key/schema.ts | 2 +- asset/src/add_key/processor.ts | 2 +- asset/src/add_short_id/interfaces.ts | 2 +- asset/src/add_short_id/processor.ts | 12 ++++------ asset/src/copy_field/processor.ts | 2 +- asset/src/count_by_field/interfaces.ts | 2 +- asset/src/count_by_field/processor.ts | 2 +- asset/src/count_by_field/schema.ts | 2 +- asset/src/data_generator/counter.ts | 2 +- asset/src/data_generator/data-schema.ts | 4 +--- asset/src/data_generator/fetcher.ts | 23 +++++++++---------- asset/src/data_generator/interfaces.ts | 2 +- asset/src/data_generator/schema.ts | 2 +- asset/src/data_generator/slicer.ts | 4 ++-- asset/src/data_window_to_array/processor.ts | 2 +- asset/src/date_router/processor.ts | 5 ++-- asset/src/dedupe/interfaces.ts | 2 +- asset/src/dedupe/processor.ts | 6 ++--- asset/src/dedupe/schema.ts | 2 +- asset/src/drop_field/processor.ts | 2 +- asset/src/drop_field_conditional/processor.ts | 2 +- asset/src/extraction/processor.ts | 4 ++-- asset/src/extraction/schema.ts | 2 +- asset/src/field_router/processor.ts | 5 ++-- asset/src/group_by/interfaces.ts | 2 +- asset/src/group_by/processor.ts | 4 ++-- asset/src/group_by/schema.ts | 2 +- asset/src/hash_router/processor.ts | 7 +++--- asset/src/key_router/processor.ts | 5 ++-- asset/src/match/processor.ts | 9 ++++---- asset/src/output/processor.ts | 4 ++-- asset/src/output/schema.ts | 2 +- asset/src/post_process/processor.ts | 6 ++--- asset/src/post_process/schema.ts | 2 +- asset/src/remove_key/processor.ts | 2 +- asset/src/routed_sender/interfaces.ts | 2 +- asset/src/routed_sender/processor.ts | 10 ++++---- asset/src/routed_sender/schema.ts | 4 ++-- asset/src/selection/processor.ts | 4 ++-- asset/src/selection/schema.ts | 2 +- asset/src/set_field/processor.ts | 2 +- asset/src/set_key/interfaces.ts | 2 +- asset/src/set_key/processor.ts | 4 ++-- asset/src/set_key/schema.ts | 2 +- asset/src/sort/interfaces.ts | 4 ++-- asset/src/sort/processor.ts | 11 +++++---- asset/src/sort/schema.ts | 4 ++-- asset/src/stdout/interfaces.ts | 2 +- asset/src/transform/interfaces.ts | 2 +- asset/src/transform/processor.ts | 4 ++-- asset/src/transform/schema.ts | 2 +- asset/src/window/interfaces.ts | 2 +- asset/src/window/processor.ts | 6 ++--- asset/src/window/schema.ts | 2 +- 61 files changed, 128 insertions(+), 127 deletions(-) diff --git a/asset/src/__lib/accumulator-key.ts b/asset/src/__lib/accumulator-key.ts index be844ba9..23beb58b 100644 --- a/asset/src/__lib/accumulator-key.ts +++ b/asset/src/__lib/accumulator-key.ts @@ -1,7 +1,7 @@ import { DataEntity } from '@terascope/job-components'; -import Accumulator from './accumulator'; -import DataWindow from './data-window'; -import { AccumulateByKeyConfig } from '../accumulate_by_key/interfaces'; +import Accumulator from './accumulator.js'; +import DataWindow from './data-window.js'; +import { AccumulateByKeyConfig } from '../accumulate_by_key/interfaces.js'; export default class AccumulatorByKey extends Accumulator { buckets = new Map(); diff --git a/asset/src/__lib/utils.ts b/asset/src/__lib/utils.ts index d796fcf2..002c721d 100644 --- a/asset/src/__lib/utils.ts +++ b/asset/src/__lib/utils.ts @@ -1,6 +1,6 @@ -import path from 'path'; +import path from 'node:path'; import { get, getTime as tsGetTime } from '@terascope/job-components'; -import { PhaseConfig } from '../transform/interfaces'; +import { PhaseConfig } from '../transform/interfaces.js'; export enum Order { asc = 'asc', @@ -52,11 +52,11 @@ export async function loadResources(opConfig: PhaseConfig, getPaths: GetPathFn): if (opConfig.plugins) { const pluginPaths = await formatPaths(getPaths, opConfig.plugins); Object.assign(opConfig, { plugins: pluginPaths }); - plugins = pluginPaths.map((pPath) => { - const myPlugin = require(pPath); + plugins = await Promise.all(pluginPaths.map(async (pPath) => { + const myPlugin = await import(pPath); // if es6 import default, else use regular node required obj return get(myPlugin, 'default', myPlugin); - }); + })); } return { opConfig, plugins }; } diff --git a/asset/src/accumulate/interfaces.ts b/asset/src/accumulate/interfaces.ts index 850d9ffd..a7d66583 100644 --- a/asset/src/accumulate/interfaces.ts +++ b/asset/src/accumulate/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface AccumulateConfig extends OpConfig { empty_after: number; diff --git a/asset/src/accumulate/processor.ts b/asset/src/accumulate/processor.ts index 22e6a4f4..0d226ae7 100644 --- a/asset/src/accumulate/processor.ts +++ b/asset/src/accumulate/processor.ts @@ -1,16 +1,17 @@ import { - BatchProcessor, DataEntity, WorkerContext, ExecutionConfig + BatchProcessor, DataEntity, Context } from '@terascope/job-components'; -import { AccumulateConfig } from './interfaces'; -import DataWindow from '../__lib/data-window'; -import Accumulator from '../__lib/accumulator'; +import { ExecutionConfig } from '@terascope/types'; +import { AccumulateConfig } from './interfaces.js'; +import DataWindow from '../__lib/data-window.js'; +import Accumulator from '../__lib/accumulator.js'; export default class Accumulate extends BatchProcessor { flushData = false; shuttingDown = false; accumulator: Accumulator; - constructor(context: WorkerContext, opConfig: AccumulateConfig, exConfig: ExecutionConfig) { + constructor(context: Context, opConfig: AccumulateConfig, exConfig: ExecutionConfig) { super(context, opConfig, exConfig); this.accumulator = new Accumulator(this.opConfig.empty_after); } diff --git a/asset/src/accumulate/schema.ts b/asset/src/accumulate/schema.ts index 5245e645..d05bb67e 100644 --- a/asset/src/accumulate/schema.ts +++ b/asset/src/accumulate/schema.ts @@ -1,7 +1,7 @@ import { ConvictSchema, isNumber, getTypeOf, isBoolean } from '@terascope/job-components'; -import { AccumulateConfig } from './interfaces'; +import { AccumulateConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/accumulate_by_key/interfaces.ts b/asset/src/accumulate_by_key/interfaces.ts index 375c96bc..617587f3 100644 --- a/asset/src/accumulate_by_key/interfaces.ts +++ b/asset/src/accumulate_by_key/interfaces.ts @@ -1,5 +1,5 @@ -import { OpConfig } from '@terascope/job-components'; -import { AccumulateConfig } from '../accumulate/interfaces'; +import { OpConfig } from '@terascope/types'; +import { AccumulateConfig } from '../accumulate/interfaces.js'; export interface AccumulateByKeyConfig extends AccumulateConfig, OpConfig { key_field: string; diff --git a/asset/src/accumulate_by_key/processor.ts b/asset/src/accumulate_by_key/processor.ts index c4a82789..dee3710c 100644 --- a/asset/src/accumulate_by_key/processor.ts +++ b/asset/src/accumulate_by_key/processor.ts @@ -1,15 +1,16 @@ import { - BatchProcessor, WorkerContext, ExecutionConfig, DataEntity + BatchProcessor, Context, DataEntity } from '@terascope/job-components'; -import { AccumulateByKeyConfig } from './interfaces'; -import AccumulatorByKey from '../__lib/accumulator-key'; +import { ExecutionConfig } from '@terascope/types'; +import { AccumulateByKeyConfig } from './interfaces.js'; +import AccumulatorByKey from '../__lib/accumulator-key.js'; export default class AccumulateByKey extends BatchProcessor { flushData = false; accumulator: AccumulatorByKey; constructor( - context: WorkerContext, opConfig: AccumulateByKeyConfig, exConfig: ExecutionConfig + context: Context, opConfig: AccumulateByKeyConfig, exConfig: ExecutionConfig ) { super(context, opConfig, exConfig); const { empty_after: emptyAfter } = opConfig; diff --git a/asset/src/accumulate_by_key/schema.ts b/asset/src/accumulate_by_key/schema.ts index a4668d10..e7b6dbe4 100644 --- a/asset/src/accumulate_by_key/schema.ts +++ b/asset/src/accumulate_by_key/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema, isInteger } from '@terascope/job-components'; -import { AccumulateByKeyConfig } from './interfaces'; +import { AccumulateByKeyConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/add_key/processor.ts b/asset/src/add_key/processor.ts index 1ada8cb2..b8f3c0bc 100644 --- a/asset/src/add_key/processor.ts +++ b/asset/src/add_key/processor.ts @@ -21,7 +21,7 @@ import { } from '@terascope/types'; import crypto from 'crypto'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class AddKey extends BatchProcessor { async onBatch(data: DataEntity[] | DataWindow[]) { diff --git a/asset/src/add_short_id/interfaces.ts b/asset/src/add_short_id/interfaces.ts index 117b325c..fdcef530 100644 --- a/asset/src/add_short_id/interfaces.ts +++ b/asset/src/add_short_id/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface UniqueIdOpConfig extends OpConfig { length: number; diff --git a/asset/src/add_short_id/processor.ts b/asset/src/add_short_id/processor.ts index d66887d6..ccc9227c 100644 --- a/asset/src/add_short_id/processor.ts +++ b/asset/src/add_short_id/processor.ts @@ -1,14 +1,12 @@ import { MapProcessor, DataEntity, - WorkerContext, - OpConfig, - ExecutionConfig, - + Context } from '@terascope/job-components'; +import { ExecutionConfig, OpConfig } from '@terascope/types'; import ShortUniqueId from 'short-unique-id'; -import DataWindow from '../__lib/data-window'; -import { UniqueIdOpConfig } from './interfaces'; +import DataWindow from '../__lib/data-window.js'; +import { UniqueIdOpConfig } from './interfaces.js'; /** * Adds a short unique ID of a specified length to the specified field @@ -18,7 +16,7 @@ import { UniqueIdOpConfig } from './interfaces'; export default class AddShortId extends MapProcessor { uniqueId: ShortUniqueId; - constructor(context: WorkerContext, opConfig: UniqueIdOpConfig, exConfig: ExecutionConfig) { + constructor(context: Context, opConfig: UniqueIdOpConfig, exConfig: ExecutionConfig) { super(context, opConfig, exConfig); this.uniqueId = new ShortUniqueId({ diff --git a/asset/src/copy_field/processor.ts b/asset/src/copy_field/processor.ts index 5def4adb..c9e3c087 100644 --- a/asset/src/copy_field/processor.ts +++ b/asset/src/copy_field/processor.ts @@ -4,7 +4,7 @@ import { DataEntity, } from '@terascope/job-components'; import { get, set } from '@terascope/utils'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class CopyField extends MapProcessor { map(doc: DataEntity): DataEntity { diff --git a/asset/src/count_by_field/interfaces.ts b/asset/src/count_by_field/interfaces.ts index 87cf82e8..4820da43 100644 --- a/asset/src/count_by_field/interfaces.ts +++ b/asset/src/count_by_field/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface CountByField { op_name: string; diff --git a/asset/src/count_by_field/processor.ts b/asset/src/count_by_field/processor.ts index 4ac68038..524f0059 100644 --- a/asset/src/count_by_field/processor.ts +++ b/asset/src/count_by_field/processor.ts @@ -1,7 +1,7 @@ import { MapProcessor, DataEntity, isPromAvailable } from '@terascope/job-components'; -import { CountByFieldConfig } from './interfaces'; +import { CountByFieldConfig } from './interfaces.js'; type Counters = { [valueAsString: string]: { diff --git a/asset/src/count_by_field/schema.ts b/asset/src/count_by_field/schema.ts index 7cc851a5..c35b133c 100644 --- a/asset/src/count_by_field/schema.ts +++ b/asset/src/count_by_field/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema } from '@terascope/job-components'; -import { CountByFieldConfig } from './interfaces'; +import { CountByFieldConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/data_generator/counter.ts b/asset/src/data_generator/counter.ts index 6c8c2c0e..d9d5ac21 100644 --- a/asset/src/data_generator/counter.ts +++ b/asset/src/data_generator/counter.ts @@ -1,4 +1,4 @@ -import { CounterResults } from './interfaces'; +import { CounterResults } from './interfaces.js'; export default class Counter { isPersistent: boolean; diff --git a/asset/src/data_generator/data-schema.ts b/asset/src/data_generator/data-schema.ts index 24eb590f..7957cfd7 100644 --- a/asset/src/data_generator/data-schema.ts +++ b/asset/src/data_generator/data-schema.ts @@ -1,6 +1,6 @@ import moment from 'moment'; import { AnyObject, isEmpty } from '@terascope/utils'; -import { DataGenerator, DateOptions, IDType } from './interfaces'; +import { DataGenerator, DateOptions, IDType } from './interfaces.js'; // "2016-01-19T13:33:09.356-07:00" export const dateFormat = 'YYYY-MM-DDTHH:mm:ss.SSSZ'; @@ -106,7 +106,6 @@ export default function getSchema(opConfig: DataGenerator, otherSchema: AnyObjec schema[opConfig.date_key] = schema.created; delete schema.created; } - if (opConfig.format) { const dataConfig = schema[dateKey]; const newFn = getFormatFunction(opConfig.format, { start, diff }); @@ -122,6 +121,5 @@ export default function getSchema(opConfig: DataGenerator, otherSchema: AnyObjec const reg = schema.id.randexp; schema.id.randexp = `${opConfig.id_start_key}${reg}`; } - return schema; } diff --git a/asset/src/data_generator/fetcher.ts b/asset/src/data_generator/fetcher.ts index d12c051e..eeba8715 100644 --- a/asset/src/data_generator/fetcher.ts +++ b/asset/src/data_generator/fetcher.ts @@ -1,30 +1,31 @@ import { - Fetcher, WorkerContext, ExecutionConfig, TSError, AnyObject + Fetcher, Context, TSError, AnyObject } from '@terascope/job-components'; -import mocker from 'mocker-data-generator'; +import { ExecutionConfig } from '@terascope/types'; +import { Mocker } from 'mocker-data-generator'; import { faker } from '@faker-js/faker'; import Randexp from 'randexp'; import Chance from 'chance'; -import path from 'path'; -import { existsSync } from 'fs'; -import { DataGenerator, CounterResults } from './interfaces'; -import defaultSchema from './data-schema'; +import path from 'node:path'; +import { existsSync } from 'node:fs'; +import { DataGenerator, CounterResults } from './interfaces.js'; +import defaultSchema from './data-schema.js'; const chance = new Chance(); export default class DataGeneratorFetcher extends Fetcher { dataSchema: AnyObject; - constructor(context: WorkerContext, opConfig: DataGenerator, exConfig: ExecutionConfig) { + constructor(context: Context, opConfig: DataGenerator, exConfig: ExecutionConfig) { super(context, opConfig, exConfig); this.dataSchema = parsedSchema(opConfig); } async fetch(slice?: CounterResults): Promise { + const mocker = new Mocker(); if (slice == null) return []; const { count } = slice; - if (this.opConfig.stress_test) { - return mocker() + return mocker .addGenerator('faker', faker) .addGenerator('chance', chance) .addGenerator('randexp', Randexp, (Generator, input) => new Generator(input).gen()) @@ -40,8 +41,7 @@ export default class DataGeneratorFetcher extends Fetcher { }) .catch((err) => Promise.reject(new TSError(err, { reason: 'could not generate mocked data' }))); } - - return mocker() + return mocker .addGenerator('faker', faker) .addGenerator('chance', chance) .addGenerator('randexp', Randexp, (Generator, input) => new Generator(input).gen()) @@ -54,7 +54,6 @@ export default class DataGeneratorFetcher extends Fetcher { function parsedSchema(opConfig: DataGenerator) { let dataSchema = {}; - if (opConfig.json_schema) { const firstPath = opConfig.json_schema; const nextPath = path.join(process.cwd(), opConfig.json_schema); diff --git a/asset/src/data_generator/interfaces.ts b/asset/src/data_generator/interfaces.ts index 552d21a3..123e6a3b 100644 --- a/asset/src/data_generator/interfaces.ts +++ b/asset/src/data_generator/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export enum DateOptions { dateNow = 'dateNow', diff --git a/asset/src/data_generator/schema.ts b/asset/src/data_generator/schema.ts index 90bb614d..f74860b0 100644 --- a/asset/src/data_generator/schema.ts +++ b/asset/src/data_generator/schema.ts @@ -7,7 +7,7 @@ import { getTypeOf, isString } from '@terascope/job-components'; -import { DataGenerator, IDType, DateOptions } from './interfaces'; +import { DataGenerator, IDType, DateOptions } from './interfaces.js'; export default class Schema extends ConvictSchema { validateJob(job: ValidatedJobConfig): void { diff --git a/asset/src/data_generator/slicer.ts b/asset/src/data_generator/slicer.ts index 6ce9f934..a5f042b2 100644 --- a/asset/src/data_generator/slicer.ts +++ b/asset/src/data_generator/slicer.ts @@ -1,6 +1,6 @@ import { Slicer, get, SlicerRecoveryData } from '@terascope/job-components'; -import { DataGenerator, CounterResults } from './interfaces'; -import Counter from './counter'; +import { DataGenerator, CounterResults } from './interfaces.js'; +import Counter from './counter.js'; export default class DataGeneratorSlicer extends Slicer { countHandle!: () => Promise; diff --git a/asset/src/data_window_to_array/processor.ts b/asset/src/data_window_to_array/processor.ts index e73ef59a..33271f50 100644 --- a/asset/src/data_window_to_array/processor.ts +++ b/asset/src/data_window_to_array/processor.ts @@ -1,5 +1,5 @@ import { BatchProcessor, DataEntity, OpConfig } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class DataWindowToArray extends BatchProcessor { async onBatch(dataArray: DataWindow[]): Promise { diff --git a/asset/src/date_router/processor.ts b/asset/src/date_router/processor.ts index 4a1e0b76..fbdcf4e0 100644 --- a/asset/src/date_router/processor.ts +++ b/asset/src/date_router/processor.ts @@ -1,13 +1,14 @@ import { - MapProcessor, DataEntity, WorkerContext, OpConfig, ExecutionConfig + MapProcessor, DataEntity, Context } from '@terascope/job-components'; +import { ExecutionConfig, OpConfig } from '@terascope/types'; import { DateRouter, DateRouterConfig } from '@terascope/standard-asset-apis'; export default class DateRouterProcessor extends MapProcessor { router: DateRouter; constructor( - context: WorkerContext, + context: Context, opConfig: DateRouterConfig & OpConfig, exConfig: ExecutionConfig ) { diff --git a/asset/src/dedupe/interfaces.ts b/asset/src/dedupe/interfaces.ts index dbcbf019..c3493f69 100644 --- a/asset/src/dedupe/interfaces.ts +++ b/asset/src/dedupe/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface DedupeConfig extends OpConfig { field: string; diff --git a/asset/src/dedupe/processor.ts b/asset/src/dedupe/processor.ts index ff181ea1..6064c5d3 100644 --- a/asset/src/dedupe/processor.ts +++ b/asset/src/dedupe/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; -import { DedupeConfig } from './interfaces'; -import { getTime } from '../__lib/utils'; +import DataWindow from '../__lib/data-window.js'; +import { DedupeConfig } from './interfaces.js'; +import { getTime } from '../__lib/utils.js'; export default class Dedupe extends BatchProcessor { async onBatch(dataArray: DataWindow[] | DataEntity[]): Promise { diff --git a/asset/src/dedupe/schema.ts b/asset/src/dedupe/schema.ts index 9e080200..7455038a 100644 --- a/asset/src/dedupe/schema.ts +++ b/asset/src/dedupe/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema, isPlainObject, isString } from '@terascope/job-components'; -import * as I from './interfaces'; +import * as I from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/drop_field/processor.ts b/asset/src/drop_field/processor.ts index 2e035885..1fcc048c 100644 --- a/asset/src/drop_field/processor.ts +++ b/asset/src/drop_field/processor.ts @@ -3,7 +3,7 @@ import { OpConfig, DataEntity } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class DropField extends MapProcessor { map(doc: DataEntity): DataEntity { diff --git a/asset/src/drop_field_conditional/processor.ts b/asset/src/drop_field_conditional/processor.ts index 73f2470f..7886bb4d 100644 --- a/asset/src/drop_field_conditional/processor.ts +++ b/asset/src/drop_field_conditional/processor.ts @@ -4,7 +4,7 @@ import { DataEntity } from '@terascope/job-components'; import { FieldValidator } from '@terascope/data-mate'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class DropField extends MapProcessor { map(doc: DataEntity): DataEntity { diff --git a/asset/src/extraction/processor.ts b/asset/src/extraction/processor.ts index f955bd45..99421722 100644 --- a/asset/src/extraction/processor.ts +++ b/asset/src/extraction/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; import { ExtractionPhase, Loader, OperationsManager } from 'ts-transforms'; -import { PhaseConfig } from '../transform/interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from '../transform/interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class Extraction extends BatchProcessor { private phase!: ExtractionPhase; diff --git a/asset/src/extraction/schema.ts b/asset/src/extraction/schema.ts index 650a1f07..0580f981 100644 --- a/asset/src/extraction/schema.ts +++ b/asset/src/extraction/schema.ts @@ -1,3 +1,3 @@ -import TransformSchema from '../transform/schema'; +import TransformSchema from '../transform/schema.js'; export default TransformSchema; diff --git a/asset/src/field_router/processor.ts b/asset/src/field_router/processor.ts index 15af6ae5..b1318b2f 100644 --- a/asset/src/field_router/processor.ts +++ b/asset/src/field_router/processor.ts @@ -1,13 +1,14 @@ import { - MapProcessor, DataEntity, OpConfig, WorkerContext, ExecutionConfig + MapProcessor, DataEntity, Context } from '@terascope/job-components'; +import { ExecutionConfig, OpConfig } from '@terascope/types'; import { FieldRouterConfig, FieldRouter } from '@terascope/standard-asset-apis'; export default class FieldRouterProcessor extends MapProcessor { router: FieldRouter; constructor( - context: WorkerContext, + context: Context, opConfig: FieldRouterConfig & OpConfig, exConfig: ExecutionConfig ) { diff --git a/asset/src/group_by/interfaces.ts b/asset/src/group_by/interfaces.ts index 1cfbeb2e..7a25ede1 100644 --- a/asset/src/group_by/interfaces.ts +++ b/asset/src/group_by/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface GroupByConfig extends OpConfig { field: string; diff --git a/asset/src/group_by/processor.ts b/asset/src/group_by/processor.ts index 5be5fe01..0a9ebe9a 100644 --- a/asset/src/group_by/processor.ts +++ b/asset/src/group_by/processor.ts @@ -1,6 +1,6 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; -import { GroupByConfig } from './interfaces'; +import DataWindow from '../__lib/data-window.js'; +import { GroupByConfig } from './interfaces.js'; /* handles an array of data entities or an array of data windows diff --git a/asset/src/group_by/schema.ts b/asset/src/group_by/schema.ts index 041b7536..7cf0ffdd 100644 --- a/asset/src/group_by/schema.ts +++ b/asset/src/group_by/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema } from '@terascope/job-components'; -import { GroupByConfig } from './interfaces'; +import { GroupByConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/hash_router/processor.ts b/asset/src/hash_router/processor.ts index b4a308f0..92514738 100644 --- a/asset/src/hash_router/processor.ts +++ b/asset/src/hash_router/processor.ts @@ -1,17 +1,16 @@ import { MapProcessor, DataEntity, - WorkerContext, - ExecutionConfig, - OpConfig + Context } from '@terascope/job-components'; +import { ExecutionConfig, OpConfig } from '@terascope/types'; import { HashRouter, HashRouterConfig } from '@terascope/standard-asset-apis'; export default class HashRouterProcessor extends MapProcessor { router: HashRouter; constructor( - context: WorkerContext, + context: Context, opConfig: HashRouterConfig & OpConfig, exConfig: ExecutionConfig ) { diff --git a/asset/src/key_router/processor.ts b/asset/src/key_router/processor.ts index 14918564..5fd13079 100644 --- a/asset/src/key_router/processor.ts +++ b/asset/src/key_router/processor.ts @@ -1,13 +1,14 @@ import { - MapProcessor, DataEntity, WorkerContext, ExecutionConfig, OpConfig + MapProcessor, DataEntity, Context } from '@terascope/job-components'; +import { ExecutionConfig, OpConfig } from '@terascope/types'; import { KeyRouter, KeyRouterConfig } from '@terascope/standard-asset-apis'; export default class KeyRouterProcessor extends MapProcessor { router: KeyRouter; constructor( - context: WorkerContext, + context: Context, opConfig: KeyRouterConfig & OpConfig, exConfig: ExecutionConfig ) { diff --git a/asset/src/match/processor.ts b/asset/src/match/processor.ts index a38d474c..dd0f64a3 100644 --- a/asset/src/match/processor.ts +++ b/asset/src/match/processor.ts @@ -1,14 +1,15 @@ import { - WorkerContext, BatchProcessor, ExecutionConfig, DataEntity + Context, BatchProcessor, DataEntity } from '@terascope/job-components'; +import { ExecutionConfig } from '@terascope/types'; import { Matcher } from 'ts-transforms'; -import { PhaseConfig } from '../transform/interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from '../transform/interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class Match extends BatchProcessor { private matcher!: Matcher; - constructor(context: WorkerContext, opConfig: PhaseConfig, executionConfig: ExecutionConfig) { + constructor(context: Context, opConfig: PhaseConfig, executionConfig: ExecutionConfig) { super(context, opConfig, executionConfig); } diff --git a/asset/src/output/processor.ts b/asset/src/output/processor.ts index d19cb8e6..6bac9324 100644 --- a/asset/src/output/processor.ts +++ b/asset/src/output/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; import { OutputPhase, Loader, OperationsManager } from 'ts-transforms'; -import { PhaseConfig } from '../transform/interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from '../transform/interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class Output extends BatchProcessor { private phase!: OutputPhase; diff --git a/asset/src/output/schema.ts b/asset/src/output/schema.ts index 650a1f07..0580f981 100644 --- a/asset/src/output/schema.ts +++ b/asset/src/output/schema.ts @@ -1,3 +1,3 @@ -import TransformSchema from '../transform/schema'; +import TransformSchema from '../transform/schema.js'; export default TransformSchema; diff --git a/asset/src/post_process/processor.ts b/asset/src/post_process/processor.ts index e9330bb6..92cafadb 100644 --- a/asset/src/post_process/processor.ts +++ b/asset/src/post_process/processor.ts @@ -1,14 +1,14 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; import { PostProcessPhase, Loader, OperationsManager } from 'ts-transforms'; -import { PhaseConfig } from '../transform/interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from '../transform/interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class PostProcess extends BatchProcessor { private phase!: PostProcessPhase; async initialize(): Promise { const { getPath } = this.context.apis.assets; - const { opConfig, plugins } = await loadResources(this.opConfig, getPath); + const { opConfig, plugins } = await loadResources(this.opConfig as any, getPath); const loader = new Loader(opConfig, this.logger); const opsManager = new OperationsManager(plugins); const { postProcessing } = await loader.load(opsManager); diff --git a/asset/src/post_process/schema.ts b/asset/src/post_process/schema.ts index 650a1f07..0580f981 100644 --- a/asset/src/post_process/schema.ts +++ b/asset/src/post_process/schema.ts @@ -1,3 +1,3 @@ -import TransformSchema from '../transform/schema'; +import TransformSchema from '../transform/schema.js'; export default TransformSchema; diff --git a/asset/src/remove_key/processor.ts b/asset/src/remove_key/processor.ts index 39054c04..206af031 100644 --- a/asset/src/remove_key/processor.ts +++ b/asset/src/remove_key/processor.ts @@ -1,5 +1,5 @@ import { MapProcessor, DataEntity, OpConfig } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class RemoveKey extends MapProcessor { // Does this need to make a new DataEntity since it receives one starting out? diff --git a/asset/src/routed_sender/interfaces.ts b/asset/src/routed_sender/interfaces.ts index 5b21d8a3..03592647 100644 --- a/asset/src/routed_sender/interfaces.ts +++ b/asset/src/routed_sender/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface ConnectionMapping { [key: string]: string; diff --git a/asset/src/routed_sender/processor.ts b/asset/src/routed_sender/processor.ts index 2061b8d1..40d43599 100644 --- a/asset/src/routed_sender/processor.ts +++ b/asset/src/routed_sender/processor.ts @@ -1,30 +1,30 @@ import { BatchProcessor, - WorkerContext, - ExecutionConfig, + Context, RouteSenderAPI, APIFactoryRegistry } from '@terascope/job-components'; +import { ExecutionConfig } from '@terascope/types'; import { TSError, DataEntity, isEmpty, AnyObject } from '@terascope/utils'; import { RoutedSender } from '@terascope/standard-asset-apis'; import { RouteSenderConfig -} from './interfaces'; +} from './interfaces.js'; type SenderFactoryAPI = APIFactoryRegistry export type SenderFn = ( fn: (msg: any) => DataEntity -) => (msg: any) => void +) => (msg: any) => void; export default class RoutedSenderProcessor extends BatchProcessor { routedSender: RoutedSender; api!: SenderFactoryAPI; tryFn: SenderFn; - constructor(context: WorkerContext, opConfig: RouteSenderConfig, exConfig: ExecutionConfig) { + constructor(context: Context, opConfig: RouteSenderConfig, exConfig: ExecutionConfig) { super(context, opConfig, exConfig); const { routing, size, concurrency } = opConfig; diff --git a/asset/src/routed_sender/schema.ts b/asset/src/routed_sender/schema.ts index 26ed9658..2e2311f2 100644 --- a/asset/src/routed_sender/schema.ts +++ b/asset/src/routed_sender/schema.ts @@ -3,13 +3,13 @@ import { AnyObject, isPlainObject, getOpConfig, - ValidatedJobConfig, has, isNumber, getTypeOf, isNil } from '@terascope/job-components'; -import { RouteSenderConfig } from './interfaces'; +import { ValidatedJobConfig } from '@terascope/types'; +import { RouteSenderConfig } from './interfaces.js'; function fetchConfig(job: ValidatedJobConfig) { const opConfig = getOpConfig(job, 'routed_sender'); diff --git a/asset/src/selection/processor.ts b/asset/src/selection/processor.ts index 32de57ed..898399f8 100644 --- a/asset/src/selection/processor.ts +++ b/asset/src/selection/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; import { SelectionPhase, Loader, OperationsManager } from 'ts-transforms'; -import { PhaseConfig } from '../transform/interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from '../transform/interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class Selection extends BatchProcessor { private phase!: SelectionPhase; diff --git a/asset/src/selection/schema.ts b/asset/src/selection/schema.ts index 650a1f07..0580f981 100644 --- a/asset/src/selection/schema.ts +++ b/asset/src/selection/schema.ts @@ -1,3 +1,3 @@ -import TransformSchema from '../transform/schema'; +import TransformSchema from '../transform/schema.js'; export default TransformSchema; diff --git a/asset/src/set_field/processor.ts b/asset/src/set_field/processor.ts index ce6696d1..16283cc4 100644 --- a/asset/src/set_field/processor.ts +++ b/asset/src/set_field/processor.ts @@ -4,7 +4,7 @@ import { DataEntity, } from '@terascope/job-components'; import { set, has } from '@terascope/utils'; -import DataWindow from '../__lib/data-window'; +import DataWindow from '../__lib/data-window.js'; export default class SetField extends MapProcessor { map(doc: DataEntity): DataEntity { diff --git a/asset/src/set_key/interfaces.ts b/asset/src/set_key/interfaces.ts index b638f02e..cca8962f 100644 --- a/asset/src/set_key/interfaces.ts +++ b/asset/src/set_key/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface SetKeyConfig extends OpConfig { field: string; diff --git a/asset/src/set_key/processor.ts b/asset/src/set_key/processor.ts index cbe99873..077e27d7 100644 --- a/asset/src/set_key/processor.ts +++ b/asset/src/set_key/processor.ts @@ -1,6 +1,6 @@ import { MapProcessor, DataEntity } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; -import { SetKeyConfig } from './interfaces'; +import DataWindow from '../__lib/data-window.js'; +import { SetKeyConfig } from './interfaces.js'; export default class SetKey extends MapProcessor { private _setKey(doc: DataEntity) { diff --git a/asset/src/set_key/schema.ts b/asset/src/set_key/schema.ts index 98bb8981..0818f822 100644 --- a/asset/src/set_key/schema.ts +++ b/asset/src/set_key/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema } from '@terascope/job-components'; -import { SetKeyConfig } from './interfaces'; +import { SetKeyConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/sort/interfaces.ts b/asset/src/sort/interfaces.ts index bbfeee98..15b0f639 100644 --- a/asset/src/sort/interfaces.ts +++ b/asset/src/sort/interfaces.ts @@ -1,5 +1,5 @@ -import { OpConfig } from '@terascope/job-components'; -import { Order } from '../__lib/utils'; +import { OpConfig } from '@terascope/types'; +import { Order } from '../__lib/utils.js'; export interface SortConfig extends OpConfig { field: string; diff --git a/asset/src/sort/processor.ts b/asset/src/sort/processor.ts index c9aa7c99..9b73a234 100644 --- a/asset/src/sort/processor.ts +++ b/asset/src/sort/processor.ts @@ -1,15 +1,16 @@ import { sort } from 'timsort'; import { - BatchProcessor, WorkerContext, ExecutionConfig, DataEntity + BatchProcessor, DataEntity, Context } from '@terascope/job-components'; -import { sortFunction } from '../__lib/utils'; -import DataWindow from '../__lib/data-window'; -import { SortConfig } from './interfaces'; +import { ExecutionConfig } from '@terascope/types'; +import { sortFunction } from '../__lib/utils.js'; +import DataWindow from '../__lib/data-window.js'; +import { SortConfig } from './interfaces.js'; export default class Sort extends BatchProcessor { sort: (a: any, b: any) => number; - constructor(context: WorkerContext, opConfig: SortConfig, executionConfig: ExecutionConfig) { + constructor(context: Context, opConfig: SortConfig, executionConfig: ExecutionConfig) { super(context, opConfig, executionConfig); this.sort = sortFunction(this.opConfig.field, this.opConfig.order).bind(this); } diff --git a/asset/src/sort/schema.ts b/asset/src/sort/schema.ts index 4f9cc6a8..21db4abd 100644 --- a/asset/src/sort/schema.ts +++ b/asset/src/sort/schema.ts @@ -1,6 +1,6 @@ import { ConvictSchema } from '@terascope/job-components'; -import { SortConfig } from './interfaces'; -import { Order } from '../__lib/utils'; +import { SortConfig } from './interfaces.js'; +import { Order } from '../__lib/utils.js'; export default class Schema extends ConvictSchema { build(): Record { diff --git a/asset/src/stdout/interfaces.ts b/asset/src/stdout/interfaces.ts index a7585d94..60b7cdf1 100644 --- a/asset/src/stdout/interfaces.ts +++ b/asset/src/stdout/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export interface StdoutConfig extends OpConfig { limit: number; diff --git a/asset/src/transform/interfaces.ts b/asset/src/transform/interfaces.ts index 4a1ffaa0..31f1dda2 100644 --- a/asset/src/transform/interfaces.ts +++ b/asset/src/transform/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; import { WatcherConfig } from 'ts-transforms'; export enum NotifyType { matcher = 'matcher', extraction = 'extraction' } diff --git a/asset/src/transform/processor.ts b/asset/src/transform/processor.ts index cf5399b8..4554c5f6 100644 --- a/asset/src/transform/processor.ts +++ b/asset/src/transform/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; import { Transform } from 'ts-transforms'; -import { PhaseConfig } from './interfaces'; -import { loadResources } from '../__lib/utils'; +import { PhaseConfig } from './interfaces.js'; +import { loadResources } from '../__lib/utils.js'; export default class Transforms extends BatchProcessor { private transform!: Transform; diff --git a/asset/src/transform/schema.ts b/asset/src/transform/schema.ts index df4d84d5..427234a3 100644 --- a/asset/src/transform/schema.ts +++ b/asset/src/transform/schema.ts @@ -5,7 +5,7 @@ import { getTypeOf, isObjectEntity } from '@terascope/job-components'; -import { PhaseConfig } from './interfaces'; +import { PhaseConfig } from './interfaces.js'; export default class Schema extends ConvictSchema { validate(input: PhaseConfig): APIConfig & PhaseConfig { diff --git a/asset/src/window/interfaces.ts b/asset/src/window/interfaces.ts index a9af9e5a..fcaaba65 100644 --- a/asset/src/window/interfaces.ts +++ b/asset/src/window/interfaces.ts @@ -1,4 +1,4 @@ -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; export enum TimeSetting { event = 'event', diff --git a/asset/src/window/processor.ts b/asset/src/window/processor.ts index 93e37f03..496d9683 100644 --- a/asset/src/window/processor.ts +++ b/asset/src/window/processor.ts @@ -1,7 +1,7 @@ import { BatchProcessor, DataEntity } from '@terascope/job-components'; -import DataWindow from '../__lib/data-window'; -import { WindowConfig } from './interfaces'; -import { getTime } from '../__lib/utils'; +import DataWindow from '../__lib/data-window.js'; +import { WindowConfig } from './interfaces.js'; +import { getTime } from '../__lib/utils.js'; export default class Window extends BatchProcessor { flushWindows = false; diff --git a/asset/src/window/schema.ts b/asset/src/window/schema.ts index 81f6fc12..0a5387c1 100644 --- a/asset/src/window/schema.ts +++ b/asset/src/window/schema.ts @@ -1,5 +1,5 @@ import { ConvictSchema } from '@terascope/job-components'; -import { WindowConfig, TimeSetting, WindowType } from './interfaces'; +import { WindowConfig, TimeSetting, WindowType } from './interfaces.js'; export default class Schema extends ConvictSchema { build(): Record { From 5fec316e0c66290dd35ce73c7fe87c19278b657f Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:27:27 -0700 Subject: [PATCH 10/16] convert top level asset tests to be esm --- test/accumulate/processor-spec.ts | 2 +- test/accumulate/schema-spec.ts | 2 +- test/accumulate_by_key/processor-spec.ts | 2 +- test/accumulate_by_key/schema-spec.ts | 2 +- test/add_key/processor-spec.ts | 2 +- test/add_short_id/processor-spec.ts | 2 +- test/copy_field/processor-spec.ts | 2 +- test/count_by_field/processor-spec.ts | 8 ++++++-- test/count_by_field/schema-spec.ts | 2 +- test/data-generator/fetcher-spec.ts | 6 ++++-- test/data-generator/schema-spec.ts | 2 +- test/data-window-to-array/processor-spec.ts | 2 +- test/date_router/schema-spec.ts | 2 +- test/dedupe/processor-spec.ts | 2 +- test/dedupe/schema-spec.ts | 2 +- test/drop_field/processor-spec.ts | 2 +- test/drop_field_conditional/processor-spec.ts | 2 +- test/extraction/processor-spec.ts | 10 +++++++--- test/extraction/schema-spec.ts | 2 +- test/field_router/schema-spec.ts | 2 +- test/fixtures/someAssetId/plugins/index.ts | 2 +- test/fixtures/someAssetId/test_api/api.ts | 2 +- test/group_by/processor-spec.ts | 2 +- test/group_by/schema-spec.ts | 2 +- test/hash_router/schema-spec.ts | 2 +- test/index-spec.ts | 10 ++++++---- test/match/processor-spec.ts | 10 +++++++--- test/match/schema-spec.ts | 2 +- test/output/processor-spec.ts | 9 ++++++--- test/output/schema-spec.ts | 2 +- test/post_process/processor-spec.ts | 10 +++++++--- test/post_process/schema-spec.ts | 2 +- test/remove_key/processor-spec.ts | 2 +- test/routed_sender/processor-spec.ts | 13 ++++++++----- test/routed_sender/schema-spec.ts | 14 ++++++++------ test/selection/processor-spec.ts | 10 +++++++--- test/selection/schema-spec.ts | 2 +- test/set_field/processor-spec.ts | 2 +- test/set_key/processor-spec.ts | 2 +- test/set_key/schema-spec.ts | 2 +- test/sort/processor-spec.ts | 2 +- test/sort/schema-spec.ts | 2 +- test/stdout/processor-spec.ts | 1 + test/stdout/schema-spec.ts | 2 +- test/transform/processor-spec.ts | 10 +++++++--- test/transform/schema-spec.ts | 2 +- test/window/schema-spec.ts | 2 +- 47 files changed, 109 insertions(+), 72 deletions(-) diff --git a/test/accumulate/processor-spec.ts b/test/accumulate/processor-spec.ts index 9fe7d998..ee61a4b8 100644 --- a/test/accumulate/processor-spec.ts +++ b/test/accumulate/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const testData = [ { id: 1, time: '2019-04-25T18:12:00.000Z' }, diff --git a/test/accumulate/schema-spec.ts b/test/accumulate/schema-spec.ts index 047a289d..8548937d 100644 --- a/test/accumulate/schema-spec.ts +++ b/test/accumulate/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { AccumulateConfig } from '../../asset/src/accumulate/interfaces'; +import { AccumulateConfig } from '../../asset/src/accumulate/interfaces.js'; describe('accumulate schema', () => { let harness: WorkerTestHarness; diff --git a/test/accumulate_by_key/processor-spec.ts b/test/accumulate_by_key/processor-spec.ts index b80483d0..aaeb0496 100644 --- a/test/accumulate_by_key/processor-spec.ts +++ b/test/accumulate_by_key/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const data = [{ id: 1 }, { id: 2 }, { id: 3 }]; const singleKeyData = data.map((doc) => DataEntity.make(doc, { _key: 1 })); diff --git a/test/accumulate_by_key/schema-spec.ts b/test/accumulate_by_key/schema-spec.ts index 3fec3b46..3550ffc9 100644 --- a/test/accumulate_by_key/schema-spec.ts +++ b/test/accumulate_by_key/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { AccumulateByKeyConfig } from '../../asset/src/accumulate_by_key/interfaces'; +import { AccumulateByKeyConfig } from '../../asset/src/accumulate_by_key/interfaces.js'; describe('accumulate_by_key schema', () => { let harness: WorkerTestHarness; diff --git a/test/add_key/processor-spec.ts b/test/add_key/processor-spec.ts index bbb2b5f3..f7d6305b 100644 --- a/test/add_key/processor-spec.ts +++ b/test/add_key/processor-spec.ts @@ -3,7 +3,7 @@ import 'jest-extended'; import { cloneDeep } from '@terascope/utils'; import { DataEntity, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const testData: any[] = [ { diff --git a/test/add_short_id/processor-spec.ts b/test/add_short_id/processor-spec.ts index 71e01ebb..9d4c03c9 100644 --- a/test/add_short_id/processor-spec.ts +++ b/test/add_short_id/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('add_short_id', () => { let harness: WorkerTestHarness; diff --git a/test/copy_field/processor-spec.ts b/test/copy_field/processor-spec.ts index 3a24a0a2..f9002ff3 100644 --- a/test/copy_field/processor-spec.ts +++ b/test/copy_field/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('copy_field should', () => { let harness: WorkerTestHarness; diff --git a/test/count_by_field/processor-spec.ts b/test/count_by_field/processor-spec.ts index 0a9e5be4..13c3b3e1 100644 --- a/test/count_by_field/processor-spec.ts +++ b/test/count_by_field/processor-spec.ts @@ -2,7 +2,10 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; -import path from 'path'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); describe('count_by_field processor', () => { let harness: WorkerTestHarness; @@ -58,11 +61,12 @@ describe('count_by_field processor', () => { }); harness = new WorkerTestHarness(jobWithCollectMetrics, { - assetDir: path.join(__dirname, '../../asset'), + assetDir: path.join(dirname, '../../asset'), cluster_manager_type: 'kubernetes' }); await harness.context.apis.foundation.promMetrics.init({ + terasliceName: 'ts-test', assignment: 'worker', logger: harness.context.logger, tf_prom_metrics_enabled: false, diff --git a/test/count_by_field/schema-spec.ts b/test/count_by_field/schema-spec.ts index cb7f6333..e9922dad 100644 --- a/test/count_by_field/schema-spec.ts +++ b/test/count_by_field/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { CountByFieldConfig } from '../../asset/src/count_by_field/interfaces'; +import { CountByFieldConfig } from '../../asset/src/count_by_field/interfaces.js'; describe('count_by_field schema', () => { let harness: WorkerTestHarness; diff --git a/test/data-generator/fetcher-spec.ts b/test/data-generator/fetcher-spec.ts index cdf3ec4f..5cace21c 100644 --- a/test/data-generator/fetcher-spec.ts +++ b/test/data-generator/fetcher-spec.ts @@ -1,13 +1,15 @@ import 'jest-extended'; import { AnyObject, DataEntity } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import { IDType, DateOptions } from '../../asset/src/data_generator/interfaces'; +import { IDType, DateOptions } from '../../asset/src/data_generator/interfaces.js'; describe('data_generator fetcher', () => { let harness: WorkerTestHarness; afterEach(async () => { - if (harness) await harness.shutdown(); + if (harness) { + await harness.shutdown(); + } }); async function makeFetcherTest(config: AnyObject = {}) { diff --git a/test/data-generator/schema-spec.ts b/test/data-generator/schema-spec.ts index 8daafb3c..9ae8c45a 100644 --- a/test/data-generator/schema-spec.ts +++ b/test/data-generator/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { DataGenerator } from '../../asset/src/data_generator/interfaces'; +import { DataGenerator } from '../../asset/src/data_generator/interfaces.js'; describe('data-generator schema', () => { let harness: WorkerTestHarness; diff --git a/test/data-window-to-array/processor-spec.ts b/test/data-window-to-array/processor-spec.ts index fb090bba..3f739f6c 100644 --- a/test/data-window-to-array/processor-spec.ts +++ b/test/data-window-to-array/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const defaultConfig = { _op: 'data_window_to_array', diff --git a/test/date_router/schema-spec.ts b/test/date_router/schema-spec.ts index 487a0f71..29a6bb77 100644 --- a/test/date_router/schema-spec.ts +++ b/test/date_router/schema-spec.ts @@ -1,6 +1,6 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; import { DateRouterConfig, DateResolution } from '@terascope/standard-asset-apis'; describe('date_router schema', () => { diff --git a/test/dedupe/processor-spec.ts b/test/dedupe/processor-spec.ts index 2e9983e9..07b7ac7c 100644 --- a/test/dedupe/processor-spec.ts +++ b/test/dedupe/processor-spec.ts @@ -3,7 +3,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('dedupe', () => { let harness: WorkerTestHarness; diff --git a/test/dedupe/schema-spec.ts b/test/dedupe/schema-spec.ts index 54c5a925..8dade1b0 100644 --- a/test/dedupe/schema-spec.ts +++ b/test/dedupe/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { DedupeConfig } from '../../asset/src/dedupe/interfaces'; +import { DedupeConfig } from '../../asset/src/dedupe/interfaces.js'; describe('dedupe schema', () => { let harness: WorkerTestHarness; diff --git a/test/drop_field/processor-spec.ts b/test/drop_field/processor-spec.ts index a9120cb7..8fc29a48 100644 --- a/test/drop_field/processor-spec.ts +++ b/test/drop_field/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('drop_field should', () => { let harness: WorkerTestHarness; diff --git a/test/drop_field_conditional/processor-spec.ts b/test/drop_field_conditional/processor-spec.ts index 9606d72d..41aa42e5 100644 --- a/test/drop_field_conditional/processor-spec.ts +++ b/test/drop_field_conditional/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('drop_field should', () => { let harness: WorkerTestHarness; diff --git a/test/extraction/processor-spec.ts b/test/extraction/processor-spec.ts index b6687220..ae18e3a7 100644 --- a/test/extraction/processor-spec.ts +++ b/test/extraction/processor-spec.ts @@ -1,12 +1,16 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; -import path from 'path'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { jest } from '@jest/globals'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); describe('extraction phase', () => { - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; let harness: WorkerTestHarness; diff --git a/test/extraction/schema-spec.ts b/test/extraction/schema-spec.ts index 1c99b287..a3d7d92e 100644 --- a/test/extraction/schema-spec.ts +++ b/test/extraction/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('extraction schema', () => { let harness: WorkerTestHarness; diff --git a/test/field_router/schema-spec.ts b/test/field_router/schema-spec.ts index ef4746ea..e06056fe 100644 --- a/test/field_router/schema-spec.ts +++ b/test/field_router/schema-spec.ts @@ -1,6 +1,6 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; import { FieldRouterConfig } from '@terascope/standard-asset-apis'; describe('Field Router Schema', () => { diff --git a/test/fixtures/someAssetId/plugins/index.ts b/test/fixtures/someAssetId/plugins/index.ts index bd48aea8..790a7f70 100644 --- a/test/fixtures/someAssetId/plugins/index.ts +++ b/test/fixtures/someAssetId/plugins/index.ts @@ -1,4 +1,4 @@ -import Tag from './tag'; +import Tag from './tag.js'; export default class Plugin { init(): { tag: typeof Tag } { diff --git a/test/fixtures/someAssetId/test_api/api.ts b/test/fixtures/someAssetId/test_api/api.ts index e5a65da5..35579563 100644 --- a/test/fixtures/someAssetId/test_api/api.ts +++ b/test/fixtures/someAssetId/test_api/api.ts @@ -1,5 +1,5 @@ import { APIFactory, RouteSenderAPI, AnyObject } from '@terascope/job-components'; -import TestSender from './test_sender'; +import TestSender from './test_sender.js'; export default class TestApi extends APIFactory { async create( diff --git a/test/group_by/processor-spec.ts b/test/group_by/processor-spec.ts index ab4edddc..0e21559f 100644 --- a/test/group_by/processor-spec.ts +++ b/test/group_by/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const testData = [ { diff --git a/test/group_by/schema-spec.ts b/test/group_by/schema-spec.ts index c5baf282..2a866448 100644 --- a/test/group_by/schema-spec.ts +++ b/test/group_by/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { GroupByConfig } from '../../asset/src/group_by/interfaces'; +import { GroupByConfig } from '../../asset/src/group_by/interfaces.js'; describe('group_by schema', () => { let harness: WorkerTestHarness; diff --git a/test/hash_router/schema-spec.ts b/test/hash_router/schema-spec.ts index bfd0b96d..8fcf550d 100644 --- a/test/hash_router/schema-spec.ts +++ b/test/hash_router/schema-spec.ts @@ -1,6 +1,6 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import { OpConfig } from '@terascope/job-components'; +import { OpConfig } from '@terascope/types'; import { HashRouterConfig } from '@terascope/standard-asset-apis'; describe('Hash Router Schema', () => { diff --git a/test/index-spec.ts b/test/index-spec.ts index 9c62e41d..e3264fef 100644 --- a/test/index-spec.ts +++ b/test/index-spec.ts @@ -1,8 +1,10 @@ -import path from 'path'; -import fs from 'fs'; -import processors = require('../asset/src'); +import path from 'node:path'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import * as processors from '../asset/src/index.js'; -const assetDir = path.join(__dirname, '..', 'asset', 'src'); +const dirname = path.dirname(fileURLToPath(import.meta.url)); +const assetDir = path.join(dirname, '..', 'asset', 'src'); describe('index', () => { it('should export every processor', () => { diff --git a/test/match/processor-spec.ts b/test/match/processor-spec.ts index 85b10d62..21ebb3dc 100644 --- a/test/match/processor-spec.ts +++ b/test/match/processor-spec.ts @@ -1,14 +1,18 @@ -import path from 'path'; +import path from 'node:path'; import { DataEntity, AnyObject } from '@terascope/utils'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; +import { fileURLToPath } from 'node:url'; +import { jest } from '@jest/globals'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); describe('match phase', () => { let harness: WorkerTestHarness; - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; async function makeTest(config: AnyObject = {}) { diff --git a/test/match/schema-spec.ts b/test/match/schema-spec.ts index 15c52c32..9708f379 100644 --- a/test/match/schema-spec.ts +++ b/test/match/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('Match Schema', () => { let harness: WorkerTestHarness; diff --git a/test/output/processor-spec.ts b/test/output/processor-spec.ts index 4f5a2175..95f05ddb 100644 --- a/test/output/processor-spec.ts +++ b/test/output/processor-spec.ts @@ -1,10 +1,13 @@ -import path from 'path'; +import path from 'node:path'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; +import { fileURLToPath } from 'node:url'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); describe('Output Phase', () => { - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; let harness: WorkerTestHarness; diff --git a/test/output/schema-spec.ts b/test/output/schema-spec.ts index 8019ddde..07989621 100644 --- a/test/output/schema-spec.ts +++ b/test/output/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('Output Schema', () => { let harness: WorkerTestHarness; diff --git a/test/post_process/processor-spec.ts b/test/post_process/processor-spec.ts index 241b120d..12eb8353 100644 --- a/test/post_process/processor-spec.ts +++ b/test/post_process/processor-spec.ts @@ -1,13 +1,17 @@ import 'jest-extended'; -import path from 'path'; +import path from 'node:path'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; +import { fileURLToPath } from 'node:url'; +import { jest } from '@jest/globals'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); describe('post_process phase', () => { - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; let harness: WorkerTestHarness; diff --git a/test/post_process/schema-spec.ts b/test/post_process/schema-spec.ts index c6a8159c..7728e267 100644 --- a/test/post_process/schema-spec.ts +++ b/test/post_process/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('post_process Schema', () => { let harness: WorkerTestHarness; diff --git a/test/remove_key/processor-spec.ts b/test/remove_key/processor-spec.ts index 3bcbde08..d0309796 100644 --- a/test/remove_key/processor-spec.ts +++ b/test/remove_key/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('remove_key', () => { let harness: WorkerTestHarness; diff --git a/test/routed_sender/processor-spec.ts b/test/routed_sender/processor-spec.ts index e5ec883e..3119bdb0 100644 --- a/test/routed_sender/processor-spec.ts +++ b/test/routed_sender/processor-spec.ts @@ -4,15 +4,18 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { isEmpty, DataEntity, get, RouteSenderAPI } from '@terascope/job-components'; -import path from 'path'; -import TestApi from '../fixtures/someAssetId/test_api/api'; -import RoutedSender from '../../asset/src/routed_sender/processor'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import TestApi from '../fixtures/someAssetId/test_api/api.js'; +import RoutedSender from '../../asset/src/routed_sender/processor.js'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); describe('Route Sender', () => { let harness: WorkerTestHarness; - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; const apiName = 'test_api'; diff --git a/test/routed_sender/schema-spec.ts b/test/routed_sender/schema-spec.ts index c3bc7146..a3a47b7d 100644 --- a/test/routed_sender/schema-spec.ts +++ b/test/routed_sender/schema-spec.ts @@ -2,13 +2,16 @@ import 'jest-extended'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import path from 'path'; -import { RouteSenderConfig } from '../../asset/src/routed_sender/interfaces'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { RouteSenderConfig } from '../../asset/src/routed_sender/interfaces.js'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); describe('routed_sender Schema', () => { let harness: WorkerTestHarness; - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; const name = 'routed_sender'; const api_name = 'test_api'; @@ -41,11 +44,10 @@ describe('routed_sender Schema', () => { }); harness = new WorkerTestHarness(job, { assetDir }); - await harness.initialize(); const validConfig = harness.executionContext.config.operations.find( - (testConfig) => testConfig._op === name + (testConfig:any) => testConfig._op === name ); return validConfig as RouteSenderConfig; diff --git a/test/selection/processor-spec.ts b/test/selection/processor-spec.ts index 74d5d8b0..13c7499b 100644 --- a/test/selection/processor-spec.ts +++ b/test/selection/processor-spec.ts @@ -1,13 +1,17 @@ import 'jest-extended'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; -import path from 'path'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { jest } from '@jest/globals'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); describe('selection phase', () => { - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; let harness: WorkerTestHarness; diff --git a/test/selection/schema-spec.ts b/test/selection/schema-spec.ts index 8822087f..71a554c2 100644 --- a/test/selection/schema-spec.ts +++ b/test/selection/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('selection Schema', () => { let harness: WorkerTestHarness; diff --git a/test/set_field/processor-spec.ts b/test/set_field/processor-spec.ts index 311eed77..908476d1 100644 --- a/test/set_field/processor-spec.ts +++ b/test/set_field/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('drop_field should', () => { let harness: WorkerTestHarness; diff --git a/test/set_key/processor-spec.ts b/test/set_key/processor-spec.ts index cd230203..656e856d 100644 --- a/test/set_key/processor-spec.ts +++ b/test/set_key/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, cloneDeep, AnyObject } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; describe('set_key should', () => { let harness: WorkerTestHarness; diff --git a/test/set_key/schema-spec.ts b/test/set_key/schema-spec.ts index 023feec6..991da35e 100644 --- a/test/set_key/schema-spec.ts +++ b/test/set_key/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { SetKeyConfig } from '../../asset/src/set_key/interfaces'; +import { SetKeyConfig } from '../../asset/src/set_key/interfaces.js'; describe('set_key schema', () => { let harness: WorkerTestHarness; diff --git a/test/sort/processor-spec.ts b/test/sort/processor-spec.ts index 4a1a3c4c..b37d46d5 100644 --- a/test/sort/processor-spec.ts +++ b/test/sort/processor-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { DataEntity, AnyObject, times } from '@terascope/job-components'; import { WorkerTestHarness } from 'teraslice-test-harness'; -import DataWindow from '../../asset/src/__lib/data-window'; +import DataWindow from '../../asset/src/__lib/data-window.js'; const testData = [ { diff --git a/test/sort/schema-spec.ts b/test/sort/schema-spec.ts index a19d2e76..3b6cf76e 100644 --- a/test/sort/schema-spec.ts +++ b/test/sort/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { SortConfig } from '../../asset/src/sort/interfaces'; +import { SortConfig } from '../../asset/src/sort/interfaces.js'; describe('sort schema', () => { let harness: WorkerTestHarness; diff --git a/test/stdout/processor-spec.ts b/test/stdout/processor-spec.ts index 130cb17d..309ab42c 100644 --- a/test/stdout/processor-spec.ts +++ b/test/stdout/processor-spec.ts @@ -1,6 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; +import { jest } from '@jest/globals'; jest.setTimeout(10_000); diff --git a/test/stdout/schema-spec.ts b/test/stdout/schema-spec.ts index 8a0a88dc..f49d1895 100644 --- a/test/stdout/schema-spec.ts +++ b/test/stdout/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { SetKeyConfig } from '../../asset/src/set_key/interfaces'; +import { SetKeyConfig } from '../../asset/src/set_key/interfaces.js'; describe('stdout schema', () => { let harness: WorkerTestHarness; diff --git a/test/transform/processor-spec.ts b/test/transform/processor-spec.ts index 089d1e43..ae00f447 100644 --- a/test/transform/processor-spec.ts +++ b/test/transform/processor-spec.ts @@ -1,12 +1,16 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; -import path from 'path'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { jest } from '@jest/globals'; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); describe('transform matches', () => { - const testAssetPath = path.join(__dirname, '../fixtures/someAssetId'); - const opPathName = path.join(__dirname, '../../asset/'); + const testAssetPath = path.join(dirname, '../fixtures/someAssetId'); + const opPathName = path.join(dirname, '../../asset/'); const assetDir = [testAssetPath, opPathName]; let harness: WorkerTestHarness; diff --git a/test/transform/schema-spec.ts b/test/transform/schema-spec.ts index 79e853fa..3357351c 100644 --- a/test/transform/schema-spec.ts +++ b/test/transform/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { PhaseConfig } from '../../asset/src/transform/interfaces'; +import { PhaseConfig } from '../../asset/src/transform/interfaces.js'; describe('transform Schema', () => { let harness: WorkerTestHarness; diff --git a/test/window/schema-spec.ts b/test/window/schema-spec.ts index fc166e94..5d4b30ae 100644 --- a/test/window/schema-spec.ts +++ b/test/window/schema-spec.ts @@ -1,7 +1,7 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { WindowConfig, TimeSetting, WindowType } from '../../asset/src/window/interfaces'; +import { WindowConfig, TimeSetting, WindowType } from '../../asset/src/window/interfaces.js'; describe('window Schema', () => { let harness: WorkerTestHarness; From c22c2a3578311e4191446c5aba5e26ac2d15a52c Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 15:57:35 -0700 Subject: [PATCH 11/16] temp fix to resolve CI yarn setup --- packages/standard-asset-apis/test/RoutedSender-spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/standard-asset-apis/test/RoutedSender-spec.ts b/packages/standard-asset-apis/test/RoutedSender-spec.ts index 52f3568e..d70b0a6f 100644 --- a/packages/standard-asset-apis/test/RoutedSender-spec.ts +++ b/packages/standard-asset-apis/test/RoutedSender-spec.ts @@ -5,7 +5,7 @@ import { debugLogger } from '@terascope/utils'; import 'jest-extended'; -import { jest } from '@jest/globals'; +// import { jest } from '@jest/globals'; import { RoutedSender } from '../src/index.js'; From a604274789bdbeff0663cecad96c881607de3e27 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 16:22:03 -0700 Subject: [PATCH 12/16] fix jest not defined error --- docs/operations/routed_sender.md | 2 +- jest.config.js | 3 +++ packages/standard-asset-apis/jest.config.js | 5 ++++- packages/standard-asset-apis/test/RoutedSender-spec.ts | 1 - packages/standard-asset-apis/test/test.setup.js | 2 ++ test/extraction/processor-spec.ts | 2 -- test/match/processor-spec.ts | 2 -- test/post_process/processor-spec.ts | 1 - test/selection/processor-spec.ts | 1 - test/stdout/processor-spec.ts | 1 - test/test.setup.js | 3 +++ test/transform/processor-spec.ts | 1 - 12 files changed, 13 insertions(+), 11 deletions(-) diff --git a/docs/operations/routed_sender.md b/docs/operations/routed_sender.md index c59579f1..b65d2ef7 100644 --- a/docs/operations/routed_sender.md +++ b/docs/operations/routed_sender.md @@ -246,7 +246,7 @@ import fse from 'fs-extra'; import ChunkedSender from '../__lib/chunked-file-sender'; import { FileSenderAPIConfig } from './interfaces'; import { FileSenderType } from '../__lib/interfaces'; -import path from 'path'; +import path from 'node:path'; export default class FileSender implements RouteSenderAPI { logger: Logger; diff --git a/jest.config.js b/jest.config.js index 9b8cae13..cf5863a6 100644 --- a/jest.config.js +++ b/jest.config.js @@ -43,4 +43,7 @@ export default { useESM: true }] }, + setupFiles: [ + "/test/test.setup.js" + ] }; diff --git a/packages/standard-asset-apis/jest.config.js b/packages/standard-asset-apis/jest.config.js index d830eaf6..340a35ce 100644 --- a/packages/standard-asset-apis/jest.config.js +++ b/packages/standard-asset-apis/jest.config.js @@ -18,5 +18,8 @@ export default { }, moduleNameMapper: { '^(\\.{1,2}/.*)\\.js$': '$1', - } + }, + setupFiles: [ + "/test/test.setup.js" + ] }; diff --git a/packages/standard-asset-apis/test/RoutedSender-spec.ts b/packages/standard-asset-apis/test/RoutedSender-spec.ts index d70b0a6f..e53b7757 100644 --- a/packages/standard-asset-apis/test/RoutedSender-spec.ts +++ b/packages/standard-asset-apis/test/RoutedSender-spec.ts @@ -5,7 +5,6 @@ import { debugLogger } from '@terascope/utils'; import 'jest-extended'; -// import { jest } from '@jest/globals'; import { RoutedSender } from '../src/index.js'; diff --git a/packages/standard-asset-apis/test/test.setup.js b/packages/standard-asset-apis/test/test.setup.js index f7534b31..c698e0c8 100644 --- a/packages/standard-asset-apis/test/test.setup.js +++ b/packages/standard-asset-apis/test/test.setup.js @@ -1 +1,3 @@ process.env.NODE_ENV = 'test'; +import { jest } from '@jest/globals'; +global.jest = jest; diff --git a/test/extraction/processor-spec.ts b/test/extraction/processor-spec.ts index ae18e3a7..3d9e28b5 100644 --- a/test/extraction/processor-spec.ts +++ b/test/extraction/processor-spec.ts @@ -2,8 +2,6 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { jest } from '@jest/globals'; - const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); diff --git a/test/match/processor-spec.ts b/test/match/processor-spec.ts index 21ebb3dc..cf218223 100644 --- a/test/match/processor-spec.ts +++ b/test/match/processor-spec.ts @@ -2,8 +2,6 @@ import path from 'node:path'; import { DataEntity, AnyObject } from '@terascope/utils'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { fileURLToPath } from 'node:url'; -import { jest } from '@jest/globals'; - const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); diff --git a/test/post_process/processor-spec.ts b/test/post_process/processor-spec.ts index 12eb8353..1935d2f1 100644 --- a/test/post_process/processor-spec.ts +++ b/test/post_process/processor-spec.ts @@ -3,7 +3,6 @@ import path from 'node:path'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; import { fileURLToPath } from 'node:url'; -import { jest } from '@jest/globals'; const dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/test/selection/processor-spec.ts b/test/selection/processor-spec.ts index 13c7499b..918e3757 100644 --- a/test/selection/processor-spec.ts +++ b/test/selection/processor-spec.ts @@ -3,7 +3,6 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { jest } from '@jest/globals'; const dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/test/stdout/processor-spec.ts b/test/stdout/processor-spec.ts index 309ab42c..130cb17d 100644 --- a/test/stdout/processor-spec.ts +++ b/test/stdout/processor-spec.ts @@ -1,7 +1,6 @@ import 'jest-extended'; import { WorkerTestHarness } from 'teraslice-test-harness'; import { AnyObject } from '@terascope/job-components'; -import { jest } from '@jest/globals'; jest.setTimeout(10_000); diff --git a/test/test.setup.js b/test/test.setup.js index f7534b31..7c860a90 100644 --- a/test/test.setup.js +++ b/test/test.setup.js @@ -1 +1,4 @@ process.env.NODE_ENV = 'test'; + +import { jest } from '@jest/globals'; +global.jest = jest; diff --git a/test/transform/processor-spec.ts b/test/transform/processor-spec.ts index ae00f447..210fc8a2 100644 --- a/test/transform/processor-spec.ts +++ b/test/transform/processor-spec.ts @@ -2,7 +2,6 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; -import { jest } from '@jest/globals'; const dirname = path.dirname(fileURLToPath(import.meta.url)); From a3fb57031958c955665e6c1eb25c72aedfd0b736 Mon Sep 17 00:00:00 2001 From: sotojn Date: Wed, 26 Jun 2024 16:26:52 -0700 Subject: [PATCH 13/16] hotfix for tests to pass --- jest.config.js | 2 +- packages/standard-asset-apis/jest.config.js | 2 +- packages/standard-asset-apis/test/test.setup.js | 3 ++- test/extraction/processor-spec.ts | 1 + test/match/processor-spec.ts | 1 + test/routed_sender/processor-spec.ts | 3 +++ test/routed_sender/schema-spec.ts | 3 +++ test/test.setup.js | 4 ++-- 8 files changed, 14 insertions(+), 5 deletions(-) diff --git a/jest.config.js b/jest.config.js index cf5863a6..cf025d32 100644 --- a/jest.config.js +++ b/jest.config.js @@ -44,6 +44,6 @@ export default { }] }, setupFiles: [ - "/test/test.setup.js" + '/test/test.setup.js' ] }; diff --git a/packages/standard-asset-apis/jest.config.js b/packages/standard-asset-apis/jest.config.js index 340a35ce..5667734d 100644 --- a/packages/standard-asset-apis/jest.config.js +++ b/packages/standard-asset-apis/jest.config.js @@ -20,6 +20,6 @@ export default { '^(\\.{1,2}/.*)\\.js$': '$1', }, setupFiles: [ - "/test/test.setup.js" + '/test/test.setup.js' ] }; diff --git a/packages/standard-asset-apis/test/test.setup.js b/packages/standard-asset-apis/test/test.setup.js index c698e0c8..59c17e7b 100644 --- a/packages/standard-asset-apis/test/test.setup.js +++ b/packages/standard-asset-apis/test/test.setup.js @@ -1,3 +1,4 @@ -process.env.NODE_ENV = 'test'; import { jest } from '@jest/globals'; + +process.env.NODE_ENV = 'test'; global.jest = jest; diff --git a/test/extraction/processor-spec.ts b/test/extraction/processor-spec.ts index 3d9e28b5..fdaa76c2 100644 --- a/test/extraction/processor-spec.ts +++ b/test/extraction/processor-spec.ts @@ -2,6 +2,7 @@ import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { DataEntity, AnyObject } from '@terascope/job-components'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; + const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); diff --git a/test/match/processor-spec.ts b/test/match/processor-spec.ts index cf218223..4976bf0e 100644 --- a/test/match/processor-spec.ts +++ b/test/match/processor-spec.ts @@ -2,6 +2,7 @@ import path from 'node:path'; import { DataEntity, AnyObject } from '@terascope/utils'; import { WorkerTestHarness, newTestJobConfig } from 'teraslice-test-harness'; import { fileURLToPath } from 'node:url'; + const dirname = path.dirname(fileURLToPath(import.meta.url)); jest.setTimeout(10_000); diff --git a/test/routed_sender/processor-spec.ts b/test/routed_sender/processor-spec.ts index 3119bdb0..f0639d71 100644 --- a/test/routed_sender/processor-spec.ts +++ b/test/routed_sender/processor-spec.ts @@ -8,6 +8,9 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; import TestApi from '../fixtures/someAssetId/test_api/api.js'; import RoutedSender from '../../asset/src/routed_sender/processor.js'; +// This is a temp fix to get routed sender imported during testing. May not be a good idea +await import('../../asset/src/routed_sender/processor.js'); +// const dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/test/routed_sender/schema-spec.ts b/test/routed_sender/schema-spec.ts index a3a47b7d..8aec3795 100644 --- a/test/routed_sender/schema-spec.ts +++ b/test/routed_sender/schema-spec.ts @@ -5,6 +5,9 @@ import { AnyObject } from '@terascope/job-components'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { RouteSenderConfig } from '../../asset/src/routed_sender/interfaces.js'; +// This is a temp fix to get routed sender imported during testing. May not be a good idea +await import('../../asset/src/routed_sender/processor.js'); +// const dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/test/test.setup.js b/test/test.setup.js index 7c860a90..59c17e7b 100644 --- a/test/test.setup.js +++ b/test/test.setup.js @@ -1,4 +1,4 @@ -process.env.NODE_ENV = 'test'; - import { jest } from '@jest/globals'; + +process.env.NODE_ENV = 'test'; global.jest = jest; From 709750f74ee4a6f085157f0186ccf04bcc7dd65f Mon Sep 17 00:00:00 2001 From: sotojn Date: Mon, 1 Jul 2024 10:26:19 -0700 Subject: [PATCH 14/16] convert requires to imports in data gen --- asset/src/data_generator/fetcher.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asset/src/data_generator/fetcher.ts b/asset/src/data_generator/fetcher.ts index eeba8715..4758acbb 100644 --- a/asset/src/data_generator/fetcher.ts +++ b/asset/src/data_generator/fetcher.ts @@ -60,9 +60,9 @@ function parsedSchema(opConfig: DataGenerator) { try { if (existsSync(firstPath)) { - dataSchema = require(firstPath); + dataSchema = import(firstPath); } else { - dataSchema = require(nextPath); + dataSchema = import(nextPath); } return dataSchema; } catch (err) { From 9f3577353ddd5e5d970348dfc723b6a430def2bf Mon Sep 17 00:00:00 2001 From: sotojn Date: Mon, 1 Jul 2024 10:27:38 -0700 Subject: [PATCH 15/16] bump: (major) standard@1.0.0, standard-assets-bundle@1.0.0 --- asset/asset.json | 2 +- asset/package.json | 4 ++-- package.json | 4 ++-- packages/standard-asset-apis/package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/asset/asset.json b/asset/asset.json index 6feaf0a9..62686350 100644 --- a/asset/asset.json +++ b/asset/asset.json @@ -1,5 +1,5 @@ { "name": "standard", - "version": "0.25.1", + "version": "1.0.0", "description": "Teraslice standard processor asset bundle" } diff --git a/asset/package.json b/asset/package.json index dcb95e43..e42af38c 100644 --- a/asset/package.json +++ b/asset/package.json @@ -1,15 +1,15 @@ { "name": "standard", "displayName": "Asset", - "version": "0.25.1", + "version": "1.0.0", "private": true, - "type": "module", "description": "Teraslice standard processor asset bundle", "repository": { "type": "git", "url": "git+https://github.com/terascope/standard-assets.git" }, "license": "MIT", + "type": "module", "workspaces": { "nohoist": [ "**" diff --git a/package.json b/package.json index ed1e0132..62cdf3bd 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,10 @@ { "name": "standard-assets-bundle", "displayName": "Standard Assets Bundle", - "version": "0.25.1", + "version": "1.0.0", "private": true, - "type": "module", "description": "Teraslice standard processor asset bundle", + "type": "module", "workspaces": [ "packages/*", "asset" diff --git a/packages/standard-asset-apis/package.json b/packages/standard-asset-apis/package.json index 72225acd..40e3de13 100644 --- a/packages/standard-asset-apis/package.json +++ b/packages/standard-asset-apis/package.json @@ -6,8 +6,8 @@ "homepage": "https://github.com/terascope/standard-assets", "repository": "git@github.com:terascope/standard-assets.git", "license": "MIT", - "type": "module", "author": "Terascope, LLC ", + "type": "module", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", "files": [ From a02ed1fd7cf8581b534f88a29990f1558eec59cd Mon Sep 17 00:00:00 2001 From: sotojn Date: Mon, 1 Jul 2024 16:09:49 -0700 Subject: [PATCH 16/16] cleanup jest config --- jest.config.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/jest.config.js b/jest.config.js index cf025d32..556c3d66 100644 --- a/jest.config.js +++ b/jest.config.js @@ -21,11 +21,7 @@ export default { ], testMatch: [ '/test/**/*-spec.{ts,js}', - '/test/*-spec.{ts,js}', - - // '/test/routed_sender/schema-spec.{ts,js}', - // '/test/data-generator/fetcher-spec.{ts,js}', - + '/test/*-spec.{ts,js}' ], moduleNameMapper: { '^@terascope/standard-asset-apis$': path.join(dirname, '/packages/standard-asset-apis/src/index.ts'),