Files
smoothschedule/activepieces-fork/tools/scripts/move-pieces.js
poduck 3aa7199503 Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece
- Create integrations app with Activepieces service layer
- Add embed token endpoint for iframe integration
- Create Automations page with embedded workflow builder
- Add sidebar visibility fix for embed mode
- Add list inactive customers endpoint to Public API
- Include SmoothSchedule triggers: event created/updated/cancelled
- Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 22:59:37 -05:00

46 lines
1.6 KiB
JavaScript

const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
// Define the root folder path
const rootFolderPath = '/workspace/packages/pieces';
// Function to read project.json file and extract name attribute
function readProjectJson(folderPath) {
const projectJsonPath = path.join(folderPath, 'project.json');
const projectJson = JSON.parse(fs.readFileSync(projectJsonPath, 'utf8'));
const packageName = projectJson.name;
return packageName;
}
// Function to list packages/pieces in each folder
function listPackagesInFolders(folderPath) {
const folders = fs.readdirSync(folderPath, { withFileTypes: true })
.filter(dirent => dirent.isDirectory() && dirent.name !== 'community' && dirent.name !== 'custom')
.map(dirent => dirent.name);
const packages = folders.map(folder => {
const packagePath = path.join(folderPath, folder);
const packageName = readProjectJson(packagePath);
return { folder, packageName };
});
// Execute nx g move command
packages.forEach(({ folder, packageName }) => {
const destination = 'packages/pieces/community/' + folder;
const command = `nx g move --projectName=${packageName} --newProjectName=${packageName} --destination=${destination} --importPath=@activepieces/piece-${folder}`;
try{
execSync(command, { stdio: 'inherit' });
}catch(err){
console.log(err);
}
})
return packages;
}
// Call the function with the root folder path
const packagesInFolders = listPackagesInFolders(rootFolderPath);
console.log(packagesInFolders);