feat: update Makelore modules and conversations
This commit is contained in:
@@ -10,37 +10,37 @@ afterEach(async () => {
|
||||
await Promise.all(temporaryDirectories.splice(0).map((directory) => rm(directory, { recursive: true, force: true })));
|
||||
});
|
||||
|
||||
async function createProjectConfig(templateId: string, superpowersEnabled?: boolean): Promise<string> {
|
||||
async function createProjectConfig(superpowersEnabled?: boolean): Promise<string> {
|
||||
const projectPath = await mkdtemp(path.join(tmpdir(), 'niancode-superpowers-plugin-'));
|
||||
temporaryDirectories.push(projectPath);
|
||||
await mkdir(path.join(projectPath, '.niancode'), { recursive: true });
|
||||
await writeFile(
|
||||
path.join(projectPath, '.niancode', 'project.json'),
|
||||
JSON.stringify({ templateId, ...(typeof superpowersEnabled === 'boolean' ? { superpowersEnabled } : {}) }),
|
||||
JSON.stringify({ schemaVersion: 1, ...(typeof superpowersEnabled === 'boolean' ? { superpowersEnabled } : {}) }),
|
||||
'utf8',
|
||||
);
|
||||
return projectPath;
|
||||
}
|
||||
|
||||
describe('bundled Superpowers plugin project gating', () => {
|
||||
it('uses the project setting and template fallback', async () => {
|
||||
const gamePath = await createProjectConfig('game-development');
|
||||
const standardPath = await createProjectConfig('standard-development');
|
||||
const explicitGamePath = await createProjectConfig('game-development', true);
|
||||
it('uses only the explicit project setting', async () => {
|
||||
const defaultPath = await createProjectConfig();
|
||||
const disabledPath = await createProjectConfig(false);
|
||||
const enabledPath = await createProjectConfig(true);
|
||||
|
||||
expect(isSuperpowersEnabledForDirectory(gamePath)).toBe(false);
|
||||
expect(isSuperpowersEnabledForDirectory(standardPath)).toBe(true);
|
||||
expect(isSuperpowersEnabledForDirectory(explicitGamePath)).toBe(true);
|
||||
expect(isSuperpowersEnabledForDirectory(defaultPath)).toBe(true);
|
||||
expect(isSuperpowersEnabledForDirectory(disabledPath)).toBe(false);
|
||||
expect(isSuperpowersEnabledForDirectory(enabledPath)).toBe(true);
|
||||
});
|
||||
|
||||
it('returns no hooks when a project disables Superpowers', async () => {
|
||||
const projectPath = await createProjectConfig('game-development', false);
|
||||
const projectPath = await createProjectConfig(false);
|
||||
|
||||
await expect(SuperpowersPlugin({ directory: projectPath })).resolves.toEqual({});
|
||||
});
|
||||
|
||||
it('registers the Skills path and bootstrap when a project enables Superpowers', async () => {
|
||||
const projectPath = await createProjectConfig('standard-development', true);
|
||||
const projectPath = await createProjectConfig(true);
|
||||
const hooks = await SuperpowersPlugin({ directory: projectPath });
|
||||
const config = { skills: { paths: [] as string[] } };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user