create-fhevm-playground-pro 1.0.15 → 1.0.16

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.
@@ -6,6 +6,11 @@ const config = {
6
6
  sources: './contracts',
7
7
  tests: './test',
8
8
  artifacts: './artifacts'
9
+ },
10
+ mocha: {
11
+ require: ['ts-node/register'],
12
+ extensions: ['ts', 'js'],
13
+ timeout: 200000
9
14
  }
10
15
  };
11
16
 
@@ -72,21 +72,14 @@ async function createExample(options) {
72
72
  if (fs_extra_1.default.existsSync(testSrc)) {
73
73
  fs_extra_1.default.copySync(testSrc, testDest, { overwrite: true });
74
74
  console.log(chalk_1.default.cyan(`Overlaid tests from ${exampleDirName}-premium`));
75
- // Convert TypeScript test files to JavaScript for ESM compatibility
76
- const testFiles = fs_extra_1.default.readdirSync(testDest).filter(f => f.endsWith('.ts'));
75
+ // Fix import paths in test files for standalone projects
76
+ const testFiles = fs_extra_1.default.readdirSync(testDest).filter(f => f.endsWith('.ts') || f.endsWith('.js'));
77
77
  for (const testFile of testFiles) {
78
- const tsPath = path_1.default.join(testDest, testFile);
79
- const jsPath = path_1.default.join(testDest, testFile.replace('.ts', '.test.js'));
80
- let testContent = fs_extra_1.default.readFileSync(tsPath, 'utf-8');
81
- // Remove TypeScript type annotations and imports
82
- // Remove type annotations like : any, : type, etc.
83
- testContent = testContent.replace(/:\s*(\w+(<[^>]*>)?(\[\])?)/g, '');
78
+ const testPath = path_1.default.join(testDest, testFile);
79
+ let testContent = fs_extra_1.default.readFileSync(testPath, 'utf-8');
84
80
  // Replace absolute paths: ../../../../scripts/test-helpers -> ./test-helpers.js
85
81
  testContent = testContent.replace(/import\s+{([^}]+)}\s+from\s+"\.\.\/\.\.\/\.\.\/\.\.\/scripts\/test-helpers"/, 'import { $1 } from "./test-helpers.js"');
86
- // Write as .test.js
87
- fs_extra_1.default.writeFileSync(jsPath, testContent);
88
- // Remove original .ts file
89
- fs_extra_1.default.removeSync(tsPath);
82
+ fs_extra_1.default.writeFileSync(testPath, testContent);
90
83
  }
91
84
  // Create test-helpers.js stub if it doesn't exist
92
85
  const testHelpersPath = path_1.default.join(testDest, 'test-helpers.js');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fhevm-playground-pro",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "Premium scaffolding CLI for fhEVM Playground Pro – Zama bounty",
5
5
  "main": "dist/create-example.js",
6
6
  "bin": {