create-fhevm-playground-pro 1.0.4 → 1.0.5

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.
Files changed (2) hide show
  1. package/dist/scaffolder.js +14 -4
  2. package/package.json +1 -1
@@ -41,15 +41,25 @@ async function createExample(options) {
41
41
  }
42
42
  // Try to find the actual example in central-repo/examples/[category]-premium/
43
43
  const exampleDirName = CATEGORY_TO_EXAMPLE_DIR[options.category] || options.category;
44
- const centralRepoExampleDir = path_1.default.resolve(__dirname, '..', '..', '..', 'central-repo', 'examples', `${exampleDirName}-premium`);
44
+ // Look for central-repo in multiple locations (relative to cwd or parent dirs)
45
+ let centralRepoExampleDir = null;
46
+ const searchPaths = [
47
+ path_1.default.resolve(process.cwd(), 'central-repo', 'examples', `${exampleDirName}-premium`),
48
+ path_1.default.resolve(process.cwd(), '..', 'central-repo', 'examples', `${exampleDirName}-premium`),
49
+ path_1.default.resolve(process.cwd(), '..', '..', 'central-repo', 'examples', `${exampleDirName}-premium`),
50
+ ];
51
+ for (const searchPath of searchPaths) {
52
+ if (fs_extra_1.default.existsSync(searchPath)) {
53
+ centralRepoExampleDir = searchPath;
54
+ break;
55
+ }
56
+ }
45
57
  let srcTemplate;
46
- if (fs_extra_1.default.existsSync(centralRepoExampleDir)) {
47
- // Use the actual example from central-repo
58
+ if (centralRepoExampleDir) {
48
59
  srcTemplate = centralRepoExampleDir;
49
60
  console.log(chalk_1.default.cyan(`Using example from ${exampleDirName}-premium`));
50
61
  }
51
62
  else {
52
- // Fall back to base-template (for npm published users)
53
63
  srcTemplate = path_1.default.resolve(__dirname, '..', 'base-template');
54
64
  if (!fs_extra_1.default.existsSync(srcTemplate)) {
55
65
  throw new Error('base-template not found in package. Ensure base-template/ is published.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fhevm-playground-pro",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Premium scaffolding CLI for fhEVM Playground Pro – Zama bounty",
5
5
  "main": "dist/create-example.js",
6
6
  "bin": {