mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 08:56:41 +00:00
Add OAuth support for plugins with PKCE, token persistence in local-only IndexedDB, and Electron/web redirect handling. Extend two-way sync with dueDay, dueWithTime, and timeEstimate field mappings including mutually exclusive field clearing. Support remote issue deletion on task delete and remote deletion detection during polling. Add Google Calendar plugin (disabled from bundled builds pending legal review) as a development reference for the plugin OAuth and two-way sync APIs. Additional fixes: - Restore accidentally deleted focus-mode translation keys - Remove full Task[] from deleteTasks action to prevent op-log bloat - Add dueDay/deadlineDay format validation guards (#6908) - Fix Android reminder alarm cancel intent matching - Validate dueDay format to prevent false overdue from corrupted data - Fix PKCE test expectation after utility consolidation
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const { build } = require('esbuild');
|
|
|
|
const ROOT_DIR = path.join(__dirname, '..');
|
|
const SRC_DIR = path.join(ROOT_DIR, 'src');
|
|
const DIST_DIR = path.join(ROOT_DIR, 'dist');
|
|
|
|
async function buildPlugin() {
|
|
console.log('Building google-calendar-provider...');
|
|
|
|
if (fs.existsSync(DIST_DIR)) {
|
|
fs.rmSync(DIST_DIR, { recursive: true });
|
|
}
|
|
fs.mkdirSync(DIST_DIR);
|
|
|
|
// Build TypeScript to IIFE bundle
|
|
await build({
|
|
entryPoints: [path.join(SRC_DIR, 'plugin.ts')],
|
|
bundle: true,
|
|
outfile: path.join(DIST_DIR, 'plugin.js'),
|
|
platform: 'browser',
|
|
target: 'es2020',
|
|
format: 'iife',
|
|
define: {
|
|
'process.env.NODE_ENV': '"production"',
|
|
},
|
|
logLevel: 'info',
|
|
minify: true,
|
|
sourcemap: false,
|
|
});
|
|
|
|
// Copy manifest.json
|
|
fs.copyFileSync(path.join(SRC_DIR, 'manifest.json'), path.join(DIST_DIR, 'manifest.json'));
|
|
|
|
// Copy icon.svg if present
|
|
const iconSrc = path.join(ROOT_DIR, 'icon.svg');
|
|
if (fs.existsSync(iconSrc)) {
|
|
fs.copyFileSync(iconSrc, path.join(DIST_DIR, 'icon.svg'));
|
|
console.log('Copied icon.svg');
|
|
}
|
|
|
|
console.log('Build complete!');
|
|
}
|
|
|
|
buildPlugin().catch((err) => {
|
|
console.error('Build failed:', err);
|
|
process.exit(1);
|
|
});
|