const { join } = require('path')
const { writeFile } = require('fs').promises
const { default: players } = require('../lib/players')

const generateSinglePlayers = async () => {
  for (const { key, name } of players) {
    const file = `
      const createReactPlayer = require('./lib/ReactPlayer').createReactPlayer
      const Player = require('./lib/players/${name}').default
      module.exports = createReactPlayer([Player])
    `
    await writeFile(join('.', `${key}.js`), file)
  }
}

generateSinglePlayers()

@@ -414,22 +414,108 @@
 Player(%5B
-Player
+%7B%0A        key: '$%7Bkey%7D',%0A        canPlay: Player.canPlay,%0A        lazyPlayer: Player%0A      %7D
 %5D)%0A    %60

Fix single player import logic