Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add curated extensions list as source of truth #155

Merged
merged 7 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.3.0",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-typescript": "11.1.0",
"@types/inquirer": "9.0.3",
"@types/ncp": "2.0.5",
Expand Down
3 changes: 2 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import typescript from "@rollup/plugin-typescript";
import autoExternal from "rollup-plugin-auto-external";
import json from "@rollup/plugin-json";

export default {
input: "src/cli.ts",
Expand All @@ -8,5 +9,5 @@ export default {
format: "es",
sourcemap: true,
},
plugins: [autoExternal(), typescript({ exclude: ["templates/**", "externalExtensions/**"] })],
plugins: [autoExternal(), typescript({ exclude: ["templates/**", "externalExtensions/**"] }), json()],
};
47 changes: 21 additions & 26 deletions src/curated-extensions.ts
Original file line number Diff line number Diff line change
@@ -1,30 +1,25 @@
import { ExternalExtension } from "./types";
import extensions from "./extensions.json";

const CURATED_EXTENSIONS: { [key: string]: ExternalExtension } = {
subgraph: {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "subgraph",
},
"eip-712": {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "eip-712",
},
ponder: {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "ponder",
},
onchainkit: {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "onchainkit",
},
"erc-20": {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "erc-20",
},
"eip-5792": {
repository: "https://github.com/scaffold-eth/create-eth-extensions",
branch: "eip-5792",
},
};
interface ExternalExtensionWithName extends ExternalExtension {
name: string;
}

const CURATED_EXTENSIONS: { [key: string]: ExternalExtension } = extensions
.map((extension: ExternalExtensionWithName) => {
return {
[extension.name]: {
repository: extension.repository,
branch: extension.branch,
description: extension.description,
installCommand: extension.installCommand,
builder: extension.builder,
coBuilders: extension.coBuilders,
},
};
})
.reduce((acc, extension) => {
return { ...acc, ...extension };
});

export { CURATED_EXTENSIONS };
67 changes: 67 additions & 0 deletions src/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
[
{
"name": "subgraph",
"description": "This Scaffold-ETH 2 extension helps you build and test subgraphs locally for your contracts. It also enables interaction with the front-end and facilitates easy deployment to Subgraph Studio.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "subgraph",
"installCommand": "npx create-eth@latest -e subgraph",
"builder": "0x1A2d838c4bbd1e73d162d0777d142c1d783Cb831",
"coBuilders": []
technophile-04 marked this conversation as resolved.
Show resolved Hide resolved
},
{
"name": "eip-712",
"description": "An implementation of EIP-712, allowing you to send, sign, and verify typed messages in a user-friendly manner.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "eip-712",
"installCommand": "npx create-eth@latest -e eip-712",
"builder": "0x1A2d838c4bbd1e73d162d0777d142c1d783Cb831",
"coBuilders": []
},
{
"name": "ponder",
"description": "This Scaffold-ETH 2 extension comes pre-configured with ponder.sh, providing an example to help you get started quickly.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "ponder",
"installCommand": "npx create-eth@latest -e ponder",
"builder": "0x5dCb5f4F39Caa6Ca25380cfc42280330b49d3c93",
"coBuilders": []
},
{
"name": "onchainkit",
"description": "This Scaffold-ETH 2 extension comes pre-configured with onchainkit, providing an example to help you get started quickly.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "onchainkit",
"installCommand": "npx create-eth@latest -e onchainkit",
"builder": "0x45334F41aAA464528CD5bc0F582acadC49Eb0Cd1",
"coBuilders": []
},
{
"name": "erc-20",
"description": "This extension introduces an ERC-20 token contract and demonstrates how to interact with it, including getting a holder balance and transferring tokens.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "erc-20",
"installCommand": "npx create-eth@latest -e erc-20",
"builder": "0x5dCb5f4F39Caa6Ca25380cfc42280330b49d3c93",
"coBuilders": [
"0x60583563D5879C2E59973E5718c7DE2147971807"
]
},
{
"name": "eip-5792",
"description": "This extension demonstrates on how to use EIP-5792 wallet capabilities. This EIP introduces new JSON-RPC methods for sending multiple calls from the user wallet, and checking their status",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "eip-5792",
"installCommand": "npx create-eth@latest -e eip-5792",
"builder": "0x1A2d838c4bbd1e73d162d0777d142c1d783Cb831",
"coBuilders": []
},
{
"name": "randao",
"description": "This extension shows how to use on-chain randomness using RANDAO for truly on-chain unpredictable random sources.",
"repository": "https://github.com/scaffold-eth/create-eth-extensions",
"branch": "randao",
"installCommand": "npx create-eth@latest -e randao",
"builder": "0x5dCb5f4F39Caa6Ca25380cfc42280330b49d3c93",
"coBuilders": []
}
]
4 changes: 4 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export type ExternalExtensionNameDev = string;
export type ExternalExtension = {
repository: string;
branch?: string | null;
description: string;
installCommand: string;
builder: string;
coBuilders: string[];
technophile-04 marked this conversation as resolved.
Show resolved Hide resolved
};

