@514labs/moose-lib 0.6.322-ci-9-g72529e37 → 0.6.322-ci-14-ga8e5dacb
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/dist/browserCompatible.js +0 -9
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +0 -9
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/dataModels/toDataModels.js +3 -7
- package/dist/dataModels/toDataModels.js.map +1 -1
- package/dist/dataModels/toDataModels.mjs +3 -7
- package/dist/dataModels/toDataModels.mjs.map +1 -1
- package/dist/dmv2/index.js +0 -9
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +0 -9
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/index.js +16 -60
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -64
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +57 -140
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +64 -147
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +2 -3
- package/dist/moose-tspc.d.mts +0 -1
- package/dist/moose-tspc.d.ts +0 -1
- package/dist/moose-tspc.js +0 -121
- package/dist/moose-tspc.js.map +0 -1
- package/dist/moose-tspc.mjs +0 -98
- package/dist/moose-tspc.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -450,7 +450,7 @@ var init_commons = __esm({
|
|
|
450
450
|
console.log(message);
|
|
451
451
|
}
|
|
452
452
|
};
|
|
453
|
-
antiCachePath = (
|
|
453
|
+
antiCachePath = (path2) => `${path2}?num=${Math.random().toString()}&time=${Date.now()}`;
|
|
454
454
|
getFileName = (filePath) => {
|
|
455
455
|
const regex = /\/([^\/]+)\.ts/;
|
|
456
456
|
const matches = filePath.match(regex);
|
|
@@ -547,44 +547,10 @@ var init_commons = __esm({
|
|
|
547
547
|
}
|
|
548
548
|
});
|
|
549
549
|
|
|
550
|
-
// src/
|
|
550
|
+
// src/dmv2/internal.ts
|
|
551
551
|
function getSourceDir() {
|
|
552
|
-
return
|
|
553
|
-
}
|
|
554
|
-
function hasCompiledArtifacts(projectRoot = process.cwd()) {
|
|
555
|
-
const sourceDir = getSourceDir();
|
|
556
|
-
const compiledIndexPath = import_path.default.join(
|
|
557
|
-
projectRoot,
|
|
558
|
-
".moose",
|
|
559
|
-
"compiled",
|
|
560
|
-
sourceDir,
|
|
561
|
-
"index.js"
|
|
562
|
-
);
|
|
563
|
-
return (0, import_fs.existsSync)(compiledIndexPath);
|
|
564
|
-
}
|
|
565
|
-
function shouldUseCompiled(projectRoot = process.cwd()) {
|
|
566
|
-
const envSaysCompiled = process.env.MOOSE_USE_COMPILED === "true";
|
|
567
|
-
if (!envSaysCompiled) {
|
|
568
|
-
return false;
|
|
569
|
-
}
|
|
570
|
-
const hasArtifacts = hasCompiledArtifacts(projectRoot);
|
|
571
|
-
if (!hasArtifacts) {
|
|
572
|
-
console.warn(
|
|
573
|
-
`[moose] MOOSE_USE_COMPILED=true but no compiled artifacts found at .moose/compiled/${getSourceDir()}/index.js. Falling back to ts-node.`
|
|
574
|
-
);
|
|
575
|
-
}
|
|
576
|
-
return hasArtifacts;
|
|
552
|
+
return import_process.default.env.MOOSE_SOURCE_DIR || "app";
|
|
577
553
|
}
|
|
578
|
-
var import_fs, import_path;
|
|
579
|
-
var init_compiler_config = __esm({
|
|
580
|
-
"src/compiler-config.ts"() {
|
|
581
|
-
"use strict";
|
|
582
|
-
import_fs = require("fs");
|
|
583
|
-
import_path = __toESM(require("path"));
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
// src/dmv2/internal.ts
|
|
588
554
|
var import_process, isClientOnlyMode, moose_internal, defaultRetentionPeriod, getMooseInternal, loadIndex, dlqSchema, dlqColumns, getWorkflows;
|
|
589
555
|
var init_internal = __esm({
|
|
590
556
|
"src/dmv2/internal.ts"() {
|
|
@@ -592,7 +558,6 @@ var init_internal = __esm({
|
|
|
592
558
|
import_process = __toESM(require("process"));
|
|
593
559
|
init_index();
|
|
594
560
|
init_commons();
|
|
595
|
-
init_compiler_config();
|
|
596
561
|
isClientOnlyMode = () => import_process.default.env.MOOSE_CLIENT_ONLY === "true";
|
|
597
562
|
moose_internal = {
|
|
598
563
|
tables: /* @__PURE__ */ new Map(),
|
|
@@ -611,7 +576,6 @@ var init_internal = __esm({
|
|
|
611
576
|
globalThis.moose_internal = moose_internal;
|
|
612
577
|
}
|
|
613
578
|
loadIndex = () => {
|
|
614
|
-
const useCompiled = shouldUseCompiled();
|
|
615
579
|
const registry = getMooseInternal();
|
|
616
580
|
registry.tables.clear();
|
|
617
581
|
registry.streams.clear();
|
|
@@ -622,21 +586,14 @@ var init_internal = __esm({
|
|
|
622
586
|
registry.webApps.clear();
|
|
623
587
|
registry.materializedViews.clear();
|
|
624
588
|
registry.views.clear();
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
delete require.cache[key];
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
}
|
|
633
|
-
try {
|
|
634
|
-
const sourceDir = getSourceDir();
|
|
635
|
-
if (useCompiled) {
|
|
636
|
-
require(`${import_process.default.cwd()}/.moose/compiled/${sourceDir}/index.js`);
|
|
637
|
-
} else {
|
|
638
|
-
require(`${import_process.default.cwd()}/${sourceDir}/index.ts`);
|
|
589
|
+
const appDir = `${import_process.default.cwd()}/${getSourceDir()}`;
|
|
590
|
+
Object.keys(require.cache).forEach((key) => {
|
|
591
|
+
if (key.startsWith(appDir)) {
|
|
592
|
+
delete require.cache[key];
|
|
639
593
|
}
|
|
594
|
+
});
|
|
595
|
+
try {
|
|
596
|
+
require(`${import_process.default.cwd()}/${getSourceDir()}/index.ts`);
|
|
640
597
|
} catch (error) {
|
|
641
598
|
let hint;
|
|
642
599
|
let includeDetails = true;
|
|
@@ -2220,22 +2177,22 @@ var init_consumptionApi = __esm({
|
|
|
2220
2177
|
return this._handler;
|
|
2221
2178
|
};
|
|
2222
2179
|
async call(baseUrl, queryParams) {
|
|
2223
|
-
let
|
|
2180
|
+
let path2;
|
|
2224
2181
|
if (this.config?.path) {
|
|
2225
2182
|
if (this.config.version) {
|
|
2226
2183
|
const pathEndsWithVersion = this.config.path.endsWith(`/${this.config.version}`) || this.config.path === this.config.version || this.config.path.endsWith(this.config.version) && this.config.path.length > this.config.version.length && this.config.path[this.config.path.length - this.config.version.length - 1] === "/";
|
|
2227
2184
|
if (pathEndsWithVersion) {
|
|
2228
|
-
|
|
2185
|
+
path2 = this.config.path;
|
|
2229
2186
|
} else {
|
|
2230
|
-
|
|
2187
|
+
path2 = `${this.config.path.replace(/\/$/, "")}/${this.config.version}`;
|
|
2231
2188
|
}
|
|
2232
2189
|
} else {
|
|
2233
|
-
|
|
2190
|
+
path2 = this.config.path;
|
|
2234
2191
|
}
|
|
2235
2192
|
} else {
|
|
2236
|
-
|
|
2193
|
+
path2 = this.config?.version ? `${this.name}/${this.config.version}` : this.name;
|
|
2237
2194
|
}
|
|
2238
|
-
const url = new URL(`${baseUrl.replace(/\/$/, "")}/api/${
|
|
2195
|
+
const url = new URL(`${baseUrl.replace(/\/$/, "")}/api/${path2}`);
|
|
2239
2196
|
const searchParams = url.searchParams;
|
|
2240
2197
|
for (const [key, value] of Object.entries(queryParams)) {
|
|
2241
2198
|
if (Array.isArray(value)) {
|
|
@@ -3329,7 +3286,6 @@ var init_runner = __esm({
|
|
|
3329
3286
|
init_cluster_utils();
|
|
3330
3287
|
init_sqlHelpers();
|
|
3331
3288
|
init_internal();
|
|
3332
|
-
init_compiler_config();
|
|
3333
3289
|
createConsumptionApi = createApi;
|
|
3334
3290
|
}
|
|
3335
3291
|
});
|