pdd-skills 3.1.7 → 3.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/init.js +42 -19
- package/package.json +1 -1
package/lib/init.js
CHANGED
|
@@ -32,26 +32,20 @@ const AI_TEST_DIRS = [
|
|
|
32
32
|
'test-result'
|
|
33
33
|
];
|
|
34
34
|
|
|
35
|
+
const AI_TEST_SOURCE_FILES = [
|
|
36
|
+
'tests/testcase-ai.py',
|
|
37
|
+
'tests/login_manager.py',
|
|
38
|
+
];
|
|
39
|
+
|
|
40
|
+
const AI_TEST_EXAMPLE_FILES = [
|
|
41
|
+
'testcases/examples/asset-eval-apply.yaml',
|
|
42
|
+
'testcases/examples/asset-eval-apply.env',
|
|
43
|
+
'testcases/examples/login-flow.yaml',
|
|
44
|
+
'testcases/examples/login-flow.env',
|
|
45
|
+
'testcases/examples/yaml-format-guide.md',
|
|
46
|
+
];
|
|
47
|
+
|
|
35
48
|
const AI_TEST_FILES = [
|
|
36
|
-
{ path: 'tests/testcase-ai.py', content: `#!/usr/bin/env python3
|
|
37
|
-
# -*- coding: utf-8 -*-
|
|
38
|
-
"""
|
|
39
|
-
AI Test Framework v2.0 - Main Entry Point
|
|
40
|
-
YAML-driven test execution engine with MCP browser automation.
|
|
41
|
-
Usage: python tests/testcase-ai.py testcases/<your-test>.yaml
|
|
42
|
-
"""
|
|
43
|
-
# This is a placeholder - copy from pdd-skills-v3/tests/testcase-ai.py
|
|
44
|
-
print("[AI Test Framework] Please copy testcase-ai.py and login_manager.py from source")
|
|
45
|
-
` },
|
|
46
|
-
{ path: 'tests/login_manager.py', content: `#!/usr/bin/env python3
|
|
47
|
-
# -*- coding: utf-8 -*-
|
|
48
|
-
"""
|
|
49
|
-
Login State Manager - Intelligent login detection and auto-switching.
|
|
50
|
-
Supports: state detection, user verification, auto-logout via dropdown menu.
|
|
51
|
-
"""
|
|
52
|
-
# This is a placeholder - copy from pdd-skills-v3/tests/login_manager.py
|
|
53
|
-
print("[LoginManager] Please copy from source project")
|
|
54
|
-
` },
|
|
55
49
|
{ path: 'tests/.env.test', content: `# ============================================================
|
|
56
50
|
# AI Test Framework - Environment Configuration
|
|
57
51
|
# ============================================================
|
|
@@ -504,6 +498,35 @@ export async function initProject(targetPath = '.', options = {}) {
|
|
|
504
498
|
console.log(chalk.gray(` [OK] ${file.path}`));
|
|
505
499
|
}
|
|
506
500
|
|
|
501
|
+
// Copy AI Test Framework source files (testcase-ai.py, login_manager.py)
|
|
502
|
+
const srcRoot = path.resolve(path.dirname(new URL(import.meta.url).pathname), '..');
|
|
503
|
+
console.log(chalk.blue('\n>> Copying AI Test source files...\n'));
|
|
504
|
+
for (const rel of AI_TEST_SOURCE_FILES) {
|
|
505
|
+
const srcPath = path.join(srcRoot, 'tests', path.basename(rel));
|
|
506
|
+
const dstPath = path.join(absolutePath, rel);
|
|
507
|
+
if (fs.existsSync(srcPath)) {
|
|
508
|
+
await fs.ensureDir(path.dirname(dstPath));
|
|
509
|
+
await fs.copyFile(srcPath, dstPath);
|
|
510
|
+
console.log(chalk.gray(` [OK] ${rel}`));
|
|
511
|
+
} else {
|
|
512
|
+
console.log(chalk.yellow(` [SKIP] ${rel} (source not found at ${srcPath})`));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// Copy example test cases and env files
|
|
517
|
+
console.log(chalk.blue('\n>> Copying example test cases...\n'));
|
|
518
|
+
for (const rel of AI_TEST_EXAMPLE_FILES) {
|
|
519
|
+
const srcPath = path.join(srcRoot, rel);
|
|
520
|
+
const dstPath = path.join(absolutePath, rel);
|
|
521
|
+
if (fs.existsSync(srcPath)) {
|
|
522
|
+
await fs.ensureDir(path.dirname(dstPath));
|
|
523
|
+
await fs.copyFile(srcPath, dstPath);
|
|
524
|
+
console.log(chalk.gray(` [OK] ${rel}`));
|
|
525
|
+
} else {
|
|
526
|
+
console.log(chalk.yellow(` [SKIP] ${rel} (source not found)`));
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
507
530
|
await copyOpenspecConfig(absolutePath);
|
|
508
531
|
await copyPrdTemplate(absolutePath);
|
|
509
532
|
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"pdd-skills","version":"3.1.
|
|
1
|
+
{"name":"pdd-skills","version":"3.1.9","type":"module","description":"PDD Skills - PRD驱动开发框架 | 41+技能: 核心(12)/专家(8)/熵减(4)/OpenSpec(10)/PR管理(7) | AI原生开发工作流 | Bug模式库(14) | PRD规则(30) | 4级门控引擎","main":"index.js","bin":{"pdd":"./bin/pdd.js","pdd-skills":"./bin/pdd.js"},"files":["bin/","lib/","skills/","templates/","scaffolds/","scripts/","config/","hooks/","docs/","index.js"],"scripts":{"start":"node bin/pdd.js","list":"node bin/pdd.js list","lint":"node bin/pdd.js linter --type code prd sql activiti","generate":"node bin/pdd.js generate","verify":"node bin/pdd.js verify","report":"node bin/pdd.js report","config":"node bin/pdd.js config --list","api":"node bin/pdd.js api","api:dev":"node bin/pdd.js api -p 3000 --cors","init":"node bin/pdd.js init","update":"node bin/pdd.js update","cso":"node bin/pdd.js cso","eval":"node bin/pdd.js eval","token":"node bin/pdd.js token","i18n":"node bin/pdd.js i18n"},"keywords":["pdd","prd-driven-development","ai","claude","skills","tdd","code-generation","linter","api-server","cli"],"author":"PDD Team","license":"MIT","engines":{"node":">=18.0.0"},"dependencies":{"chalk":"^5.3.0","commander":"^12.0.0","fs-extra":"^11.2.0","yaml":"^2.3.0"}}
|