mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-18 17:05:48 +00:00
A document-mode plugin under packages/plugin-dev/document-mode/ that renders the active work context's tasks as an editable TipTap document. Per-context doc state is persisted as a last-writer-wins JSON blob via PluginAPI.persistDataSynced; task identity (title, done state, hierarchy) stays in NgRx and is reached through PluginAPI.updateTask and the ANY_TASK_UPDATE hook. It registers a work-context header button and embeds itself into the work-view embed slot added in the preceding commit. See docs/plans/2026-05-21-document-mode-tiptap-plugin.md for the full design. Squashed from the feat/doc-mode-v4 work; full per-step history is preserved in the archive/doc-mode-v4-full-history branch and the doc-mode-v4-pre-squash tag.
39 lines
1 KiB
JavaScript
39 lines
1 KiB
JavaScript
#!/usr/bin/env node
|
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const ROOT_DIR = path.join(__dirname, '..');
|
|
const DIST_DIR = path.join(ROOT_DIR, 'dist');
|
|
const TARGET_DIR = path.join(
|
|
ROOT_DIR,
|
|
'..',
|
|
'..',
|
|
'..',
|
|
'src',
|
|
'assets',
|
|
'bundled-plugins',
|
|
'document-mode',
|
|
);
|
|
|
|
// editor.js is inlined into index.html, so it doesn't need to be deployed.
|
|
const FILES = ['manifest.json', 'plugin.js', 'index.html', 'icon.svg'];
|
|
|
|
if (!fs.existsSync(DIST_DIR)) {
|
|
console.error('Error: dist directory not found. Run "npm run build" first.');
|
|
process.exit(1);
|
|
}
|
|
if (!fs.existsSync(TARGET_DIR)) {
|
|
fs.mkdirSync(TARGET_DIR, { recursive: true });
|
|
}
|
|
for (const file of FILES) {
|
|
const src = path.join(DIST_DIR, file);
|
|
const dest = path.join(TARGET_DIR, file);
|
|
if (fs.existsSync(src)) {
|
|
fs.copyFileSync(src, dest);
|
|
console.log(`✓ Copied ${file}`);
|
|
} else {
|
|
console.warn(`⚠ ${file} not found in dist`);
|
|
}
|
|
}
|
|
console.log(`\n✅ Deployed to ${TARGET_DIR}`);
|