type BaseOptions = {
Expand Down
9 changes: 6 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"esModuleInterop": true,
"sourceMap": true,
"skipLibCheck": true,
"moduleResolution": "node"
"moduleResolution": "node",
"resolveJsonModule": true
},
"exclude": ["node_modules"]
}
"exclude": [
"node_modules"
]
}
38 changes: 38 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,20 @@ __metadata:
languageName: node
linkType: hard

"@rollup/plugin-json@npm:^6.1.0":
version: 6.1.0
resolution: "@rollup/plugin-json@npm:6.1.0"
dependencies:
"@rollup/pluginutils": ^5.1.0
peerDependencies:
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
checksum: cc018d20c80242a2b8b44fae61a968049cf31bb8406218187cc7cda35747616594e79452dd65722e7da6dd825b392e90d4599d43cd4461a02fefa2865945164e
languageName: node
linkType: hard

"@rollup/plugin-typescript@npm:11.1.0":
version: 11.1.0
resolution: "@rollup/plugin-typescript@npm:11.1.0"
Expand Down Expand Up @@ -474,6 +488,22 @@ __metadata:
languageName: node
linkType: hard

"@rollup/pluginutils@npm:^5.1.0":
version: 5.1.3
resolution: "@rollup/pluginutils@npm:5.1.3"
dependencies:
"@types/estree": ^1.0.0
estree-walker: ^2.0.2
picomatch: ^4.0.2
peerDependencies:
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
peerDependenciesMeta:
rollup:
optional: true
checksum: a6e9bac8ae94da39679dae390b53b43fe7a218f8fa2bfecf86e59be4da4ba02ac004f166daf55f03506e49108399394f13edeb62cce090f8cfc967b29f4738bf
languageName: node
linkType: hard

"@tootallnate/once@npm:2":
version: 2.0.0
resolution: "@tootallnate/once@npm:2.0.0"
Expand Down Expand Up @@ -1281,6 +1311,7 @@ __metadata:
dependencies:
"@changesets/cli": ^2.26.2
"@eslint/js": ^9.3.0
"@rollup/plugin-json": ^6.1.0
"@rollup/plugin-typescript": 11.1.0
"@types/inquirer": 9.0.3
"@types/ncp": 2.0.5
Expand Down Expand Up @@ -3759,6 +3790,13 @@ __metadata:
languageName: node
linkType: hard

"picomatch@npm:^4.0.2":
version: 4.0.2
resolution: "picomatch@npm:4.0.2"
checksum: a7a5188c954f82c6585720e9143297ccd0e35ad8072231608086ca950bee672d51b0ef676254af0788205e59bd4e4deb4e7708769226bed725bf13370a7d1464
languageName: node
linkType: hard

"pify@npm:^3.0.0":
version: 3.0.0
resolution: "pify@npm:3.0.0"
Expand Down
Loading