{"id":19069591,"url":"https://github.com/cncjs/cncjs-widget-boilerplate","last_synced_at":"2025-04-28T14:12:13.592Z","repository":{"id":55677602,"uuid":"102852440","full_name":"cncjs/cncjs-widget-boilerplate","owner":"cncjs","description":"Creating custom widgets for CNCjs","archived":false,"fork":false,"pushed_at":"2024-11-22T15:07:32.000Z","size":3196,"stargazers_count":11,"open_issues_count":2,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-21T03:18:52.095Z","etag":null,"topics":["cncjs","widget"],"latest_commit_sha":null,"homepage":"https://cncjs.github.io/cncjs-widget-boilerplate/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cncjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-08T11:02:55.000Z","updated_at":"2024-11-22T15:04:16.000Z","dependencies_parsed_at":"2022-08-15T06:20:20.057Z","dependency_job_id":null,"html_url":"https://github.com/cncjs/cncjs-widget-boilerplate","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-widget-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-widget-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-widget-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cncjs%2Fcncjs-widget-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cncjs","download_url":"https://codeload.github.com/cncjs/cncjs-widget-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250734950,"owners_count":21478601,"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":["cncjs","widget"],"created_at":"2024-11-09T01:14:50.944Z","updated_at":"2025-04-28T14:12:13.571Z","avatar_url":"https://github.com/cncjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cncjs-widget-boilerplate\n\n**Custom Widget for CNCjs**\n\n## Version Compatibility\n\nCustom Widget Version | CNCjs Version\n:-------------------- | :------------\n0.x                   | 1.9.10 or 1.9.11\n1.x                   | \u003e=1.9.12 or later patch versions\n2.x                   | \u003e=2.0.0 or later versions\n\n## Installation\n\n```bash\nyarn install\n```\n\n## Development Guide\n\nCreate a directory under \u003cb\u003esrc/widgets\u003c/b\u003e and put your code in there.\n\n```\nsrc/\n   widgets/\n      custom/index.jsx\n```\n\nRun `yarn dev` to start a development server.\n\n### Query Parameters\n\nName | Description\n:--- | :----------\ntoken | (Required) An authentication token to enable secure communication. The token will be automatically set by CNCjs.\nhost | (Optional) Specifies the host to connect to. Defaults to an empty string.\n\n### Examples\n\n![image](https://user-images.githubusercontent.com/447801/30728983-b866f4b6-9f8e-11e7-9a90-6b712344d270.png)\n\n## Development\n\nRun `npm run dev` to start a local development server for development, then connect to http://localhost:5000 and wait until bundle finished.\n\nYou can specify a mount path to test your widgets with CNCjs:\n```bash\ncncjs -vv --mount /widget:/path/to/cncjs-widget-boilerplate/dist\n```\n\n## Production\n\nRun `npm run prepublish` to build production code. It will output index.html, fonts, images, and JavaScript files to the dist folder. \n\nAfter that, you can copy all dist files to a directory (e.g. /home/widget), and specify a mount path for the static directory, as shown below:\n```bash\nmkdir -p /home/widget\ncp -af /path/to/cncjs-widget-boilerplate/dist/* /home/widget\ncncjs --mount /widget:/home/widget\n```\n\n### Configure CNCjs\n\n1. Click \u003cb\u003eManage Widgets\u003c/b\u003e to add a custom widget\u003cbr\u003e\n    ![image](https://user-images.githubusercontent.com/447801/30728946-78e1d860-9f8e-11e7-96c5-e8bbd06b1c0f.png)\n\n2. Click the \u003cimg src=\"https://cdn.rawgit.com/cncjs/cncjs/master/media/font-awesome/black/svg/cog.svg\" width=\"16\" title=\"Edit\" /\u003e icon to configure widget settings\u003cbr\u003e\n    ![image](https://user-images.githubusercontent.com/447801/30729069-593dc4dc-9f8f-11e7-8a63-1e46249bbe34.png)\n    \n3. If everything goes well, you will see the loaded widget, like so:\u003cbr\u003e\n    ![image](https://user-images.githubusercontent.com/447801/30728983-b866f4b6-9f8e-11e7-9a90-6b712344d270.png)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncjs%2Fcncjs-widget-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcncjs%2Fcncjs-widget-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcncjs%2Fcncjs-widget-boilerplate/lists"}