{"id":22072584,"url":"https://github.com/broxus/locklift-plugin-boilerplate","last_synced_at":"2026-04-16T19:05:23.072Z","repository":{"id":66355176,"uuid":"558374170","full_name":"broxus/locklift-plugin-boilerplate","owner":"broxus","description":"Boilerplate plugin for Locklift framework","archived":false,"fork":false,"pushed_at":"2022-10-31T18:08:56.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-29T02:46:57.377Z","etag":null,"topics":["blockchain","dapps","debugging","everscale","framework","javascript","locklift","smart-contracts","solidity","stack-traces","task-runner","tooling","typescript"],"latest_commit_sha":null,"homepage":"https://github.com/broxus/locklift","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/broxus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-27T12:27:14.000Z","updated_at":"2023-07-25T15:03:17.000Z","dependencies_parsed_at":"2023-06-08T06:45:39.654Z","dependency_job_id":null,"html_url":"https://github.com/broxus/locklift-plugin-boilerplate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Flocklift-plugin-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Flocklift-plugin-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Flocklift-plugin-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/broxus%2Flocklift-plugin-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/broxus","download_url":"https://codeload.github.com/broxus/locklift-plugin-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245155524,"owners_count":20569715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","dapps","debugging","everscale","framework","javascript","locklift","smart-contracts","solidity","stack-traces","task-runner","tooling","typescript"],"created_at":"2024-11-30T21:13:49.679Z","updated_at":"2026-04-16T19:05:23.019Z","avatar_url":"https://github.com/broxus.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plugin integration documentation\n\n\n## Development of a plugin\nrun ```npm i``` inside this repo\n\nIn this boilerplate we can find two file `index.ts` and `type-extentions.ts`\n\n### Inside the `index.ts` we are calling function `addPlugin` that obtain some parameters\n#### `pluginName` your plugin name that should be defined in `type-extentions.ts` as `PLUGIN_NAME`\n#### `initializer` function will be called by locklift when it will be initialized\nThis is core plugin function that provides `locklift` instance, selected `network` and `config` object.\nThis function should return an instance of your plugin implementation `Promise\u003cTEST_PLUGIN\u003e` like in the example.\nAfter it the plugin consumer(user) will have access to your plugin instance inside the CLI and Typescript\n\n\n#### `commandBuilders` array of custom CLI commands\nThis is an Array of objects\n```typescript\nArray\u003c{\n    commandCreator: (command: commander.Command) =\u003e commander.Command;\n    skipSteps?: {\n      build?: boolean;\n    };\n  }\u003e\n```\n#### `commandCreator`\nThis is a function that accepting `command` instance that you can [configure](https://www.npmjs.com/package/commander#commands) as you want.\nAlso, each command have predefined params like `contracts`, `build`, `network`, `config` and `script`, so you shouldn't provide it again in your plugin.\nInside `action` function you will get all command params and `locklift` instance (see an example)\n#### `skipSteps` configuration of force skipping some steps\nLockilft by default runs the build process, if you command don't need this process you can override current behavior by setting `{build: false}`\n\n### Inside the `type-extentions.ts` we are:\n1. overriding types for `Locklift`(extending Locklift).\n2. overriding types for `LockliftConfig`(extending locklift.config object).\n3. change name of our plugin `export const PLUGIN_NAME = \"samplePlugin\"` this constant used in type overriding and as plugin name inside the `add plugin` function,\nand will be used as access to this plugin inside the locklift project e.g. `console.log(locklift.samplePlugin.getGreeting());`\n\n## Using plugin inside a locklift project\n1. Plugin should be installed in the locklift project\n2. Plugin should be imported inside the `locklift.config.ts` like this `import \"sample-plugin\";`\n3. Define custom fields in `locklift.config.ts` if it needed.\n\n### CLI usage\nThen user can use it via cli \n```shell\nnpx locklift -h\n```\n```shell\nUsage: cli [options] [command]\n\nOptions:\n  -V, --version           output the version number\n  -h, --help              display help for command\n\nCommands:\n  init [options]          Initialize sample Locklift project in a directory\n  test [options]          Run mocha tests\n  build [options]         Build contracts by using Ever Solidity compiler and TVM linker\n  run [options]           Run arbitrary locklift script\n  TEST_COMMAND [options]\n  getcode [options]\n  get-greeting [options]\n  help [command]          display help for command\n```\nas you can see inside the help there are some new commands that was provided by our plugin.\n\nLet's use `getcode` method\n```shell\nnpx locklift getcode -n local --contract MyContarctName\n```\noutput(cut):\n```shell\nte6ccgEC...AAAEA==\n```\n### Typescript usage\nIn `type-extensions.ts` we have already overridden types for `Locklift`, so a user will see our plugin inside the `locklift` object, and interact with it like this\n```typescript\nconsole.log(locklift.samplePlugin.getGreeting());\n```\n\n## Local development\n1. Initialize new locklift project inside any folder e.g. `./my_project/plugin_development_project`\n2. Define this boilerplate inside another folder e.g. `./my_project/my_plugin`, and change project name inside `package.json` e.g. `my-plugin`\n3. Inside the plugin folder build and link the plugin `npm run build \u0026\u0026 npm link`\n4. Go to locklift project and link your plugin `npm link my-plugin`\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Flocklift-plugin-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbroxus%2Flocklift-plugin-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbroxus%2Flocklift-plugin-boilerplate/lists"}