Skip to content

Commit

Permalink
Merge pull request #172 from wp-graphql/refactor-plugins
Browse files Browse the repository at this point in the history
refactor: Refactor plugins
  • Loading branch information
josephfusco authored Jun 10, 2024
2 parents 428bca4 + 66f7e28 commit b36cdf4
Show file tree
Hide file tree
Showing 14 changed files with 357 additions and 144 deletions.
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

0 comments on commit b36cdf4

Please sign in to comment.