mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
Migrate the ClickUp issue provider from a tightly-coupled Angular service to the external plugin architecture, following the pattern established by the GitHub provider migration. - Delete all built-in ClickUp files (api service, models, components, tests, constants) from src/app/features/issue/providers/clickup/ - Create new plugin in packages/plugin-dev/clickup-issue-provider/ with pure-function API layer, plugin registration, i18n, and tests - Add migration in issue-provider.reducer.ts to convert old ClickUp provider config to plugin shape (preserves legacy fields for rollback) - Move CLICKUP from BuiltInIssueProviderKey to MigratedIssueProviderKey - Register clickup-issue-provider as bundled plugin - Fix isDone detection: use status.type instead of status.status so custom closed statuses like "Shipped" are correctly detected - Show disabled plugin issue providers in setup overview for discoverability — clicking auto-enables and opens config dialog
64 lines
1.7 KiB
JavaScript
64 lines
1.7 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');
|
|
const I18N_SRC = path.join(ROOT_DIR, 'i18n');
|
|
const I18N_DIST = path.join(DIST_DIR, 'i18n');
|
|
|
|
async function buildPlugin() {
|
|
console.log('Building clickup-issue-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');
|
|
}
|
|
|
|
// Copy i18n files
|
|
if (fs.existsSync(I18N_SRC)) {
|
|
fs.mkdirSync(I18N_DIST, { recursive: true });
|
|
for (const file of fs.readdirSync(I18N_SRC)) {
|
|
if (file.endsWith('.json')) {
|
|
fs.copyFileSync(path.join(I18N_SRC, file), path.join(I18N_DIST, file));
|
|
}
|
|
}
|
|
console.log('Copied i18n files');
|
|
}
|
|
|
|
console.log('Build complete!');
|
|
}
|
|
|
|
buildPlugin().catch((err) => {
|
|
console.error('Build failed:', err);
|
|
process.exit(1);
|
|
});
|