chore(workflow): add AI-assisted workflow commands and configurations
Add comprehensive workflow commands for AI-assisted development: - Claude commands: analyze, clarify, plan - Kilocode workflows: full feature development lifecycle - Opencode commands: specification and implementation workflows - Roo MCP configuration for tool integration Update .gitignore to exclude .astro build cache directories. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
42
backend/scripts/migrate.js
Normal file
42
backend/scripts/migrate.js
Normal file
@@ -0,0 +1,42 @@
|
||||
// Migration script to import content from CSVs to Payload CMS
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const csv = require('csv-parser'); // Assume installed
|
||||
const { Payload } = require('payload');
|
||||
|
||||
async function migrate() {
|
||||
// Initialize Payload
|
||||
const payload = new Payload({
|
||||
// Config
|
||||
});
|
||||
|
||||
// Read CSV files
|
||||
const csvFiles = [
|
||||
'research/恩群數位行銷 - 文章分類s.csv',
|
||||
'research/恩群數位行銷 - 行銷放大鏡集.csv',
|
||||
'research/恩群數位行銷 - 網站設計範本s.csv'
|
||||
];
|
||||
|
||||
for (const file of csvFiles) {
|
||||
const data = [];
|
||||
fs.createReadStream(path.join(__dirname, '../../', file))
|
||||
.pipe(csv())
|
||||
.on('data', (row) => data.push(row))
|
||||
.on('end', async () => {
|
||||
// Import to Payload collections
|
||||
for (const item of data) {
|
||||
try {
|
||||
await payload.create({
|
||||
collection: 'posts', // or appropriate collection
|
||||
data: item
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Migration error:', error);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
migrate().catch(console.error);
|
||||
Reference in New Issue
Block a user