Skip to content

Commit ef6b824

Browse files
authored
Merge pull request #770 from constructive-io/devin/1772489252-fix-init-prompter-passthrough
fix: pass prompter through to initModule to prevent duplicate stdin listeners
2 parents 1506166 + 80bef67 commit ef6b824

8 files changed

Lines changed: 66 additions & 91 deletions

File tree

graphql/codegen/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"@babel/types": "^7.28.6",
5959
"@constructive-io/graphql-query": "workspace:^",
6060
"@constructive-io/graphql-types": "workspace:^",
61-
"@inquirerer/utils": "^3.2.3",
61+
"@inquirerer/utils": "^3.3.1",
6262
"@pgpmjs/core": "workspace:^",
6363
"ajv": "^8.17.1",
6464
"deepmerge": "^4.3.1",
@@ -67,7 +67,7 @@
6767
"graphile-schema": "workspace:^",
6868
"graphql": "^16.9.0",
6969
"inflekt": "^0.3.1",
70-
"inquirerer": "^4.4.0",
70+
"inquirerer": "^4.5.2",
7171
"jiti": "^2.6.1",
7272
"komoji": "^0.8.0",
7373
"oxfmt": "^0.26.0",

packages/cli/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"test:watch": "jest --watch"
3535
},
3636
"devDependencies": {
37-
"@inquirerer/test": "^1.3.0",
37+
"@inquirerer/test": "^1.3.3",
3838
"@types/js-yaml": "^4.0.9",
3939
"@types/node": "^20.12.7",
4040
"@types/pg": "^8.16.0",
@@ -51,14 +51,14 @@
5151
"@constructive-io/graphql-server": "workspace:^",
5252
"@constructive-io/graphql-types": "workspace:^",
5353
"@constructive-io/knative-job-service": "workspace:^",
54-
"@inquirerer/utils": "^3.2.3",
54+
"@inquirerer/utils": "^3.3.1",
5555
"@pgpmjs/core": "workspace:^",
5656
"@pgpmjs/logger": "workspace:^",
5757
"@pgpmjs/server-utils": "workspace:^",
5858
"@pgpmjs/types": "workspace:^",
5959
"appstash": "^0.3.0",
6060
"find-and-require-package-json": "^0.9.0",
61-
"inquirerer": "^4.5.0",
61+
"inquirerer": "^4.5.2",
6262
"js-yaml": "^4.1.0",
6363
"pg-cache": "workspace:^",
6464
"pg-env": "workspace:^",

packages/csv-to-pg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@pgsql/types": "^17.6.2",
4747
"@pgsql/utils": "^17.8.11",
4848
"csv-parser": "^2.3.3",
49-
"inquirerer": "^4.4.0",
49+
"inquirerer": "^4.5.2",
5050
"js-yaml": "^3.14.0",
5151
"pgsql-deparser": "^17.17.2"
5252
}

pgpm/cli/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"test:watch": "jest --watch"
3434
},
3535
"devDependencies": {
36-
"@inquirerer/test": "^1.3.0",
36+
"@inquirerer/test": "^1.3.3",
3737
"@types/js-yaml": "^4.0.9",
3838
"@types/node": "^20.12.7",
3939
"@types/pg": "^8.16.0",
@@ -45,15 +45,15 @@
4545
"ts-node": "^10.9.2"
4646
},
4747
"dependencies": {
48-
"@inquirerer/utils": "^3.3.0",
48+
"@inquirerer/utils": "^3.3.1",
4949
"@pgpmjs/core": "workspace:^",
5050
"@pgpmjs/env": "workspace:^",
5151
"@pgpmjs/logger": "workspace:^",
5252
"@pgpmjs/types": "workspace:^",
5353
"appstash": "^0.3.0",
5454
"find-and-require-package-json": "^0.9.0",
55-
"genomic": "^5.3.0",
56-
"inquirerer": "^4.4.0",
55+
"genomic": "^5.3.5",
56+
"inquirerer": "^4.5.2",
5757
"js-yaml": "^4.1.0",
5858
"pg-cache": "workspace:^",
5959
"pg-env": "workspace:^",

pgpm/cli/src/commands/init/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ async function handleModuleInit(
558558
answers: templateAnswers,
559559
noTty: ctx.noTty,
560560
pgpm: isPgpmTemplate,
561+
prompter,
561562
});
562563

563564
const isRoot = path.resolve(project.workspacePath) === path.resolve(ctx.cwd);

pgpm/core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@pgsql/types": "^17.6.2",
4545
"@types/pg": "^8.16.0",
4646
"copyfiles": "^2.4.1",
47-
"inquirerer": "^4.4.0",
47+
"inquirerer": "^4.5.2",
4848
"makage": "^0.1.12"
4949
},
5050
"dependencies": {
@@ -53,7 +53,7 @@
5353
"@pgpmjs/server-utils": "workspace:^",
5454
"@pgpmjs/types": "workspace:^",
5555
"csv-to-pg": "workspace:^",
56-
"genomic": "^5.3.0",
56+
"genomic": "^5.3.5",
5757
"glob": "^13.0.0",
5858
"komoji": "^0.8.0",
5959
"minimatch": "^10.1.1",

pgpm/core/src/core/class/pgpm.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,13 @@ export interface InitModuleOptions {
129129
* Defaults to true for backward compatibility.
130130
*/
131131
pgpm?: boolean;
132+
/**
133+
* Optional Inquirerer instance to reuse for prompting during template scaffolding.
134+
* If provided, prevents creating a duplicate instance on process.stdin which
135+
* would cause double-echoed keystrokes and other input conflicts.
136+
* The caller retains ownership and is responsible for closing it.
137+
*/
138+
prompter?: import('inquirerer').Inquirerer;
132139
}
133140

134141
export class PgpmPackage {
@@ -476,7 +483,8 @@ export class PgpmPackage {
476483
noTty: options.noTty ?? false,
477484
cacheTtlMs: options.cacheTtlMs ?? DEFAULT_TEMPLATE_TTL_MS,
478485
toolName: options.toolName ?? DEFAULT_TEMPLATE_TOOL_NAME,
479-
cwd: this.cwd
486+
cwd: this.cwd,
487+
prompter: options.prompter,
480488
});
481489

482490
// Only create pgpm files (pgpm.plan, .control, deploy/revert/verify dirs) for pgpm-managed modules

0 commit comments

Comments
 (0)