chore: 添加项目配置文件和测试脚本

- 添加CLAUDE.md项目指令文件
- 添加test-package.js用于测试抖音SDK包降级结果
This commit is contained in:
imeepos 2025-09-08 13:42:36 +08:00
parent 3d7370d73a
commit d5c4344ad3
2 changed files with 27 additions and 0 deletions

2
CLAUDE.md Normal file
View File

@ -0,0 +1,2 @@
包管理工具pnpm

25
test-package.js Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env node
console.log('测试降级后的 @open-dy/open_api_sdk@1.0.0 包...');
try {
console.log('1. 尝试导入包...');
const dyOpenAiSdk = require('@open-dy/open_api_credential');
console.log('✅ 2. 包导入成功!');
console.log('3. 包内容:', typeof dyOpenAiSdk);
console.log('4. 包属性:', Object.keys(dyOpenAiSdk || {}));
if (dyOpenAiSdk) {
console.log('✅ 包降级成功,可以正常导入');
}
} catch (error) {
console.error('❌ 包导入仍然失败:');
console.error('错误类型:', error.name);
console.error('错误消息:', error.message);
if (error.message.includes('Maximum call stack size exceeded')) {
console.log('\n❌ 1.0.0 版本仍有问题,建议尝试更早版本或寻找替代方案');
}
}
console.log('测试完成。');