Skip to content

Commit ecc5379

Browse files
authored
Merge pull request #5352 from NomicFoundation/example-project
Example project
2 parents 648e6d2 + ded63d5 commit ecc5379

File tree

9 files changed

+119
-8
lines changed

9 files changed

+119
-8
lines changed

.github/workflows/v-next-ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/checkout@v4
4848
- id: list
4949
run: |
50-
echo "packages=$(ls -d v-next/* | xargs -n 1 basename| jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
50+
echo "packages=$(ls -d v-next/* | xargs -n 1 basename | grep -v example-project | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
5151
5252
lint:
5353
needs: list-packages

pnpm-lock.yaml

+29-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/check-v-next-npm-scripts.js

+5
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ for (const dir of dirs) {
2020
continue;
2121
}
2222

23+
// Same with the example project, we don't use the same scripts
24+
if (dir.name === "example-project") {
25+
continue;
26+
}
27+
2328
const packageJsonPath = path.resolve(vNextDir, dir.name, "package.json");
2429
const packageJson = require(packageJsonPath);
2530

v-next/example-project/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Node modules
2+
/node_modules
3+
4+
# Compilation output
5+
/dist

v-next/example-project/LICENSE

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Nomic Foundation
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

v-next/example-project/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Hardhat example project
2+
3+
This is an example hardhat v3 project, which you can use to experiment with the developnment version.
4+
5+
To use it you have to `cd` into this folder and run:
6+
7+
```sh
8+
pnpm install
9+
pnpm build
10+
pnpm hardhat
11+
```
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { task, HardhatUserConfig } from "@nomicfoundation/hardhat/config";
2+
3+
export default {
4+
tasks: [
5+
task("hello", "Prints a greeting")
6+
.addNamedParameter({
7+
name: "greeting",
8+
description: "The greeting to print",
9+
defaultValue: "Hello, World!",
10+
})
11+
.setAction(async ({ greeting }, _) => {
12+
console.log(greeting);
13+
})
14+
.build(),
15+
],
16+
} satisfies HardhatUserConfig;

v-next/example-project/package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@nomicfoundation/example-project",
3+
"private": true,
4+
"version": "3.0.0",
5+
"description": "Example project using Hardhat v3",
6+
"homepage": "https://github.com/nomicfoundation/hardhat/tree/v-next/v-next/example-project",
7+
"repository": "github:nomicfoundation/hardhat",
8+
"author": "Nomic Foundation",
9+
"license": "MIT",
10+
"type": "module",
11+
"scripts": {
12+
"lint": "pnpm prettier --check",
13+
"lint:fix": "pnpm prettier --write",
14+
"prettier": "prettier \"**/*.{ts,js,md,json}\"",
15+
"build": "tsc --build .",
16+
"prepublishOnly": "pnpm build",
17+
"clean": "rimraf dist"
18+
},
19+
"devDependencies": {
20+
"@nomicfoundation/hardhat": "workspace:^3.0.0",
21+
"@types/node": "^20.0.0",
22+
"prettier": "3.2.5",
23+
"typescript": "~5.4.0"
24+
}
25+
}

v-next/example-project/tsconfig.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"extends": "../../config-v-next/tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "./dist",
5+
"composite": true,
6+
"incremental": true
7+
},
8+
"exclude": [
9+
"./dist",
10+
"./node_modules",
11+
"./test/fixture-projects/hardhat.config.ts"
12+
],
13+
"references": [
14+
{
15+
"path": "../hardhat"
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)