Skip to content

Commit 1fcf511

Browse files
authored
Merge pull request #61 from polkadot-developers/refactor/improvements
refactor: parachain template and PAPI improvements
2 parents 833fb48 + 6ec5312 commit 1fcf511

File tree

23 files changed

+666
-709
lines changed

23 files changed

+666
-709
lines changed

.github/workflows/test-sdk.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,15 @@ jobs:
295295
if: needs.check-changes.outputs.sdk_changed == 'true'
296296
run: cargo build --package cli --locked --verbose
297297

298-
- name: Test CLI - Valid recipe creation
298+
- name: Test CLI - Valid project creation
299299
if: needs.check-changes.outputs.sdk_changed == 'true'
300300
run: |
301301
cargo run --package cli --locked -- create --title "Testing CLI Validation" --skip-install --no-git --non-interactive
302-
if [ ! -f "recipes/pallets/testing-cli-validation/README.md" ]; then
302+
if [ ! -f "testing-cli-validation/README.md" ]; then
303303
echo "Error: Project was not created"
304304
exit 1
305305
fi
306-
rm -rf recipes/pallets/testing-cli-validation
306+
rm -rf testing-cli-validation
307307
308308
- name: Test CLI - Missing required title
309309
if: needs.check-changes.outputs.sdk_changed == 'true'

CONTRIBUTING.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,18 @@ Edit the generated files:
7474
### 4. Test Your Project
7575

7676
```bash
77-
# Test your project
77+
# Test from within the project directory
78+
cd my-project-name
79+
dot test
80+
81+
# Or specify the project path
7882
dot test my-project-name
83+
84+
# Run only Rust tests
85+
dot test --rust
86+
87+
# Run only TypeScript tests
88+
dot test --ts
7989
```
8090

8191
### 5. Submit as a Recipe
@@ -130,7 +140,10 @@ dot contract # Create a contract project
130140
dot parachain # Create a parachain project
131141

132142
# Testing and submission
133-
dot test # Test a project
143+
dot test # Test current directory project
144+
dot test <path> # Test specific project
145+
dot test --rust # Run only Rust tests
146+
dot test --ts # Run only TypeScript tests
134147
dot submit # Submit as pull request to cookbook
135148
```
136149

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@ curl -fsSL https://raw.githubusercontent.com/polkadot-developers/polkadot-cookbo
202202
# Create a new project (interactive mode)
203203
dot create
204204

205-
# Test your project
205+
# Test your project (from within project directory)
206+
dot test
207+
208+
# Or specify a path
206209
dot test my-pallet
207210

208211
# Submit your project as a recipe to the cookbook

docs/developers/cli-reference.md

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ dot create \
8989

9090
**What it Creates:**
9191

92-
**Parachain Recipe:**
92+
**Parachain Project:**
9393
```
94-
recipes/my-parachain/
94+
my-parachain/
9595
├── README.md # Tutorial documentation
9696
├── Cargo.toml # Workspace configuration
9797
├── rust-toolchain.toml # Rust version specification
@@ -101,22 +101,24 @@ recipes/my-parachain/
101101
├── runtime/ # Parachain runtime
102102
├── tests/ # PAPI integration tests
103103
├── scripts/ # Node management scripts
104-
└── zombienet-xcm.toml # Multi-parachain XCM testing
104+
├── dev_chain_spec.json # Development chain specification
105+
├── zombienet.toml # Parachain node network config
106+
└── zombienet-omni-node.toml # Omni-node network config
105107
```
106108

107-
**Pallet-Only Recipe:**
109+
**Pallet-Only Project:**
108110
```
109-
recipes/my-pallet/
111+
my-pallet/
110112
├── README.md # Pallet documentation
111113
├── Cargo.toml # Minimal workspace
112114
├── rust-toolchain.toml # Rust version
113115
└── pallets/ # Custom pallet only
114116
└── template/ # Template pallet with mock runtime
115117
```
116118

117-
**Contracts Recipe:**
119+
**Contracts Project:**
118120
```
119-
recipes/my-contract/
121+
my-contract/
120122
├── README.md # Contract documentation
121123
├── package.json # Hardhat dependencies
122124
├── hardhat.config.ts # Hardhat configuration
@@ -182,33 +184,46 @@ git config --global user.email "[email protected]"
182184

183185
### `test`
184186

185-
Run tests for a recipe.
187+
Run tests for a project.
186188

187189
**Usage:**
188190
```bash
189-
dot test <SLUG>
191+
dot test [PATH] [OPTIONS]
190192
```
191193

192194
**Arguments:**
193-
- `SLUG` - Recipe slug to test
195+
- `PATH` - Project path to test (defaults to current directory)
196+
197+
**Options:**
198+
- `--rust` - Run only Rust tests (cargo test)
199+
- `--ts` - Run only TypeScript tests (npm test)
194200

195201
**What it Does:**
196-
1. Detects recipe type (Rust, TypeScript, etc.)
197-
2. Runs appropriate test command
198-
3. Reports results
202+
1. Detects project type from `Cargo.toml` and/or `package.json`
203+
2. By default, runs both test suites if project has both
204+
3. Reports results for each test suite
199205

200206
**Examples:**
201207
```bash
202-
# Test specific recipe
203-
dot test basic-pallet
208+
# Test current directory (runs both Rust and TS tests if applicable)
209+
dot test
210+
211+
# Test specific project path
212+
dot test my-parachain
213+
214+
# Run only Rust tests
215+
dot test --rust
216+
217+
# Run only TypeScript tests
218+
dot test --ts
204219

205-
# Test current directory recipe
206-
dot test .
220+
# Combine path and flags
221+
dot test my-parachain --rust
207222
```
208223

209224
**Exit Codes:**
210-
- `0` - Tests passed
211-
- `1` - Tests failed
225+
- `0` - All tests passed
226+
- `1` - One or more tests failed
212227

213228
---
214229

0 commit comments

Comments
 (0)