Skip to content

feat: Allow types to be imported from the other projects#23

Open
xeho91 wants to merge 3 commits into
roydukkey:masterfrom
xeho91:fix/types-importing
Open

feat: Allow types to be imported from the other projects#23
xeho91 wants to merge 3 commits into
roydukkey:masterfrom
xeho91:fix/types-importing

Conversation

@xeho91
Copy link
Copy Markdown

@xeho91 xeho91 commented Jan 20, 2023

What is the purpose of this Pull Request?

It resolves the issue where the types defined in your project cannot be imported.
I noticed it when trying to make an extendable config for my projects.

For example, once you try:

import type { Config } from "clean-package";

there's an error message:

Module '"clean-package"' declares 'Config' locally, but it is not exported.


By the way, thank you for this great tool! ❤️

@roydukkey roydukkey changed the title fix: 🐛 Allow types to be imported from the other projects feat: Allow types to be imported from the other projects Jan 20, 2023
Comment thread tsconfig.json
"noImplicitThis": true,
"removeComments": false
"removeComments": false,
"isolatedModules": true
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

What issue where you hitting here? I think it makes sense, but would like to here your thoughts too.

Comment thread src/index.ts
// Licensed under the MIT. See LICENSE file in the project root for full license information.


export * from "./spec";
Copy link
Copy Markdown
Owner

@roydukkey roydukkey Jan 20, 2023

Choose a reason for hiding this comment

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

Suggested change
export * from "./spec";
export type { CompiledConfig, Config, JsonDocument } from "./spec";

Some of these types have no relevance with the other exports of this file. For example, types that support the CLI.

Likewise, some of the others are internals and I'd like to avoid making them public.

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