@code-pushup/nx-plugin 0.96.0 → 0.96.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-pushup/nx-plugin",
3
- "version": "0.96.0",
3
+ "version": "0.96.1",
4
4
  "license": "MIT",
5
5
  "description": "Nx plugin to integrate the Code PushUp CLI into your workspace 🛠️",
6
6
  "publishConfig": {
@@ -32,8 +32,8 @@
32
32
  "generators": "./generators.json",
33
33
  "executors": "./executors.json",
34
34
  "dependencies": {
35
- "@code-pushup/models": "0.96.0",
36
- "@code-pushup/utils": "0.96.0",
35
+ "@code-pushup/models": "0.96.1",
36
+ "@code-pushup/utils": "0.96.1",
37
37
  "@nx/devkit": ">=17.0.0",
38
38
  "nx": ">=17.0.0"
39
39
  },
@@ -1,8 +1,8 @@
1
1
  import type { ExecutorContext } from '@nx/devkit';
2
- import type { AutorunCommandExecutorOptions } from './schema.js';
2
+ import type { CliCommandExecutorOptions } from './schema.js';
3
3
  export type ExecutorOutput = {
4
4
  success: boolean;
5
5
  command?: string;
6
6
  error?: Error;
7
7
  };
8
- export default function runAutorunExecutor(terminalAndExecutorOptions: AutorunCommandExecutorOptions, context: ExecutorContext): Promise<ExecutorOutput>;
8
+ export default function runCliExecutor(terminalAndExecutorOptions: CliCommandExecutorOptions, context: ExecutorContext): Promise<ExecutorOutput>;
@@ -1,40 +1,50 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = runAutorunExecutor;
3
+ exports.default = runCliExecutor;
4
4
  const execute_process_js_1 = require("../../internal/execute-process.js");
5
5
  const context_js_1 = require("../internal/context.js");
6
6
  const utils_js_1 = require("./utils.js");
7
7
  /* eslint-disable-next-line max-lines-per-function */
8
- async function runAutorunExecutor(terminalAndExecutorOptions, context) {
8
+ async function runCliExecutor(terminalAndExecutorOptions, context) {
9
9
  const { objectToCliArgs, formatCommandStatus, logger, stringifyError } = await Promise.resolve().then(() => require('@code-pushup/utils'));
10
10
  const normalizedContext = (0, context_js_1.normalizeContext)(context);
11
- const cliArgumentObject = (0, utils_js_1.parseAutorunExecutorOptions)(terminalAndExecutorOptions, normalizedContext);
12
- const { command: cliCommand } = terminalAndExecutorOptions;
13
- const { verbose = false, dryRun, bin, ...restArgs } = cliArgumentObject;
11
+ const { command: cliCommand, verbose = false, dryRun, env: executorEnv, bin, ...restArgs } = (0, utils_js_1.parseCliExecutorOptions)(terminalAndExecutorOptions, normalizedContext);
12
+ // this sets `CP_VERBOSE=true` on process.env
14
13
  logger.setVerbose(verbose);
15
14
  const command = bin ? `node` : 'npx';
16
- const positionals = [
15
+ const args = [
17
16
  bin ?? '@code-pushup/cli',
18
17
  ...(cliCommand ? [cliCommand] : []),
18
+ ...objectToCliArgs(restArgs),
19
19
  ];
20
- const args = [...positionals, ...objectToCliArgs(restArgs)];
21
- const executorEnvVariables = {
20
+ const loggedEnvVars = {
21
+ ...executorEnv,
22
22
  ...(verbose && { CP_VERBOSE: 'true' }),
23
23
  };
24
24
  const commandString = formatCommandStatus([command, ...args].join(' '), {
25
25
  cwd: context.cwd,
26
- env: executorEnvVariables,
26
+ env: loggedEnvVars,
27
27
  });
28
28
  if (dryRun) {
29
29
  logger.warn(`DryRun execution of: ${commandString}`);
30
30
  }
31
31
  else {
32
32
  try {
33
- logger.debug(`With env vars: ${executorEnvVariables}`);
33
+ logger.debug(`Run CLI with env vars: ${loggedEnvVars}`);
34
34
  await (0, execute_process_js_1.executeProcess)({
35
35
  command,
36
36
  args,
37
37
  ...(context.cwd ? { cwd: context.cwd } : {}),
38
+ ...(executorEnv && Object.keys(executorEnv).length > 0
39
+ ? {
40
+ env: {
41
+ // if env is undefined, executeProcess extends process.env by default
42
+ ...process.env,
43
+ // we don't pass `CP_VERBOSE=true` as it is handled inside logger.setVerbose
44
+ ...executorEnv,
45
+ },
46
+ }
47
+ : {}),
38
48
  });
39
49
  }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,CAAC,CAAC,EAAE,CAAC;gBAC5C,GAAG,CAAC,WAAW,IAAI,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,GAAG,CAAC;oBACpD,CAAC,CAAC;wBACE,GAAG,EAAE;4BACH,qEAAqE;4BACrE,GAAG,OAAO,CAAC,GAAG;4BACd,4EAA4E;4BAC5E,GAAG,WAAW;yBACf;qBACF;oBACH,CAAC,CAAC,EAAE,CAAC;aACR,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;YACpC,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,aAAa;gBACtB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,KAAK,EAAE,CAAC;aAC9D,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO;QACL,OAAO,EAAE,IAAI;QACb,OAAO,EAAE,aAAa;KACvB,CAAC;AACJ,CAAC"}
@@ -4,8 +4,8 @@ export type PrintConfigOptions = {
4
4
  output?: string;
5
5
  };
6
6
  export type PrintConfigCommandExecutorOptions = PrintConfigOptions;
7
- export type AutorunCommandExecutorOnlyOptions = ProjectExecutorOnlyOptions & CollectExecutorOnlyOptions & GeneralExecutorOnlyOptions;
8
- export type AutorunCommandExecutorOptions = Partial<{
7
+ export type CliCommandExecutorOnlyOptions = ProjectExecutorOnlyOptions & CollectExecutorOnlyOptions & GeneralExecutorOnlyOptions;
8
+ export type CliCommandExecutorOptions = Partial<{
9
9
  upload: Partial<UploadConfig>;
10
10
  persist: Partial<PersistConfig>;
11
- } & AutorunCommandExecutorOnlyOptions & GlobalExecutorOptions> & PrintConfigOptions;
11
+ } & CliCommandExecutorOnlyOptions & GlobalExecutorOptions> & PrintConfigOptions;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/schema",
3
- "$id": "AutorunExecutorOptions",
3
+ "$id": "CliExecutorOptions",
4
4
  "title": "CodePushup CLI autorun executor",
5
5
  "description": "Executes the @code-pushup/cli autorun command See: https://github.com/code-pushup/cli/blob/main/packages/cli/README.md#autorun-command",
6
6
  "type": "object",
@@ -21,6 +21,13 @@
21
21
  "type": "string",
22
22
  "description": "Path to Code PushUp CLI"
23
23
  },
24
+ "env": {
25
+ "type": "object",
26
+ "additionalProperties": {
27
+ "type": "string"
28
+ },
29
+ "description": "Environment variables added to Code PushUp CLI process"
30
+ },
24
31
  "verbose": {
25
32
  "type": "boolean",
26
33
  "description": "Print additional logs"
@@ -1,5 +1,5 @@
1
1
  import type { NormalizedExecutorContext } from '../internal/context.js';
2
- import type { AutorunCommandExecutorOnlyOptions, AutorunCommandExecutorOptions, PrintConfigCommandExecutorOptions } from './schema.js';
3
- export declare function parseAutorunExecutorOnlyOptions(options: Partial<AutorunCommandExecutorOnlyOptions>): AutorunCommandExecutorOnlyOptions;
2
+ import type { CliCommandExecutorOnlyOptions, CliCommandExecutorOptions, PrintConfigCommandExecutorOptions } from './schema.js';
3
+ export declare function parseCliExecutorOnlyOptions(options: Partial<CliCommandExecutorOnlyOptions>): CliCommandExecutorOnlyOptions;
4
4
  export declare function parsePrintConfigExecutorOptions(options: Partial<PrintConfigCommandExecutorOptions>): PrintConfigCommandExecutorOptions;
5
- export declare function parseAutorunExecutorOptions(options: Partial<AutorunCommandExecutorOptions>, normalizedContext: NormalizedExecutorContext): AutorunCommandExecutorOptions;
5
+ export declare function parseCliExecutorOptions(options: Partial<CliCommandExecutorOptions>, normalizedContext: NormalizedExecutorContext): CliCommandExecutorOptions;
@@ -1,15 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseAutorunExecutorOnlyOptions = parseAutorunExecutorOnlyOptions;
3
+ exports.parseCliExecutorOnlyOptions = parseCliExecutorOnlyOptions;
4
4
  exports.parsePrintConfigExecutorOptions = parsePrintConfigExecutorOptions;
5
- exports.parseAutorunExecutorOptions = parseAutorunExecutorOptions;
5
+ exports.parseCliExecutorOptions = parseCliExecutorOptions;
6
6
  const config_js_1 = require("../internal/config.js");
7
- function parseAutorunExecutorOnlyOptions(options) {
8
- const { projectPrefix, dryRun, onlyPlugins } = options;
7
+ function parseCliExecutorOnlyOptions(options) {
8
+ const { projectPrefix, dryRun, onlyPlugins, env, bin } = options;
9
9
  return {
10
10
  ...(projectPrefix && { projectPrefix }),
11
11
  ...(dryRun != null && { dryRun }),
12
12
  ...(onlyPlugins && { onlyPlugins }),
13
+ ...(env && { env }),
14
+ ...(bin && { bin }),
13
15
  };
14
16
  }
15
17
  function parsePrintConfigExecutorOptions(options) {
@@ -18,14 +20,14 @@ function parsePrintConfigExecutorOptions(options) {
18
20
  ...(output && { output }),
19
21
  };
20
22
  }
21
- function parseAutorunExecutorOptions(options, normalizedContext) {
23
+ function parseCliExecutorOptions(options, normalizedContext) {
22
24
  const { projectPrefix, persist, upload, command, output } = options;
23
25
  const needsUploadParams = command === 'upload' || command === 'autorun' || command === undefined;
24
26
  const uploadCfg = (0, config_js_1.uploadConfig)({ projectPrefix, ...upload }, normalizedContext);
25
27
  const hasApiToken = uploadCfg?.apiKey != null;
26
28
  return {
27
29
  ...parsePrintConfigExecutorOptions(options),
28
- ...parseAutorunExecutorOnlyOptions(options),
30
+ ...parseCliExecutorOnlyOptions(options),
29
31
  ...(0, config_js_1.globalConfig)(options, normalizedContext),
30
32
  ...(output ? { output } : {}),
31
33
  persist: (0, config_js_1.persistConfig)({ projectPrefix, ...persist }, normalizedContext),
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/executors/cli/utils.ts"],"names":[],"mappings":";;AAYA,0EASC;AAED,0EAOC;AAED,kEAuBC;AAvDD,qDAI+B;AAQ/B,SAAgB,+BAA+B,CAC7C,OAAmD;IAEnD,MAAM,EAAE,aAAa,EAAE,MAAM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B,CAAC;IACF,MAAM,WAAW,GAAG,SAAS,EAAE,MAAM,IAAI,IAAI,CAAC;IAC9C,OAAO;QACL,GAAG,+BAA+B,CAAC,OAAO,CAAC;QAC3C,GAAG,2BAA2B,CAAC,OAAO,CAAC;QACvC,GAAG,IAAA,wBAAY,EAAC,OAAO,EAAE,iBAAiB,CAAC;QAC3C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,IAAA,yBAAa,EAAC,EAAE,aAAa,EAAE,GAAG,OAAO,EAAE,EAAE,iBAAiB,CAAC;QACxE,mGAAmG;QACnG,qDAAqD;QACrD,6CAA6C;QAC7C,GAAG,CAAC,iBAAiB,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnE,CAAC;AACJ,CAAC"}
@@ -8,8 +8,9 @@ const env_js_1 = require("./env.js");
8
8
  function globalConfig(options, context) {
9
9
  const { projectConfig } = context;
10
10
  const { root: projectRoot = '' } = projectConfig ?? {};
11
- const { verbose, config } = options;
11
+ const { verbose, config, command } = options;
12
12
  return {
13
+ command,
13
14
  verbose: !!verbose,
14
15
  config: config ?? path.join(projectRoot, 'code-pushup.config.ts'),
15
16
  };
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/executors/internal/config.ts"],"names":[],"mappings":";;AAUA,oCAWC;AAED,sCAkBC;AAED,oCA8BC;AAzED,kCAAkC;AAGlC,qCAAoC;AAOpC,SAAgB,YAAY,CAC1B,OAAiE,EACjE,OAAsC;IAEtC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAClC,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,aAAa,IAAI,EAAE,CAAC;IACvD,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC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AE,CAAC,CAAC,KAAK,SAAS,CAAC,CACvC;KACF,CAAC;AACJ,CAAC"}
@@ -4,6 +4,8 @@ import type { ProjectConfiguration } from 'nx/src/config/workspace-json-project-
4
4
  */
5
5
  export type GeneralExecutorOnlyOptions = {
6
6
  dryRun?: boolean;
7
+ env?: Record<string, string>;
8
+ bin?: string;
7
9
  };
8
10
  /**
9
11
  * executor types that apply for a subset of exector's.
@@ -19,7 +21,6 @@ export type ProjectExecutorOnlyOptions = {
19
21
  export type Command = 'collect' | 'upload' | 'autorun' | 'print-config' | 'compare' | 'merge-diffs' | 'history';
20
22
  export type GlobalExecutorOptions = {
21
23
  command?: Command;
22
- bin?: string;
23
24
  verbose?: boolean;
24
25
  config?: string;
25
26
  };
@@ -2,7 +2,6 @@ import type { DynamicTargetOptions } from '../../internal/types.js';
2
2
 
3
3
  export type ConfigurationGeneratorOptions = {
4
4
  project: string;
5
- bin?: string;
6
5
  skipTarget?: boolean;
7
6
  skipConfig?: boolean;
8
7
  skipFormat?: boolean;
package/src/index.d.ts CHANGED
@@ -4,7 +4,7 @@ declare const plugin: {
4
4
  createNodes: import("@nx/devkit").CreateNodes;
5
5
  };
6
6
  export default plugin;
7
- export type { AutorunCommandExecutorOptions } from './executors/cli/schema.js';
7
+ export type { CliCommandExecutorOptions } from './executors/cli/schema.js';
8
8
  export { generateCodePushupConfig } from './generators/configuration/code-pushup-config.js';
9
9
  export { configurationGenerator } from './generators/configuration/generator.js';
10
10
  export type { ConfigurationGeneratorOptions } from './generators/configuration/schema.js';
@@ -1,4 +1,5 @@
1
1
  export type DynamicTargetOptions = {
2
2
  targetName?: string;
3
3
  bin?: string;
4
+ env?: Record<string, string>;
4
5
  };
@@ -3,4 +3,7 @@ import type { ProjectPrefixOptions } from '../types.js';
3
3
  export declare function createExecutorTarget(options?: {
4
4
  bin?: string;
5
5
  projectPrefix?: string;
6
- }): TargetConfiguration<ProjectPrefixOptions>;
6
+ env?: Record<string, string>;
7
+ }): TargetConfiguration<ProjectPrefixOptions & {
8
+ env?: Record<string, string>;
9
+ }>;
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createExecutorTarget = createExecutorTarget;
4
4
  const constants_js_1 = require("../../internal/constants.js");
5
5
  function createExecutorTarget(options) {
6
- const { bin, projectPrefix } = options ?? {};
6
+ const { bin, projectPrefix, env } = options ?? {};
7
7
  const executor = `${constants_js_1.PACKAGE_NAME}:cli`;
8
- const executorOptions = (bin || projectPrefix) && {
8
+ const executorOptions = (bin || projectPrefix || env) && {
9
9
  ...(bin && { bin }),
10
10
  ...(projectPrefix && { projectPrefix }),
11
+ ...(env && { env }),
11
12
  };
12
13
  return { executor, ...(executorOptions && { options: executorOptions }) };
13
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../src/plugin/target/executor-target.ts"],"names":[],"mappings":";;AAIA,oDAYC;AAfD,8DAA2D;AAG3D,SAAgB,oBAAoB,CAAC,OAGpC;IACC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE7C,MAAM,QAAQ,GAAG,GAAG,2BAAY,MAAM,CAAC;IACvC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI;QAChD,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;KACxC,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAC5E,CAAC"}
1
+ {"version":3,"file":"executor-target.js","sourceRoot":"","sources":["../../../../src/plugin/target/executor-target.ts"],"names":[],"mappings":";;AAIA,oDAgBC;AAnBD,8DAA2D;AAG3D,SAAgB,oBAAoB,CAAC,OAIpC;IAGC,MAAM,EAAE,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAElD,MAAM,QAAQ,GAAG,GAAG,2BAAY,MAAM,CAAC;IACvC,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,aAAa,IAAI,GAAG,CAAC,IAAI;QACvD,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;QACnB,GAAG,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,CAAC;QACvC,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC;KACpB,CAAC;IACF,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,CAAC;AAC5E,CAAC"}
@@ -5,7 +5,9 @@ export type CreateTargetsOptions = {
5
5
  createOptions: CreateNodesOptions;
6
6
  };
7
7
  export declare function createTargets(normalizedContext: CreateTargetsOptions): Promise<{
8
- [x: string]: import("@nx/devkit").TargetConfiguration<import("../types.js").ProjectPrefixOptions>;
8
+ [x: string]: import("@nx/devkit").TargetConfiguration<import("../types.js").ProjectPrefixOptions & {
9
+ env?: Record<string, string>;
10
+ }>;
9
11
  } | {
10
12
  [x: string]: import("@nx/devkit").TargetConfiguration<import("nx/src/executors/run-commands/run-commands.impl.js").RunCommandsOptions>;
11
13
  }>;
@@ -7,11 +7,11 @@ const configuration_target_js_1 = require("./configuration-target.js");
7
7
  const constants_js_2 = require("./constants.js");
8
8
  const executor_target_js_1 = require("./executor-target.js");
9
9
  async function createTargets(normalizedContext) {
10
- const { targetName = constants_js_1.CP_TARGET_NAME, bin, projectPrefix, } = normalizedContext.createOptions;
10
+ const { targetName = constants_js_1.CP_TARGET_NAME, bin, projectPrefix, env, } = normalizedContext.createOptions;
11
11
  const rootFiles = await (0, promises_1.readdir)(normalizedContext.projectRoot);
12
12
  return rootFiles.some(filename => filename.match(constants_js_2.CODE_PUSHUP_CONFIG_REGEX))
13
13
  ? {
14
- [targetName]: (0, executor_target_js_1.createExecutorTarget)({ bin, projectPrefix }),
14
+ [targetName]: (0, executor_target_js_1.createExecutorTarget)({ bin, projectPrefix, env }),
15
15
  }
16
16
  : // if NO code-pushup.config.*.(ts|js|mjs) is present return configuration target
17
17
  {
@@ -1 +1 @@
1
- {"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../../src/plugin/target/targets.ts"],"names":[],"mappings":";;AAgBA,sCAiBC;AAjCD,+CAA2C;AAC3C,kDAAiD;AAKjD,uEAAsE;AACtE,iDAA0D;AAC1D,6DAA4D;AAQrD,KAAK,UAAU,aAAa,CAAC,iBAAuC;IACzE,MAAM,EACJ,UAAU,GAAG,6BAAc,EAC3B,GAAG,EACH,aAAa,GACd,GAAG,iBAAiB,CAAC,aAAa,CAAC;IACpC,MAAM,SAAS,GAAG,MAAM,IAAA,kBAAO,EAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,uCAAwB,CAAC,CAAC;QACzE,CAAC,CAAC;YACE,CAAC,UAAU,CAAC,EAAE,IAAA,yCAAoB,EAAC,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC;SAC3D;QACH,CAAC,CAAC,gFAAgF;YAChF;gBACE,CAAC,GAAG,UAAU,iBAAiB,CAAC,EAAE,MAAM,IAAA,mDAAyB,EAAC;oBAChE,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC,IAAI;iBAChD,CAAC;aACH,CAAC;AACR,CAAC"}
1
+ {"version":3,"file":"targets.js","sourceRoot":"","sources":["../../../../src/plugin/target/targets.ts"],"names":[],"mappings":";;AAgBA,sCAkBC;AAlCD,+CAA2C;AAC3C,kDAAiD;AAKjD,uEAAsE;AACtE,iDAA0D;AAC1D,6DAA4D;AAQrD,KAAK,UAAU,aAAa,CAAC,iBAAuC;IACzE,MAAM,EACJ,UAAU,GAAG,6BAAc,EAC3B,GAAG,EACH,aAAa,E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