@deployoor/hardhat 0.1.0 → 0.1.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @deployoor/hardhat
2
2
 
3
- > A [Hardhat](https://hardhat.org) plugin that regenerates [deployoor](../deployoor)'s typed deployers automatically after every `hardhat compile`.
3
+ > A [Hardhat](https://hardhat.org) plugin that regenerates [deployoor](https://www.npmjs.com/package/deployoor)'s typed deployers automatically after every `hardhat compile`.
4
4
 
5
5
  Without it, the flow is two steps — `hardhat compile` then `deployoor generate`. With it, `hardhat compile` runs `deployoor generate` in process the moment fresh `artifacts/` are written: no extra terminal, no separate command, no stale deployers. Edit a contract, compile, and the typed `getOrDeploy<Name>` functions are already up to date.
6
6
 
package/dist/index.cjs CHANGED
@@ -1,7 +1,6 @@
1
1
  let hardhat_config_js = require("hardhat/config.js");
2
2
  let hardhat_builtin_tasks_task_names_js = require("hardhat/builtin-tasks/task-names.js");
3
3
  let deployoor_generate = require("deployoor/generate");
4
- require("hardhat/types/config.js");
5
4
  //#region src/runner.ts
6
5
  /**
7
6
  * Run `deployoor generate` after a Hardhat compile. A generation failure (e.g. no config yet,
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["TASK_COMPILE","generateDeployers"],"sources":["../src/runner.ts","../src/index.ts"],"sourcesContent":["/** The slice of a generated file this plugin reports on (the full record carries `contents` too). */\nexport interface GeneratedFileInfo {\n readonly path: string;\n}\n\nexport interface RunAfterCompileOptions {\n /** Project root handed to `generateDeployers` (Hardhat's `config.paths.root`). */\n readonly root: string;\n /** When false, generation is skipped — the `deployoor: { generate: false }` opt-out. */\n readonly enabled: boolean;\n /** The generate function, injected so this wiring is testable without a Hardhat runtime. */\n readonly generate: (opts: { root: string }) => Promise<ReadonlyArray<GeneratedFileInfo>>;\n /** Where progress/failures are reported. Defaults to the console. */\n readonly log?: { info: (message: string) => void; warn: (message: string) => void };\n}\n\n/**\n * Run `deployoor generate` after a Hardhat compile. A generation failure (e.g. no config yet,\n * nothing compiled) is reported but never rethrown, so a deployoor misconfiguration can never\n * break `hardhat compile` itself.\n */\nexport const runAfterCompile = async (opts: RunAfterCompileOptions): Promise<void> => {\n if (!opts.enabled) return;\n const log = opts.log ?? {\n info: (message: string) => console.log(message),\n warn: (message: string) => console.warn(message),\n };\n try {\n const files = await opts.generate({ root: opts.root });\n log.info(`deployoor: generated ${files.length} deployer file(s)`);\n } catch (error) {\n log.warn(`deployoor: skipped generate — ${error instanceof Error ? error.message : String(error)}`);\n }\n};\n","import { extendConfig, task } from \"hardhat/config\";\nimport { TASK_COMPILE } from \"hardhat/builtin-tasks/task-names\";\nimport { generateDeployers } from \"deployoor/generate\";\nimport { runAfterCompile } from \"./runner\";\nimport \"./type-extensions\";\n\n/**\n * @deployoor/hardhat — regenerate deployoor's typed deployers automatically after every\n * `hardhat compile`, in process. No extra terminal, no separate `deployoor generate` step:\n * the moment Hardhat writes fresh `artifacts/`, the deployers are rebuilt from them.\n *\n * Add it to your Hardhat config:\n *\n * // hardhat.config.ts\n * import \"@deployoor/hardhat\";\n * // hardhat.config.js\n * require(\"@deployoor/hardhat\");\n *\n * Opt out per project with `deployoor: { generate: false }` in the Hardhat config.\n */\nextendConfig((config, userConfig) => {\n config.deployoor = { generate: userConfig.deployoor?.generate ?? true };\n});\n\n// Wrap the built-in compile: run it, then regenerate from the fresh artifacts.\ntask(TASK_COMPILE).setAction(async (args, hre, runSuper) => {\n const result = await runSuper(args);\n await runAfterCompile({\n root: hre.config.paths.root,\n enabled: hre.config.deployoor.generate,\n generate: generateDeployers,\n });\n return result;\n});\n"],"mappings":";;;;;;;;;;AAqBA,MAAa,kBAAkB,OAAO,SAAgD;CACpF,IAAI,CAAC,KAAK,SAAS;CACnB,MAAM,MAAM,KAAK,OAAO;EACtB,OAAO,YAAoB,QAAQ,IAAI,OAAO;EAC9C,OAAO,YAAoB,QAAQ,KAAK,OAAO;CACjD;CACA,IAAI;EACF,MAAM,QAAQ,MAAM,KAAK,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC;EACrD,IAAI,KAAK,wBAAwB,MAAM,OAAO,kBAAkB;CAClE,SAAS,OAAO;EACd,IAAI,KAAK,iCAAiC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CACpG;AACF;;;;;;;;;;;;;;;;;qCCbc,QAAQ,eAAe;CACnC,OAAO,YAAY,EAAE,UAAU,WAAW,WAAW,YAAY,KAAK;AACxE,CAAC;4BAGIA,oCAAAA,YAAY,CAAC,CAAC,UAAU,OAAO,MAAM,KAAK,aAAa;CAC1D,MAAM,SAAS,MAAM,SAAS,IAAI;CAClC,MAAM,gBAAgB;EACpB,MAAM,IAAI,OAAO,MAAM;EACvB,SAAS,IAAI,OAAO,UAAU;EAC9B,UAAUC,mBAAAA;CACZ,CAAC;CACD,OAAO;AACT,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["TASK_COMPILE","generateDeployers"],"sources":["../src/runner.ts","../src/index.ts"],"sourcesContent":["/** The slice of a generated file this plugin reports on (the full record carries `contents` too). */\nexport interface GeneratedFileInfo {\n readonly path: string;\n}\n\nexport interface RunAfterCompileOptions {\n /** Project root handed to `generateDeployers` (Hardhat's `config.paths.root`). */\n readonly root: string;\n /** When false, generation is skipped — the `deployoor: { generate: false }` opt-out. */\n readonly enabled: boolean;\n /** The generate function, injected so this wiring is testable without a Hardhat runtime. */\n readonly generate: (opts: { root: string }) => Promise<ReadonlyArray<GeneratedFileInfo>>;\n /** Where progress/failures are reported. Defaults to the console. */\n readonly log?: { info: (message: string) => void; warn: (message: string) => void };\n}\n\n/**\n * Run `deployoor generate` after a Hardhat compile. A generation failure (e.g. no config yet,\n * nothing compiled) is reported but never rethrown, so a deployoor misconfiguration can never\n * break `hardhat compile` itself.\n */\nexport const runAfterCompile = async (opts: RunAfterCompileOptions): Promise<void> => {\n if (!opts.enabled) return;\n const log = opts.log ?? {\n info: (message: string) => console.log(message),\n warn: (message: string) => console.warn(message),\n };\n try {\n const files = await opts.generate({ root: opts.root });\n log.info(`deployoor: generated ${files.length} deployer file(s)`);\n } catch (error) {\n log.warn(`deployoor: skipped generate — ${error instanceof Error ? error.message : String(error)}`);\n }\n};\n","import { extendConfig, task } from \"hardhat/config\";\nimport { TASK_COMPILE } from \"hardhat/builtin-tasks/task-names\";\nimport { generateDeployers } from \"deployoor/generate\";\nimport { runAfterCompile } from \"./runner\";\nimport \"./type-extensions\";\n\n/**\n * @deployoor/hardhat — regenerate deployoor's typed deployers automatically after every\n * `hardhat compile`, in process. No extra terminal, no separate `deployoor generate` step:\n * the moment Hardhat writes fresh `artifacts/`, the deployers are rebuilt from them.\n *\n * Add it to your Hardhat config:\n *\n * // hardhat.config.ts\n * import \"@deployoor/hardhat\";\n * // hardhat.config.js\n * require(\"@deployoor/hardhat\");\n *\n * Opt out per project with `deployoor: { generate: false }` in the Hardhat config.\n */\nextendConfig((config, userConfig) => {\n config.deployoor = { generate: userConfig.deployoor?.generate ?? true };\n});\n\n// Wrap the built-in compile: run it, then regenerate from the fresh artifacts.\ntask(TASK_COMPILE).setAction(async (args, hre, runSuper) => {\n const result = await runSuper(args);\n await runAfterCompile({\n root: hre.config.paths.root,\n enabled: hre.config.deployoor.generate,\n generate: generateDeployers,\n });\n return result;\n});\n"],"mappings":";;;;;;;;;AAqBA,MAAa,kBAAkB,OAAO,SAAgD;CACpF,IAAI,CAAC,KAAK,SAAS;CACnB,MAAM,MAAM,KAAK,OAAO;EACtB,OAAO,YAAoB,QAAQ,IAAI,OAAO;EAC9C,OAAO,YAAoB,QAAQ,KAAK,OAAO;CACjD;CACA,IAAI;EACF,MAAM,QAAQ,MAAM,KAAK,SAAS,EAAE,MAAM,KAAK,KAAK,CAAC;EACrD,IAAI,KAAK,wBAAwB,MAAM,OAAO,kBAAkB;CAClE,SAAS,OAAO;EACd,IAAI,KAAK,iCAAiC,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,GAAG;CACpG;AACF;;;;;;;;;;;;;;;;;qCCbc,QAAQ,eAAe;CACnC,OAAO,YAAY,EAAE,UAAU,WAAW,WAAW,YAAY,KAAK;AACxE,CAAC;4BAGIA,oCAAAA,YAAY,CAAC,CAAC,UAAU,OAAO,MAAM,KAAK,aAAa;CAC1D,MAAM,SAAS,MAAM,SAAS,IAAI;CAClC,MAAM,gBAAgB;EACpB,MAAM,IAAI,OAAO,MAAM;EACvB,SAAS,IAAI,OAAO,UAAU;EAC9B,UAAUC,mBAAAA;CACZ,CAAC;CACD,OAAO;AACT,CAAC"}
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@deployoor/hardhat",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "type": "module",
6
+ "sideEffects": false,
6
7
  "description": "Hardhat plugin: regenerate deployoor's typed deployers automatically after every `hardhat compile`.",
7
8
  "keywords": [
8
9
  "ethereum",
@@ -47,7 +48,7 @@
47
48
  "typescript": "^5.9.3",
48
49
  "unrun": "^0.3.1",
49
50
  "vitest": "^4.0.17",
50
- "deployoor": "0.1.0"
51
+ "deployoor": "0.2.0"
51
52
  },
52
53
  "publishConfig": {
53
54
  "access": "public"