Skip to content

Conversation

@animeshjajoopostman
Copy link
Collaborator

No description provided.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

integration test code coverage

Lines Statements Branches Functions
Coverage: 19%
19.65% (2099/10680) 13.39% (999/7457) 20.87% (248/1188)
Coverage Breakdown • (19%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files19.6513.3920.8719.95 
lib40.7239.4627.741.02 
   schemaUtils.js47.6944.4738.5548.01...3247, 3281–5381
libV29.27009.37 
   index.js12.50012.528–326
libV2/CollectionGeneration5.51005.57 
   requestMatchingUtils.js1.52001.5511–229, 246–385
   schemaUtils.js7.75007.82...2779, 2792–2852
   utils.js11.940012.129–51, 54–82, 92–242
   validationUtils.js3.11003.1498–2539, 2547–2792
test/integration100100100100 
   integration.test.js100100100100 
test/unit86.66508089.65 
   sanity.test.js86.66508089.6538–41

@github-actions
Copy link
Contributor

github-actions bot commented Dec 22, 2025

unit test code coverage

Lines Statements Branches Functions
Coverage: 89%
89.12% (5803/6511) 80.83% (3834/4743) 93.82% (851/907)
Coverage Breakdown • (89%)
File% Stmts% Branch% Funcs% LinesUncovered Line #s
All files89.1280.8393.8289.24 
bin51.8556.815053.16 
   openapi2postmanv2.js51.8556.815053.16...65–166, 178–179
lib92.9786.696.6292.95 
   schemaUtils.js93.3987.3598.7293.31...5346–5348, 5372
libV278.3569.3510078.12 
   index.js69.1651.7810069.16...27, 302–306, 317
libV2/CollectionGeneration90.9482.695.0590.98 
   requestMatchingUtils.js96.9491.1710096.89263–267, 284, 341
   schemaUtils.js94.0688.4199.0394.29...2526, 2671–2677
   utils.js95.5283.3394.7395.45112, 161, 172
   validationUtils.js86.2674.6191.4886.1...2725, 2762–2765

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds TypeScript support to the project by introducing type definitions and converting the main entry point to TypeScript. The changes enable better type safety and developer experience when using this OpenAPI to Postman converter library.

Key changes:

  • New TypeScript type definitions in types/index.ts covering all major interfaces
  • Conversion of index.js to index.ts with TypeScript annotations
  • Build pipeline setup with TypeScript compilation to dist/ directory

Reviewed changes

Copilot reviewed 25 out of 35 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
types/index.ts Comprehensive type definitions for converter inputs, options, and outputs
index.ts TypeScript conversion of main entry point with type annotations
package.json Added TypeScript tooling, build scripts, and updated main/types entry points
libV2/index.js Updated import paths to reference reorganized CollectionGeneration directory
libV2/CollectionGeneration/schemaUtils.js Added missing eslint-disable comment and fixed import paths with .js extensions
libV2/CollectionGeneration/validationUtils.js Updated import paths with .js extensions for relocated modules
test/unit/*.test.js Updated test imports to use compiled dist/index.js instead of source
test/system/*.test.js Updated test imports to use compiled dist/index.js
test/integration/integration.test.js Updated import to use compiled dist/index.js
scripts/test-lint.sh Removed index.js from eslint targets since it's now TypeScript

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +5 to +7
const { MODULE_VERSION } = require('../lib/schemapack.js');
const SchemaPack = require('../lib/schemapack.js').SchemaPack;
const UserError = require('../lib/common/UserError');
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The require paths use '../lib/' but should use './lib/' since index.ts is at the project root, not in a subdirectory. These incorrect paths will cause module resolution failures at runtime.

Suggested change
const { MODULE_VERSION } = require('../lib/schemapack.js');
const SchemaPack = require('../lib/schemapack.js').SchemaPack;
const UserError = require('../lib/common/UserError');
const { MODULE_VERSION } = require('./lib/schemapack.js');
const SchemaPack = require('./lib/schemapack.js').SchemaPack;
const UserError = require('./lib/common/UserError');

Copilot uses AI. Check for mistakes.
else if (propValue.properties) {
let processedProperties = processSchema(propValue);
propertyDetails.properties = processedProperties.properties;
// eslint-disable-next-line max-depth
Copy link

Copilot AI Dec 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added eslint-disable comment suggests deeply nested code at this location. Consider refactoring to reduce nesting depth rather than suppressing the warning, as excessive nesting impacts code readability and maintainability.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 28 out of 38 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +21 to +23
const { MODULE_VERSION } = require('../lib/schemapack.js');
const SchemaPack = require('../lib/schemapack.js').SchemaPack;
const UserError = require('../lib/common/UserError');
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The require statements use relative paths starting with '../lib/' but these files are now at './lib/' relative to index.ts in the project root. These paths will fail at runtime since the compiled JavaScript will be in the dist directory.

Suggested change
const { MODULE_VERSION } = require('../lib/schemapack.js');
const SchemaPack = require('../lib/schemapack.js').SchemaPack;
const UserError = require('../lib/common/UserError');
const { MODULE_VERSION } = require('./lib/schemapack.js');
const SchemaPack = require('./lib/schemapack.js').SchemaPack;
const UserError = require('./lib/common/UserError');

Copilot uses AI. Check for mistakes.
return schema.detectRelatedFiles();
},

bundle: async function(input: MultiFileSpecInput & { options?: Options }): Promise<BundledContent> {
Copy link

Copilot AI Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parameter type uses intersection with an inline type which is inconsistent with the defined MultiFileSpecInput interface. Consider adding an 'options' field directly to MultiFileSpecInput or creating a separate BundleInput type.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants