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

Barrel management and the extName documentation #1087

Closed
Downchuck opened this issue Jul 24, 2024 · 1 comment
Closed

Barrel management and the extName documentation #1087

Downchuck opened this issue Jul 24, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@Downchuck
Copy link

What is the type of issue?

Documentation is confusing

What is the issue?

I've come up against two issues in the Zod plugin working with processing:

The extName only applies to barrel files, and the barrel files are processed after the buildEnd hook.

    pluginZod({
      output: {
        path: "./parser",
        extName: ".js",
        exportType: "barrel",
      }, ...
const pluginZodJsdoc = createPlugin((options) => {
  return {
    name: "plugin-zod-jsdoc",
    key: ['plugin-zod-jsdoc'],
    options,
    pre: [pluginZodName],
    async buildEnd() {
   ...

Arguably, the extName only applies to barrel files, and the barrel files are not buildEnd for a pre-hook.

That said, I'd expect that the "operations.ts" file generated by pluginZod would use import statements with the extName applied, and that a plugin with a pre would wait until after the barrel file is generate before triggering the buildEnd hook on the plugin.

Where did you find it?

No response

@stijnvanhulle
Copy link
Collaborator

@Downchuck This has been resolved as part of v3 of Kubb, see https://v3.kubb.dev/getting-started/configure#output-extension. We will use output.extension instead of extName, this will make it possible to override the extension and make sure we use the same extname for every file created by Kubb.

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

No branches or pull requests

2 participants