@powerlines/engine 0.43.31 → 0.44.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/dist/_internal/worker.cjs +155 -125
- package/dist/_internal/worker.mjs +158 -128
- package/dist/_internal/worker.mjs.map +1 -1
- package/dist/api.cjs +3 -2
- package/dist/api.d.cts.map +1 -1
- package/dist/api.d.mts.map +1 -1
- package/dist/api.mjs +3 -2
- package/dist/api.mjs.map +1 -1
- package/dist/{base-context-CPoqO4io.cjs → base-context-5_AZZYFu.cjs} +24 -30
- package/dist/{base-context-SmQ6OfXm.mjs → base-context-D_ZidDDm.mjs} +26 -32
- package/dist/base-context-D_ZidDDm.mjs.map +1 -0
- package/dist/context/index.cjs +3 -3
- package/dist/context/index.d.cts +47 -29
- package/dist/context/index.d.cts.map +1 -1
- package/dist/context/index.d.mts +47 -29
- package/dist/context/index.d.mts.map +1 -1
- package/dist/context/index.mjs +3 -3
- package/dist/{engine-context-D7CWyTsr.mjs → engine-context-PQ3BgcgR.mjs} +2 -2
- package/dist/{engine-context-D7CWyTsr.mjs.map → engine-context-PQ3BgcgR.mjs.map} +1 -1
- package/dist/{engine-context-CEu21ZZf.cjs → engine-context-w4fts28j.cjs} +1 -1
- package/dist/{execution-context-DsT6s1du.cjs → execution-context-0GmpbWbs.cjs} +134 -99
- package/dist/{execution-context-C_7IC8er.mjs → execution-context-zedP0h4Z.mjs} +136 -101
- package/dist/execution-context-zedP0h4Z.mjs.map +1 -0
- package/dist/index.cjs +8 -7
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/base-context-SmQ6OfXm.mjs.map +0 -1
- package/dist/execution-context-C_7IC8er.mjs.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-C0xms8kb.cjs');
|
|
2
2
|
let _stryke_fs_resolve = require("@stryke/fs/resolve");
|
|
3
|
-
let _storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
4
3
|
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
5
4
|
let _powerlines_core_lib_config = require("@powerlines/core/lib/config");
|
|
6
5
|
let _powerlines_core_lib_logger = require("@powerlines/core/lib/logger");
|
|
6
|
+
let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
|
|
7
7
|
let _stryke_env_get_env_paths = require("@stryke/env/get-env-paths");
|
|
8
8
|
let _stryke_json_storm_json = require("@stryke/json/storm-json");
|
|
9
9
|
let _stryke_path_is_equal = require("@stryke/path/is-equal");
|
|
10
10
|
let _stryke_path_replace = require("@stryke/path/replace");
|
|
11
|
-
let _stryke_type_checks_is_null = require("@stryke/type-checks/is-null");
|
|
12
11
|
let chalk = require("chalk");
|
|
13
12
|
chalk = require_chunk.__toESM(chalk, 1);
|
|
14
13
|
let date_fns_formatDistanceToNowStrict = require("date-fns/formatDistanceToNowStrict");
|
|
@@ -47,7 +46,6 @@ function createResolver(options) {
|
|
|
47
46
|
//#region src/context/base-context.ts
|
|
48
47
|
var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
49
48
|
#timestamp = Date.now();
|
|
50
|
-
#logLevel = "info";
|
|
51
49
|
/**
|
|
52
50
|
* The path to the Powerlines package
|
|
53
51
|
*/
|
|
@@ -72,24 +70,16 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
72
70
|
* A timestamp representing when the context was initialized
|
|
73
71
|
*/
|
|
74
72
|
get timestamp() {
|
|
75
|
-
return
|
|
73
|
+
return this.#timestamp;
|
|
76
74
|
}
|
|
77
75
|
get logLevel() {
|
|
78
|
-
return this
|
|
79
|
-
}
|
|
80
|
-
set logLevel(level) {
|
|
81
|
-
this.#logLevel = level;
|
|
76
|
+
return (0, _powerlines_core_plugin_utils.resolveLogLevel)(this.options.logLevel, this.options.mode);
|
|
82
77
|
}
|
|
83
78
|
/**
|
|
84
79
|
* The logger function
|
|
85
80
|
*/
|
|
86
81
|
get log() {
|
|
87
|
-
|
|
88
|
-
if (!this.logger || this.logger.level !== level) this.logger = {
|
|
89
|
-
log: this.createLog(),
|
|
90
|
-
level
|
|
91
|
-
};
|
|
92
|
-
return this.logger.log;
|
|
82
|
+
return this.createLog();
|
|
93
83
|
}
|
|
94
84
|
/**
|
|
95
85
|
* The environment paths for the project
|
|
@@ -120,7 +110,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
120
110
|
* @param message - The message to log.
|
|
121
111
|
*/
|
|
122
112
|
fatal(message) {
|
|
123
|
-
this.log(
|
|
113
|
+
this.log("error", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
124
114
|
}
|
|
125
115
|
/**
|
|
126
116
|
* A logging function for error messages
|
|
@@ -128,7 +118,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
128
118
|
* @param message - The message to log.
|
|
129
119
|
*/
|
|
130
120
|
error(message) {
|
|
131
|
-
this.log(
|
|
121
|
+
this.log("error", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
132
122
|
}
|
|
133
123
|
/**
|
|
134
124
|
* A logging function for warning messages
|
|
@@ -136,7 +126,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
136
126
|
* @param message - The message to log.
|
|
137
127
|
*/
|
|
138
128
|
warn(message) {
|
|
139
|
-
this.log(
|
|
129
|
+
this.log("warn", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
140
130
|
}
|
|
141
131
|
/**
|
|
142
132
|
* A logging function for informational messages
|
|
@@ -144,7 +134,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
144
134
|
* @param message - The message to log.
|
|
145
135
|
*/
|
|
146
136
|
info(message) {
|
|
147
|
-
this.log(
|
|
137
|
+
this.log("info", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
148
138
|
}
|
|
149
139
|
/**
|
|
150
140
|
* A logging function for debug messages
|
|
@@ -152,7 +142,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
152
142
|
* @param message - The message to log.
|
|
153
143
|
*/
|
|
154
144
|
debug(message) {
|
|
155
|
-
this.log(
|
|
145
|
+
this.log("debug", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
156
146
|
}
|
|
157
147
|
/**
|
|
158
148
|
* A logging function for trace messages
|
|
@@ -160,7 +150,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
160
150
|
* @param message - The message to log.
|
|
161
151
|
*/
|
|
162
152
|
trace(message) {
|
|
163
|
-
this.log(
|
|
153
|
+
this.log("trace", (0, _stryke_type_checks_is_string.isString)(message) ? message : _stryke_json_storm_json.StormJSON.stringify(message));
|
|
164
154
|
}
|
|
165
155
|
/**
|
|
166
156
|
* A function to create a timer for measuring the duration of asynchronous operations
|
|
@@ -180,29 +170,32 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
180
170
|
const startDuration = performance.now();
|
|
181
171
|
return () => {
|
|
182
172
|
const duration = performance.now() - startDuration;
|
|
183
|
-
this.log(
|
|
173
|
+
this.log({
|
|
174
|
+
level: "info",
|
|
175
|
+
category: "performance"
|
|
176
|
+
}, `${chalk.default.bold.cyanBright(name)} completed in ${chalk.default.bold.cyanBright(duration < 1e3 ? `${duration.toFixed(2)} milliseconds` : (0, date_fns_formatDistanceToNowStrict.formatDistanceToNowStrict)(startDate))}`);
|
|
184
177
|
};
|
|
185
178
|
}
|
|
186
179
|
/**
|
|
187
180
|
* Create a new logger instance
|
|
188
181
|
*
|
|
189
|
-
* @param
|
|
182
|
+
* @param config - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
190
183
|
* @returns A logger function
|
|
191
184
|
*/
|
|
192
|
-
createLog(
|
|
193
|
-
return (0, _powerlines_core_lib_logger.
|
|
185
|
+
createLog(config) {
|
|
186
|
+
return (0, _powerlines_core_lib_logger.createLogFn)({
|
|
194
187
|
...this.options,
|
|
195
|
-
|
|
188
|
+
...config
|
|
196
189
|
});
|
|
197
190
|
}
|
|
198
191
|
/**
|
|
199
192
|
* Extend the current logger instance with a new source
|
|
200
193
|
*
|
|
201
|
-
* @param
|
|
202
|
-
* @returns A logger function
|
|
194
|
+
* @param config - The overlay metadata to use for the badge in the log output, which can be used to customize the appearance and behavior of the log messages generated by the extended logger. This typically includes the name of the plugin or module that is creating the logger instance, and can also include other metadata such as the command or environment.
|
|
195
|
+
* @returns A new logger function that includes the badge in its output.
|
|
203
196
|
*/
|
|
204
|
-
extendLog(
|
|
205
|
-
return (0, _powerlines_core_lib_logger.
|
|
197
|
+
extendLog(config) {
|
|
198
|
+
return (0, _powerlines_core_lib_logger.extendLogFn)(this.log, config);
|
|
206
199
|
}
|
|
207
200
|
/**
|
|
208
201
|
* A logger function specific to this context
|
|
@@ -217,7 +210,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
217
210
|
* @param options - The configuration options to initialize the context with
|
|
218
211
|
*/
|
|
219
212
|
async init(options = {}) {
|
|
220
|
-
this.inputOptions = options;
|
|
213
|
+
this.inputOptions = { ...options };
|
|
221
214
|
if (!this.powerlinesPath) {
|
|
222
215
|
const powerlinesPath = await (0, _stryke_fs_resolve.resolvePackage)("powerlines");
|
|
223
216
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
@@ -229,6 +222,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
229
222
|
root,
|
|
230
223
|
cwd,
|
|
231
224
|
mode: options.mode,
|
|
225
|
+
logLevel: options.logLevel,
|
|
232
226
|
framework: options.framework,
|
|
233
227
|
organization: options.organization,
|
|
234
228
|
configFile: options.configFile
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { resolvePackage } from "@stryke/fs/resolve";
|
|
2
|
-
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
3
2
|
import { isString } from "@stryke/type-checks/is-string";
|
|
4
3
|
import { loadUserConfigFile } from "@powerlines/core/lib/config";
|
|
5
|
-
import {
|
|
4
|
+
import { createLogFn, extendLogFn } from "@powerlines/core/lib/logger";
|
|
5
|
+
import { resolveLogLevel } from "@powerlines/core/plugin-utils";
|
|
6
6
|
import { getEnvPaths } from "@stryke/env/get-env-paths";
|
|
7
7
|
import { StormJSON } from "@stryke/json/storm-json";
|
|
8
8
|
import { isEqual } from "@stryke/path/is-equal";
|
|
9
9
|
import { replacePath } from "@stryke/path/replace";
|
|
10
|
-
import { isNull } from "@stryke/type-checks/is-null";
|
|
11
10
|
import chalk from "chalk";
|
|
12
11
|
import { formatDistanceToNowStrict } from "date-fns/formatDistanceToNowStrict";
|
|
13
12
|
import defu from "defu";
|
|
@@ -44,7 +43,6 @@ function createResolver(options) {
|
|
|
44
43
|
//#region src/context/base-context.ts
|
|
45
44
|
var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
46
45
|
#timestamp = Date.now();
|
|
47
|
-
#logLevel = "info";
|
|
48
46
|
/**
|
|
49
47
|
* The path to the Powerlines package
|
|
50
48
|
*/
|
|
@@ -69,24 +67,16 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
69
67
|
* A timestamp representing when the context was initialized
|
|
70
68
|
*/
|
|
71
69
|
get timestamp() {
|
|
72
|
-
return
|
|
70
|
+
return this.#timestamp;
|
|
73
71
|
}
|
|
74
72
|
get logLevel() {
|
|
75
|
-
return this
|
|
76
|
-
}
|
|
77
|
-
set logLevel(level) {
|
|
78
|
-
this.#logLevel = level;
|
|
73
|
+
return resolveLogLevel(this.options.logLevel, this.options.mode);
|
|
79
74
|
}
|
|
80
75
|
/**
|
|
81
76
|
* The logger function
|
|
82
77
|
*/
|
|
83
78
|
get log() {
|
|
84
|
-
|
|
85
|
-
if (!this.logger || this.logger.level !== level) this.logger = {
|
|
86
|
-
log: this.createLog(),
|
|
87
|
-
level
|
|
88
|
-
};
|
|
89
|
-
return this.logger.log;
|
|
79
|
+
return this.createLog();
|
|
90
80
|
}
|
|
91
81
|
/**
|
|
92
82
|
* The environment paths for the project
|
|
@@ -117,7 +107,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
117
107
|
* @param message - The message to log.
|
|
118
108
|
*/
|
|
119
109
|
fatal(message) {
|
|
120
|
-
this.log(
|
|
110
|
+
this.log("error", isString(message) ? message : StormJSON.stringify(message));
|
|
121
111
|
}
|
|
122
112
|
/**
|
|
123
113
|
* A logging function for error messages
|
|
@@ -125,7 +115,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
125
115
|
* @param message - The message to log.
|
|
126
116
|
*/
|
|
127
117
|
error(message) {
|
|
128
|
-
this.log(
|
|
118
|
+
this.log("error", isString(message) ? message : StormJSON.stringify(message));
|
|
129
119
|
}
|
|
130
120
|
/**
|
|
131
121
|
* A logging function for warning messages
|
|
@@ -133,7 +123,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
133
123
|
* @param message - The message to log.
|
|
134
124
|
*/
|
|
135
125
|
warn(message) {
|
|
136
|
-
this.log(
|
|
126
|
+
this.log("warn", isString(message) ? message : StormJSON.stringify(message));
|
|
137
127
|
}
|
|
138
128
|
/**
|
|
139
129
|
* A logging function for informational messages
|
|
@@ -141,7 +131,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
141
131
|
* @param message - The message to log.
|
|
142
132
|
*/
|
|
143
133
|
info(message) {
|
|
144
|
-
this.log(
|
|
134
|
+
this.log("info", isString(message) ? message : StormJSON.stringify(message));
|
|
145
135
|
}
|
|
146
136
|
/**
|
|
147
137
|
* A logging function for debug messages
|
|
@@ -149,7 +139,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
149
139
|
* @param message - The message to log.
|
|
150
140
|
*/
|
|
151
141
|
debug(message) {
|
|
152
|
-
this.log(
|
|
142
|
+
this.log("debug", isString(message) ? message : StormJSON.stringify(message));
|
|
153
143
|
}
|
|
154
144
|
/**
|
|
155
145
|
* A logging function for trace messages
|
|
@@ -157,7 +147,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
157
147
|
* @param message - The message to log.
|
|
158
148
|
*/
|
|
159
149
|
trace(message) {
|
|
160
|
-
this.log(
|
|
150
|
+
this.log("trace", isString(message) ? message : StormJSON.stringify(message));
|
|
161
151
|
}
|
|
162
152
|
/**
|
|
163
153
|
* A function to create a timer for measuring the duration of asynchronous operations
|
|
@@ -177,29 +167,32 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
177
167
|
const startDuration = performance.now();
|
|
178
168
|
return () => {
|
|
179
169
|
const duration = performance.now() - startDuration;
|
|
180
|
-
this.log(
|
|
170
|
+
this.log({
|
|
171
|
+
level: "info",
|
|
172
|
+
category: "performance"
|
|
173
|
+
}, `${chalk.bold.cyanBright(name)} completed in ${chalk.bold.cyanBright(duration < 1e3 ? `${duration.toFixed(2)} milliseconds` : formatDistanceToNowStrict(startDate))}`);
|
|
181
174
|
};
|
|
182
175
|
}
|
|
183
176
|
/**
|
|
184
177
|
* Create a new logger instance
|
|
185
178
|
*
|
|
186
|
-
* @param
|
|
179
|
+
* @param config - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
187
180
|
* @returns A logger function
|
|
188
181
|
*/
|
|
189
|
-
createLog(
|
|
190
|
-
return
|
|
182
|
+
createLog(config) {
|
|
183
|
+
return createLogFn({
|
|
191
184
|
...this.options,
|
|
192
|
-
|
|
185
|
+
...config
|
|
193
186
|
});
|
|
194
187
|
}
|
|
195
188
|
/**
|
|
196
189
|
* Extend the current logger instance with a new source
|
|
197
190
|
*
|
|
198
|
-
* @param
|
|
199
|
-
* @returns A logger function
|
|
191
|
+
* @param config - The overlay metadata to use for the badge in the log output, which can be used to customize the appearance and behavior of the log messages generated by the extended logger. This typically includes the name of the plugin or module that is creating the logger instance, and can also include other metadata such as the command or environment.
|
|
192
|
+
* @returns A new logger function that includes the badge in its output.
|
|
200
193
|
*/
|
|
201
|
-
extendLog(
|
|
202
|
-
return
|
|
194
|
+
extendLog(config) {
|
|
195
|
+
return extendLogFn(this.log, config);
|
|
203
196
|
}
|
|
204
197
|
/**
|
|
205
198
|
* A logger function specific to this context
|
|
@@ -214,7 +207,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
214
207
|
* @param options - The configuration options to initialize the context with
|
|
215
208
|
*/
|
|
216
209
|
async init(options = {}) {
|
|
217
|
-
this.inputOptions = options;
|
|
210
|
+
this.inputOptions = { ...options };
|
|
218
211
|
if (!this.powerlinesPath) {
|
|
219
212
|
const powerlinesPath = await resolvePackage("powerlines");
|
|
220
213
|
if (!powerlinesPath) throw new Error("Could not resolve `powerlines` package location.");
|
|
@@ -226,6 +219,7 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
226
219
|
root,
|
|
227
220
|
cwd,
|
|
228
221
|
mode: options.mode,
|
|
222
|
+
logLevel: options.logLevel,
|
|
229
223
|
framework: options.framework,
|
|
230
224
|
organization: options.organization,
|
|
231
225
|
configFile: options.configFile
|
|
@@ -246,4 +240,4 @@ var PowerlinesBaseContext = class PowerlinesBaseContext {
|
|
|
246
240
|
|
|
247
241
|
//#endregion
|
|
248
242
|
export { PowerlinesBaseContext as t };
|
|
249
|
-
//# sourceMappingURL=base-context-
|
|
243
|
+
//# sourceMappingURL=base-context-D_ZidDDm.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-context-D_ZidDDm.mjs","names":["#timestamp"],"sources":["../src/_internal/helpers/resolver.ts","../src/context/base-context.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { ResolvedConfig, Resolver } from \"@powerlines/core\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport defu from \"defu\";\nimport { JitiOptions, createJiti } from \"jiti\";\n\nexport type CreateResolverOptions = Omit<\n JitiOptions,\n \"fsCache\" | \"moduleCache\" | \"interopDefault\"\n> &\n Pick<ResolvedConfig, \"mode\" | \"logLevel\" | \"skipCache\"> & {\n workspaceRoot: string;\n root: string;\n cacheDir: string;\n };\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nfunction resolveOptions(options: CreateResolverOptions): JitiOptions {\n return defu(options, {\n interopDefault: true,\n fsCache:\n options.mode !== \"development\"\n ? joinPaths(options.cacheDir, \"jiti\")\n : false,\n moduleCache: options.mode !== \"development\"\n });\n}\n\n/**\n * Create a Jiti resolver for the given workspace and project root.\n *\n * @param options - The options for creating the resolver.\n * @returns A Jiti instance configured for the specified workspace and project root.\n */\nexport function createResolver(options: CreateResolverOptions): Resolver {\n const baseResolver = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n ) as Resolver;\n baseResolver.plugin = createJiti(\n joinPaths(options.workspaceRoot, options.root),\n resolveOptions(options)\n );\n\n return baseResolver;\n}\n","/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type {\n BaseContext,\n EngineOptions,\n LogFn,\n LogFnConfig,\n LogLevelResolvedConfig,\n ParsedUserConfig,\n PowerlinesMessage,\n ResolvedEngineOptions,\n Resolver\n} from \"@powerlines/core\";\nimport { loadUserConfigFile } from \"@powerlines/core/lib/config\";\nimport { createLogFn, extendLogFn } from \"@powerlines/core/lib/logger\";\nimport { resolveLogLevel } from \"@powerlines/core/plugin-utils\";\nimport { EnvPaths, getEnvPaths } from \"@stryke/env/get-env-paths\";\nimport { resolvePackage } from \"@stryke/fs/resolve\";\nimport { StormJSON } from \"@stryke/json/storm-json\";\nimport { isEqual } from \"@stryke/path/is-equal\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport chalk from \"chalk\";\nimport { formatDistanceToNowStrict } from \"date-fns/formatDistanceToNowStrict\";\nimport defu from \"defu\";\nimport { createResolver } from \"../_internal/helpers/resolver\";\n\nexport class PowerlinesBaseContext implements BaseContext {\n #timestamp: number = Date.now();\n\n /**\n * The path to the Powerlines package\n */\n public powerlinesPath!: string;\n\n /**\n * The module resolver for the project\n */\n public resolver!: Resolver;\n\n /**\n * The options provided to the Powerlines process\n */\n public options!: ResolvedEngineOptions;\n\n /**\n * The input options used to initialize the context, which may be used when cloning the context to ensure the same configuration is applied to the new context\n */\n public inputOptions: Partial<EngineOptions> = {};\n\n /**\n * The parsed configuration file for the project\n */\n public configFile!: ParsedUserConfig;\n\n /**\n * A timestamp representing when the context was initialized\n */\n public get timestamp(): number {\n return this.#timestamp;\n }\n\n public get logLevel(): LogLevelResolvedConfig {\n return resolveLogLevel(this.options.logLevel, this.options.mode);\n }\n\n /**\n * The logger function\n */\n public get log(): LogFn {\n return this.createLog();\n }\n\n /**\n * The environment paths for the project\n */\n public get envPaths(): EnvPaths {\n return getEnvPaths({\n orgId: this.options.organization,\n appId: this.options.framework || \"powerlines\",\n workspaceRoot: this.options.cwd\n });\n }\n\n /**\n * Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.\n *\n * @remarks\n * The cloned context will have the same configuration and workspace settings as the original context, but will have a different build ID, release ID, and timestamp. The virtual file system and caches will also be separate between the original and cloned contexts.\n *\n * @returns A promise that resolves to the cloned context.\n */\n public async clone(): Promise<BaseContext> {\n const clone = new PowerlinesBaseContext();\n await clone.init(this.options);\n\n return clone;\n }\n\n /**\n * A logging function for fatal messages\n *\n * @param message - The message to log.\n */\n public fatal(message: string | PowerlinesMessage) {\n this.log(\n \"error\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for error messages\n *\n * @param message - The message to log.\n */\n public error(message: string | PowerlinesMessage) {\n this.log(\n \"error\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for warning messages\n *\n * @param message - The message to log.\n */\n public warn(message: string | PowerlinesMessage) {\n this.log(\n \"warn\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for informational messages\n *\n * @param message - The message to log.\n */\n public info(message: string | PowerlinesMessage) {\n this.log(\n \"info\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for debug messages\n *\n * @param message - The message to log.\n */\n public debug(message: string | PowerlinesMessage) {\n this.log(\n \"debug\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A logging function for trace messages\n *\n * @param message - The message to log.\n */\n public trace(message: string | PowerlinesMessage) {\n this.log(\n \"trace\",\n isString(message) ? message : StormJSON.stringify(message)\n );\n }\n\n /**\n * A function to create a timer for measuring the duration of asynchronous operations\n *\n * @example\n * ```ts\n * const stopTimer = context.timer(\"Your Async Operation\");\n * await performAsyncOperation();\n * stopTimer(); // \"Your Async Operation completed in 123.45 milliseconds\"\n * ```\n *\n * @param name - The name of the timer.\n * @returns A function that, when called, stops the timer and logs the duration.\n */\n public timer(name: string): () => void {\n const startDate = Date.now();\n const startDuration = performance.now();\n\n return () => {\n const duration = performance.now() - startDuration;\n this.log(\n { level: \"info\", category: \"performance\" },\n `${chalk.bold.cyanBright(name)} completed in ${chalk.bold.cyanBright(\n duration < 1000\n ? `${duration.toFixed(2)} milliseconds`\n : formatDistanceToNowStrict(startDate)\n )}`\n );\n };\n }\n\n /**\n * Create a new logger instance\n *\n * @param config - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.\n * @returns A logger function\n */\n public createLog(config?: LogFnConfig): LogFn {\n return createLogFn({ ...this.options, ...config });\n }\n\n /**\n * Extend the current logger instance with a new source\n *\n * @param config - The overlay metadata to use for the badge in the log output, which can be used to customize the appearance and behavior of the log messages generated by the extended logger. This typically includes the name of the plugin or module that is creating the logger instance, and can also include other metadata such as the command or environment.\n * @returns A new logger function that includes the badge in its output.\n */\n public extendLog(config: LogFnConfig): LogFn {\n return extendLogFn(this.log, config);\n }\n\n /**\n * A logger function specific to this context\n */\n protected logger!: Logger;\n\n /**\n * Initialize the context with the provided configuration options\n *\n * @remarks\n * This method will set up the resolver and load the user configuration file based on the provided options. It is called during the construction of the context and can also be called when cloning the context to ensure that the new context has the same configuration and resolver setup.\n *\n * @param options - The configuration options to initialize the context with\n */\n protected async init(options: Partial<EngineOptions> = {}) {\n this.inputOptions = { ...options };\n\n if (!this.powerlinesPath) {\n const powerlinesPath = await resolvePackage(\"powerlines\");\n if (!powerlinesPath) {\n throw new Error(\"Could not resolve `powerlines` package location.\");\n }\n this.powerlinesPath = powerlinesPath;\n }\n\n const cwd = options.cwd || this.options?.cwd || process.cwd();\n const root = replacePath(\n (options.root || this.options?.root) &&\n (options.root || this.options.root).replace(/^\\.\\/?/, \"\") &&\n !isEqual(options.root || this.options.root, cwd)\n ? options.root || this.options.root\n : \".\",\n cwd\n );\n\n this.options = defu(\n {\n root,\n cwd,\n mode: options.mode,\n logLevel: options.logLevel,\n framework: options.framework,\n organization: options.organization,\n configFile: options.configFile\n },\n this.options ?? {},\n {\n mode: \"production\",\n framework: \"powerlines\"\n }\n ) as ResolvedEngineOptions;\n\n this.resolver = createResolver({\n workspaceRoot: cwd,\n root,\n cacheDir: this.envPaths.cache,\n mode: this.options.mode,\n logLevel: this.logLevel\n });\n\n this.configFile = await loadUserConfigFile(this.options, this.resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAS,eAAe,SAA6C;AACnE,QAAO,KAAK,SAAS;EACnB,gBAAgB;EAChB,SACE,QAAQ,SAAS,gBACb,UAAU,QAAQ,UAAU,OAAO,GACnC;EACN,aAAa,QAAQ,SAAS;EAC/B,CAAC;;;;;;;;AASJ,SAAgB,eAAe,SAA0C;CACvE,MAAM,eAAe,WACnB,UAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AACD,cAAa,SAAS,WACpB,UAAU,QAAQ,eAAe,QAAQ,KAAK,EAC9C,eAAe,QAAQ,CACxB;AAED,QAAO;;;;;ACvBT,IAAa,wBAAb,MAAa,sBAA6C;CACxD,aAAqB,KAAK,KAAK;;;;CAK/B,AAAO;;;;CAKP,AAAO;;;;CAKP,AAAO;;;;CAKP,AAAO,eAAuC,EAAE;;;;CAKhD,AAAO;;;;CAKP,IAAW,YAAoB;AAC7B,SAAO,MAAKA;;CAGd,IAAW,WAAmC;AAC5C,SAAO,gBAAgB,KAAK,QAAQ,UAAU,KAAK,QAAQ,KAAK;;;;;CAMlE,IAAW,MAAa;AACtB,SAAO,KAAK,WAAW;;;;;CAMzB,IAAW,WAAqB;AAC9B,SAAO,YAAY;GACjB,OAAO,KAAK,QAAQ;GACpB,OAAO,KAAK,QAAQ,aAAa;GACjC,eAAe,KAAK,QAAQ;GAC7B,CAAC;;;;;;;;;;CAWJ,MAAa,QAA8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K,OAAO;;;;;CAMtC,AAAU;;;;;;;;;CAUV,MAAgB,KAAK,UAAkC,EAAE,EAAE;AACzD,OAAK,eAAe,EAAE,GAAG,SAAS;AAElC,MAAI,CAAC,KAAK,gBAAgB;GACxB,MAAM,iBAAiB,MAAM,eAAe,aAAa;AACzD,OAAI,CAAC,eACH,OAAM,IAAI,MAAM,mDAAmD;AAErE,QAAK,iBAAiB;;EAGxB,MAAM,MAAM,QAAQ,OAAO,KAAK,SAAS,OAAO,QAAQ,KAAK;EAC7D,MAAM,OAAO,aACV,QAAQ,QAAQ,KAAK,SAAS,UAC5B,QAAQ,QAAQ,KAAK,QAAQ,MAAM,QAAQ,UAAU,GAAG,IACzD,CAAC,QAAQ,QAAQ,QAAQ,KAAK,QAAQ,MAAM,IAAI,GAC9C,QAAQ,QAAQ,KAAK,QAAQ,OAC7B,KACJ,IACD;AAED,OAAK,UAAU,KACb;GACE;GACA;GACA,MAAM,QAAQ;GACd,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACnB,cAAc,QAAQ;GACtB,YAAY,QAAQ;GACrB,EACD,KAAK,WAAW,EAAE,EAClB;GACE,MAAM;GACN,WAAW;GACZ,CACF;AAED,OAAK,WAAW,eAAe;GAC7B,eAAe;GACf;GACA,UAAU,KAAK,SAAS;GACxB,MAAM,KAAK,QAAQ;GACnB,UAAU,KAAK;GAChB,CAAC;AAEF,OAAK,aAAa,MAAM,mBAAmB,KAAK,SAAS,KAAK,SAAS"}
|
package/dist/context/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_base_context = require('../base-context-
|
|
3
|
-
const require_engine_context = require('../engine-context-
|
|
4
|
-
const require_execution_context = require('../execution-context-
|
|
2
|
+
const require_base_context = require('../base-context-5_AZZYFu.cjs');
|
|
3
|
+
const require_engine_context = require('../engine-context-w4fts28j.cjs');
|
|
4
|
+
const require_execution_context = require('../execution-context-0GmpbWbs.cjs');
|
|
5
5
|
|
|
6
6
|
exports.PowerlinesBaseContext = require_base_context.PowerlinesBaseContext;
|
|
7
7
|
exports.PowerlinesContext = require_execution_context.PowerlinesContext;
|
package/dist/context/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, ExecutionState, FetchOptions, HooksList, InlineConfig, LogFn,
|
|
1
|
+
import { BaseContext, Context, EmitEntryOptions, EmitOptions, EngineContext, EngineOptions, EnvironmentContext, EnvironmentContextPlugin, EnvironmentResolvedConfig, ExecutionContext, ExecutionOptions, ExecutionState, FetchOptions, HooksList, InlineConfig, LogFn, LogFnConfig, LogLevelResolvedConfig, MetaInfo, ParseOptions, ParsedTypeScriptConfig, ParsedUserConfig, Plugin, PluginContext, PowerlinesMessage, ResolveOptions, ResolveResult, ResolvedConfig, ResolvedEngineOptions, ResolvedEntryTypeDefinition, ResolvedExecutionOptions, Resolver, SelectHookResult, SelectHooksOptions, TransformResult, VirtualFile, VirtualFileSystemInterface } from "@powerlines/core";
|
|
2
2
|
import { EnvPaths } from "@stryke/env/get-env-paths";
|
|
3
|
-
import { UnpluginMessage } from "unplugin";
|
|
4
3
|
import { Unstable_ContextInternal, Unstable_EnvironmentContext, Unstable_PluginContext } from "@powerlines/core/types/_internal";
|
|
5
4
|
import { PackageJson } from "@stryke/types/package-json";
|
|
6
5
|
import { FlatCache } from "flat-cache";
|
|
@@ -34,9 +33,8 @@ declare class PowerlinesBaseContext implements BaseContext {
|
|
|
34
33
|
/**
|
|
35
34
|
* A timestamp representing when the context was initialized
|
|
36
35
|
*/
|
|
37
|
-
get timestamp():
|
|
38
|
-
get logLevel():
|
|
39
|
-
set logLevel(level: LogLevel | null);
|
|
36
|
+
get timestamp(): number;
|
|
37
|
+
get logLevel(): LogLevelResolvedConfig;
|
|
40
38
|
/**
|
|
41
39
|
* The logger function
|
|
42
40
|
*/
|
|
@@ -59,37 +57,37 @@ declare class PowerlinesBaseContext implements BaseContext {
|
|
|
59
57
|
*
|
|
60
58
|
* @param message - The message to log.
|
|
61
59
|
*/
|
|
62
|
-
fatal(message: string |
|
|
60
|
+
fatal(message: string | PowerlinesMessage): void;
|
|
63
61
|
/**
|
|
64
62
|
* A logging function for error messages
|
|
65
63
|
*
|
|
66
64
|
* @param message - The message to log.
|
|
67
65
|
*/
|
|
68
|
-
error(message: string |
|
|
66
|
+
error(message: string | PowerlinesMessage): void;
|
|
69
67
|
/**
|
|
70
68
|
* A logging function for warning messages
|
|
71
69
|
*
|
|
72
70
|
* @param message - The message to log.
|
|
73
71
|
*/
|
|
74
|
-
warn(message: string |
|
|
72
|
+
warn(message: string | PowerlinesMessage): void;
|
|
75
73
|
/**
|
|
76
74
|
* A logging function for informational messages
|
|
77
75
|
*
|
|
78
76
|
* @param message - The message to log.
|
|
79
77
|
*/
|
|
80
|
-
info(message: string |
|
|
78
|
+
info(message: string | PowerlinesMessage): void;
|
|
81
79
|
/**
|
|
82
80
|
* A logging function for debug messages
|
|
83
81
|
*
|
|
84
82
|
* @param message - The message to log.
|
|
85
83
|
*/
|
|
86
|
-
debug(message: string |
|
|
84
|
+
debug(message: string | PowerlinesMessage): void;
|
|
87
85
|
/**
|
|
88
86
|
* A logging function for trace messages
|
|
89
87
|
*
|
|
90
88
|
* @param message - The message to log.
|
|
91
89
|
*/
|
|
92
|
-
trace(message: string |
|
|
90
|
+
trace(message: string | PowerlinesMessage): void;
|
|
93
91
|
/**
|
|
94
92
|
* A function to create a timer for measuring the duration of asynchronous operations
|
|
95
93
|
*
|
|
@@ -107,17 +105,17 @@ declare class PowerlinesBaseContext implements BaseContext {
|
|
|
107
105
|
/**
|
|
108
106
|
* Create a new logger instance
|
|
109
107
|
*
|
|
110
|
-
* @param
|
|
108
|
+
* @param config - The configuration options to use for the logger instance, which can be used to customize the appearance and behavior of the log messages generated by the logger. This is typically the name of the plugin or module that is creating the logger instance.
|
|
111
109
|
* @returns A logger function
|
|
112
110
|
*/
|
|
113
|
-
createLog(
|
|
111
|
+
createLog(config?: LogFnConfig): LogFn;
|
|
114
112
|
/**
|
|
115
113
|
* Extend the current logger instance with a new source
|
|
116
114
|
*
|
|
117
|
-
* @param
|
|
118
|
-
* @returns A logger function
|
|
115
|
+
* @param config - The overlay metadata to use for the badge in the log output, which can be used to customize the appearance and behavior of the log messages generated by the extended logger. This typically includes the name of the plugin or module that is creating the logger instance, and can also include other metadata such as the command or environment.
|
|
116
|
+
* @returns A new logger function that includes the badge in its output.
|
|
119
117
|
*/
|
|
120
|
-
extendLog(
|
|
118
|
+
extendLog(config: LogFnConfig): LogFn;
|
|
121
119
|
/**
|
|
122
120
|
* A logger function specific to this context
|
|
123
121
|
*/
|
|
@@ -282,6 +280,20 @@ declare class PowerlinesContext<TResolvedConfig extends ResolvedConfig = Resolve
|
|
|
282
280
|
* @param options - The options to use for creating the context, including the resolved configuration and workspace settings.
|
|
283
281
|
*/
|
|
284
282
|
protected constructor(options: ResolvedExecutionOptions);
|
|
283
|
+
/**
|
|
284
|
+
* Create a new log function with the specified configuration, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
285
|
+
*
|
|
286
|
+
* @param config - Optional configuration for the log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
287
|
+
* @returns A log function that can be used to log messages with the specified configuration.
|
|
288
|
+
*/
|
|
289
|
+
createLog(config?: LogFnConfig): LogFn;
|
|
290
|
+
/**
|
|
291
|
+
* Extend the current log function instance with a new name
|
|
292
|
+
*
|
|
293
|
+
* @param config - The configuration for the extended log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the log function instance according to your needs.
|
|
294
|
+
* @returns A log function
|
|
295
|
+
*/
|
|
296
|
+
extendLog(config: LogFnConfig): LogFn;
|
|
285
297
|
/**
|
|
286
298
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
287
299
|
*
|
|
@@ -514,20 +526,19 @@ declare class PowerlinesEnvironmentContext<TResolvedConfig extends ResolvedConfi
|
|
|
514
526
|
*/
|
|
515
527
|
get hooks(): Record<string, HooksList<PluginContext<TResolvedConfig>>>;
|
|
516
528
|
/**
|
|
517
|
-
* Create a new logger instance
|
|
529
|
+
* Create a new log function with the specified configuration, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
518
530
|
*
|
|
519
|
-
* @param
|
|
520
|
-
* @returns A
|
|
531
|
+
* @param config - Optional configuration for the log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
532
|
+
* @returns A log function that can be used to log messages with the specified configuration.
|
|
521
533
|
*/
|
|
522
|
-
createLog(
|
|
534
|
+
createLog(config?: LogFnConfig): LogFn;
|
|
523
535
|
/**
|
|
524
|
-
* Extend the current
|
|
536
|
+
* Extend the current log function instance with a new name
|
|
525
537
|
*
|
|
526
|
-
* @param
|
|
527
|
-
* @
|
|
528
|
-
* @returns A logger function
|
|
538
|
+
* @param config - The configuration for the extended log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the log function instance according to your needs.
|
|
539
|
+
* @returns A log function
|
|
529
540
|
*/
|
|
530
|
-
extendLog(
|
|
541
|
+
extendLog(config: LogFnConfig): LogFn;
|
|
531
542
|
/**
|
|
532
543
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
533
544
|
*
|
|
@@ -609,12 +620,19 @@ declare class PowerlinesExecutionContext<TResolvedConfig extends ResolvedConfig
|
|
|
609
620
|
*/
|
|
610
621
|
protected constructor(options: ResolvedExecutionOptions);
|
|
611
622
|
/**
|
|
612
|
-
* Create a new logger instance
|
|
623
|
+
* Create a new log function with the specified configuration, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
613
624
|
*
|
|
614
|
-
* @param
|
|
615
|
-
* @returns A
|
|
625
|
+
* @param config - Optional configuration for the log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the logger instance according to your needs.
|
|
626
|
+
* @returns A log function that can be used to log messages with the specified configuration.
|
|
627
|
+
*/
|
|
628
|
+
createLog(config?: LogFnConfig): LogFn;
|
|
629
|
+
/**
|
|
630
|
+
* Extend the current log function instance with a new name
|
|
631
|
+
*
|
|
632
|
+
* @param config - The configuration for the extended log function instance, which can include properties such as log level, colors, and other metadata to be included with each log message. This allows you to customize the behavior and appearance of the log function instance according to your needs.
|
|
633
|
+
* @returns A log function
|
|
616
634
|
*/
|
|
617
|
-
|
|
635
|
+
extendLog(config: LogFnConfig): LogFn;
|
|
618
636
|
/**
|
|
619
637
|
* Creates a clone of the current context with the same configuration and workspace settings. This can be useful for running multiple builds in parallel or for creating isolated contexts for different parts of the build process.
|
|
620
638
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/engine-context.ts","../../src/context/environment-context.ts","../../src/context/execution-context.ts","../../src/context/plugin-context.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/context/base-context.ts","../../src/context/context.ts","../../src/context/engine-context.ts","../../src/context/environment-context.ts","../../src/context/execution-context.ts","../../src/context/plugin-context.ts"],"mappings":";;;;;;;;;;cA2Ca,qBAAA,YAAiC,WAAA;EAAA;;;;EAMrC,cAAA;;;AANT;EAWS,QAAA,EAAW,QAAA;;;;EAKX,OAAA,EAAU,qBAAA;EAKI;;;EAAd,YAAA,EAAc,OAAA,CAAQ,aAAA;EA4B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