local task(obj) =
  {
    name: 'packages | Install ' + obj.name,
    tags: obj.name,
    command: 'pnpm add -g' + std.foldl(function(x, y) x + ' ' + y, [x + '@latest' for x in obj.pack], ''),
  }
;

local packages =
  [
    { name: 'mermaid', pack: ['@mermaid-js/mermaid-cli'] },
    { name: 'marp', pack: ['@marp-team/marp-cli', '@marp-team/marpit'] },
    { name: 'antora', pack: ['@antora/cli', '@antora/site-generator'] },
    {
      name: 'conventional-commit',
      pack: ['conventional-changelog-cli', '@commitlint/cli', 'commitizen'],
    },
    { name: 'cdktf', pack: ['cdktf-cli'] },
    { name: 'slidev', pack: ['@slidev/cli'] },
  ]
  + [
    { name: x, pack: [self.name] }
    for x in [
      'browser-sync',
      'carbon-now-cli',
      'esy',
      'mapscii',
      'nx',
      'pkg',
      'projen',
      'serverless',
      'swagger-ui-watcher',
      'turbo',
      'wavedrom-cli',
      'wrangler',
    ]
  ];

std.manifestYamlDoc([task(x) for x in packages], quote_keys=false)
