gregnb / filemanager-webpack-plugin

Copy, move, archive (zip/tar/tar.gz), delete files and directories before and after Webpack builds. Win32/Mac/*Nix supported
MIT License
463 stars 34 forks source link

Typescript error with 7.0.0-alpha.1 #114

Closed Phil147 closed 2 years ago

Phil147 commented 2 years ago

Issue

The simplest form like

new FileManagerPlugin({
  events: {
     onEnd: {
        copy: [
          { source: '/path/fromfile.txt', destination: '/path/tofile.txt' },
          { source: '/path/**/*.js', destination: '/path' },
        ],
      }
   }
})

is not working with typescript and v7.0.0-alpha.1 anymore. Typescript will throw with:

error TS2322: Type '{ copy: { source: string; destination: string; }[]; }' is not assignable to type 'Actions | Actions[] | undefined'.
  Types of property 'copy' are incompatible.
    Type '{ source: string; destination: string; }[]' is not assignable to type 'Copy'.
      Type '{ source: string; destination: string; }' is missing the following properties from type '{ source: string; destination: string; options: CopyActionOptions; globOptions: Pick<Options, "baseNameMatch" | "braceExpansion" | "caseSensitiveMatch" | ... 15 more ... | "unique">; }': options, globOptions

Possibly introduced by: https://github.com/gregnb/filemanager-webpack-plugin/pull/111/files#diff-a150fb53afee945f23f3fe7c176007111f3ba81bb0d188af4077d4a0fc4caa37R23-R26

I think options and globOptions should be optional. Works fine with 7.0.0-alpha.0

Your Environment

Tech Version
filemanager-plugin-webpack 7.0.0-alpha.1
node 14
OS macos 12.1
sibiraj-s commented 2 years ago

Yes. those are optional items. will fix 👍

sibiraj-s commented 2 years ago

Fixed in v7.0.0-alpha.2

Phil147 commented 2 years ago

hey @sibiraj-s thanks for the quick fix. the version is not on npm yet, when are you planning to release it? :)

sibiraj-s commented 2 years ago
Screenshot 2022-02-02 at 6 19 54 PM

Can you check again. its there...

sibiraj-s commented 2 years ago
Screenshot 2022-02-02 at 6 26 23 PM

I have now fixed the dist tags. previously latest is pointing to alpha. check now?

Phil147 commented 2 years ago

Turned out to be some caching issues on my end. Thanks for looking into it!