create-mn-app 0.3.19 → 0.3.21
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 +54 -40
- package/dist/cli.js +13 -1
- package/dist/cli.js.map +1 -1
- package/dist/create-app.d.ts +3 -0
- package/dist/create-app.d.ts.map +1 -1
- package/dist/create-app.js +300 -102
- package/dist/create-app.js.map +1 -1
- package/dist/installers/package-installer.d.ts.map +1 -1
- package/dist/installers/package-installer.js.map +1 -1
- package/dist/utils/git-cloner.d.ts +2 -2
- package/dist/utils/git-cloner.d.ts.map +1 -1
- package/dist/utils/git-cloner.js +34 -13
- package/dist/utils/git-cloner.js.map +1 -1
- package/dist/utils/git-utils.d.ts.map +1 -1
- package/dist/utils/git-utils.js.map +1 -1
- package/dist/utils/setup-guide.d.ts +4 -14
- package/dist/utils/setup-guide.d.ts.map +1 -1
- package/dist/utils/setup-guide.js +50 -93
- package/dist/utils/setup-guide.js.map +1 -1
- package/dist/utils/templates.d.ts +27 -5
- package/dist/utils/templates.d.ts.map +1 -1
- package/dist/utils/templates.js +158 -2
- package/dist/utils/templates.js.map +1 -1
- package/package.json +18 -4
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Scaffold Midnight Network applications on Preprod.
|
|
|
10
10
|
## Quick Start
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npx create-mn-app my-app
|
|
13
|
+
npx create-mn-app@latest my-app
|
|
14
14
|
cd my-app
|
|
15
15
|
npm run setup
|
|
16
16
|
```
|
|
@@ -33,71 +33,85 @@ The `setup` command:
|
|
|
33
33
|
|
|
34
34
|
## Templates
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
Basic message storage contract demonstrating state management.
|
|
36
|
+
Templates are organized by category. The interactive flow guides you through category → template selection.
|
|
39
37
|
|
|
40
38
|
```bash
|
|
41
|
-
npx create-mn-app my-app
|
|
42
|
-
|
|
43
|
-
npm run setup # starts proof server, compiles, deploys
|
|
44
|
-
npm run cli # interact with deployed contract
|
|
39
|
+
npx create-mn-app@latest my-app # interactive: pick category then template
|
|
40
|
+
npx create-mn-app@latest my-app --list # list all templates grouped by category
|
|
45
41
|
```
|
|
46
42
|
|
|
47
|
-
###
|
|
43
|
+
### Contract
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
| Template | Description |
|
|
46
|
+
| -------- | ----------- |
|
|
47
|
+
| `hello-world` (default) | Basic message storage contract demonstrating state management |
|
|
50
48
|
|
|
51
49
|
```bash
|
|
52
|
-
npx create-mn-app my-app
|
|
50
|
+
npx create-mn-app@latest my-app
|
|
53
51
|
cd my-app
|
|
54
|
-
npm
|
|
55
|
-
#
|
|
52
|
+
npm run setup # starts proof server, compiles, deploys
|
|
53
|
+
npm run cli # interact with deployed contract
|
|
56
54
|
```
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
### Bulletin Board (Bboard)
|
|
56
|
+
### Full DApp
|
|
61
57
|
|
|
62
|
-
|
|
58
|
+
| Template | Description |
|
|
59
|
+
| -------- | ----------- |
|
|
60
|
+
| `counter` | Increment/decrement app with zkProofs ([source](https://github.com/midnightntwrk/example-counter)) |
|
|
61
|
+
| `bboard` | Multi-user bulletin board with privacy patterns ([source](https://github.com/midnightntwrk/example-bboard)) |
|
|
62
|
+
| `dex` | Decentralized exchange using FungibleToken *(coming soon)* |
|
|
63
|
+
| `midnight-kitties` | NFT-based full stack DApp *(coming soon)* |
|
|
63
64
|
|
|
64
65
|
```bash
|
|
65
|
-
npx create-mn-app my-app --template
|
|
66
|
-
|
|
67
|
-
npm install
|
|
68
|
-
# follow displayed instructions
|
|
66
|
+
npx create-mn-app@latest my-app --template counter
|
|
67
|
+
npx create-mn-app@latest my-app --template bboard
|
|
69
68
|
```
|
|
70
69
|
|
|
71
|
-
Requires Compact compiler
|
|
70
|
+
Requires Compact compiler — the CLI will check and offer to install it.
|
|
72
71
|
|
|
73
|
-
###
|
|
72
|
+
### Connector
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
- Midnight Kitties - NFT-based full stack DApp
|
|
74
|
+
Integration examples and patterns *(coming soon)*.
|
|
77
75
|
|
|
78
76
|
## Requirements
|
|
79
77
|
|
|
80
|
-
| Requirement | Version | Notes
|
|
81
|
-
| ---------------- | ------- |
|
|
82
|
-
| Node.js | 22+ | Required for all templates
|
|
83
|
-
| Docker | Latest | Runs proof server
|
|
84
|
-
| Compact Compiler | 0.
|
|
78
|
+
| Requirement | Version | Notes |
|
|
79
|
+
| ---------------- | ------- | -------------------------------------------------- |
|
|
80
|
+
| Node.js | 22+ | Required for all templates |
|
|
81
|
+
| Docker | Latest | Runs proof server |
|
|
82
|
+
| Compact Compiler | 0.28.0+ | Counter and Bboard templates (auto-install offered)|
|
|
85
83
|
|
|
86
84
|
## CLI Options
|
|
87
85
|
|
|
88
86
|
```bash
|
|
89
|
-
npx create-mn-app [project-name] [options]
|
|
87
|
+
npx create-mn-app@latest [project-name] [options]
|
|
90
88
|
```
|
|
91
89
|
|
|
92
|
-
| Option | Description
|
|
93
|
-
| ------------------------- |
|
|
94
|
-
| `-t, --template <name>` | Template: `hello-world`, `counter`
|
|
95
|
-
| `--
|
|
96
|
-
|
|
|
97
|
-
| `--
|
|
98
|
-
| `--
|
|
99
|
-
|
|
|
100
|
-
|
|
|
90
|
+
| Option | Description |
|
|
91
|
+
| ------------------------- | ---------------------------------------------------- |
|
|
92
|
+
| `-t, --template <name>` | Template: `hello-world`, `counter`, `bboard` |
|
|
93
|
+
| `--list` | List all available templates grouped by category |
|
|
94
|
+
| `-y, --yes` | Accept all defaults (non-interactive mode) |
|
|
95
|
+
| `--dry-run` | Preview what will be created without writing files |
|
|
96
|
+
| `--from <owner/repo>` | Create from a custom GitHub repository |
|
|
97
|
+
| `--use-npm/yarn/pnpm/bun` | Force package manager |
|
|
98
|
+
| `--skip-install` | Skip dependency installation |
|
|
99
|
+
| `--skip-git` | Skip git initialization |
|
|
100
|
+
| `--verbose` | Show detailed output |
|
|
101
|
+
| `-h, --help` | Show help |
|
|
102
|
+
| `-V, --version` | Show version |
|
|
103
|
+
|
|
104
|
+
### Non-Interactive / CI Mode
|
|
105
|
+
|
|
106
|
+
Use `-y` or set `CI=true` / `GITHUB_ACTIONS=true` to skip all prompts:
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
npx create-mn-app@latest my-app -y -t counter # defaults, no prompts
|
|
110
|
+
CI=true npx create-mn-app@latest my-app # auto-detected in CI
|
|
111
|
+
|
|
112
|
+
npx create-mn-app@latest my-app --dry-run # preview without writing files
|
|
113
|
+
npx create-mn-app@latest my-app --from user/repo # clone any GitHub repo
|
|
114
|
+
```
|
|
101
115
|
|
|
102
116
|
## Project Structure
|
|
103
117
|
|
package/dist/cli.js
CHANGED
|
@@ -55,6 +55,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
55
55
|
const update_notifier_1 = __importDefault(require("update-notifier"));
|
|
56
56
|
const create_app_1 = require("./create-app");
|
|
57
57
|
const error_handler_1 = require("./utils/error-handler");
|
|
58
|
+
const templates_1 = require("./utils/templates");
|
|
58
59
|
const path = __importStar(require("path"));
|
|
59
60
|
const fs = __importStar(require("fs"));
|
|
60
61
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "../package.json"), "utf-8"));
|
|
@@ -78,8 +79,19 @@ program
|
|
|
78
79
|
.option("--skip-install", "Skip package installation")
|
|
79
80
|
.option("--skip-git", "Skip git repository initialization")
|
|
80
81
|
.option("--verbose", "Show detailed output")
|
|
82
|
+
.option("--list", "List all available templates")
|
|
83
|
+
.option("-y, --yes", "Accept all defaults (non-interactive mode)")
|
|
84
|
+
.option("--dry-run", "Preview what will be created without writing files")
|
|
85
|
+
.option("--from <repo>", "Create from a custom GitHub repository (e.g., user/repo)")
|
|
81
86
|
.action(async (projectDirectory, options) => {
|
|
82
|
-
console.log(
|
|
87
|
+
console.log();
|
|
88
|
+
console.log(chalk_1.default.bgCyan(chalk_1.default.black(" create-mn-app ")) +
|
|
89
|
+
chalk_1.default.dim(` v${pkg.version}`));
|
|
90
|
+
console.log();
|
|
91
|
+
if (options.list) {
|
|
92
|
+
(0, templates_1.listTemplates)();
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
83
95
|
try {
|
|
84
96
|
await (0, create_app_1.createApp)(projectDirectory, options);
|
|
85
97
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA,sCAAsC;AACtC,yCAAyC;AACzC,sCAAsC;AACtC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,kDAAkD;AAClD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjC,yCAAoC;AACpC,kDAA0B;AAC1B,sEAA6C;AAC7C,6CAAyC;AACzC,yDAAqD;AACrD,2CAA6B;AAC7B,uCAAyB;AAEzB,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CACpB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,EAAE,OAAO,CAAC,CAClE,CAAC;AAEF,oBAAoB;AACpB,IAAA,yBAAc,EAAC,EAAE,GAAG,EAAE,mBAAmB,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;IACvE,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,2DAA2D;AAC3D,4BAAY,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAElC,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CAAC,2CAA2C,CAAC;KACxD,OAAO,CAAC,GAAG,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C,IAAI,EAAE,CAAC;QACjB,IAAA,yBAAa,GAAE,CAAC;QAChB,OAAO;IACT,CAAC;IAED,IAAI,CAAC;QACH,MAAM,IAAA,sBAAS,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,KAAK,CACX,4BAAY,CAAC,WAAW,CACtB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EACzD,cAAc,CACf,CACF,CAAC;QAEF,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,4BAAY,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;YAEpC,IAAI,OAAO,CAAC,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;gBACnC,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBACvC,OAAO,CAAC,KAAK,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/dist/create-app.d.ts
CHANGED
|
@@ -7,6 +7,9 @@ export interface CreateAppOptions {
|
|
|
7
7
|
skipInstall?: boolean;
|
|
8
8
|
skipGit?: boolean;
|
|
9
9
|
verbose?: boolean;
|
|
10
|
+
yes?: boolean;
|
|
11
|
+
dryRun?: boolean;
|
|
12
|
+
from?: string;
|
|
10
13
|
}
|
|
11
14
|
export declare function createApp(projectDirectory: string | undefined, options: CreateAppOptions): Promise<void>;
|
|
12
15
|
//# sourceMappingURL=create-app.d.ts.map
|
package/dist/create-app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create-app.d.ts","sourceRoot":"","sources":["../src/create-app.ts"],"names":[],"mappings":"AAoEA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAyBD,wBAAsB,SAAS,CAC7B,gBAAgB,EAAE,MAAM,GAAG,SAAS,EACpC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAqRf"}
|