diff --git a/integration/cjs/integration.test.cjs b/integration/cjs/integration.test.cjs index 8d8b1e66e..b62e95e3a 100644 --- a/integration/cjs/integration.test.cjs +++ b/integration/cjs/integration.test.cjs @@ -2,7 +2,17 @@ const test = require('node:test'); const assert = require('node:assert'); const { input } = require('@inquirer/prompts'); +const { createPrompt } = require('@inquirer/core'); +const defaultInput = require('@inquirer/input').default; -test('should export modules', () => { +test('[CJS] @inquirer/prompts should be exported', () => { assert(input instanceof Function); }); + +test('[CJS] @inquirer/input should be exported', () => { + assert(defaultInput instanceof Function); +}); + +test('[CJS] @inquirer/core should export createPrompt', () => { + assert(createPrompt instanceof Function); +}); diff --git a/integration/cjs/package.json b/integration/cjs/package.json index 64864dd39..f5dd7029e 100644 --- a/integration/cjs/package.json +++ b/integration/cjs/package.json @@ -6,6 +6,9 @@ "node": ">=18" }, "devDependencies": { - "@inquirer/prompts": "workspace:*" + "@inquirer/core": "workspace:*", + "@inquirer/input": "workspace:*", + "@inquirer/prompts": "workspace:*", + "inquirer": "workspace:*" } } diff --git a/integration/esm/integration.test.mjs b/integration/esm/integration.test.mjs index 7df069fb7..6fc6a5616 100644 --- a/integration/esm/integration.test.mjs +++ b/integration/esm/integration.test.mjs @@ -1,8 +1,25 @@ /* eslint-disable n/no-unsupported-features/node-builtins */ import { input } from '@inquirer/prompts'; +import defaultInput from '@inquirer/input'; +import { createPrompt } from '@inquirer/core'; +import inquirer, { createPromptModule } from 'inquirer'; import test from 'node:test'; import assert from 'node:assert'; -test('should export modules', () => { +test('[ESM] @inquirer/prompts should be exported', () => { assert(input instanceof Function); }); + +test('[ESM] @inquirer/input should be exported', () => { + assert(defaultInput instanceof Function); +}); + +test('[ESM] @inquirer/core should export createPrompt', () => { + assert(createPrompt instanceof Function); +}); + +test('[ESM] inquirer should be exported', () => { + assert(inquirer.prompt instanceof Function); + assert(inquirer.createPromptModule instanceof Function); + assert(createPromptModule instanceof Function); +}); diff --git a/integration/esm/package.json b/integration/esm/package.json index 96a714ac5..651f69494 100644 --- a/integration/esm/package.json +++ b/integration/esm/package.json @@ -7,6 +7,9 @@ "node": ">=18" }, "devDependencies": { - "@inquirer/prompts": "workspace:*" + "@inquirer/core": "workspace:*", + "@inquirer/input": "workspace:*", + "@inquirer/prompts": "workspace:*", + "inquirer": "workspace:*" } } diff --git a/yarn.lock b/yarn.lock index 45519ccf5..04037927a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -396,7 +396,10 @@ __metadata: version: 0.0.0-use.local resolution: "@inquirer/cjs-integration-tests@workspace:integration/cjs" dependencies: + "@inquirer/core": "workspace:*" + "@inquirer/input": "workspace:*" "@inquirer/prompts": "workspace:*" + inquirer: "workspace:*" languageName: unknown linkType: soft @@ -410,7 +413,7 @@ __metadata: languageName: unknown linkType: soft -"@inquirer/core@npm:^9.0.0, @inquirer/core@workspace:packages/core": +"@inquirer/core@npm:^9.0.0, @inquirer/core@workspace:*, @inquirer/core@workspace:packages/core": version: 0.0.0-use.local resolution: "@inquirer/core@workspace:packages/core" dependencies: @@ -458,7 +461,10 @@ __metadata: version: 0.0.0-use.local resolution: "@inquirer/esm-integration-tests@workspace:integration/esm" dependencies: + "@inquirer/core": "workspace:*" + "@inquirer/input": "workspace:*" "@inquirer/prompts": "workspace:*" + inquirer: "workspace:*" languageName: unknown linkType: soft @@ -479,7 +485,7 @@ __metadata: languageName: unknown linkType: soft -"@inquirer/input@npm:^2.1.12, @inquirer/input@workspace:packages/input": +"@inquirer/input@npm:^2.1.12, @inquirer/input@workspace:*, @inquirer/input@workspace:packages/input": version: 0.0.0-use.local resolution: "@inquirer/input@workspace:packages/input" dependencies: @@ -4423,7 +4429,7 @@ __metadata: languageName: node linkType: hard -"inquirer@workspace:packages/inquirer": +"inquirer@workspace:*, inquirer@workspace:packages/inquirer": version: 0.0.0-use.local resolution: "inquirer@workspace:packages/inquirer" dependencies: