{"_id":"@bix-digital/directus-extension-version-control-changelog","_rev":"2-80234c12009f8e61c4cf1d5958ea797d","name":"@bix-digital/directus-extension-version-control-changelog","dist-tags":{"latest":"0.8.1"},"versions":{"0.8.0":{"name":"@bix-digital/directus-extension-version-control-changelog","version":"0.8.0","description":"A Directus hook extension to push user written change summaries (from a singleton collection text field) to a changelog in a VCS server","author":{"name":"BI X Digital Engineers","url":"https://www.bix-digital.com"},"license":"Apache-2.0","homepage":"https://github.com/BIX-Digital/directus-version-control-changelog","repository":{"type":"git","url":"git+https://github.com/BIX-Digital/directus-version-control-changelog.git"},"bugs":{"url":"https://github.com/BIX-Digital/directus-version-control-changelog/issues"},"keywords":["directus","directus-extension","directus-custom-hook","bitbucket","vcs","changelog"],"directus:extension":{"type":"hook","path":"dist/index.js","source":"src/index.ts","host":"^9.5.1"},"scripts":{"build":"directus-extension build","test":"jest --coverage","test:watch":"jest --watch"},"devDependencies":{"@directus/extensions-sdk":"9.5.1","@types/jest":"^27.4.0","@types/node":"^17.0.16","axios":"^0.24.0","jest":"^27.5.1","pino":"^7.6.5","ts-jest":"^27.1.3","typescript":"^4.5.5"},"dependencies":{"form-data":"^4.0.0"},"gitHead":"5934fc5143e57604b1d4198f4180e5d093a8bc59","_id":"@bix-digital/directus-extension-version-control-changelog@0.8.0","_nodeVersion":"16.14.0","_npmVersion":"8.5.0","dist":{"integrity":"sha512-vhQ34+OhJiW18Kpa+JukB8WRi1mpND8jjAGFHgxcWM/54Jqu8AjQPnlxuxrZajMg9PqhXLxEhmngCNqb2lYm+Q==","shasum":"15edff6c8a97a2095fbcc987fc325763ea09bf81","tarball":"https://registry.npmjs.org/@bix-digital/directus-extension-version-control-changelog/-/directus-extension-version-control-changelog-0.8.0.tgz","fileCount":24,"unpackedSize":665545,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiC2+RCRA9TVsSAnZWagAAn9kP/jU2hYgwAMnfMFSqhQ6c\nzIu2CS5KXbyjCy0aqwBcOk5LPPOBZ7OiygvR0wLmdfxAsJrrkp6/VYL2wauH\naewgEC0CoNxiJXIMZgNTKNWn4scMnxQBvrAMkA33dY1o2eFWTiRveLS5mIsZ\nMtGfSYvEYULGlecRJNr3iiuYRfQ2ZIqVVqc+xgzGUiyEwsHf3t+1DL0jSDJ1\nwM5omYm6Sk/yC3OQN3ukht7nDYPJLzr7vBx2qQTzM9iy/fSMmoEnwfcFFMUr\nLmYM5K7PbZxKrQItSdCRbx6KRDNmbr9mQXqJclEkBHab5rl5FSsM1H7qy4TL\nBb8G6a7PhgEkAhd5I4tVh5a6MzgPwVcva+Cfq7RrmHVnY6BFadPaMKoDyboG\ncuBD+VLdZ/kWrjoq++580FGgEMyM1XLtKU9jVzb3mS58YjAHI27lpeCaMhub\nVc86IkFZ4rWCVk4zrpYmY2Ou9AgougIu2rSq1+wH6zUfG/Il/+bV/zw4FIhF\nY6/tQeg8l6uR67M/eh4/gPq1h6ti0SXboQQrKbKxlHnIjSWBIVPfRoyK7y+q\n5yU5K/ulxWCx2B95oMqXelHmvxTVccfcP8cH1Cp2ATIxTn2Y7uogNNEENSq5\nbYQ6W+ROZHJP8TKKomUFZ6eo/bU33f5KkWsUxuWDVY9H9JCdDoXEV+PtTJBx\nurvq\r\n=1wCY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD9SJgAwoyHPVYzC5NUGQ/M6e/SwzCSEb0MpbaEv2k9FwIhAIAYRXrQBtQ17LJBf6pJIE/N1dKHlKn2FIBB4kuFNgn3"}]},"_npmUser":{"name":"manuelfeller","email":"npm@devsvr.ws"},"directories":{},"maintainers":[{"name":"gerardcl","email":"gerardcl@gmail.com"},{"name":"manuelfeller","email":"npm@devsvr.ws"},{"name":"bix_digital_lab","email":"bix.platform.eng@bix-digital.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/directus-extension-version-control-changelog_0.8.0_1644916625715_0.2558370489996442"},"_hasShrinkwrap":false},"0.8.1":{"name":"@bix-digital/directus-extension-version-control-changelog","version":"0.8.1","description":"A Directus hook extension to push user written change summaries (from a singleton collection text field) to a changelog in a VCS server","author":{"name":"BI X Digital Engineers","url":"https://www.bix-digital.com"},"license":"Apache-2.0","homepage":"https://github.com/BIX-Digital/directus-version-control-changelog","repository":{"type":"git","url":"git+https://github.com/BIX-Digital/directus-version-control-changelog.git"},"bugs":{"url":"https://github.com/BIX-Digital/directus-version-control-changelog/issues"},"keywords":["directus","directus-extension","directus-custom-hook","bitbucket","vcs","changelog"],"directus:extension":{"type":"hook","path":"dist/index.js","source":"src/index.ts","host":"^9.5.1"},"scripts":{"build":"directus-extension build","test":"jest --coverage","test:watch":"jest --watch"},"devDependencies":{"@directus/extensions-sdk":"9.5.1","@types/jest":"^27.4.0","@types/node":"^17.0.16","axios":"^0.24.0","jest":"^27.5.1","pino":"^7.6.5","ts-jest":"^27.1.3","typescript":"^4.5.5"},"dependencies":{"form-data":"^4.0.0"},"gitHead":"6eb2e4d3a3516d6fd47b8d892c88022cd08c29df","_id":"@bix-digital/directus-extension-version-control-changelog@0.8.1","_nodeVersion":"16.14.0","_npmVersion":"8.5.0","dist":{"integrity":"sha512-/o3hax0dOErPp5aA7PELj44Y6qjoXBWN68Q5FHnyIdCZwXbYYWDB3fj54E0gjRVSMcWsq51rQLHZqnhWbtXiIg==","shasum":"f996125cb68be5485b3eeeb3504b00c0743a8928","tarball":"https://registry.npmjs.org/@bix-digital/directus-extension-version-control-changelog/-/directus-extension-version-control-changelog-0.8.1.tgz","fileCount":24,"unpackedSize":666908,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFQ3vACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpaxAAndH+P1eyTqo6aU7ztAAnTeQ1BeA9NVvVD9JnenRFVo32DBw9\r\nsCqGx7UN/PCkNIeROX8SlD0JK0/SzvcLJ/BODmypu6nFWk4EV2hFZPtEadLp\r\nKqfIL5Cyx12ZEqVslLvMSx7xYdPaZ6eTwKauAtsiqI6LJsX0U5BUTO10cF7G\r\nm3g7oOWG0aHNrS6PH5bKtog/nU7BhsGexVl1fpX5tQkTvzJzPeFZV4wH7gjp\r\nlnQVoaaLqufrl/Z/aoLBjYaqs8V8VcgmKoA17gzuPFp7tcE+4SOy0W1sUQfW\r\nvb2V+kZ0l7A5Ia3Yp4HB95/1K1hqJMXSR9sp1FWvC/5K0IiPCQa2nORPtp/b\r\nMPLQMfzxpG75kpxDT0baFQ9YP20u55NUEA9Itp3qZAhRkpI4QkwCME+IrJRE\r\n7KxGkDXYAV6FlQYHMj+dEeGYDf2OW3Xx7rcmimO352V8xPmtktH2X65pe3Bj\r\nT8sLYBduzeDJvieLuws6CvbDiZvBg0oFkCPJ/LvYIpyC6w8V4qnSeaCyAaMR\r\nG4P2eDc4N1mtSCQKSKWGasgoWE0PThIgALIkVMZXpu59diXqkdqE4NijymAM\r\nELRtc5AGOer0cRAv6l57rUmsHrxJJxL4l+u4lGd85Rf5b/3VkKzkUJ4HVdpm\r\n4dyxSs8QQO7PTryIYb/g1MwXw0bYCDoKinE=\r\n=Gkhd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDO9dL0VkhDfwtM31MAP1muQDV3X+4tikPEn+ijBxFQeAiEAomIhDRLWHaDx0R7COxsK72EfNydSaMVxvE+guXwfa2U="}]},"_npmUser":{"name":"manuelfeller","email":"npm@devsvr.ws"},"directories":{},"maintainers":[{"name":"gerardcl","email":"gerardcl@gmail.com"},{"name":"manuelfeller","email":"npm@devsvr.ws"},{"name":"bix_digital_lab","email":"bix.platform.eng@bix-digital.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/directus-extension-version-control-changelog_0.8.1_1645546991756_0.2171268133395976"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-15T09:17:05.664Z","0.8.0":"2022-02-15T09:17:05.947Z","modified":"2022-04-04T19:14:54.338Z","0.8.1":"2022-02-22T16:23:11.967Z"},"maintainers":[{"name":"gerardcl","email":"gerardcl@gmail.com"},{"name":"manuelfeller","email":"npm@devsvr.ws"},{"name":"bix_digital_lab","email":"bix.platform.eng@bix-digital.com"}],"description":"A Directus hook extension to push user written change summaries (from a singleton collection text field) to a changelog in a VCS server","homepage":"https://github.com/BIX-Digital/directus-version-control-changelog","keywords":["directus","directus-extension","directus-custom-hook","bitbucket","vcs","changelog"],"repository":{"type":"git","url":"git+https://github.com/BIX-Digital/directus-version-control-changelog.git"},"author":{"name":"BI X Digital Engineers","url":"https://www.bix-digital.com"},"bugs":{"url":"https://github.com/BIX-Digital/directus-version-control-changelog/issues"},"license":"Apache-2.0","readme":"# Directus Hook Extension: Version Control Changelog\n\n![Node.js CI Build Badge](https://github.com/BIX-Digital/directus-version-control-changelog/workflows/Node.js%20CI/badge.svg?branch=main) [![npm version](https://badge.fury.io/js/@bix-digital%2Fdirectus-extension-version-control-changelog.svg)](https://www.npmjs.com/package/@bix-digital/directus-extension-version-control-changelog)\n\nThis package is a Hook Extension for the CMS [Directus](https://directus.io) that allows you to add entries to a changelog in a version control system. Currently only Bitbucket Server is supported, but it is prepared to be extended to other version control systems (like GitHub or GitLab) in the future.\n\nInstead of just \"blindly\" adding each change in the database it relies on a user written changelog entry that summarizes the changes. For that it relies on a singleton collection with (at least) a textarea field in it.\n\n## Why would I want that?\n\nWe ([BI X](https://www.bix-digital.com)) created this extension because of the way how [GatsbyJS](https://www.gatsbyjs.com/) with Directus as content source and our build system ([OpenDevStack](https://www.opendevstack.org/) with [ods-pipeline](https://github.com/opendevstack/ods-pipeline)) work.  \nOur builds are triggered by webhooks that get fired on pushes to our VCS server. For that it relies heavily on the Bitbucket webhooks and its specific content. Recreating them with the Directus webhook functionality would have been a huge effort - and as our build system does not rebuild things if there are no changes (to the codebase / repository) it would also be without any effect.\n\nAdditionally we wanted to see what has changed in a new release - code as well as content.\n\nThat is why we decided to maintain a changelog inside of the VCS that can be updated by Directus. And for that we wrote this extension hook.\n\n## Table of Contents\n\n- [Directus Hook Extension: Version Control Changelog](#directus-hook-extension-version-control-changelog)\n\t- [Why would I want that?](#why-would-i-want-that)\n\t- [Table of Contents](#table-of-contents)\n\t- [How can I use it?](#how-can-i-use-it)\n\t\t- [Set up things in Directus](#set-up-things-in-directus)\n\t\t\t- [1. Create a singleton collection with at least one textarea](#1-create-a-singleton-collection-with-at-least-one-textarea)\n\t\t\t- [2. Add the required configuration values to your Directus installation](#2-add-the-required-configuration-values-to-your-directus-installation)\n\t\t\t- [3. Add the extension to your installation](#3-add-the-extension-to-your-installation)\n\t\t\t- [4. Add your first changelog entry](#4-add-your-first-changelog-entry)\n\t- [Release History](#release-history)\n\t\t- [Version 0.8.1](#version-081)\n\t\t- [Version 0.8.0](#version-080)\n\t- [Future possibilities](#future-possibilities)\n\n## How can I use it?\n\n### Set up things in Directus\n\n#### 1. Create a singleton collection with at least one textarea\n\nFirst you create a new collection in your Directus - make sure that the option to treat it as a single object is activated:\n![Screenshot of the collection setup](documentation/images/create_collection.png)\n\nThen you add at least one textarea field and make sure that it is requiring content in there to be saved:\n![Screenshot of the textarea setup](documentation/images/create_field.png)\n\nWhile the above shown is enough we recommend to use the features of Directus to give the content managers more guidance. Below you see our setup where we used the `placeholder` and the `note` of the textarea - as well as a readonly-field with an instructional message as default content:\n![Screenshot of a recommended setup](documentation/images/recommended_collection.png)\n\n#### 2. Add the required configuration values to your Directus installation\n\nThe extension uses the configuration mechanism of Directus. So all you have to do is to add the following variables to your preferred configuration location:\n\n| Variable Name | Description |\n|---------------|-------------|\n| `VERSION_CONTROL_CHANGELOG_COLLECTION` | name of the collection (e.g. `vcs_changelog`) |\n| `VERSION_CONTROL_CHANGELOG_FIELD_NAME` | name of the field in the collection (e.g. `changes_made`) |\n| `VERSION_CONTROL_CHANGELOG_VCS` | Has to be `bitbucket` for now |\n| `VERSION_CONTROL_CHANGELOG_BITBUCKET_USER` | the user of the Bitbucket VCS server |\n| `VERSION_CONTROL_CHANGELOG_BITBUCKET_PASSWORD` | the password for the user above |\n| `VERSION_CONTROL_CHANGELOG_VCS_SERVER_URL` | the full URL of your VCS server - without a trailing `/` (e.g. `https://your.vcs.example`) |\n| `VERSION_CONTROL_CHANGELOG_VCS_PROJECT` | the name of the project (or user) on the VCS server |\n| `VERSION_CONTROL_CHANGELOG_VCS_REPOSITORY` | the name of the repository of the project (or user) |\n| `VERSION_CONTROL_CHANGELOG_VCS_BRANCH` | the branch that should be used for reading and writing the changelog (e.g. `cms-changes`) |\n| `VERSION_CONTROL_CHANGELOG_VCS_FILENAME` | the name of the file that should be used (e.g. `directus-changelog.md`) |\n\n**Important:** Make sure that the assigned Bitbucket user has ***write*** permissions in the repository.  \nThere is no need to create the branch or the file in the repository, the extension takes care of this. This also means that in case you delete the file or the branch it will be automatically recreated on the next execution of the extension.\n\n#### 3. Add the extension to your installation\n\n1. clone (or download) this repository to your local machine - alternatively you can [install the package](https://www.npmjs.com/package/@bix-digital/directus-extension-version-control-changelog) from npm and run the following next steps in the folder of the module\n1. open a terminal and change into the directory containing the `package.json`\n1. run `npm install`\n1. run `npm run build`\n1. create a directory named `version-control-changelog` inside of your `<directus-root-folder>/extensions/hooks/` directory\n1. copy the generated `index.js` file from the `dist` directory\n1. paste the copied file into the newly created directory\n1. restart your Directus instance; monitor the log during startup\n\nIf everything works you will see the following line in the log output:\n\n```log\n01:23:45 ✨ Version Control Changelog Extension Extension initialized, action handler registered\n...\n01:23:45 ✨ Server started at http://localhost:8055\n```\n\n#### 4. Add your first changelog entry\n\nOnce you save your first changes in the configured collection & field the log should show you the following line:\n\n```log\n17:32:16 ✨ Version Control Changelog Extension BitbucketVersionControl: new changelog pushed successful\n```\n\nIf you see it: congratulations, your setup works!\n\n## Release History\n\n### [Version 0.8.1](https://github.com/BIX-Digital/directus-version-control-changelog/releases/tag/v0.8.1)\n\n2022-02-22\n\n- fixing a bug where a hardcoded field name (not respecting the settings) causes a crash\n- improved prefix of extension in logger messages\n\n### [Version 0.8.0](https://github.com/BIX-Digital/directus-version-control-changelog/releases/tag/v0.8.0)\n\n2022-02-14\n\n- initial release for Bitbucket\n\n## Future possibilities\n\nThese are things that would make sense, but it is not granted that it will be implemented\n\n- [ ] support \"auto-create\" of the required collection(s) and field(s) on first run\n- [ ] allow multiple changelogs (multiple collections writing to multiple repositories)\n- [ ] add GitHub and / or GitLab as target systems\n- [x] [added to npm](https://www.npmjs.com/package/@bix-digital/directus-extension-version-control-changelog) (to allow [installation via npm](https://directus.io/road-map/#q1-2022) once it is available)\n  - [ ] confirm it works or do required adjustments once available\n- [ ] add to the [Extension Marketplace]((https://directus.io/road-map/#q2-2022)) once it is available\n","readmeFilename":"README.md"}