@qlover/scripts-context 2.3.2 → 2.3.4
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/index.cjs +2 -2
- package/dist/index.d.ts +1687 -4753
- package/dist/index.js +9 -24
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -481,10 +481,7 @@ var ConfigSearch = class {
|
|
|
481
481
|
};
|
|
482
482
|
|
|
483
483
|
// src/implement/ScriptContext.ts
|
|
484
|
-
import { merge as
|
|
485
|
-
|
|
486
|
-
// ../fe-corekit/src/aborter/Aborter.ts
|
|
487
|
-
import { isString } from "lodash-es";
|
|
484
|
+
import { merge as merge3, get as get2 } from "lodash-es";
|
|
488
485
|
|
|
489
486
|
// ../fe-corekit/src/executor/impl/ExecutorContextImpl.ts
|
|
490
487
|
var runtimesStorage = /* @__PURE__ */ new WeakMap();
|
|
@@ -856,20 +853,8 @@ var ExecutorContextImpl = class {
|
|
|
856
853
|
}
|
|
857
854
|
};
|
|
858
855
|
|
|
859
|
-
// ../fe-corekit/src/request/adapter/RequestAdapterFetch.ts
|
|
860
|
-
import { merge, pick } from "lodash-es";
|
|
861
|
-
|
|
862
|
-
// ../fe-corekit/src/request/impl/RequestExecutor.ts
|
|
863
|
-
import { clone } from "lodash-es";
|
|
864
|
-
|
|
865
|
-
// ../fe-corekit/src/request/impl/RequestPlugin.ts
|
|
866
|
-
import { clone as clone2 } from "lodash-es";
|
|
867
|
-
|
|
868
|
-
// ../fe-corekit/src/request/impl/ResponsePlugin.ts
|
|
869
|
-
import { isFunction } from "lodash-es";
|
|
870
|
-
|
|
871
856
|
// src/utils/initializeOptions.ts
|
|
872
|
-
import { merge
|
|
857
|
+
import { merge, get } from "lodash-es";
|
|
873
858
|
import { Env } from "@qlover/env-loader";
|
|
874
859
|
var DEFAULT_ENV_ORDER = [".env.local", ".env"];
|
|
875
860
|
function getDefaultOptions(options, feConfig, logger) {
|
|
@@ -900,7 +885,7 @@ function getDefaultStore(scriptName, sources, logger) {
|
|
|
900
885
|
}
|
|
901
886
|
function initializeOptions(scriptName, feConfig, options, logger) {
|
|
902
887
|
const store = getDefaultStore(scriptName, feConfig, logger);
|
|
903
|
-
const mergedOptions =
|
|
888
|
+
const mergedOptions = merge({}, store, options);
|
|
904
889
|
const defaultOptions = getDefaultOptions(
|
|
905
890
|
mergedOptions,
|
|
906
891
|
feConfig,
|
|
@@ -911,7 +896,7 @@ function initializeOptions(scriptName, feConfig, options, logger) {
|
|
|
911
896
|
|
|
912
897
|
// src/utils/contextDefaults.ts
|
|
913
898
|
import { exec } from "child_process";
|
|
914
|
-
import { merge as
|
|
899
|
+
import { merge as merge2 } from "lodash-es";
|
|
915
900
|
|
|
916
901
|
// ../logger/src/interface/LogEvent.ts
|
|
917
902
|
var LogEvent = class {
|
|
@@ -2427,7 +2412,7 @@ var contextDefaults = {
|
|
|
2427
2412
|
getConfig(feConfig) {
|
|
2428
2413
|
return new ConfigSearch({
|
|
2429
2414
|
name: "fe-config",
|
|
2430
|
-
defaultConfig:
|
|
2415
|
+
defaultConfig: merge2({}, defaultFeConfig, feConfig)
|
|
2431
2416
|
});
|
|
2432
2417
|
},
|
|
2433
2418
|
/**
|
|
@@ -2546,7 +2531,7 @@ var contextDefaults = {
|
|
|
2546
2531
|
dryRun,
|
|
2547
2532
|
execPromise: _options.execPromise || contextDefaults.exec
|
|
2548
2533
|
});
|
|
2549
|
-
const _feConfig =
|
|
2534
|
+
const _feConfig = merge2({}, feConfig, { [name]: ctxOpts.options });
|
|
2550
2535
|
return {
|
|
2551
2536
|
options: _options,
|
|
2552
2537
|
dryRun: !!dryRun,
|
|
@@ -2770,7 +2755,7 @@ var ScriptContext = class extends ExecutorContextImpl {
|
|
|
2770
2755
|
*
|
|
2771
2756
|
*/
|
|
2772
2757
|
setParameters(params) {
|
|
2773
|
-
super.setParameters(
|
|
2758
|
+
super.setParameters(merge3(this.parameters, params));
|
|
2774
2759
|
}
|
|
2775
2760
|
/**
|
|
2776
2761
|
* Retrieves environment variable with optional default value
|
|
@@ -2882,7 +2867,7 @@ var ScriptContext = class extends ExecutorContextImpl {
|
|
|
2882
2867
|
};
|
|
2883
2868
|
|
|
2884
2869
|
// src/implement/ScriptPlugin.ts
|
|
2885
|
-
import { merge as
|
|
2870
|
+
import { merge as merge4 } from "lodash-es";
|
|
2886
2871
|
var ScriptPlugin = class {
|
|
2887
2872
|
/**
|
|
2888
2873
|
* Creates a new script plugin instance
|
|
@@ -2946,7 +2931,7 @@ var ScriptPlugin = class {
|
|
|
2946
2931
|
const pluginConfig = this.context.options[this.pluginName];
|
|
2947
2932
|
const fileConfig = this.context.getParameters(this.pluginName);
|
|
2948
2933
|
const baseConfig = pluginConfig || fileConfig;
|
|
2949
|
-
return props ?
|
|
2934
|
+
return props ? merge4({}, baseConfig, props) : baseConfig || {};
|
|
2950
2935
|
}
|
|
2951
2936
|
/**
|
|
2952
2937
|
* Logger instance for structured logging
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qlover/scripts-context",
|
|
3
3
|
"description": "A scripts context for frontwork",
|
|
4
|
-
"version": "2.3.
|
|
4
|
+
"version": "2.3.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
7
7
|
"homepage": "https://github.com/qlover/fe-base/tree/master/packages/scripts-context#readme",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"@commitlint/types": "^19.8.0",
|
|
44
44
|
"@types/lodash-es": "^4.17.12",
|
|
45
45
|
"@types/shelljs": "^0.8.15",
|
|
46
|
-
"@qlover/
|
|
47
|
-
"@qlover/
|
|
46
|
+
"@qlover/fe-corekit": "3.4.7",
|
|
47
|
+
"@qlover/logger": "1.2.1"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"chalk": "^5.
|
|
51
|
-
"cosmiconfig": "^9.0.
|
|
52
|
-
"lodash-es": "^4.
|
|
53
|
-
"@qlover/env-loader": "1.
|
|
50
|
+
"chalk": "^5.6.2",
|
|
51
|
+
"cosmiconfig": "^9.0.2",
|
|
52
|
+
"lodash-es": "^4.18.1",
|
|
53
|
+
"@qlover/env-loader": "1.1.1"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"lint": "eslint src --fix",
|