create-fhevm-example 1.0.1
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/README.md +320 -0
- package/dist/config.d.ts +34 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +302 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +483 -0
- package/dist/index.js.map +1 -0
- package/dist/utils.d.ts +44 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +320 -0
- package/dist/utils.js.map +1 -0
- package/package.json +46 -0
package/dist/utils.js
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for creating FHEVM example projects
|
|
3
|
+
*/
|
|
4
|
+
import * as fs from "fs";
|
|
5
|
+
import * as path from "path";
|
|
6
|
+
import { spawn } from "child_process";
|
|
7
|
+
import { REPO_URL, REPO_BRANCH, TEMPLATE_SUBMODULE_PATH } from "./config.js";
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// File System Utilities
|
|
10
|
+
// =============================================================================
|
|
11
|
+
/**
|
|
12
|
+
* Get contract name from file path
|
|
13
|
+
*/
|
|
14
|
+
export function getContractName(contractPath) {
|
|
15
|
+
const match = contractPath.match(/([^/]+)\.sol$/);
|
|
16
|
+
return match ? match[1] : null;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Recursively copy directory
|
|
20
|
+
*/
|
|
21
|
+
export function copyDirectoryRecursive(src, dest) {
|
|
22
|
+
if (!fs.existsSync(dest)) {
|
|
23
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
24
|
+
}
|
|
25
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
26
|
+
for (const entry of entries) {
|
|
27
|
+
const srcPath = path.join(src, entry.name);
|
|
28
|
+
const destPath = path.join(dest, entry.name);
|
|
29
|
+
if (entry.isDirectory()) {
|
|
30
|
+
// Skip node_modules and .git
|
|
31
|
+
if (entry.name === "node_modules" || entry.name === ".git") {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
copyDirectoryRecursive(srcPath, destPath);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
fs.copyFileSync(srcPath, destPath);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// =============================================================================
|
|
42
|
+
// GitHub Repository Utilities
|
|
43
|
+
// =============================================================================
|
|
44
|
+
/**
|
|
45
|
+
* Download file from GitHub repository
|
|
46
|
+
*/
|
|
47
|
+
export async function downloadFileFromGitHub(filePath, outputPath) {
|
|
48
|
+
// Extract owner and repo from REPO_URL
|
|
49
|
+
const urlParts = REPO_URL.replace("https://github.com/", "").split("/");
|
|
50
|
+
const owner = urlParts[0];
|
|
51
|
+
const repo = urlParts[1];
|
|
52
|
+
const url = `https://raw.githubusercontent.com/${owner}/${repo}/${REPO_BRANCH}/${filePath}`;
|
|
53
|
+
const response = await fetch(url);
|
|
54
|
+
if (!response.ok) {
|
|
55
|
+
throw new Error(`Failed to download ${filePath}: ${response.statusText}`);
|
|
56
|
+
}
|
|
57
|
+
const content = await response.text();
|
|
58
|
+
// Ensure directory exists
|
|
59
|
+
const dir = path.dirname(outputPath);
|
|
60
|
+
if (!fs.existsSync(dir)) {
|
|
61
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
62
|
+
}
|
|
63
|
+
fs.writeFileSync(outputPath, content);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Clone template repository to temporary directory
|
|
67
|
+
*/
|
|
68
|
+
export async function cloneTemplate(tempDir) {
|
|
69
|
+
const templatePath = path.join(tempDir, "template");
|
|
70
|
+
return new Promise((resolve, reject) => {
|
|
71
|
+
const cloneUrl = `${REPO_URL}.git`;
|
|
72
|
+
const args = [
|
|
73
|
+
"clone",
|
|
74
|
+
"--depth=1",
|
|
75
|
+
"--branch",
|
|
76
|
+
REPO_BRANCH,
|
|
77
|
+
"--single-branch",
|
|
78
|
+
cloneUrl,
|
|
79
|
+
templatePath,
|
|
80
|
+
];
|
|
81
|
+
const child = spawn("git", args, {
|
|
82
|
+
stdio: "pipe",
|
|
83
|
+
});
|
|
84
|
+
let stderr = "";
|
|
85
|
+
child.stderr?.on("data", (data) => {
|
|
86
|
+
stderr += data.toString();
|
|
87
|
+
});
|
|
88
|
+
child.on("close", (code) => {
|
|
89
|
+
if (code === 0) {
|
|
90
|
+
resolve(templatePath);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
reject(new Error(`Git clone failed: ${stderr}`));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
child.on("error", reject);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Initialize git submodule for template
|
|
101
|
+
*/
|
|
102
|
+
export async function initSubmodule(repoPath) {
|
|
103
|
+
return new Promise((resolve, reject) => {
|
|
104
|
+
const child = spawn("git", ["submodule", "update", "--init", "--recursive", TEMPLATE_SUBMODULE_PATH], {
|
|
105
|
+
cwd: repoPath,
|
|
106
|
+
stdio: "pipe",
|
|
107
|
+
});
|
|
108
|
+
let stderr = "";
|
|
109
|
+
child.stderr?.on("data", (data) => {
|
|
110
|
+
stderr += data.toString();
|
|
111
|
+
});
|
|
112
|
+
child.on("close", (code) => {
|
|
113
|
+
if (code === 0) {
|
|
114
|
+
resolve();
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
reject(new Error(`Submodule init failed: ${stderr}`));
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
child.on("error", reject);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// =============================================================================
|
|
124
|
+
// Command Execution Utilities
|
|
125
|
+
// =============================================================================
|
|
126
|
+
/**
|
|
127
|
+
* Run a shell command
|
|
128
|
+
*/
|
|
129
|
+
export function runCommand(cmd, args, cwd) {
|
|
130
|
+
return new Promise((resolve, reject) => {
|
|
131
|
+
const child = spawn(cmd, args, {
|
|
132
|
+
cwd,
|
|
133
|
+
shell: true,
|
|
134
|
+
stdio: "pipe",
|
|
135
|
+
});
|
|
136
|
+
let stdout = "";
|
|
137
|
+
let stderr = "";
|
|
138
|
+
child.stdout?.on("data", (data) => {
|
|
139
|
+
stdout += data.toString();
|
|
140
|
+
});
|
|
141
|
+
child.stderr?.on("data", (data) => {
|
|
142
|
+
stderr += data.toString();
|
|
143
|
+
});
|
|
144
|
+
child.on("close", (code) => {
|
|
145
|
+
if (code === 0) {
|
|
146
|
+
resolve(stdout);
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
reject(new Error(stderr || stdout || `Command failed with code ${code}`));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
child.on("error", reject);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Extract test results from npm test output
|
|
157
|
+
*/
|
|
158
|
+
export function extractTestResults(output) {
|
|
159
|
+
const passingMatch = output.match(/(\d+)\s+passing/);
|
|
160
|
+
const failingMatch = output.match(/(\d+)\s+failing/);
|
|
161
|
+
if (passingMatch) {
|
|
162
|
+
const passing = passingMatch[1];
|
|
163
|
+
const failing = failingMatch ? failingMatch[1] : "0";
|
|
164
|
+
if (failing === "0") {
|
|
165
|
+
return `${passing} tests passing ✓`;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
return `${passing} passing, ${failing} failing`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
// =============================================================================
|
|
174
|
+
// README Generation
|
|
175
|
+
// =============================================================================
|
|
176
|
+
/**
|
|
177
|
+
* Generate README for single example project
|
|
178
|
+
*/
|
|
179
|
+
export function generateExampleReadme(exampleName, description, contractName) {
|
|
180
|
+
return `# ${contractName} - FHEVM Example
|
|
181
|
+
|
|
182
|
+
${description}
|
|
183
|
+
|
|
184
|
+
## Getting Started
|
|
185
|
+
|
|
186
|
+
### Prerequisites
|
|
187
|
+
|
|
188
|
+
- Node.js >= 20
|
|
189
|
+
- npm or yarn
|
|
190
|
+
|
|
191
|
+
### Installation
|
|
192
|
+
|
|
193
|
+
\`\`\`bash
|
|
194
|
+
npm install
|
|
195
|
+
\`\`\`
|
|
196
|
+
|
|
197
|
+
### Compile Contracts
|
|
198
|
+
|
|
199
|
+
\`\`\`bash
|
|
200
|
+
npm run compile
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
### Run Tests
|
|
204
|
+
|
|
205
|
+
\`\`\`bash
|
|
206
|
+
npm run test
|
|
207
|
+
\`\`\`
|
|
208
|
+
|
|
209
|
+
### Deploy
|
|
210
|
+
|
|
211
|
+
\`\`\`bash
|
|
212
|
+
npm run deploy
|
|
213
|
+
\`\`\`
|
|
214
|
+
|
|
215
|
+
## Project Structure
|
|
216
|
+
|
|
217
|
+
- \`contracts/\` - Solidity smart contracts
|
|
218
|
+
- \`test/\` - Test files
|
|
219
|
+
- \`deploy/\` - Deployment scripts
|
|
220
|
+
- \`hardhat.config.ts\` - Hardhat configuration
|
|
221
|
+
|
|
222
|
+
## Learn More
|
|
223
|
+
|
|
224
|
+
- [FHEVM Documentation](https://docs.zama.ai/fhevm)
|
|
225
|
+
- [Zama](https://www.zama.ai/)
|
|
226
|
+
- [More Examples](https://github.com/zama-ai/fhevm-examples)
|
|
227
|
+
|
|
228
|
+
## License
|
|
229
|
+
|
|
230
|
+
BSD-3-Clause-Clear
|
|
231
|
+
`;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Generate README for category project
|
|
235
|
+
*/
|
|
236
|
+
export function generateCategoryReadme(categoryName, description, contractNames) {
|
|
237
|
+
const contractList = contractNames.map((name) => `- ${name}`).join("\n");
|
|
238
|
+
return `# ${categoryName} - FHEVM Examples
|
|
239
|
+
|
|
240
|
+
${description}
|
|
241
|
+
|
|
242
|
+
## Included Contracts
|
|
243
|
+
|
|
244
|
+
${contractList}
|
|
245
|
+
|
|
246
|
+
## Getting Started
|
|
247
|
+
|
|
248
|
+
### Prerequisites
|
|
249
|
+
|
|
250
|
+
- Node.js >= 20
|
|
251
|
+
- npm or yarn
|
|
252
|
+
|
|
253
|
+
### Installation
|
|
254
|
+
|
|
255
|
+
\`\`\`bash
|
|
256
|
+
npm install
|
|
257
|
+
\`\`\`
|
|
258
|
+
|
|
259
|
+
### Compile Contracts
|
|
260
|
+
|
|
261
|
+
\`\`\`bash
|
|
262
|
+
npm run compile
|
|
263
|
+
\`\`\`
|
|
264
|
+
|
|
265
|
+
### Run Tests
|
|
266
|
+
|
|
267
|
+
\`\`\`bash
|
|
268
|
+
npm run test
|
|
269
|
+
\`\`\`
|
|
270
|
+
|
|
271
|
+
### Deploy
|
|
272
|
+
|
|
273
|
+
\`\`\`bash
|
|
274
|
+
npm run deploy
|
|
275
|
+
\`\`\`
|
|
276
|
+
|
|
277
|
+
## Project Structure
|
|
278
|
+
|
|
279
|
+
- \`contracts/\` - Solidity smart contracts
|
|
280
|
+
- \`test/\` - Test files
|
|
281
|
+
- \`deploy/\` - Deployment scripts
|
|
282
|
+
- \`hardhat.config.ts\` - Hardhat configuration
|
|
283
|
+
|
|
284
|
+
## Learn More
|
|
285
|
+
|
|
286
|
+
- [FHEVM Documentation](https://docs.zama.ai/fhevm)
|
|
287
|
+
- [Zama](https://www.zama.ai/)
|
|
288
|
+
- [More Examples](https://github.com/zama-ai/fhevm-examples)
|
|
289
|
+
|
|
290
|
+
## License
|
|
291
|
+
|
|
292
|
+
BSD-3-Clause-Clear
|
|
293
|
+
`;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Generate deploy script
|
|
297
|
+
*/
|
|
298
|
+
export function generateDeployScript(contractName) {
|
|
299
|
+
return `import { DeployFunction } from "hardhat-deploy/types";
|
|
300
|
+
import { HardhatRuntimeEnvironment } from "hardhat/types";
|
|
301
|
+
|
|
302
|
+
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
|
|
303
|
+
const { deployer } = await hre.getNamedAccounts();
|
|
304
|
+
const { deploy } = hre.deployments;
|
|
305
|
+
|
|
306
|
+
const deployed = await deploy("${contractName}", {
|
|
307
|
+
from: deployer,
|
|
308
|
+
args: [],
|
|
309
|
+
log: true,
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
console.log(\`${contractName} contract deployed at: \${deployed.address}\`);
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
export default func;
|
|
316
|
+
func.id = "deploy_${contractName.toLowerCase()}";
|
|
317
|
+
func.tags = ["${contractName}"];
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAE7E,gFAAgF;AAChF,wBAAwB;AACxB,gFAAgF;AAEhF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,YAAoB;IAClD,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,IAAY;IAC9D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACzB,EAAE,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,OAAO,GAA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version": "1.0.1",
|
|
4
|
+
"description": "Create FHEVM example projects with a single command",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"create-fhevm-example": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"dev": "tsc --watch",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"fhevm",
|
|
19
|
+
"zama",
|
|
20
|
+
"encryption",
|
|
21
|
+
"blockchain",
|
|
22
|
+
"examples",
|
|
23
|
+
"cli",
|
|
24
|
+
"create",
|
|
25
|
+
"scaffold"
|
|
26
|
+
],
|
|
27
|
+
"author": "Zama",
|
|
28
|
+
"license": "BSD-3-Clause-Clear",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=20"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/NecipAkgz/fhevm-example-factory/tree/main/packages/create-fhevm-example#readme",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/NecipAkgz/fhevm-example-factory",
|
|
36
|
+
"directory": "packages/create-fhevm-example"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@clack/prompts": "^0.11.0",
|
|
40
|
+
"picocolors": "^1.1.1"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@types/node": "^20.19.8",
|
|
44
|
+
"typescript": "^5.8.3"
|
|
45
|
+
}
|
|
46
|
+
}
|