create-fhevm-playground-pro 1.0.15 → 1.0.17

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,9 @@ const config = {
6
6
  sources: './contracts',
7
7
  tests: './test',
8
8
  artifacts: './artifacts'
9
+ },
10
+ mocha: {
11
+ timeout: 200000
9
12
  }
10
13
  };
11
14
 
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "fhEVM-example-template",
3
3
  "version": "0.1.0",
4
- "type": "module",
5
4
  "description": "Base template for fhEVM example projects",
6
5
  "scripts": {
7
6
  "test": "hardhat test",
@@ -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');
@@ -122,8 +115,8 @@ export function isMockedMode() {
122
115
  else {
123
116
  console.log(chalk_1.default.yellow(`Example ${exampleDirName} not found; using base template contracts/tests`));
124
117
  }
125
- // Ensure only hardhat.config.cjs exists (remove .ts, .js variants for ESM compatibility)
126
- const hardhatConfigFiles = ['hardhat.config.ts', 'hardhat.config.js'];
118
+ // Ensure only hardhat.config.js exists (remove .ts, .cjs variants)
119
+ const hardhatConfigFiles = ['hardhat.config.ts', 'hardhat.config.cjs'];
127
120
  for (const configFile of hardhatConfigFiles) {
128
121
  const configPath = path_1.default.join(projectDir, configFile);
129
122
  if (fs_extra_1.default.existsSync(configPath)) {
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.17",
4
4
  "description": "Premium scaffolding CLI for fhEVM Playground Pro – Zama bounty",
5
5
  "main": "dist/create-example.js",
6
6
  "bin": {