@cedarjs/cli-helpers 7.0.0-canary.3078 → 7.0.0-canary.3082

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.d.ts CHANGED
@@ -5,6 +5,7 @@ export { loadDefaultEnvFiles, loadNodeEnvDerivedEnvFile, loadUserSpecifiedEnvFil
5
5
  export * from './lib/paths.js';
6
6
  export * from './lib/project.js';
7
7
  export * from './lib/transpileTSToJS.js';
8
+ export * from './lib/tty.js';
8
9
  export * from './lib/version.js';
9
10
  export * from './auth/setupHelpers.js';
10
11
  export type { AuthHandlerArgs, AuthGeneratorCtx } from './auth/setupHelpers.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE/E,cAAc,yBAAyB,CAAA;AAEvC,cAAc,sBAAsB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,uBAAuB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,0BAA0B,CAAA;AACxC,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE/E,cAAc,yBAAyB,CAAA;AAEvC,cAAc,sBAAsB,CAAA"}
package/dist/index.js CHANGED
@@ -9,6 +9,7 @@ import {
9
9
  export * from "./lib/paths.js";
10
10
  export * from "./lib/project.js";
11
11
  export * from "./lib/transpileTSToJS.js";
12
+ export * from "./lib/tty.js";
12
13
  export * from "./lib/version.js";
13
14
  export * from "./auth/setupHelpers.js";
14
15
  export * from "./lib/installHelpers.js";
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Prompting libraries (e.g. `prompts`) hang indefinitely when stdin isn't a
3
+ * TTY - piped input, CI, or a backgrounded process never sends a keypress,
4
+ * so the prompt neither resolves nor throws.
5
+ *
6
+ * Call this immediately before any interactive confirm/prompt that's only
7
+ * reached when a flag was left unset, so a non-interactive invocation exits
8
+ * with a clear, actionable error instead of hanging.
9
+ */
10
+ export declare function requireTTYOrExit(flagHint: string): void;
11
+ //# sourceMappingURL=tty.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tty.d.ts","sourceRoot":"","sources":["../../src/lib/tty.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAYvD"}
@@ -0,0 +1,16 @@
1
+ import { errorTelemetry } from "@cedarjs/telemetry";
2
+ import { colors } from "./colors.js";
3
+ function requireTTYOrExit(flagHint) {
4
+ if (process.stdin.isTTY) {
5
+ return;
6
+ }
7
+ const error = new Error(
8
+ `Cannot prompt for confirmation in a non-interactive terminal. Please pass ${flagHint} explicitly.`
9
+ );
10
+ errorTelemetry(process.argv, error.message);
11
+ console.error(colors.error(error.message));
12
+ process.exit(1);
13
+ }
14
+ export {
15
+ requireTTYOrExit
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli-helpers",
3
- "version": "7.0.0-canary.3078",
3
+ "version": "7.0.0-canary.3082",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cedarjs/cedar.git",
@@ -72,8 +72,8 @@
72
72
  "test:watch": "vitest watch"
73
73
  },
74
74
  "dependencies": {
75
- "@cedarjs/project-config": "7.0.0-canary.3078",
76
- "@cedarjs/telemetry": "7.0.0-canary.3078",
75
+ "@cedarjs/project-config": "7.0.0-canary.3082",
76
+ "@cedarjs/telemetry": "7.0.0-canary.3082",
77
77
  "@listr2/prompt-adapter-enquirer": "4.3.1",
78
78
  "@opentelemetry/api": "1.9.1",
79
79
  "ansis": "4.3.1",
@@ -93,7 +93,7 @@
93
93
  "yargs-parser": "21.1.1"
94
94
  },
95
95
  "devDependencies": {
96
- "@cedarjs/framework-tools": "7.0.0-canary.3078",
96
+ "@cedarjs/framework-tools": "7.0.0-canary.3082",
97
97
  "@types/dotenv-defaults": "^5.0.0",
98
98
  "@types/lodash": "4.17.25",
99
99
  "@types/pascalcase": "1.0.3",