Skip to content

Commit

Permalink
working build
Browse files Browse the repository at this point in the history
  • Loading branch information
josephfusco committed Jun 7, 2024
1 parent a58b429 commit 10c2019
Show file tree
Hide file tree
Showing 14 changed files with 18,986 additions and 126 deletions.
25 changes: 25 additions & 0 deletions bin/build-plugins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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 build a plugin using wp-scripts
const buildPlugin = (plugin) => {
const pluginName = path.basename(plugin);
console.log(pluginName);
// console.log(`Building plugin: ${pluginName}`);
// execSync('wp-scripts build', {
// cwd: plugin,
// stdio: 'inherit',
// });
};

// Build each plugin
plugins.forEach(buildPlugin);
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.
17 changes: 17 additions & 0 deletions bin/zip-build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env node

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

// Define the path to the root build directory
const buildPath = path.resolve(__dirname, '../build');
const zipPath = path.resolve(__dirname, '../wpgraphql-ide.zip');

// Function to zip a directory
const zipDirectory = (source, out) => {
const zipCommand = `zip -r ${out} ${source}`;
execSync(zipCommand, { stdio: 'inherit' });
};

// Zip the root build directory
zipDirectory(buildPath, zipPath);
Loading

0 comments on commit 10c2019

Please sign in to comment.