super-productivity/packages/plugin-dev/sync-md/build-plugin-entry.js
Johannes Millan d4d81bf511 feat(plugin-api): create foundational plugin API package
- Add @super-productivity/plugin-api package with TypeScript definitions
- Define core plugin interfaces, types, and manifest structure
- Add plugin hooks system for event-driven architecture
- Create plugin API type definitions and constants
- Add documentation and development guidelines
2025-06-27 18:13:19 +02:00

21 lines
705 B
JavaScript

const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
// Build the plugin entry file as an IIFE
const pluginEntryPath = path.resolve(__dirname, 'src/plugin-entry.ts');
const outputPath = path.resolve(__dirname, 'dist/plugin.js');
// Ensure dist directory exists
if (!fs.existsSync(path.dirname(outputPath))) {
fs.mkdirSync(path.dirname(outputPath), { recursive: true });
}
// First, compile TypeScript to JavaScript
console.log('Compiling plugin entry...');
execSync(
`npx esbuild "${pluginEntryPath}" --bundle --format=iife --outfile="${outputPath}" --platform=browser`,
{ stdio: 'inherit' },
);
console.log('Plugin entry built successfully!');