create-lionden 0.1.0
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/LICENSE +201 -0
- package/README.md +23 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +73 -0
- package/dist/index.js.map +1 -0
- package/dist/prompt.d.ts +8 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +43 -0
- package/dist/prompt.js.map +1 -0
- package/dist/scaffold.d.ts +24 -0
- package/dist/scaffold.d.ts.map +1 -0
- package/dist/scaffold.js +32 -0
- package/dist/scaffold.js.map +1 -0
- package/dist/templates.d.ts +20 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +401 -0
- package/dist/templates.js.map +1 -0
- package/package.json +33 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# create-lionden
|
|
2
|
+
|
|
3
|
+
Scaffolder for new LionDen projects.
|
|
4
|
+
|
|
5
|
+
Part of [LionDen](https://github.com/sealance-io/lionden), a Hardhat-inspired development framework for Aleo and Leo.
|
|
6
|
+
|
|
7
|
+
> **Pre-v1 notice:** LionDen is in active early development. All APIs are unstable and may change
|
|
8
|
+
> without notice between 0.x releases.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm create lionden@latest my-app -- --template hello-world
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Documentation, examples, and the issue tracker live in the
|
|
19
|
+
[LionDen repository](https://github.com/sealance-io/lionden).
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
[Apache-2.0](./LICENSE)
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IACnD,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* create-lionden — Interactive scaffolder for LionDen projects.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* npm create lionden my-project
|
|
6
|
+
* npm create lionden # prompts for name
|
|
7
|
+
* npm create lionden my-project --template token
|
|
8
|
+
*/
|
|
9
|
+
export { type ScaffoldOptions, type ScaffoldResult, scaffold } from "./scaffold.js";
|
|
10
|
+
export { getTemplate, getTemplateIds, TEMPLATES } from "./templates.js";
|
|
11
|
+
export declare function main(argv: string[]): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAkBxE,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmDxD"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* create-lionden — Interactive scaffolder for LionDen projects.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* npm create lionden my-project
|
|
6
|
+
* npm create lionden # prompts for name
|
|
7
|
+
* npm create lionden my-project --template token
|
|
8
|
+
*/
|
|
9
|
+
import { resolve } from "node:path";
|
|
10
|
+
import { ask, choose, closeReadline } from "./prompt.js";
|
|
11
|
+
import { scaffold } from "./scaffold.js";
|
|
12
|
+
import { getTemplate, getTemplateIds, TEMPLATES } from "./templates.js";
|
|
13
|
+
export { scaffold } from "./scaffold.js";
|
|
14
|
+
export { getTemplate, getTemplateIds, TEMPLATES } from "./templates.js";
|
|
15
|
+
function parseArgs(argv) {
|
|
16
|
+
let projectName;
|
|
17
|
+
let template;
|
|
18
|
+
for (let i = 0; i < argv.length; i++) {
|
|
19
|
+
const arg = argv[i];
|
|
20
|
+
if (arg === "--template" || arg === "-t") {
|
|
21
|
+
template = argv[++i];
|
|
22
|
+
}
|
|
23
|
+
else if (!arg.startsWith("-")) {
|
|
24
|
+
projectName = arg;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { projectName, template };
|
|
28
|
+
}
|
|
29
|
+
export async function main(argv) {
|
|
30
|
+
console.log("\n create-lionden — scaffold a new LionDen project\n");
|
|
31
|
+
const parsed = parseArgs(argv);
|
|
32
|
+
let projectName = parsed.projectName;
|
|
33
|
+
let templateId = parsed.template;
|
|
34
|
+
try {
|
|
35
|
+
// Prompt for project name if not provided
|
|
36
|
+
if (!projectName) {
|
|
37
|
+
projectName = await ask("Project name", "my-lionden-project");
|
|
38
|
+
}
|
|
39
|
+
if (!projectName) {
|
|
40
|
+
throw new Error("Project name is required.");
|
|
41
|
+
}
|
|
42
|
+
// Prompt for template if not provided
|
|
43
|
+
if (!templateId) {
|
|
44
|
+
const ids = getTemplateIds();
|
|
45
|
+
const descriptions = TEMPLATES.map((t) => `${t.id} — ${t.description}`);
|
|
46
|
+
const selected = await choose("Select a template:", descriptions);
|
|
47
|
+
templateId = ids[descriptions.indexOf(selected)] ?? ids[0];
|
|
48
|
+
}
|
|
49
|
+
const template = getTemplate(templateId);
|
|
50
|
+
if (!template) {
|
|
51
|
+
const valid = getTemplateIds().join(", ");
|
|
52
|
+
throw new Error(`Unknown template "${templateId}". Available: ${valid}`);
|
|
53
|
+
}
|
|
54
|
+
const projectDir = resolve(process.cwd(), projectName);
|
|
55
|
+
console.log(`\n Creating ${projectName} with template "${template.id}"...\n`);
|
|
56
|
+
const result = await scaffold({
|
|
57
|
+
projectDir,
|
|
58
|
+
projectName,
|
|
59
|
+
template,
|
|
60
|
+
});
|
|
61
|
+
console.log(` Created ${result.filesCreated} files in ${result.projectDir}\n`);
|
|
62
|
+
console.log(" Next steps:\n");
|
|
63
|
+
console.log(` cd ${projectName}`);
|
|
64
|
+
console.log(" npm install --ignore-scripts");
|
|
65
|
+
console.log(" npx lionden compile");
|
|
66
|
+
console.log(" npx lionden test");
|
|
67
|
+
console.log("");
|
|
68
|
+
}
|
|
69
|
+
finally {
|
|
70
|
+
closeReadline();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1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T,CAAC,CAAC;QAEH,OAAO,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,YAAY,aAAa,MAAM,CAAC,UAAU,IAAI,CAAC,CAAC;QAChF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,UAAU,WAAW,EAAE,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;QACvC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;YAAS,CAAC;QACT,aAAa,EAAE,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/prompt.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple interactive prompts using Node.js readline.
|
|
3
|
+
* No external dependencies needed.
|
|
4
|
+
*/
|
|
5
|
+
export declare function closeReadline(): void;
|
|
6
|
+
export declare function ask(question: string, defaultValue?: string): Promise<string>;
|
|
7
|
+
export declare function choose(question: string, choices: string[], defaultIndex?: number): Promise<string>;
|
|
8
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAO5E;AAED,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,SAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAc7F"}
|
package/dist/prompt.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple interactive prompts using Node.js readline.
|
|
3
|
+
* No external dependencies needed.
|
|
4
|
+
*/
|
|
5
|
+
import { createInterface } from "node:readline";
|
|
6
|
+
let rl = null;
|
|
7
|
+
function getReadline() {
|
|
8
|
+
if (!rl) {
|
|
9
|
+
rl = createInterface({
|
|
10
|
+
input: process.stdin,
|
|
11
|
+
output: process.stdout,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
return rl;
|
|
15
|
+
}
|
|
16
|
+
export function closeReadline() {
|
|
17
|
+
rl?.close();
|
|
18
|
+
rl = null;
|
|
19
|
+
}
|
|
20
|
+
export function ask(question, defaultValue) {
|
|
21
|
+
const suffix = defaultValue ? ` (${defaultValue})` : "";
|
|
22
|
+
return new Promise((resolve) => {
|
|
23
|
+
getReadline().question(`${question}${suffix}: `, (answer) => {
|
|
24
|
+
resolve(answer.trim() || defaultValue || "");
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export function choose(question, choices, defaultIndex = 0) {
|
|
29
|
+
const lines = choices.map((c, i) => ` ${i === defaultIndex ? ">" : " "} ${i + 1}. ${c}`);
|
|
30
|
+
const prompt = `${question}\n${lines.join("\n")}\n\nChoice (1-${choices.length}) [${defaultIndex + 1}]: `;
|
|
31
|
+
return new Promise((resolve) => {
|
|
32
|
+
getReadline().question(prompt, (answer) => {
|
|
33
|
+
const num = parseInt(answer.trim(), 10);
|
|
34
|
+
if (num >= 1 && num <= choices.length) {
|
|
35
|
+
resolve(choices[num - 1]);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
resolve(choices[defaultIndex]);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../src/prompt.ts"],"names":[],"mapp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AC,iBAAiB,OAAO,CAAC,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC;IAE1G,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;YACxC,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;YACxC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;gBACtC,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,CAAE,CAAC,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,OAAO,CAAC,YAAY,CAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project scaffolding — writes template files to disk.
|
|
3
|
+
*/
|
|
4
|
+
import { type Template } from "./templates.js";
|
|
5
|
+
export interface ScaffoldOptions {
|
|
6
|
+
/** Project directory (absolute or relative to cwd) */
|
|
7
|
+
projectDir: string;
|
|
8
|
+
/** Project name (used in package.json) */
|
|
9
|
+
projectName: string;
|
|
10
|
+
/** Template to use */
|
|
11
|
+
template: Template;
|
|
12
|
+
}
|
|
13
|
+
export interface ScaffoldResult {
|
|
14
|
+
/** Absolute path to the created project */
|
|
15
|
+
projectDir: string;
|
|
16
|
+
/** Number of files created */
|
|
17
|
+
filesCreated: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Scaffold a new LionDen project from a template.
|
|
21
|
+
* Creates the project directory and writes all template files.
|
|
22
|
+
*/
|
|
23
|
+
export declare function scaffold(options: ScaffoldOptions): Promise<ScaffoldResult>;
|
|
24
|
+
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAe,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5D,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAwBhF"}
|
package/dist/scaffold.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project scaffolding — writes template files to disk.
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
6
|
+
import { dirname, join } from "node:path";
|
|
7
|
+
import { sharedFiles } from "./templates.js";
|
|
8
|
+
/**
|
|
9
|
+
* Scaffold a new LionDen project from a template.
|
|
10
|
+
* Creates the project directory and writes all template files.
|
|
11
|
+
*/
|
|
12
|
+
export async function scaffold(options) {
|
|
13
|
+
const { projectDir, projectName, template } = options;
|
|
14
|
+
if (existsSync(projectDir)) {
|
|
15
|
+
const entries = (await import("node:fs")).readdirSync(projectDir);
|
|
16
|
+
if (entries.length > 0) {
|
|
17
|
+
throw new Error(`Directory "${projectDir}" already exists and is not empty.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
await mkdir(projectDir, { recursive: true });
|
|
21
|
+
// Collect all files: shared + template-specific
|
|
22
|
+
const allFiles = [...sharedFiles(projectName), ...template.files];
|
|
23
|
+
let filesCreated = 0;
|
|
24
|
+
for (const file of allFiles) {
|
|
25
|
+
const filePath = join(projectDir, file.path);
|
|
26
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
27
|
+
await writeFile(filePath, file.content, "utf-8");
|
|
28
|
+
filesCreated++;
|
|
29
|
+
}
|
|
30
|
+
return { projectDir, filesCreated };
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=scaffold.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../src/scaffold.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAiB,MAAM,gBAAgB,CAAC;AAkB5D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAwB;IACrD,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEtD,IAAI,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAClE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,cAAc,UAAU,oCAAoC,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAE7C,gDAAgD;IAChD,MAAM,QAAQ,GAAG,CAAC,GAAG,WAAW,CAAC,WAAW,CAAC,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElE,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;QAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7C,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,MAAM,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,YAAY,EAAE,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project templates for create-lionden.
|
|
3
|
+
* Each template defines the files to generate for a new LionDen project.
|
|
4
|
+
*/
|
|
5
|
+
export interface TemplateFile {
|
|
6
|
+
/** Relative path from project root */
|
|
7
|
+
readonly path: string;
|
|
8
|
+
/** File contents (with {{name}} placeholder for project name) */
|
|
9
|
+
readonly content: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Template {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly files: readonly TemplateFile[];
|
|
15
|
+
}
|
|
16
|
+
export declare function sharedFiles(projectName: string): TemplateFile[];
|
|
17
|
+
export declare const TEMPLATES: readonly Template[];
|
|
18
|
+
export declare function getTemplate(id: string): Template | undefined;
|
|
19
|
+
export declare function getTemplateIds(): string[];
|
|
20
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iEAAiE;IACjE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;CACzC;AAMD,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE,CAqF/D;AA8SD,eAAO,MAAM,SAAS,EAAE,SAAS,QAAQ,EAsBxC,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAE5D;AAED,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC"}
|
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project templates for create-lionden.
|
|
3
|
+
* Each template defines the files to generate for a new LionDen project.
|
|
4
|
+
*/
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Shared files (used by all templates)
|
|
7
|
+
// ---------------------------------------------------------------------------
|
|
8
|
+
export function sharedFiles(projectName) {
|
|
9
|
+
return [
|
|
10
|
+
{
|
|
11
|
+
path: "package.json",
|
|
12
|
+
content: JSON.stringify({
|
|
13
|
+
name: projectName,
|
|
14
|
+
version: "0.1.0",
|
|
15
|
+
private: true,
|
|
16
|
+
type: "module",
|
|
17
|
+
scripts: {
|
|
18
|
+
compile: "lionden compile",
|
|
19
|
+
test: "lionden test",
|
|
20
|
+
deploy: "lionden run scripts/deploy.ts",
|
|
21
|
+
node: "lionden node",
|
|
22
|
+
},
|
|
23
|
+
engines: {
|
|
24
|
+
node: "^20.19.0 || >=22.12.0",
|
|
25
|
+
},
|
|
26
|
+
devDependencies: {
|
|
27
|
+
"@lionden/cli": "^0.1.0",
|
|
28
|
+
"@lionden/config": "^0.1.0",
|
|
29
|
+
"@lionden/core": "^0.1.0",
|
|
30
|
+
"@lionden/network": "^0.1.0",
|
|
31
|
+
"@lionden/plugin-deploy": "^0.1.0",
|
|
32
|
+
"@lionden/plugin-leo": "^0.1.0",
|
|
33
|
+
"@lionden/plugin-network": "^0.1.0",
|
|
34
|
+
"@lionden/plugin-test": "^0.1.0",
|
|
35
|
+
"@lionden/testing": "^0.1.0",
|
|
36
|
+
tsx: "^4.0.0",
|
|
37
|
+
typescript: "^5.7.0",
|
|
38
|
+
vitest: "^4.0.0",
|
|
39
|
+
},
|
|
40
|
+
}, null, 2) + "\n",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
path: "tsconfig.json",
|
|
44
|
+
content: JSON.stringify({
|
|
45
|
+
compilerOptions: {
|
|
46
|
+
target: "ES2024",
|
|
47
|
+
module: "NodeNext",
|
|
48
|
+
moduleResolution: "NodeNext",
|
|
49
|
+
verbatimModuleSyntax: true,
|
|
50
|
+
strict: true,
|
|
51
|
+
skipLibCheck: true,
|
|
52
|
+
outDir: "dist",
|
|
53
|
+
declaration: true,
|
|
54
|
+
},
|
|
55
|
+
include: [
|
|
56
|
+
"typechain/**/*.ts",
|
|
57
|
+
"recipes/**/*.ts",
|
|
58
|
+
"test/**/*.ts",
|
|
59
|
+
"scripts/**/*.ts",
|
|
60
|
+
"lionden.config.ts",
|
|
61
|
+
],
|
|
62
|
+
}, null, 2) + "\n",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: ".gitignore",
|
|
66
|
+
content: `\
|
|
67
|
+
node_modules/
|
|
68
|
+
dist/
|
|
69
|
+
artifacts/
|
|
70
|
+
build/
|
|
71
|
+
typechain/
|
|
72
|
+
.cache/
|
|
73
|
+
.aleo/
|
|
74
|
+
*.tsbuildinfo
|
|
75
|
+
*.log
|
|
76
|
+
.env
|
|
77
|
+
.env.*
|
|
78
|
+
!.env.example
|
|
79
|
+
.DS_Store
|
|
80
|
+
`,
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
}
|
|
84
|
+
// ---------------------------------------------------------------------------
|
|
85
|
+
// hello-world template
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
const HELLO_CONFIG = `\
|
|
88
|
+
import { defineConfig } from "@lionden/config";
|
|
89
|
+
import pluginLeo from "@lionden/plugin-leo";
|
|
90
|
+
import pluginNetwork from "@lionden/plugin-network";
|
|
91
|
+
import pluginDeploy from "@lionden/plugin-deploy";
|
|
92
|
+
import pluginTest from "@lionden/plugin-test";
|
|
93
|
+
|
|
94
|
+
export default defineConfig({
|
|
95
|
+
plugins: [pluginLeo, pluginNetwork, pluginDeploy, pluginTest],
|
|
96
|
+
leoVersion: "4.3.2",
|
|
97
|
+
defaultNetwork: "devnode",
|
|
98
|
+
networks: {
|
|
99
|
+
devnode: { type: "devnode", autoBlock: true },
|
|
100
|
+
},
|
|
101
|
+
testing: { timeout: 120_000 },
|
|
102
|
+
});
|
|
103
|
+
`;
|
|
104
|
+
const HELLO_PROGRAM = `\
|
|
105
|
+
program hello.aleo {
|
|
106
|
+
@noupgrade
|
|
107
|
+
constructor() {}
|
|
108
|
+
|
|
109
|
+
/// Add two unsigned 32-bit integers.
|
|
110
|
+
fn main(a: u32, b: u32) -> u32 {
|
|
111
|
+
return a + b;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
`;
|
|
115
|
+
const HELLO_TEST = `\
|
|
116
|
+
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
117
|
+
import { setup, type TestContext } from "@lionden/testing";
|
|
118
|
+
import { createHello } from "../typechain/Hello.js";
|
|
119
|
+
|
|
120
|
+
const hello = createHello();
|
|
121
|
+
|
|
122
|
+
let ctx: TestContext | undefined;
|
|
123
|
+
|
|
124
|
+
beforeAll(async () => {
|
|
125
|
+
ctx = await setup();
|
|
126
|
+
try {
|
|
127
|
+
await ctx.deploy(hello);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
await ctx.teardown();
|
|
130
|
+
ctx = undefined;
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
afterAll(async () => {
|
|
136
|
+
await ctx?.teardown();
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
describe("hello program", () => {
|
|
140
|
+
beforeAll(() => {
|
|
141
|
+
hello.connect(ctx!.lre);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it("adds two numbers", async () => {
|
|
145
|
+
expect(await hello.main.locally(3, 5)).toBe(8);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
`;
|
|
149
|
+
const HELLO_DEPLOY = `\
|
|
150
|
+
import type { LionDenRuntimeEnvironment } from "@lionden/core";
|
|
151
|
+
|
|
152
|
+
export default async function (lre: LionDenRuntimeEnvironment) {
|
|
153
|
+
console.log("Compiling...");
|
|
154
|
+
await lre.tasks.run("compile");
|
|
155
|
+
|
|
156
|
+
console.log("Deploying hello.aleo...");
|
|
157
|
+
const results = await lre.tasks.run("deploy", { program: "hello" });
|
|
158
|
+
const deploy = (results as Array<{ programId: string; txId: string }>)[0]!;
|
|
159
|
+
console.log(\`Deployed \${deploy.programId} — tx: \${deploy.txId}\`);
|
|
160
|
+
}
|
|
161
|
+
`;
|
|
162
|
+
// ---------------------------------------------------------------------------
|
|
163
|
+
// token template
|
|
164
|
+
// ---------------------------------------------------------------------------
|
|
165
|
+
const TOKEN_RECIPE = `\
|
|
166
|
+
import type { DeploymentRecipe } from "@lionden/plugin-deploy";
|
|
167
|
+
import { createTokenContract } from "../typechain/Token.js";
|
|
168
|
+
|
|
169
|
+
export interface TokenSetupResult {
|
|
170
|
+
readonly programId: string;
|
|
171
|
+
readonly treasury: string;
|
|
172
|
+
readonly initialSupply: bigint;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const INITIAL_SUPPLY = 1_000_000n;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Deploy token.aleo and mint initial supply to the treasury.
|
|
179
|
+
*
|
|
180
|
+
* Run from CLI: lionden recipe --file recipes/setup.ts
|
|
181
|
+
* Run from tests: await setupToken(ctx) (TestContext satisfies DeploymentContext)
|
|
182
|
+
*
|
|
183
|
+
* Note: this recipe is intended for first-time deployment only. It passes
|
|
184
|
+
* noSkipDeployed so re-running it fails instead of reusing an existing
|
|
185
|
+
* token.aleo deployment and minting the initial supply again.
|
|
186
|
+
*/
|
|
187
|
+
export const setupToken: DeploymentRecipe<TokenSetupResult> = async (ctx) => {
|
|
188
|
+
const { deployer, treasury } = ctx.named.require({
|
|
189
|
+
deployer: "signer",
|
|
190
|
+
treasury: "address",
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
const token = createTokenContract().connect(ctx.lre);
|
|
194
|
+
await ctx.deploy(token, { noSkipDeployed: true });
|
|
195
|
+
|
|
196
|
+
await token.withSigner(deployer).mint_public.accepted(treasury, INITIAL_SUPPLY);
|
|
197
|
+
|
|
198
|
+
return { programId: token.programId, treasury: treasury.address, initialSupply: INITIAL_SUPPLY };
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export default setupToken;
|
|
202
|
+
`;
|
|
203
|
+
const TOKEN_CONFIG = `\
|
|
204
|
+
import { defineConfig } from "@lionden/config";
|
|
205
|
+
import pluginLeo from "@lionden/plugin-leo";
|
|
206
|
+
import pluginNetwork from "@lionden/plugin-network";
|
|
207
|
+
import pluginDeploy from "@lionden/plugin-deploy";
|
|
208
|
+
import pluginTest from "@lionden/plugin-test";
|
|
209
|
+
|
|
210
|
+
export default defineConfig({
|
|
211
|
+
plugins: [pluginLeo, pluginNetwork, pluginDeploy, pluginTest],
|
|
212
|
+
leoVersion: "4.3.2",
|
|
213
|
+
defaultNetwork: "devnode",
|
|
214
|
+
networks: {
|
|
215
|
+
devnode: { type: "devnode", autoBlock: true },
|
|
216
|
+
},
|
|
217
|
+
namedAccounts: {
|
|
218
|
+
deployer: {
|
|
219
|
+
default: 0,
|
|
220
|
+
// testnet: configVariable("DEPLOYER_KEY"),
|
|
221
|
+
},
|
|
222
|
+
treasury: {
|
|
223
|
+
default: "aleo1fagxe9lxaxektcnqfz4vpp0f9w7muxvwmrprepus8tve4h9fyyzq80pwu5",
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
testing: { timeout: 120_000 },
|
|
227
|
+
deploy: { confirmTransactions: true },
|
|
228
|
+
});
|
|
229
|
+
`;
|
|
230
|
+
const TOKEN_PROGRAM = `\
|
|
231
|
+
program token.aleo {
|
|
232
|
+
@noupgrade
|
|
233
|
+
constructor() {}
|
|
234
|
+
|
|
235
|
+
/// Public balances stored on-chain.
|
|
236
|
+
mapping balances: address => u64;
|
|
237
|
+
|
|
238
|
+
/// A private token record.
|
|
239
|
+
record Token {
|
|
240
|
+
owner: address,
|
|
241
|
+
amount: u64,
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/// Mint public tokens to a receiver.
|
|
245
|
+
fn mint_public(public receiver: address, public amount: u64) -> Final {
|
|
246
|
+
return final {
|
|
247
|
+
let current: u64 = balances.get_or_use(receiver, 0u64);
|
|
248
|
+
balances.set(receiver, current + amount);
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/// Transfer public tokens from signer to receiver.
|
|
253
|
+
fn transfer_public(public receiver: address, public amount: u64) -> Final {
|
|
254
|
+
let sender: address = self.signer;
|
|
255
|
+
return final {
|
|
256
|
+
let sender_balance: u64 = balances.get(sender);
|
|
257
|
+
assert(sender_balance >= amount);
|
|
258
|
+
balances.set(sender, sender_balance - amount);
|
|
259
|
+
|
|
260
|
+
let receiver_balance: u64 = balances.get_or_use(receiver, 0u64);
|
|
261
|
+
balances.set(receiver, receiver_balance + amount);
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/// Mint private tokens as a record.
|
|
266
|
+
fn mint_private(receiver: address, amount: u64) -> Token {
|
|
267
|
+
return Token {
|
|
268
|
+
owner: receiver,
|
|
269
|
+
amount: amount,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/// Transfer private tokens.
|
|
274
|
+
fn transfer_private(token: Token, receiver: address, amount: u64) -> (Token, Token) {
|
|
275
|
+
let remaining: u64 = token.amount - amount;
|
|
276
|
+
let to_receiver: Token = Token { owner: receiver, amount: amount };
|
|
277
|
+
let to_sender: Token = Token { owner: token.owner, amount: remaining };
|
|
278
|
+
return (to_receiver, to_sender);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
`;
|
|
282
|
+
const TOKEN_TEST = `\
|
|
283
|
+
import { describe, it, expect, beforeAll, afterAll } from "vitest";
|
|
284
|
+
import { setup, type TestContext } from "@lionden/testing";
|
|
285
|
+
import { createTokenContract } from "../typechain/Token.js";
|
|
286
|
+
import { setupToken } from "../recipes/setup.js";
|
|
287
|
+
|
|
288
|
+
let ctx: TestContext | undefined;
|
|
289
|
+
|
|
290
|
+
beforeAll(async () => {
|
|
291
|
+
ctx = await setup();
|
|
292
|
+
try {
|
|
293
|
+
await setupToken(ctx);
|
|
294
|
+
} catch (error) {
|
|
295
|
+
await ctx.teardown();
|
|
296
|
+
ctx = undefined;
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
afterAll(async () => {
|
|
302
|
+
await ctx?.teardown();
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
describe("token program", () => {
|
|
306
|
+
const token = createTokenContract();
|
|
307
|
+
|
|
308
|
+
beforeAll(() => {
|
|
309
|
+
token.connect(ctx!.lre);
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("recipe minted initial supply to treasury", async () => {
|
|
313
|
+
const treasury = ctx!.named.address("treasury");
|
|
314
|
+
expect(await token.mappings.balances.get(treasury)).toBe(1_000_000n);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
it("transfers public tokens from a different signer", async () => {
|
|
318
|
+
const account1 = ctx!.accounts[1]!;
|
|
319
|
+
const receiver = ctx!.accounts[2]!;
|
|
320
|
+
|
|
321
|
+
const balance1Before = await token.mappings.balances.getOrUse(account1, 0n);
|
|
322
|
+
|
|
323
|
+
// Mint tokens to account-1 (default signer is account-0)
|
|
324
|
+
await token.mint_public.accepted(account1, 5000n);
|
|
325
|
+
|
|
326
|
+
// transfer_public reads self.signer to determine the sender.
|
|
327
|
+
// withSigner switches the transaction signer to account-1.
|
|
328
|
+
await token.withSigner(account1).transfer_public.accepted(receiver, 2000n);
|
|
329
|
+
|
|
330
|
+
// account-1: +5000 (mint) -2000 (transfer) = +3000 delta
|
|
331
|
+
expect(await token.mappings.balances.get(account1)).toBe(balance1Before + 3000n);
|
|
332
|
+
});
|
|
333
|
+
|
|
334
|
+
it("mints private tokens as a typed Token record", async () => {
|
|
335
|
+
const receiver = ctx!.accounts[1]!;
|
|
336
|
+
const record = await token.mint_private.locally(receiver, 100n);
|
|
337
|
+
// Owner comes back with a \`.private\` visibility suffix on record outputs.
|
|
338
|
+
expect(record.owner.startsWith(receiver.address)).toBe(true);
|
|
339
|
+
expect(record.amount).toBe(100n);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
describe("named accounts", () => {
|
|
343
|
+
it("deployer resolves to a signable devnode account", () => {
|
|
344
|
+
const deployer = ctx!.named.signer("deployer");
|
|
345
|
+
expect(deployer.address).toMatch(/^aleo1/);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
it("treasury resolves to an address-only account", () => {
|
|
349
|
+
const treasury = ctx!.named.address("treasury");
|
|
350
|
+
expect(treasury.type).toBe("address-only");
|
|
351
|
+
});
|
|
352
|
+
});
|
|
353
|
+
});
|
|
354
|
+
`;
|
|
355
|
+
const TOKEN_DEPLOY = `\
|
|
356
|
+
import type { LionDenRuntimeEnvironment } from "@lionden/core";
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Deploy the token program and mint initial supply to the treasury.
|
|
360
|
+
* Usage: lionden run scripts/deploy.ts
|
|
361
|
+
*
|
|
362
|
+
* Targets lre.config.defaultNetwork. To select another configured network:
|
|
363
|
+
* lionden recipe --file recipes/setup.ts --network <name>
|
|
364
|
+
*/
|
|
365
|
+
export default async function (lre: LionDenRuntimeEnvironment) {
|
|
366
|
+
await lre.tasks.run("recipe", { file: "recipes/setup.ts" });
|
|
367
|
+
}
|
|
368
|
+
`;
|
|
369
|
+
// ---------------------------------------------------------------------------
|
|
370
|
+
// Template registry
|
|
371
|
+
// ---------------------------------------------------------------------------
|
|
372
|
+
export const TEMPLATES = [
|
|
373
|
+
{
|
|
374
|
+
id: "hello-world",
|
|
375
|
+
description: "A minimal Leo program with a single add function",
|
|
376
|
+
files: [
|
|
377
|
+
{ path: "lionden.config.ts", content: HELLO_CONFIG },
|
|
378
|
+
{ path: "programs/hello/main.leo", content: HELLO_PROGRAM },
|
|
379
|
+
{ path: "test/hello.test.ts", content: HELLO_TEST },
|
|
380
|
+
{ path: "scripts/deploy.ts", content: HELLO_DEPLOY },
|
|
381
|
+
],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: "token",
|
|
385
|
+
description: "A token program with mint, transfer, and balance mapping",
|
|
386
|
+
files: [
|
|
387
|
+
{ path: "lionden.config.ts", content: TOKEN_CONFIG },
|
|
388
|
+
{ path: "programs/token/main.leo", content: TOKEN_PROGRAM },
|
|
389
|
+
{ path: "recipes/setup.ts", content: TOKEN_RECIPE },
|
|
390
|
+
{ path: "test/token.test.ts", content: TOKEN_TEST },
|
|
391
|
+
{ path: "scripts/deploy.ts", content: TOKEN_DEPLOY },
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
];
|
|
395
|
+
export function getTemplate(id) {
|
|
396
|
+
return TEMPLATES.find((t) => t.id === id);
|
|
397
|
+
}
|
|
398
|
+
export function getTemplateIds() {
|
|
399
|
+
return TEMPLATES.map((t) => t.id);
|
|
400
|
+
}
|
|
401
|
+
//# sourceMappingURL=templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,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,OAAO,EAAE,UAAU,EAAE;YACnD,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE;SACrD;KACF;IACD;QACE,EAAE,EAAE,OAAO;QACX,WAAW,EAAE,0DAA0D;QACvE,KAAK,EAAE;YACL,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE;YACpD,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,EAAE,aAAa,EAAE;YAC3D,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE;YACnD,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,UAAU,EAAE;YACnD,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,YAAY,EAAE;SACrD;KACF;CACF,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,EAAU;IACpC,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-lionden",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/sealance-io/lionden.git",
|
|
9
|
+
"directory": "packages/create-lionden"
|
|
10
|
+
},
|
|
11
|
+
"engines": {
|
|
12
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"create-lionden": "./dist/bin.js"
|
|
16
|
+
},
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"!dist/**/*.test.*"
|
|
26
|
+
],
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "tsc --build"
|
|
32
|
+
}
|
|
33
|
+
}
|