create-mn-app 0.3.12 → 0.3.13
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 +46 -89
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
# create-mn-app
|
|
2
2
|
|
|
3
|
-
Scaffold Midnight Network applications.
|
|
3
|
+
Scaffold Midnight Network applications on Preprod.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/create-mn-app)
|
|
6
6
|
[](https://www.npmjs.com/package/create-mn-app)
|
|
7
7
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
8
8
|
[](https://nodejs.org/)
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
**Recommended (no install needed):**
|
|
10
|
+
## Quick Start
|
|
13
11
|
|
|
14
12
|
```bash
|
|
15
13
|
npx create-mn-app my-app
|
|
@@ -17,80 +15,48 @@ cd my-app
|
|
|
17
15
|
npm run setup
|
|
18
16
|
```
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
The `setup` command:
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```
|
|
20
|
+
1. Starts proof server via Docker
|
|
21
|
+
2. Compiles the Compact contract
|
|
22
|
+
3. Deploys to Preprod (prompts for faucet funding)
|
|
26
23
|
|
|
27
|
-
>
|
|
24
|
+
> Fund your wallet at [faucet.preprod.midnight.network](https://faucet.preprod.midnight.network/)
|
|
28
25
|
|
|
29
26
|
## Why create-mn-app?
|
|
30
27
|
|
|
31
|
-
- **Zero Configuration
|
|
32
|
-
- **
|
|
33
|
-
- **
|
|
34
|
-
- **
|
|
35
|
-
- **
|
|
36
|
-
|
|
37
|
-
## Features
|
|
38
|
-
|
|
39
|
-
- **Interactive project setup** with template selection
|
|
40
|
-
- **Auto-detects package manager** (npm/yarn/pnpm/bun)
|
|
41
|
-
- **Smart dependency management**:
|
|
42
|
-
- Checks Node.js, Docker, and Compact compiler versions
|
|
43
|
-
- **Automatic Compact compiler updates** when version mismatch detected
|
|
44
|
-
- Prompts user before updating with clear explanations
|
|
45
|
-
- **TypeScript** with hot reloading
|
|
46
|
-
- **Pre-configured Compact contracts**
|
|
47
|
-
- **Secure wallet generation**
|
|
48
|
-
- **Environment health checks**
|
|
49
|
-
|
|
50
|
-
## Quick Start
|
|
51
|
-
|
|
52
|
-
### Interactive Mode
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx create-mn-app
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### CLI Mode
|
|
59
|
-
|
|
60
|
-
```bash
|
|
61
|
-
npx create-mn-app my-app --template hello-world
|
|
62
|
-
cd my-app
|
|
63
|
-
npm run setup
|
|
64
|
-
```
|
|
28
|
+
- **Zero Configuration** - Start building immediately
|
|
29
|
+
- **Preprod Ready** - Deploys to Midnight Preprod network
|
|
30
|
+
- **SDK 3.0** - Uses latest Midnight wallet and contract SDKs
|
|
31
|
+
- **One Command Setup** - Single `npm run setup` handles everything
|
|
32
|
+
- **Auto-updates** - Built-in notifier for new versions
|
|
65
33
|
|
|
66
34
|
## Templates
|
|
67
35
|
|
|
68
36
|
### Hello World (Default)
|
|
69
37
|
|
|
70
|
-
Basic message storage contract demonstrating state management
|
|
38
|
+
Basic message storage contract demonstrating state management.
|
|
71
39
|
|
|
72
40
|
```bash
|
|
73
41
|
npx create-mn-app my-app
|
|
42
|
+
cd my-app
|
|
43
|
+
npm run setup # starts proof server, compiles, deploys
|
|
44
|
+
npm run cli # interact with deployed contract
|
|
74
45
|
```
|
|
75
46
|
|
|
76
|
-
### Counter
|
|
47
|
+
### Counter
|
|
77
48
|
|
|
78
|
-
|
|
49
|
+
Increment/decrement counter with zkProofs. Cloned from [midnightntwrk/example-counter](https://github.com/midnightntwrk/example-counter).
|
|
79
50
|
|
|
80
51
|
```bash
|
|
81
52
|
npx create-mn-app my-app --template counter
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Cloned from [Midnight Network's example-counter](https://github.com/midnightntwrk/example-counter). Requires Node.js 22+, Docker, and Compact compiler.
|
|
85
|
-
|
|
86
|
-
After creation:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
53
|
cd my-app
|
|
90
54
|
npm install
|
|
91
|
-
#
|
|
55
|
+
# follow displayed instructions
|
|
92
56
|
```
|
|
93
57
|
|
|
58
|
+
Requires Compact compiler - the CLI will check and offer to install it.
|
|
59
|
+
|
|
94
60
|
### Coming Soon
|
|
95
61
|
|
|
96
62
|
- Bulletin Board - Multi-user interactions with privacy patterns
|
|
@@ -99,53 +65,45 @@ npm install
|
|
|
99
65
|
|
|
100
66
|
## Requirements
|
|
101
67
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
- Version compatibility checked before project creation
|
|
108
|
-
- Manual installation: See [Compact releases](https://github.com/midnightntwrk/compact/releases/latest)
|
|
68
|
+
| Requirement | Version | Notes |
|
|
69
|
+
| ---------------- | ------- | -------------------------------------------- |
|
|
70
|
+
| Node.js | 22+ | Required for all templates |
|
|
71
|
+
| Docker | Latest | Runs proof server |
|
|
72
|
+
| Compact Compiler | 0.23.0+ | Counter template only (auto-install offered) |
|
|
109
73
|
|
|
110
74
|
## CLI Options
|
|
111
75
|
|
|
112
76
|
```bash
|
|
113
77
|
npx create-mn-app [project-name] [options]
|
|
114
|
-
|
|
115
|
-
Options:
|
|
116
|
-
-t, --template <name> Template: hello-world, counter
|
|
117
|
-
--use-npm Use npm
|
|
118
|
-
--use-yarn Use Yarn
|
|
119
|
-
--use-pnpm Use pnpm
|
|
120
|
-
--use-bun Use bun
|
|
121
|
-
--skip-install Skip dependency installation
|
|
122
|
-
--skip-git Skip git initialization
|
|
123
|
-
--verbose Show detailed output
|
|
124
|
-
-h, --help Help
|
|
125
|
-
-V, --version Version
|
|
126
78
|
```
|
|
127
79
|
|
|
80
|
+
| Option | Description |
|
|
81
|
+
| ------------------------- | ---------------------------------- |
|
|
82
|
+
| `-t, --template <name>` | Template: `hello-world`, `counter` |
|
|
83
|
+
| `--use-npm/yarn/pnpm/bun` | Force package manager |
|
|
84
|
+
| `--skip-install` | Skip dependency installation |
|
|
85
|
+
| `--skip-git` | Skip git initialization |
|
|
86
|
+
| `--verbose` | Show detailed output |
|
|
87
|
+
| `-h, --help` | Show help |
|
|
88
|
+
| `-V, --version` | Show version |
|
|
89
|
+
|
|
128
90
|
## Project Structure
|
|
129
91
|
|
|
130
92
|
```
|
|
131
|
-
|
|
132
|
-
├──
|
|
133
|
-
│ └──
|
|
93
|
+
my-app/
|
|
94
|
+
├── contracts/
|
|
95
|
+
│ └── hello-world.compact # Compact smart contract
|
|
134
96
|
├── src/
|
|
135
|
-
│ ├── cli.ts
|
|
136
|
-
│ ├──
|
|
137
|
-
│
|
|
138
|
-
|
|
139
|
-
├── templates/
|
|
140
|
-
│ └── hello-world/ # Bundled template
|
|
97
|
+
│ ├── cli.ts # Interact with deployed contract
|
|
98
|
+
│ ├── deploy.ts # Deploy contract to Preprod
|
|
99
|
+
│ └── check-balance.ts # Check wallet balance
|
|
100
|
+
├── docker-compose.yml # Proof server config
|
|
141
101
|
├── package.json
|
|
142
|
-
└──
|
|
102
|
+
└── deployment.json # Generated after deploy (contains wallet seed)
|
|
143
103
|
```
|
|
144
104
|
|
|
145
105
|
## Contributing
|
|
146
106
|
|
|
147
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
148
|
-
|
|
149
107
|
1. Fork the repository
|
|
150
108
|
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
151
109
|
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
@@ -156,10 +114,9 @@ Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
156
114
|
|
|
157
115
|
- [Midnight Docs](https://docs.midnight.network)
|
|
158
116
|
- [Discord Community](https://discord.com/invite/midnightnetwork)
|
|
159
|
-
- [GitHub](https://github.com/
|
|
117
|
+
- [GitHub](https://github.com/midnightntwrk/create-mn-app)
|
|
118
|
+
- [Preprod Faucet](https://faucet.preprod.midnight.network/)
|
|
160
119
|
|
|
161
120
|
## License
|
|
162
121
|
|
|
163
122
|
Apache-2.0 © 2025 Midnight Foundation
|
|
164
|
-
|
|
165
|
-
See [LICENSE](LICENSE) for more information.
|