create-ponder 0.0.11 → 0.0.12

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.
Files changed (2) hide show
  1. package/dist/src/index.js +11 -16
  2. package/package.json +2 -2
package/dist/src/index.js CHANGED
@@ -73,23 +73,18 @@ const run = async (options, overrides = {}) => {
73
73
  }
74
74
  `;
75
75
  (0, node_fs_1.writeFileSync)(node_path_1.default.join(ponderRootDir, `./handlers/index.ts`), prettier_1.default.format(handlerIndexFileContents, { parser: "typescript" }));
76
- // Write the ponder.config.js file.
77
- const finalPonderConfig = `const { graphqlPlugin } = require("@ponder/graphql");
76
+ // Write the ponder.ts file.
77
+ const finalPonderConfig = `
78
+ import type { PonderConfig } from "@ponder/core";
79
+ import { graphqlPlugin } from "@ponder/graphql";
78
80
 
79
- /**
80
- * @type {import('@ponder/core').PonderConfig}
81
- */
82
- const ponderConfig = {
83
- plugins: [graphqlPlugin()],
84
- database: {
85
- kind: "sqlite",
86
- },
87
- networks: ${JSON.stringify(ponderConfig.networks).replaceAll(/"process.env.PONDER_RPC_URL_(.*?)"/g, "process.env.PONDER_RPC_URL_$1")},
88
- sources: ${JSON.stringify(ponderConfig.sources)},
89
- };
90
-
91
- module.exports = ponderConfig;`;
92
- (0, node_fs_1.writeFileSync)(node_path_1.default.join(ponderRootDir, "ponder.config.js"), prettier_1.default.format(finalPonderConfig, { parser: "babel" }));
81
+ export const config: PonderConfig = {
82
+ plugins: [graphqlPlugin()],
83
+ networks: ${JSON.stringify(ponderConfig.networks).replaceAll(/"process.env.PONDER_RPC_URL_(.*?)"/g, "process.env.PONDER_RPC_URL_$1")},
84
+ sources: ${JSON.stringify(ponderConfig.sources)},
85
+ };
86
+ `;
87
+ (0, node_fs_1.writeFileSync)(node_path_1.default.join(ponderRootDir, "ponder.ts"), prettier_1.default.format(finalPonderConfig, { parser: "babel" }));
93
88
  // Write the .env.local file.
94
89
  const uniqueChainIds = Array.from(new Set(ponderConfig.networks.map((n) => n.chainId)));
95
90
  const envLocal = `${uniqueChainIds.map((chainId) => `PONDER_RPC_URL_${chainId}=""\n`)}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ponder",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "description": "Tool to bootstrap a Ponder project",
5
5
  "license": "MIT",
6
6
  "author": "olias.eth",
@@ -29,7 +29,7 @@
29
29
  "jest": "^29.3.1",
30
30
  "tsconfig-replace-paths": "^0.0.11",
31
31
  "typescript": "^4.5.5",
32
- "@ponder/core": "0.0.22"
32
+ "@ponder/core": "0.0.23"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "rm -rf dist && tsc && tsconfig-replace-paths --src . && mv dist/src/bin/create-ponder.js dist/src/bin/create-ponder",