@forzalabs/remora 1.0.4 → 1.0.7
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.
package/actions/run.js
CHANGED
|
@@ -22,7 +22,8 @@ const ExecutorOrchestrator_1 = __importDefault(require("../executors/ExecutorOrc
|
|
|
22
22
|
const run = (consumerName, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
23
23
|
try {
|
|
24
24
|
(0, compile_1.compile)();
|
|
25
|
-
|
|
25
|
+
// needed for newline
|
|
26
|
+
console.log();
|
|
26
27
|
const consumersToExecute = [];
|
|
27
28
|
if (consumerName && consumerName.length > 0) {
|
|
28
29
|
const cons = Environment_1.default.getConsumer(consumerName);
|
|
@@ -40,6 +41,10 @@ const run = (consumerName, options) => __awaiter(void 0, void 0, void 0, functio
|
|
|
40
41
|
else {
|
|
41
42
|
consumersToExecute.push(...Environment_1.default._env.consumers);
|
|
42
43
|
}
|
|
44
|
+
if (consumersToExecute.length === 1)
|
|
45
|
+
console.log(chalk_1.default.blue(`Running consumer ${consumersToExecute[0].name}...\n`));
|
|
46
|
+
else
|
|
47
|
+
console.log(chalk_1.default.blue(`Running consumers ${consumersToExecute.map(x => x.name).join(', ')}...\n`));
|
|
43
48
|
const results = [];
|
|
44
49
|
for (let i = 0; i < consumersToExecute.length; i++) {
|
|
45
50
|
const consumer = consumersToExecute[i];
|
|
@@ -149,6 +149,8 @@ class TransformationEngineClass {
|
|
|
149
149
|
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
150
150
|
}
|
|
151
151
|
if ('substring' in transformations) {
|
|
152
|
+
if (!Algo_1.default.hasVal(value))
|
|
153
|
+
return '';
|
|
152
154
|
if (typeof value !== 'string')
|
|
153
155
|
throw new Error(`Cannot take substring of non-string value in field '${field.key}'`);
|
|
154
156
|
const { start, end } = transformations.substring;
|
|
@@ -27,6 +27,7 @@ const TransformationEngine_1 = __importDefault(require("../engines/transform/Tra
|
|
|
27
27
|
const RequestExecutor_1 = __importDefault(require("../engines/execution/RequestExecutor"));
|
|
28
28
|
const Affirm_1 = __importDefault(require("../core/Affirm"));
|
|
29
29
|
const Constants_1 = __importDefault(require("../Constants"));
|
|
30
|
+
const Algo_1 = __importDefault(require("../core/Algo"));
|
|
30
31
|
class ConsumerExecutorClass {
|
|
31
32
|
constructor() {
|
|
32
33
|
this._getWorkPath = (consumer, executionId) => {
|
|
@@ -79,7 +80,7 @@ class ConsumerExecutorClass {
|
|
|
79
80
|
// set the fixed default value for the field, or throw error if not present in the producer
|
|
80
81
|
const dimension = dimensions.find(x => x.name === cField.key);
|
|
81
82
|
if (!dimension) {
|
|
82
|
-
if (cField.fixed && cField.default)
|
|
83
|
+
if (cField.fixed && Algo_1.default.hasVal(cField.default))
|
|
83
84
|
record[fieldKey] = cField.default;
|
|
84
85
|
else
|
|
85
86
|
throw new Error(`The requested field "${cField.key}" from the consumer is not present in the underlying producer "${producer.name}" (${dimensions.map(x => x.name).join(', ')})`);
|
|
@@ -151,7 +151,7 @@ class ExecutorOrchestratorClass {
|
|
|
151
151
|
return [{ start: 0, end: fileSize, isFirstChunk: true, fileUri }];
|
|
152
152
|
}
|
|
153
153
|
// Calculate optimal chunk count based on file size and CPU cores
|
|
154
|
-
const cpus = numChunks !== null && numChunks !== void 0 ? numChunks :
|
|
154
|
+
const cpus = numChunks !== null && numChunks !== void 0 ? numChunks : os_1.default.cpus().length;
|
|
155
155
|
const maxChunksBySize = Math.floor(fileSize / Constants_1.default.defaults.MIN_CHUNK_SIZE);
|
|
156
156
|
const effectiveChunks = Math.min(cpus, maxChunksBySize);
|
|
157
157
|
if (effectiveChunks <= 1)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forzalabs/remora",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A powerful CLI tool for seamless data translation.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"private": false,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"copy-static-file": "npx tsx ./scripts/CopyStaticFile.js",
|
|
24
24
|
"build": "npm i && npm run sync && tsc --outDir .build && npm run copy-static-file",
|
|
25
25
|
"fast-build": "tsc --outDir .build",
|
|
26
|
-
"upload": "npm run build && cd .build && npm
|
|
26
|
+
"upload": "npm run build && cd .build && npm publish --access=public"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"nextjs",
|