cdk-real-drift 0.4.2 → 0.4.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/README.md CHANGED
@@ -383,7 +383,12 @@ the line) are errors (exit `2`): a typo'd flag never silently becomes a stack na
383
383
  Every option runs exactly the same code as the standalone commands. Prompts are
384
384
  skipped under `--json`, `--show-all`, `--pre-deploy`, and `--fail`. A non-TTY run
385
385
  never prompts: a required write decision without `--yes` errors with exit 2 (the
386
- safe side); `--yes` in a TTY skips the write confirmation AND each verb's selection
386
+ safe side). "Interactive" requires **both** a TTY stdin and a TTY stdout — so
387
+ **redirecting or piping the output** (`cdkrd check > report.txt`, `| tee`) is also
388
+ treated as non-interactive: the report is written cleanly with no prompt (which
389
+ would otherwise deadlock, waiting on stdin for a prompt written into the file) and
390
+ no spinner frames leaking into the text. `--yes` in a TTY skips the write
391
+ confirmation AND each verb's selection
387
392
  multiselect — `record` records ALL, `ignore` ignores ALL, `revert` applies the full
388
393
  plan. Only `check`'s action menu (Record / Revert / Ignore / …) still shows under
389
394
  `--yes`.
package/dist/cli.js CHANGED
@@ -327,9 +327,18 @@ const ALLOWED_FLAGS_BY_VERB = {
327
327
  * non-TTY (real CI/cron/pipes). The single source of truth — command code threads this
328
328
  * in rather than reading `process.stdin.isTTY` directly. Optional prompts skip when
329
329
  * false; required-decision prompts error (exit 2) when false.
330
+ *
331
+ * #869: gate on BOTH stdin AND stdout being a TTY — the interactive UI (the @clack
332
+ * spinner + resolve prompt) WRITES to stdout, so `cdkrd check > out.txt` (or `| tee`)
333
+ * from a terminal has a TTY stdin but a redirected stdout: gating on stdin alone RAN the
334
+ * prompt into the file, deadlocking the run on a prompt the user cannot see, and leaked
335
+ * the spinner's ANSI erase-frames into the text report (polluting the `^result:` grep
336
+ * contract). Requiring stdout too matches the color gate (`style.ts`, `process.stdout.isTTY`)
337
+ * so the two interactivity axes are consistent: a redirected/piped stdout is report-only,
338
+ * never prompts, never hangs.
330
339
  */
331
340
  function isInteractive() {
332
- return Boolean(process.stdin.isTTY);
341
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
333
342
  }
334
343
  function parseCommonArgs(args, verb) {
335
344
  const values = {};
@@ -4803,6 +4812,26 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4803
4812
  SecondaryPrivateIpAddressCount: Math.max(0, ips.length - 1)
4804
4813
  };
4805
4814
  }
4815
+ if (resourceType === "AWS::ApiGateway::Stage") {
4816
+ const stageDeploymentId = declared["DeploymentId"] ?? live["DeploymentId"];
4817
+ if (typeof stageDeploymentId === "string") knownDefPaths = {
4818
+ ...knownDefPaths,
4819
+ "CanarySetting.DeploymentId": stageDeploymentId
4820
+ };
4821
+ }
4822
+ if (resourceType === "AWS::EC2::VPCEndpoint") {
4823
+ const epType = declared["VpcEndpointType"];
4824
+ const dnsRecordIpType = epType === "Interface" ? "ipv4" : epType === "Gateway" ? "service-defined" : void 0;
4825
+ if (dnsRecordIpType !== void 0) knownDef = {
4826
+ ...knownDef,
4827
+ DnsOptions: {
4828
+ DnsRecordIpType: dnsRecordIpType,
4829
+ PrivateDnsOnlyForInboundResolverEndpoint: "NotSpecified",
4830
+ PrivateDnsSpecifiedDomains: ["*"],
4831
+ PrivateDnsPreference: "VERIFIED_DOMAINS_ONLY"
4832
+ }
4833
+ };
4834
+ }
4806
4835
  const generatedPaths = GENERATED_PATHS[resourceType] ?? [];
4807
4836
  const generatedNestedPaths = GENERATED_NESTED_PATHS[resourceType];
4808
4837
  const freeFormMapPaths = schema.freeFormMapPaths ?? [];
@@ -5148,7 +5177,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
5148
5177
  }
5149
5178
  continue;
5150
5179
  }
5151
- if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
5180
+ if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) && !(k in knownDef) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
5152
5181
  findings.push({
5153
5182
  tier: "atDefault",
5154
5183
  logicalId,