teraslice 0.92.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,8 @@
1
- 'use strict';
2
-
3
- const { get, logError } = require('@terascope/utils');
4
- const { shutdownHandler } = require('./dist/src/lib/workers/helpers/worker-shutdown');
5
- const { makeTerafoundationContext } = require('./dist/src/lib/workers/context/terafoundation-context');
6
- const { ClusterMaster } = require('./dist/src/lib/cluster/cluster_master');
7
- const { AssetsService } = require('./dist/src/lib/cluster/services');
1
+ import { get, logError } from '@terascope/utils';
2
+ import { shutdownHandler } from './dist/src/lib/workers/helpers/worker-shutdown.js';
3
+ import { makeTerafoundationContext } from './dist/src/lib/workers/context/terafoundation-context.js';
4
+ import { ClusterMaster } from './dist/src/lib/cluster/cluster_master.js';
5
+ import { AssetsService } from './dist/src/lib/cluster/services/index.js';
8
6
 
9
7
  class Service {
10
8
  constructor(context) {
package/dist/src/index.js CHANGED
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  /**
3
2
  * Export of internal components and functions of teraslice.
4
3
  *
@@ -6,37 +5,9 @@
6
5
  * Since these are internal components, breaking changes may occur if using them.
7
6
  * For best results teraslice with an exact semver match, i.e "0.38.0".
8
7
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || function (mod) {
26
- if (mod && mod.__esModule) return mod;
27
- var result = {};
28
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
29
- __setModuleDefault(result, mod);
30
- return result;
31
- };
32
- Object.defineProperty(exports, "__esModule", { value: true });
33
- exports.stores = exports.config = exports.makeTerafoundationContext = exports.initializeTestExecution = void 0;
34
- const config = __importStar(require("./lib/config"));
35
- exports.config = config;
36
- const stores = __importStar(require("./lib/storage"));
37
- exports.stores = stores;
38
- const terafoundation_context_1 = require("./lib/workers/context/terafoundation-context");
39
- Object.defineProperty(exports, "makeTerafoundationContext", { enumerable: true, get: function () { return terafoundation_context_1.makeTerafoundationContext; } });
40
- const job_1 = require("./lib/workers/helpers/job");
41
- Object.defineProperty(exports, "initializeTestExecution", { enumerable: true, get: function () { return job_1.initializeTestExecution; } });
8
+ import * as config from './lib/config/index.js';
9
+ import * as stores from './lib/storage/index.js';
10
+ import { makeTerafoundationContext } from './lib/workers/context/terafoundation-context.js';
11
+ import { initializeTestExecution } from './lib/workers/helpers/job.js';
12
+ export { initializeTestExecution, makeTerafoundationContext, config, stores, };
42
13
  //# sourceMappingURL=index.js.map
package/jest.config.js CHANGED
@@ -1,3 +1,20 @@
1
- 'use strict';
1
+ import { fileURLToPath } from 'node:url';
2
+ import path from 'node:path';
2
3
 
3
- module.exports = require('../../jest.config.base')(__dirname);
4
+ const dirPath = fileURLToPath(new URL('.', import.meta.url));
5
+ const configModulePath = path.join(dirPath, '../../jest.config.base.js');
6
+
7
+ const module = await import(configModulePath);
8
+
9
+ const config = module.default(dirPath);
10
+
11
+ config.extensionsToTreatAsEsm = ['.ts'];
12
+ config.moduleNameMapper = {
13
+ '^(\\.{1,2}/.*)\\.js$': '$1',
14
+ };
15
+ config.testTimeout = 60 * 1000;
16
+ config.transform = {};
17
+
18
+ config.transform['^.+\\.(t|j)sx?$'] = '@swc/jest';
19
+
20
+ export default config;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "teraslice",
3
3
  "displayName": "Teraslice",
4
- "version": "0.92.0",
4
+ "version": "0.93.0",
5
5
  "description": "Distributed computing platform for processing JSON data",
6
6
  "homepage": "https://github.com/terascope/teraslice#readme",
7
7
  "bugs": {
@@ -13,6 +13,7 @@
13
13
  },
14
14
  "license": "Apache-2.0",
15
15
  "author": "Terascope, LLC <info@terascope.io>",
16
+ "type": "module",
16
17
  "main": "dist/src/index.js",
17
18
  "typings": "dist/src/index.d.ts",
18
19
  "files": [
package/service.js CHANGED
@@ -1,12 +1,9 @@
1
1
  #!/usr/bin/env node
2
-
3
- 'use strict';
4
-
5
- const util = require('util');
6
- const { ClusterContext } = require('terafoundation');
7
- const { safeEncode, safeDecode } = require('./dist/src/lib/utils/encoding_utils');
8
- const { nodeMaster } = require('./dist/src/lib/cluster/node_master');
9
- const { getTerasliceConfig } = require('./dist/src/lib/config');
2
+ import util from 'node:util';
3
+ import { ClusterContext } from 'terafoundation';
4
+ import { safeEncode, safeDecode } from './dist/src/lib/utils/encoding_utils.js';
5
+ import { nodeMaster } from './dist/src/lib/cluster/node_master.js';
6
+ import { getTerasliceConfig } from './dist/src/lib/config/index.js';
10
7
 
11
8
  const assignment = process.env.assignment || process.env.NODE_TYPE;
12
9
 
@@ -20,12 +17,12 @@ if (['execution_controller', 'worker'].includes(assignment)) {
20
17
  process.env.EX = safeEncode(JSON.parse(process.env.job));
21
18
  }
22
19
 
23
- require('./worker-service');
20
+ import('./worker-service.js');
24
21
  } else if (['cluster_master', 'assets_service'].includes(assignment)) {
25
22
  process.env.assignment = assignment;
26
23
  process.env.NODE_TYPE = assignment;
27
24
 
28
- require('./cluster-service');
25
+ import('./cluster-service.js');
29
26
  } else {
30
27
  process.env.assignment = 'node_master';
31
28
  process.env.NODE_TYPE = 'node_master';
package/worker-service.js CHANGED
@@ -1,14 +1,12 @@
1
- 'use strict';
2
-
3
- const {
1
+ import {
4
2
  logError, get, isEmpty, isPlainObject
5
- } = require('@terascope/utils');
6
- const { shutdownHandler } = require('./dist/src/lib/workers/helpers/worker-shutdown');
7
- const { safeDecode } = require('./dist/src/lib/utils/encoding_utils');
8
- const { makeExecutionContext } = require('./dist/src/lib/workers/context/execution-context');
9
- const { makeTerafoundationContext } = require('./dist/src/lib/workers/context/terafoundation-context');
10
- const { ExecutionController } = require('./dist/src/lib/workers/execution-controller');
11
- const { Worker } = require('./dist/src/lib/workers/worker');
3
+ } from '@terascope/utils';
4
+ import { shutdownHandler } from './dist/src/lib/workers/helpers/worker-shutdown.js';
5
+ import { safeDecode } from './dist/src/lib/utils/encoding_utils.js';
6
+ import { makeExecutionContext } from './dist/src/lib/workers/context/execution-context.js';
7
+ import { makeTerafoundationContext } from './dist/src/lib/workers/context/terafoundation-context.js';
8
+ import { ExecutionController } from './dist/src/lib/workers/execution-controller/index.js';
9
+ import { Worker } from './dist/src/lib/workers/worker/index.js';
12
10
 
13
11
  class Service {
14
12
  constructor(context) {