generateVscodeManifest function

Map<String, dynamic> generateVscodeManifest({
  1. String name = 'neomage-bridge',
  2. String displayName = 'Neomage Bridge',
  3. String version = '1.0.0',
  4. String description = 'Bridge extension connecting VS Code to Neomage',
  5. int port = 19836,
})

Generate a VS Code extension manifest (package.json) for the Neomage bridge extension.

Implementation

Map<String, dynamic> generateVscodeManifest({
  String name = 'neomage-bridge',
  String displayName = 'Neomage Bridge',
  String version = '1.0.0',
  String description = 'Bridge extension connecting VS Code to Neomage',
  int port = 19836,
}) {
  return {
    'name': name,
    'displayName': displayName,
    'version': version,
    'description': description,
    'publisher': 'anthropic',
    'engines': {'vscode': '^1.80.0'},
    'categories': ['Other'],
    'activationEvents': ['onStartupFinished'],
    'main': './out/extension.js',
    'contributes': {
      'commands': [
        {'command': 'neomage.connect', 'title': 'Neomage: Connect'},
        {'command': 'neomage.disconnect', 'title': 'Neomage: Disconnect'},
        {'command': 'neomage.showDiff', 'title': 'Neomage: Show Diff'},
        {
          'command': 'neomage.sendSelection',
          'title': 'Neomage: Send Selection',
        },
      ],
      'configuration': {
        'title': 'Neomage Bridge',
        'properties': {
          'neomageCode.port': {
            'type': 'number',
            'default': port,
            'description': 'Port for the Neomage bridge server',
          },
          'neomageCode.autoConnect': {
            'type': 'boolean',
            'default': true,
            'description': 'Automatically connect on startup',
          },
        },
      },
      'menus': {
        'editor/context': [
          {
            'command': 'neomage.sendSelection',
            'when': 'editorHasSelection',
            'group': 'neomage',
          },
        ],
      },
    },
    'scripts': {
      'vscode:prepublish': 'npm run compile',
      'compile': 'tsc -p ./',
      'watch': 'tsc -watch -p ./',
    },
    'devDependencies': {
      '@types/vscode': '^1.80.0',
      '@types/node': '^18.0.0',
      'typescript': '^5.0.0',
    },
    'dependencies': {'ws': '^8.0.0'},
  };
}