@sqlanvil/cli 1.32.10 → 1.33.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.
- package/README.md +1 -1
- package/bundle.js +960 -770
- package/package.json +1 -1
- package/worker_bundle.js +16 -12
package/package.json
CHANGED
package/worker_bundle.js
CHANGED
|
@@ -49557,7 +49557,7 @@ Struct.verify = function (object) {
|
|
|
49557
49557
|
for (const [k, v] of Object.entries(object)) {
|
|
49558
49558
|
fields[k] = unknownToValueShallow(v);
|
|
49559
49559
|
}
|
|
49560
|
-
Object.keys(object).forEach(key => delete object[key]);
|
|
49560
|
+
Object.keys(object).forEach((key) => delete object[key]);
|
|
49561
49561
|
object.fields = fields;
|
|
49562
49562
|
}
|
|
49563
49563
|
return originalVerify.call(this, object);
|
|
@@ -49568,7 +49568,7 @@ Struct.fromObject = function (object) {
|
|
|
49568
49568
|
for (const [k, v] of Object.entries(object)) {
|
|
49569
49569
|
fields[k] = unknownToValueShallow(v);
|
|
49570
49570
|
}
|
|
49571
|
-
Object.keys(object).forEach(key => delete object[key]);
|
|
49571
|
+
Object.keys(object).forEach((key) => delete object[key]);
|
|
49572
49572
|
object.fields = fields;
|
|
49573
49573
|
}
|
|
49574
49574
|
return originalFromObject.call(this, object);
|
|
@@ -49617,8 +49617,8 @@ function compile(compileConfig) {
|
|
|
49617
49617
|
context: "sandbox",
|
|
49618
49618
|
root: compileConfig.projectDir,
|
|
49619
49619
|
external: true,
|
|
49620
|
-
builtin: ["path"]
|
|
49621
|
-
}
|
|
49620
|
+
builtin: ["path"],
|
|
49621
|
+
},
|
|
49622
49622
|
});
|
|
49623
49623
|
const compiler = indexGeneratorVm.run('return require("@sqlanvil/core").compiler', vmIndexFileName);
|
|
49624
49624
|
const sqlanvilCoreVersion = indexGeneratorVm.run('return require("@sqlanvil/core").version || "0.0.0"', vmIndexFileName);
|
|
@@ -49641,16 +49641,20 @@ function compile(compileConfig) {
|
|
|
49641
49641
|
const userCodeVm = new vm2.NodeVM({
|
|
49642
49642
|
wrapper: "none",
|
|
49643
49643
|
sandbox: {
|
|
49644
|
-
__df_enter: (p) => {
|
|
49645
|
-
|
|
49646
|
-
|
|
49644
|
+
__df_enter: (p) => {
|
|
49645
|
+
fileStack.push(p);
|
|
49646
|
+
},
|
|
49647
|
+
__df_exit: () => {
|
|
49648
|
+
fileStack.pop();
|
|
49649
|
+
},
|
|
49650
|
+
__df_current: () => (fileStack.length > 0 ? fileStack[fileStack.length - 1] : null),
|
|
49647
49651
|
},
|
|
49648
49652
|
require: {
|
|
49649
49653
|
builtin: ["path"],
|
|
49650
49654
|
context: "sandbox",
|
|
49651
49655
|
external: true,
|
|
49652
49656
|
root: compileConfig.projectDir,
|
|
49653
|
-
resolve: (moduleName, parentDirName) => path__namespace.join(parentDirName, path__namespace.relative(parentDirName, compileConfig.projectDir), moduleName)
|
|
49657
|
+
resolve: (moduleName, parentDirName) => path__namespace.join(parentDirName, path__namespace.relative(parentDirName, compileConfig.projectDir), moduleName),
|
|
49654
49658
|
},
|
|
49655
49659
|
sourceExtensions: ["js", "sql", "sqlx", "yaml", "yml"],
|
|
49656
49660
|
compiler: (code, filePath) => {
|
|
@@ -49667,7 +49671,7 @@ function compile(compileConfig) {
|
|
|
49667
49671
|
__df_exit();
|
|
49668
49672
|
}
|
|
49669
49673
|
`;
|
|
49670
|
-
}
|
|
49674
|
+
},
|
|
49671
49675
|
});
|
|
49672
49676
|
const hasWorkflowSettingsYaml = fs__namespace.existsSync(path__namespace.join(compileConfig.projectDir, "workflow_settings.yaml"));
|
|
49673
49677
|
return userCodeVm.run(`
|
|
@@ -49677,7 +49681,7 @@ function compile(compileConfig) {
|
|
|
49677
49681
|
});
|
|
49678
49682
|
${hasWorkflowSettingsYaml
|
|
49679
49683
|
? 'global.workflowSettingsYaml = require("./workflow_settings.yaml");'
|
|
49680
|
-
:
|
|
49684
|
+
: ""}
|
|
49681
49685
|
return require("@sqlanvil/core").main("${createCoreExecutionRequest(compileConfig)}")
|
|
49682
49686
|
`, vmIndexFileName);
|
|
49683
49687
|
}
|
|
@@ -49716,7 +49720,7 @@ function readCliVersion() {
|
|
|
49716
49720
|
}
|
|
49717
49721
|
}
|
|
49718
49722
|
const OLD_CORE_THROW = 'if(!t)throw new Error("Unable to find valid caller file; please report this issue.")';
|
|
49719
|
-
const OLD_CORE_WITH_FALLBACK =
|
|
49723
|
+
const OLD_CORE_WITH_FALLBACK = "if(!t){if(global.__sqlanvil_current_file){t=global.__sqlanvil_current_file}" +
|
|
49720
49724
|
'else{throw new Error("Unable to find valid caller file; please report this issue.")}}';
|
|
49721
49725
|
function patchOldCoreCallerFile(source) {
|
|
49722
49726
|
return source.replace(OLD_CORE_THROW, OLD_CORE_WITH_FALLBACK);
|
|
@@ -49724,7 +49728,7 @@ function patchOldCoreCallerFile(source) {
|
|
|
49724
49728
|
function createCoreExecutionRequest(compileConfig) {
|
|
49725
49729
|
const filePaths = Array.from(new Set(glob__namespace.sync("!(node_modules)/**/*.*", { cwd: compileConfig.projectDir })));
|
|
49726
49730
|
return encode64(sqlanvil.CoreExecutionRequest, {
|
|
49727
|
-
compile: { compileConfig: Object.assign({ filePaths }, compileConfig) }
|
|
49731
|
+
compile: { compileConfig: Object.assign({ filePaths }, compileConfig) },
|
|
49728
49732
|
});
|
|
49729
49733
|
}
|
|
49730
49734
|
|