Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Refactor plugins #172

Merged
merged 16 commits into from
Jun 10, 2024
5 changes: 5 additions & 0 deletions .changeset/afraid-fishes-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"wpgraphql-ide": patch
---

- Remove npm workspaces and have webpack handle compiling of the main app and internal plugins.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ wpgraphql-ide.zip
/playwright-report/
/blob-report/
/playwright/.cache/
/@wpgraphql/
/@wpgraphql/

**/package-lock.json
24 changes: 24 additions & 0 deletions bin/start-plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

const { execSync } = require('child_process');
const path = require('path');
const glob = require('glob');

// Define the path to the plugins directory
const pluginsPath = path.resolve(__dirname, '../plugins');

// Use glob to find all plugin directories
const plugins = glob.sync(`${pluginsPath}/*`);

// Function to start a plugin using wp-scripts
const startPlugin = (plugin) => {
const pluginName = path.basename(plugin);
console.log(`Starting plugin: ${pluginName}`);
execSync('wp-scripts start', {
cwd: plugin,
stdio: 'inherit',
});
};

// Start each plugin
plugins.forEach(startPlugin);
File renamed without changes.
Loading
Loading