mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-20 18:08:55 +00:00
- 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
21 lines
705 B
JavaScript
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!');
|