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

json and code plugin callbacks do not run when building Lit components #1709

Open
1 of 12 tasks
taylorfsteele opened this issue Mar 3, 2025 · 0 comments
Open
1 of 12 tasks
Labels
bug Something isn't working

Comments

@taylorfsteele
Copy link

I am interested in helping provide a fix!

Yes

Which generators are impacted?

  • All
  • Angular
  • HTML
  • Preact
  • Qwik
  • React
  • React-Native
  • Solid
  • Stencil
  • Svelte
  • Vue
  • Web components

Reproduction case

N/A

Expected Behaviour

When writing a plugin to run against Lit components, the json and code callback functions don't run.

With the plugin:

/**
 * @type {import('@builder.io/mitosis').MitosisConfig}
 */
module.exports = {
  files: "src/**",
  targets: ["lit"],
  dest: "../",
  commonOptions: {
    typescript: true,
  },
  options: {
    lit: {
      plugins: [
        () => ({
          name: "hello-plugin",
          order: 1,
          build: {
            pre: () => console.log("pre build"),
            post: () => console.log("post build"),
          },
          json: {
            pre: () => console.log("pre json"),
            post: () => console.log("post json"),
          },
          code: {
            pre: () => console.log("pre code"),
            post: () => console.log("post post"),
          },
        }),
      ],
    },
  },
};

The CLI should print during the pre and post steps of the build, json, and code steps.

Actual Behaviour

Plugin callbacks with code and json steps do not run against lit components.

With the above example, the CLI prints:

pre build
Mitosis: lit: generated 1 components, 1 regular files.
post build
Mitosis: generation completed.

Additional Information

No response

@taylorfsteele taylorfsteele added the bug Something isn't working label Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant