create-fhevm-playground-pro 1.0.17 → 1.0.19

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.
@@ -0,0 +1,6 @@
1
+ {
2
+ "require": ["ts-node/register"],
3
+ "extensions": ["ts"],
4
+ "spec": "test/**/*.test.ts",
5
+ "timeout": 200000
6
+ }
@@ -1,4 +1,5 @@
1
1
  require('@nomicfoundation/hardhat-toolbox');
2
+ require('ts-node/register');
2
3
 
3
4
  const config = {
4
5
  solidity: '0.8.24',
@@ -8,6 +9,9 @@ const config = {
8
9
  artifacts: './artifacts'
9
10
  },
10
11
  mocha: {
12
+ require: ['ts-node/register'],
13
+ extensions: ['js'],
14
+ spec: 'test/**/*.test.js',
11
15
  timeout: 200000
12
16
  }
13
17
  };
@@ -70,17 +70,22 @@ async function createExample(options) {
70
70
  console.log(chalk_1.default.cyan(`Overlaid contracts from ${exampleDirName}-premium`));
71
71
  }
72
72
  if (fs_extra_1.default.existsSync(testSrc)) {
73
- fs_extra_1.default.copySync(testSrc, testDest, { overwrite: true });
74
- console.log(chalk_1.default.cyan(`Overlaid tests from ${exampleDirName}-premium`));
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
- for (const testFile of testFiles) {
78
- const testPath = path_1.default.join(testDest, testFile);
79
- let testContent = fs_extra_1.default.readFileSync(testPath, 'utf-8');
80
- // Replace absolute paths: ../../../../scripts/test-helpers -> ./test-helpers.js
81
- testContent = testContent.replace(/import\s+{([^}]+)}\s+from\s+"\.\.\/\.\.\/\.\.\/\.\.\/scripts\/test-helpers"/, 'import { $1 } from "./test-helpers.js"');
82
- fs_extra_1.default.writeFileSync(testPath, testContent);
73
+ // Copy tests directory content
74
+ const testFiles = fs_extra_1.default.readdirSync(testSrc);
75
+ for (const file of testFiles) {
76
+ const srcPath = path_1.default.join(testSrc, file);
77
+ if (fs_extra_1.default.statSync(srcPath).isFile()) {
78
+ const destPath = path_1.default.join(testDest, file);
79
+ // Convert .ts to .js (rename extension)
80
+ const destFileName = file.endsWith('.ts') ? file.replace('.ts', '.js') : file;
81
+ const finalDestPath = path_1.default.join(testDest, destFileName);
82
+ let content = fs_extra_1.default.readFileSync(srcPath, 'utf-8');
83
+ // Fix import paths in test files
84
+ content = content.replace(/import\s+{([^}]+)}\s+from\s+"\.\.\/\.\.\/\.\.\/\.\.\/scripts\/test-helpers"/, 'import { $1 } from "./test-helpers.js"');
85
+ fs_extra_1.default.writeFileSync(finalDestPath, content);
86
+ }
83
87
  }
88
+ console.log(chalk_1.default.cyan(`Overlaid tests from ${exampleDirName}-premium`));
84
89
  // Create test-helpers.js stub if it doesn't exist
85
90
  const testHelpersPath = path_1.default.join(testDest, 'test-helpers.js');
86
91
  if (!fs_extra_1.default.existsSync(testHelpersPath)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fhevm-playground-pro",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "description": "Premium scaffolding CLI for fhEVM Playground Pro – Zama bounty",
5
5
  "main": "dist/create-example.js",
6
6
  "bin": {