mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(plugin): better handle bundled plugins
This commit is contained in:
parent
472289d88e
commit
caa64775e5
7 changed files with 22 additions and 12 deletions
|
|
@ -4,7 +4,8 @@
|
|||
"app-builds/**/*",
|
||||
"dist/**",
|
||||
"node_modules/**/*",
|
||||
"src/app/t.const.ts"
|
||||
"src/app/t.const.ts",
|
||||
"src/assets/bundled-plugins/**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
|
|
|
|||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -90,4 +90,7 @@ electron-builder.win-store.yaml
|
|||
#
|
||||
perf-metrics-create-tasks.json
|
||||
perf-metrics-initial-load.json
|
||||
/packages/plugin-dev/procrastination-buster/procrastination-buster-v1.0.0.zip
|
||||
|
||||
|
||||
# bundled plugins (generated by build process)
|
||||
src/assets/bundled-plugins/**/*.*
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ async function buildPlugin(plugin) {
|
|||
|
||||
// Copy files to assets if not skipped
|
||||
if (!plugin.skipCopy) {
|
||||
const targetDir = path.join('src/assets', plugin.name);
|
||||
const targetDir = path.join('src/assets/bundled-plugins', plugin.name);
|
||||
await ensureDir(targetDir);
|
||||
|
||||
const filesToCopy = plugin.distFiles || plugin.files || [];
|
||||
|
|
|
|||
|
|
@ -6,7 +6,10 @@ const __filename = fileURLToPath(import.meta.url);
|
|||
const __dirname = path.dirname(__filename);
|
||||
|
||||
const distDir = path.join(__dirname, '../dist');
|
||||
const targetDir = path.join(__dirname, '../../../../src/assets/procrastination-buster');
|
||||
const targetDir = path.join(
|
||||
__dirname,
|
||||
'../../../../src/assets/bundled-plugins/procrastination-buster',
|
||||
);
|
||||
|
||||
// Read the HTML file
|
||||
const htmlPath = path.join(distDir, 'index.html');
|
||||
|
|
|
|||
|
|
@ -41,7 +41,10 @@ const plugins = [
|
|||
copyToAssets: true,
|
||||
buildCommand: async (pluginPath) => {
|
||||
// Copy to assets directory
|
||||
const targetDir = path.join(__dirname, '../../../src/assets/api-test-plugin');
|
||||
const targetDir = path.join(
|
||||
__dirname,
|
||||
'../../../src/assets/bundled-plugins/api-test-plugin',
|
||||
);
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
|
|
@ -93,7 +96,7 @@ const plugins = [
|
|||
// Copy to assets directory
|
||||
const targetDir = path.join(
|
||||
__dirname,
|
||||
'../../../src/assets/yesterday-tasks-plugin',
|
||||
'../../../src/assets/bundled-plugins/yesterday-tasks-plugin',
|
||||
);
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
|
|
|
|||
|
|
@ -90,10 +90,10 @@ export class PluginService implements OnDestroy {
|
|||
|
||||
private async _discoverBuiltInPlugins(): Promise<void> {
|
||||
const pluginPaths = [
|
||||
'assets/yesterday-tasks-plugin',
|
||||
'assets/bundled-plugins/yesterday-tasks-plugin',
|
||||
// 'assets/sync-md-plugin', // Disabled - not ready for prime time
|
||||
'assets/api-test-plugin',
|
||||
'assets/procrastination-buster',
|
||||
'assets/bundled-plugins/api-test-plugin',
|
||||
'assets/bundled-plugins/procrastination-buster',
|
||||
];
|
||||
|
||||
// Only load manifests for discovery
|
||||
|
|
@ -146,10 +146,10 @@ export class PluginService implements OnDestroy {
|
|||
|
||||
private async _loadBuiltInPlugins(): Promise<void> {
|
||||
const pluginPaths = [
|
||||
'assets/yesterday-tasks-plugin',
|
||||
'assets/bundled-plugins/yesterday-tasks-plugin',
|
||||
// 'assets/sync-md-plugin', // Disabled - not ready for prime time
|
||||
'assets/api-test-plugin',
|
||||
'assets/procrastination-buster',
|
||||
'assets/bundled-plugins/api-test-plugin',
|
||||
'assets/bundled-plugins/procrastination-buster',
|
||||
];
|
||||
|
||||
// KISS: No preloading - just load plugins directly
|
||||
|
|
|
|||
0
src/assets/bundled-plugins/.gitkeep
Normal file
0
src/assets/bundled-plugins/.gitkeep
Normal file
Loading…
Add table
Add a link
Reference in a new issue