hyperbrew / vite-cep-plugin

A Vite plugin to build Adobe CEP Extension Panels
MIT License
17 stars 17 forks source link

Optional StartOnEvents parameter in config produces undefined artifact in manifest when not included #16

Closed Inventsable closed 1 year ago

Inventsable commented 1 year ago

This happens in all 3 default templates via yarn create bolt-cep myApp --template [framework].

In CEP_Config.panels, an entry like:

  panels: [
    {
      mainPath: "./main/index.html",
      name: "main",
      panelDisplayName: "Bolt CEP",
      autoVisible: true,
      width: 600,
      height: 650,
      minHeight: 300,
      minWidth: 260,
      maxHeight: 1000,
      maxWidth: 1000
    }
  ]

Produces an undefined in the manifest on build:

  <Extension Id="com.main.panel">
    <DispatchInfo>
      <Resources>
        <MainPath>./main/index.html</MainPath>
        <CEFCommandLine>
          <Parameter>--v=0</Parameter>
          <Parameter>--enable-nodejs</Parameter>
          <Parameter>--mixed-context</Parameter>
        </CEFCommandLine>
      </Resources>
      <Lifecycle>
        <AutoVisible>true</AutoVisible>
        undefined
      </Lifecycle>

Which seems to be happening on this line in extension-template.ts despite checking for startOnEvents truthiness and the types not indicating it's a mandatory prop, may trace all the way back to cepConfig in index.ts. For some reason this works initially but seems to make the manifest faulty for certain props during new builds so that it defaults to a previous version (I wasn't sure why I couldn't get an ext icon to load until noticing this despite my panel seeming to be running fine otherwise, removing the undefined manually made my icon work).

justintaylor-dev commented 1 year ago

Thanks for catching that Tom! Resolved in 97b8569273bb40beae181cde003c666b7d998f66 and available in Bolt CEP 0.3.6