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.
package/dist/scaffolder.js
CHANGED
|
@@ -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
|
-
//
|
|
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
|
|
79
|
-
|
|
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
|
-
|
|
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');
|