diff --git a/graphql/codegen/package.json b/graphql/codegen/package.json index f33d6483a..d9652fbc2 100644 --- a/graphql/codegen/package.json +++ b/graphql/codegen/package.json @@ -58,7 +58,7 @@ "@babel/types": "^7.28.6", "@constructive-io/graphql-query": "workspace:^", "@constructive-io/graphql-types": "workspace:^", - "@inquirerer/utils": "^3.2.3", + "@inquirerer/utils": "^3.3.1", "@pgpmjs/core": "workspace:^", "ajv": "^8.17.1", "deepmerge": "^4.3.1", @@ -67,7 +67,7 @@ "graphile-schema": "workspace:^", "graphql": "^16.9.0", "inflekt": "^0.3.1", - "inquirerer": "^4.4.0", + "inquirerer": "^4.5.2", "jiti": "^2.6.1", "komoji": "^0.8.0", "oxfmt": "^0.26.0", diff --git a/packages/cli/package.json b/packages/cli/package.json index 341fd54ef..7ad0a9a83 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -34,7 +34,7 @@ "test:watch": "jest --watch" }, "devDependencies": { - "@inquirerer/test": "^1.3.0", + "@inquirerer/test": "^1.3.3", "@types/js-yaml": "^4.0.9", "@types/node": "^20.12.7", "@types/pg": "^8.16.0", @@ -51,14 +51,14 @@ "@constructive-io/graphql-server": "workspace:^", "@constructive-io/graphql-types": "workspace:^", "@constructive-io/knative-job-service": "workspace:^", - "@inquirerer/utils": "^3.2.3", + "@inquirerer/utils": "^3.3.1", "@pgpmjs/core": "workspace:^", "@pgpmjs/logger": "workspace:^", "@pgpmjs/server-utils": "workspace:^", "@pgpmjs/types": "workspace:^", "appstash": "^0.3.0", "find-and-require-package-json": "^0.9.0", - "inquirerer": "^4.5.0", + "inquirerer": "^4.5.2", "js-yaml": "^4.1.0", "pg-cache": "workspace:^", "pg-env": "workspace:^", diff --git a/packages/csv-to-pg/package.json b/packages/csv-to-pg/package.json index 0591eda3d..42120d10b 100644 --- a/packages/csv-to-pg/package.json +++ b/packages/csv-to-pg/package.json @@ -46,7 +46,7 @@ "@pgsql/types": "^17.6.2", "@pgsql/utils": "^17.8.11", "csv-parser": "^2.3.3", - "inquirerer": "^4.4.0", + "inquirerer": "^4.5.2", "js-yaml": "^3.14.0", "pgsql-deparser": "^17.17.2" } diff --git a/pgpm/cli/package.json b/pgpm/cli/package.json index fd1e75382..a9762a98f 100644 --- a/pgpm/cli/package.json +++ b/pgpm/cli/package.json @@ -33,7 +33,7 @@ "test:watch": "jest --watch" }, "devDependencies": { - "@inquirerer/test": "^1.3.0", + "@inquirerer/test": "^1.3.3", "@types/js-yaml": "^4.0.9", "@types/node": "^20.12.7", "@types/pg": "^8.16.0", @@ -45,15 +45,15 @@ "ts-node": "^10.9.2" }, "dependencies": { - "@inquirerer/utils": "^3.3.0", + "@inquirerer/utils": "^3.3.1", "@pgpmjs/core": "workspace:^", "@pgpmjs/env": "workspace:^", "@pgpmjs/logger": "workspace:^", "@pgpmjs/types": "workspace:^", "appstash": "^0.3.0", "find-and-require-package-json": "^0.9.0", - "genomic": "^5.3.0", - "inquirerer": "^4.4.0", + "genomic": "^5.3.5", + "inquirerer": "^4.5.2", "js-yaml": "^4.1.0", "pg-cache": "workspace:^", "pg-env": "workspace:^", diff --git a/pgpm/cli/src/commands/init/index.ts b/pgpm/cli/src/commands/init/index.ts index 91fab1cd2..78ed55591 100644 --- a/pgpm/cli/src/commands/init/index.ts +++ b/pgpm/cli/src/commands/init/index.ts @@ -558,6 +558,7 @@ async function handleModuleInit( answers: templateAnswers, noTty: ctx.noTty, pgpm: isPgpmTemplate, + prompter, }); const isRoot = path.resolve(project.workspacePath) === path.resolve(ctx.cwd); diff --git a/pgpm/core/package.json b/pgpm/core/package.json index 93786f058..cb79fb219 100644 --- a/pgpm/core/package.json +++ b/pgpm/core/package.json @@ -44,7 +44,7 @@ "@pgsql/types": "^17.6.2", "@types/pg": "^8.16.0", "copyfiles": "^2.4.1", - "inquirerer": "^4.4.0", + "inquirerer": "^4.5.2", "makage": "^0.1.12" }, "dependencies": { @@ -53,7 +53,7 @@ "@pgpmjs/server-utils": "workspace:^", "@pgpmjs/types": "workspace:^", "csv-to-pg": "workspace:^", - "genomic": "^5.3.0", + "genomic": "^5.3.5", "glob": "^13.0.0", "komoji": "^0.8.0", "minimatch": "^10.1.1", diff --git a/pgpm/core/src/core/class/pgpm.ts b/pgpm/core/src/core/class/pgpm.ts index 2482855a9..74937c70a 100644 --- a/pgpm/core/src/core/class/pgpm.ts +++ b/pgpm/core/src/core/class/pgpm.ts @@ -129,6 +129,13 @@ export interface InitModuleOptions { * Defaults to true for backward compatibility. */ pgpm?: boolean; + /** + * Optional Inquirerer instance to reuse for prompting during template scaffolding. + * If provided, prevents creating a duplicate instance on process.stdin which + * would cause double-echoed keystrokes and other input conflicts. + * The caller retains ownership and is responsible for closing it. + */ + prompter?: import('inquirerer').Inquirerer; } export class PgpmPackage { @@ -476,7 +483,8 @@ export class PgpmPackage { noTty: options.noTty ?? false, cacheTtlMs: options.cacheTtlMs ?? DEFAULT_TEMPLATE_TTL_MS, toolName: options.toolName ?? DEFAULT_TEMPLATE_TOOL_NAME, - cwd: this.cwd + cwd: this.cwd, + prompter: options.prompter, }); // Only create pgpm files (pgpm.plan, .control, deploy/revert/verify dirs) for pgpm-managed modules diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 29eff921c..733e447d3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -797,8 +797,8 @@ importers: specifier: workspace:^ version: link:../types/dist '@inquirerer/utils': - specifier: ^3.2.3 - version: 3.2.3 + specifier: ^3.3.1 + version: 3.3.1 '@pgpmjs/core': specifier: workspace:^ version: link:../../pgpm/core/dist @@ -824,8 +824,8 @@ importers: specifier: ^0.3.1 version: 0.3.1 inquirerer: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^4.5.2 + version: 4.5.2 jiti: specifier: ^2.6.1 version: 2.6.1 @@ -1695,8 +1695,8 @@ importers: specifier: workspace:^ version: link:../../jobs/knative-job-service/dist '@inquirerer/utils': - specifier: ^3.2.3 - version: 3.2.3 + specifier: ^3.3.1 + version: 3.3.1 '@pgpmjs/core': specifier: workspace:^ version: link:../../pgpm/core/dist @@ -1716,8 +1716,8 @@ importers: specifier: ^0.9.0 version: 0.9.0 inquirerer: - specifier: ^4.5.0 - version: 4.5.0 + specifier: ^4.5.2 + version: 4.5.2 js-yaml: specifier: ^4.1.0 version: 4.1.1 @@ -1738,8 +1738,8 @@ importers: version: 0.2.0 devDependencies: '@inquirerer/test': - specifier: ^1.3.0 - version: 1.3.0(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3))) + specifier: ^1.3.3 + version: 1.3.3(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3))) '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 @@ -1805,8 +1805,8 @@ importers: specifier: ^2.3.3 version: 2.3.5 inquirerer: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^4.5.2 + version: 4.5.2 js-yaml: specifier: ^3.14.0 version: 3.14.2 @@ -1958,8 +1958,8 @@ importers: pgpm/cli: dependencies: '@inquirerer/utils': - specifier: ^3.3.0 - version: 3.3.0 + specifier: ^3.3.1 + version: 3.3.1 '@pgpmjs/core': specifier: workspace:^ version: link:../core/dist @@ -1979,11 +1979,11 @@ importers: specifier: ^0.9.0 version: 0.9.0 genomic: - specifier: ^5.3.0 - version: 5.3.0 + specifier: ^5.3.5 + version: 5.3.5 inquirerer: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^4.5.2 + version: 4.5.2 js-yaml: specifier: ^4.1.0 version: 4.1.1 @@ -2007,8 +2007,8 @@ importers: version: 0.2.0 devDependencies: '@inquirerer/test': - specifier: ^1.3.0 - version: 1.3.0(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3))) + specifier: ^1.3.3 + version: 1.3.3(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3))) '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 @@ -2056,8 +2056,8 @@ importers: specifier: workspace:^ version: link:../../packages/csv-to-pg/dist genomic: - specifier: ^5.3.0 - version: 5.3.0 + specifier: ^5.3.5 + version: 5.3.5 glob: specifier: ^13.0.0 version: 13.0.0 @@ -2099,8 +2099,8 @@ importers: specifier: ^2.4.1 version: 2.4.1 inquirerer: - specifier: ^4.4.0 - version: 4.4.0 + specifier: ^4.5.2 + version: 4.5.2 makage: specifier: ^0.1.12 version: 0.1.12 @@ -3656,19 +3656,16 @@ packages: '@types/node': optional: true - '@inquirerer/test@1.3.0': - resolution: {integrity: sha512-uKn1yJ66MKaPf8ECxoTRma6+lQSLy1YtBOXHDrTGn/j6xtCDdfDYw34h51gM0MLimPTd1vAoxMG+zQGXRSHZLg==} + '@inquirerer/test@1.3.3': + resolution: {integrity: sha512-PowD9YoBzvThoIrfxGcEVPH3FuXpWqVStTmqhFDhvmrYdnN8FrnQ49S5QoLDU8hIzMKhDj3t/ZJbp61kkSU0Rw==} peerDependencies: jest: '>=29.0.0' peerDependenciesMeta: jest: optional: true - '@inquirerer/utils@3.2.3': - resolution: {integrity: sha512-Ak0GspJ8fT9aW9pp1Op53xebtJOoZpt1/7eklI1TpUh7QuLxqmk2cl7sGMP1mROvR3q5Ms10ZvJ3eS2GKI++yw==} - - '@inquirerer/utils@3.3.0': - resolution: {integrity: sha512-QugrMW6U6UfPLBKiAvGRUsyQ/WmQlGnOfWOtXX4Zd5uwJuaxbwcXoTy7MJvZpD9WRjg7IaDhI1Wwdlewxq2nFg==} + '@inquirerer/utils@3.3.1': + resolution: {integrity: sha512-9KkXpM3q7C59KTZXrSDAWBto5RoTQlwoJ2w6fAAt/8o6OdsXwJUQa8huzg25yGvydxcivxEoNT6/yAERT1EZJw==} '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} @@ -5554,9 +5551,6 @@ packages: appstash@0.3.0: resolution: {integrity: sha512-F4rMrok4wQYDVitYMWbPQh2MBoKCj7GYzmI/Gw8zDeO2vDLmCmyzmbd0zAwplghB6X3VMGQw/NKcngIc8w6oTA==} - appstash@0.3.1: - resolution: {integrity: sha512-6blvfn9slJQeA7oavIeJ8Wbj5/KCRKkWRsmL54+sgY/ZDPTZndRGTFGOpdARHx0MZzRRQSUPrt1pUaOXXy350A==} - appstash@0.5.0: resolution: {integrity: sha512-f9CkbNq1UK2aRn7ErcZI4C1ojInalknp+GsjHnlGSM35sKDBYf6lDc3Z6hViH751hOI0tSrNcFunkaYvxWYgKQ==} @@ -5840,8 +5834,8 @@ packages: cjs-module-lexer@2.2.0: resolution: {integrity: sha512-4bHTS2YuzUvtoLjdy+98ykbNB5jS0+07EvFNXerqZQJ89F7DI6ET7OQo/HJuW6K0aVsKA9hj9/RVb2kQVOrPDQ==} - clean-ansi@0.2.0: - resolution: {integrity: sha512-AX26I7oo87AIA4OixLOARtjeNdX85aKGI+HPJ7wQEnXkoC3ytbwIuPu3d5+cmDoh2j1I2pQsQa/z3/FNAR8vOQ==} + clean-ansi@0.2.1: + resolution: {integrity: sha512-V9IOKBKHv0Sqay4efImuCVWwO8kVmaKU66cvbDBa99F21j2G3ye3mrKkPSfZ7RTR7yP4CNDjtESkNY5dFq+8Sg==} clean-css@4.2.4: resolution: {integrity: sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==} @@ -6759,8 +6753,8 @@ packages: function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - genomic@5.3.0: - resolution: {integrity: sha512-59rZ++BMgR4/rbh/j55n0BCYAZI/KrP9l7IgxdOHT+HEMAADA6kGaPOhDBltekw2QpHOAUeOXoRiTvntM7b1Ug==} + genomic@5.3.5: + resolution: {integrity: sha512-VDaKXRUjqR15DjXjx5qCxkHPBzUR7TFKbuOXSpifesUY7vmsYM9/EivetfbVJ957pheSIV+qDyojKuU08uLNfQ==} gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -7193,14 +7187,8 @@ packages: resolution: {integrity: sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==} engines: {node: '>=12.0.0'} - inquirerer@4.4.0: - resolution: {integrity: sha512-zra0M4Oh+rzgr7PMJy9cNi/LbkJbtB6QRABou65nN6NTwb368/lMJ8ACHXozM7bw3+t5SOI0TP3gxKAyT0BCRw==} - - inquirerer@4.5.0: - resolution: {integrity: sha512-ULWscyMV6Y/OH1XRODvunrQH1EO4r7q+UV/boWFiVIt9h2UZ7wa/Qc+ZpAqUaWynKUhDtY3UqZV4MVrRcEkmNg==} - - inquirerer@4.5.1: - resolution: {integrity: sha512-/Cis0BNeqdgcXJt3loHKt7PbfawPG7fLTQHr29IfpOHCRaLACmf5737PAHakVU1rBflCNNMo4lpdso6t4FHpjg==} + inquirerer@4.5.2: + resolution: {integrity: sha512-MUSAR2HuIPuriITCA9X1j7e9FS2P/6HJyKTI6/f6mMdpAkMQDXPERX+D9UmUFmQ3eeUaqvXYfFb406DS2dBpzA==} interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} @@ -11305,23 +11293,17 @@ snapshots: optionalDependencies: '@types/node': 20.19.27 - '@inquirerer/test@1.3.0(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3)))': + '@inquirerer/test@1.3.3(jest@30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3)))': dependencies: - clean-ansi: 0.2.0 - inquirerer: 4.4.0 + clean-ansi: 0.2.1 + inquirerer: 4.5.2 optionalDependencies: jest: 30.2.0(@types/node@20.19.27)(ts-node@10.9.2(@types/node@20.19.27)(typescript@5.9.3)) - '@inquirerer/utils@3.2.3': - dependencies: - appstash: 0.3.1 - inquirerer: 4.5.1 - semver: 7.7.4 - - '@inquirerer/utils@3.3.0': + '@inquirerer/utils@3.3.1': dependencies: appstash: 0.5.0 - inquirerer: 4.5.1 + inquirerer: 4.5.2 semver: 7.7.4 '@isaacs/balanced-match@4.0.1': {} @@ -13700,8 +13682,6 @@ snapshots: appstash@0.3.0: {} - appstash@0.3.1: {} - appstash@0.5.0: {} aproba@2.0.0: {} @@ -14054,7 +14034,7 @@ snapshots: cjs-module-lexer@2.2.0: {} - clean-ansi@0.2.0: {} + clean-ansi@0.2.1: {} clean-css@4.2.4: dependencies: @@ -14936,10 +14916,10 @@ snapshots: function-bind@1.1.2: {} - genomic@5.3.0: + genomic@5.3.5: dependencies: - appstash: 0.3.0 - inquirerer: 4.4.0 + appstash: 0.5.0 + inquirerer: 4.5.2 gensync@1.0.0-beta.2: {} @@ -15459,21 +15439,7 @@ snapshots: transitivePeerDependencies: - '@types/node' - inquirerer@4.4.0: - dependencies: - deepmerge: 4.3.1 - find-and-require-package-json: 0.9.0 - minimist: 1.2.8 - yanse: 0.2.0 - - inquirerer@4.5.0: - dependencies: - deepmerge: 4.3.1 - find-and-require-package-json: 0.9.0 - minimist: 1.2.8 - yanse: 0.2.0 - - inquirerer@4.5.1: + inquirerer@4.5.2: dependencies: deepmerge: 4.3.1 find-and-require-package-json: 0.9.1