Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add export of crds constants into typescript model #1619

Merged
merged 1 commit into from
Aug 7, 2024

Conversation

svor
Copy link
Contributor

@svor svor commented Aug 2, 2024

What does this PR do?

Currently it is not possible to import constants from crds when using devfile/api library.

This PR adds export of crds constants into index.ts that is declared as a exported file in package.json.

export * from "./http/http";
export * from "./auth/auth";
export * from "./models/all";
export { createConfiguration } from "./configuration"
export { Configuration } from "./configuration"
export * from "./apis/exception";
export * from "./servers";
export { RequiredError } from "./apis/baseapi";

export { PromiseMiddleware as Middleware } from './middleware';
export { } from './types/ObjectParamAPI';


export * from './constants/constants';

Which issue(s) does this PR fix

eclipse-che/che#23041

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed

How to test changes / Special notes to the reviewer

Check that crds constants are added into exports

@svor svor self-assigned this Aug 2, 2024
@svor svor requested a review from thepetk August 5, 2024 09:29
Copy link
Contributor

@thepetk thepetk left a comment

Choose a reason for hiding this comment

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

/lgtm

I've been testing the suggested fix. I can confirm that the index.ts now includes the export of the constants.

More detailed, by running the bash build/typescript-models/generate.sh I see the following in index.ts:

export * from "./http/http";
export * from "./auth/auth";
export * from "./models/all";
export { createConfiguration } from "./configuration"
export { Configuration } from "./configuration"
export * from "./apis/exception";
export * from "./servers";
export { RequiredError } from "./apis/baseapi";

export { PromiseMiddleware as Middleware } from './middleware';
export { } from './types/ObjectParamAPI';


export * from './constants/constants';

While on the main branch we have two separate files:

  1. The api.ts containing only the constants
export * from './constants/constants';
  1. And the index.ts with the rest.
export * from "./http/http";
export * from "./auth/auth";
export * from "./models/all";
export { createConfiguration } from "./configuration"
export { Configuration } from "./configuration"
export * from "./apis/exception";
export * from "./servers";
export { RequiredError } from "./apis/baseapi";

export { PromiseMiddleware as Middleware } from './middleware';
export { } from './types/ObjectParamAPI';

/hold

As the PR needs a review from one of the codeowners too.

@svor
Copy link
Contributor Author

svor commented Aug 6, 2024

@yangcao77 @johnmcollier could you take a look please

Copy link

openshift-ci bot commented Aug 6, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ibuziuk, johnmcollier, svor, thepetk

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@svor
Copy link
Contributor Author

svor commented Aug 6, 2024

@thepetk I think we can merge it now. And it would be nice to have a new version of devfile/api on npm registry

@johnmcollier johnmcollier merged commit b10e979 into main Aug 7, 2024
7 checks passed
@johnmcollier johnmcollier deleted the sv-fix-export-constants branch August 7, 2024 12:34
@thepetk
Copy link
Contributor

thepetk commented Aug 7, 2024

@thepetk I think we can merge it now. And it would be nice to have a new version of devfile/api on npm registry

@svor sorry I'm on PTO atm. @johnmcollier thanks for merging it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants