mirror of
https://github.com/obra/superpowers.git
synced 2026-04-17 19:43:49 +00:00
refactor: convert skills-core and plugin to pure ESM for module compatibility
This commit is contained in:
@@ -8,18 +8,14 @@
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import { createRequire } from 'module';
|
||||
import { fileURLToPath } from 'url';
|
||||
import * as skillsCore from '../../lib/skills-core.js';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
export const SuperpowersPlugin = async ({ project, client, $, directory, worktree }) => {
|
||||
const { z } = await import('zod');
|
||||
|
||||
// Load CommonJS skills-core using require inside the async function
|
||||
const require = createRequire(import.meta.url);
|
||||
const skillsCore = require(path.join(__dirname, '../../lib/skills-core.js'));
|
||||
|
||||
const homeDir = os.homedir();
|
||||
const superpowersSkillsDir = path.join(homeDir, '.config/opencode/superpowers/skills');
|
||||
const personalSkillsDir = path.join(homeDir, '.config/opencode/skills');
|
||||
|
||||
Reference in New Issue
Block a user