{"_id":"@aparna036/changelog-extract","_rev":"1-c460080ccc9f57a9d92c5e4199b3c750","name":"@aparna036/changelog-extract","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aparna036/changelog-extract","version":"1.0.0","description":"This package is used for extracting changelogs from your projects","main":"index.js","repository":{"type":"git","url":"git+ssh://git@bitbucket.org/atlassian/changelog-extract.git"},"author":{"name":"Aparna Raj"},"license":"MIT","scripts":{"test":"jest"},"jest":{"setupFiles":["<rootDir>/test-setup.js"],"moduleFileExtensions":["ts","tsx","js"],"transform":{"^.+\\.(ts|tsx)$":"<rootDir>/test-preprocessor.js"},"testMatch":["**/__tests__/*.(ts|tsx|js)"]},"devDependencies":{"@types/enzyme":"^2.8.11","@types/jest":"^21.1.2","enzyme":"^3.1.0","enzyme-adapter-react-16":"^1.0.1","extract-react-types-loader":"^0.3.0","jest":"^21.2.1","nodemon":"^1.12.1","react-test-renderer":"^16.0.0","ts-loader":"^5.3.3"},"dependencies":{"@atlaskit/button":"^10.1.2","@atlaskit/css-reset":"^3.0.5","@atlaskit/field-text":"^7.0.18","@atlaskit/icon":"^16.0.0","@atlaskit/lozenge":"^6.2.4","@atlaskit/theme":"^7.0.1","@babel/runtime":"^7.0.0","@types/react":"^16.4.18","@types/semver":"^5.5.0","awesome-typescript-loader":"^3.2.3","babel-runtime":"^6.26.0","commonmark":"^0.27.0","commonmark-react-renderer":"^4.3.3","connect-history-api-fallback":"^1.5.0","extract-text-webpack-plugin":"^3.0.1","happypack":"^5.0.0","ldclient-js":"^2.3.1","lodash.debounce":"^4.0.8","minimatch":"^3.0.4","prismjs":"^1.6.0","prop-types":"^15.5.10","query-string":"^4.3.2","react":"^16.4.0","react-addons-text-content":"^0.0.4","react-dom":"^16.4.2","react-ga":"^2.3.5","react-markdown":"^2.5.0","react-router":"^4.2.0","react-router-dom":"^4.2.2","react-transition-group":"^2.2.1","recompose":"^0.26.0","semver":"^5.4.1","sentence-case":"^2.1.1","snake-case":"^2.1.0","source-map-loader":"^0.2.2","styled-components":"^3.2.6","tti-polyfill":"^0.2.2","typescript":"^2.5.3","uglify-js":"^3.1.7","webpack":"^3.6.0"},"gitHead":"6b5409294ef4f4a23448638754116f4659efbb29","homepage":"https://bitbucket.org/atlassian/changelog-extract#readme","_id":"@aparna036/changelog-extract@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.9.0","_npmUser":{"name":"aparna036","email":"aparna036@gmail.com"},"dist":{"integrity":"sha512-hqZ3wcwirOApDu1KwxYz5MCea2JcqD4841RhUF3ylljcUVoGGwITmHdLBDTSLOdMFlyfZx3VCSzDdpFnm8Sqtw==","shasum":"0d82848497f2fc0ca06f14d15ea204b0687928ee","tarball":"https://registry.npmjs.org/@aparna036/changelog-extract/-/changelog-extract-1.0.0.tgz","fileCount":22,"unpackedSize":301569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchzK6CRA9TVsSAnZWagAAnvQP/3T+5TP7aY/dpP6sGBe7\nLIAVMJBlC2u2oEUwEphDJZF2xtUTkwsggeWjoC3GIxgGApfn4t8CGMSbMjJK\nLpeazpUy6SXtgC9xH9MpTMNm4yuxZM200ikY8F98DL90+eve8wtUHfHWkdgQ\nysumuu+fJ+qwQ9FfossPe0whnDjmra8p67JE3Wq7tzB9olpsc+ZwavFvPJeL\nekLaLX49NgvwEPyqQksuPqMaqKtd3dZjF1Hsph/rmbsqj4kAyhDg+jfFnBqn\nYDpu1a2HnpOi1zga0tvuWAQmrWI96j0DYhviK5N5wezkjikliI2Tn6hAKvdh\nFuUCOTT9tU190NVHqAVtMhi7efZkDzV9OBCTPlBjpFDIEk8sSmFO0N53nVU4\nFuMvXerlBMaHSgQ4QukThv6QH85C9aFLggaMHGDJ27HEz0lPHq2DooDcIxPb\nbmTJH8Z9Fy/mQiDmN+RNSUi81vcke8+7JEzf2F+15tkEhGLq7M65c4sx/WFa\nLyWqKQqnmSux3r0Amag6h7h6kIvwK8i0ElClgUN3+OYMUh1MgenSAFQEGG6r\n1o/U0bYRh8YtydaP+q3ES+nS/IG+tPZUdYY1ivKIGHnJI8qHXvPn3Wk8q3Wx\nytTvRZnplLZB7Qi7KAJY8GURzn0bGWjKos4WKHnSEYPOxqEZBwp818zUWw9v\nsQfD\r\n=J1JI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC1owLSkz9okzdS+6KX6AVnlDLp3+5u9WJIZmb0s9VBoAiA3dwKENspZP9oWNRPAVpVm/UUSHp5lHgyZQWT1wTnKgA=="}]},"maintainers":[{"name":"aparna036","email":"aparna036@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/changelog-extract_1.0.0_1552364217597_0.9117318590129191"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-12T04:16:57.422Z","1.0.0":"2019-03-12T04:16:57.835Z","modified":"2022-04-04T14:32:14.318Z"},"maintainers":[{"name":"aparna036","email":"aparna036@gmail.com"}],"description":"This package is used for extracting changelogs from your projects","homepage":"https://bitbucket.org/atlassian/changelog-extract#readme","repository":{"type":"git","url":"git+ssh://git@bitbucket.org/atlassian/changelog-extract.git"},"author":{"name":"Aparna Raj"},"license":"MIT","readme":"# Changelog Extract\nThis library is designed to help you display changelogs and changelog information, as well as filtering a complete changelog to the relevant subset of changes.\n\nWe have two exports:\n\n```js\nimport Changelog from 'package-name'\n```\n\nwhich is a react component, and\n\n```js\nimport { divideChangelog, filterChangelogs } from 'package-name'\n```\n\nwhich are function.\n\n## Changelog Component:\n\nThe changelog component is designed to display changelog entries in react. A base use-case would look something like:\n\n```jsx\nimport Changelog from `package-name`\nconst stubChangelog = `# This package itself\n\n## 1.0.0\n- [major] 24601\n\n## 0.5.0\n- [minor] Who am I?\n\n## 0.4.3\n- [patch] And so, Honor, you see it's true,\n- [minor] That man bears no more guilt than you!\n\n## 0.4.2\n- [patch] Who am I?\n- [patch] I am Jean Valjean!\n\tYou see, I decided for these changelogs that I wanted to demonstrate how it renders a bunch of different content.\n\t\n\tWe convert and render *whatever* markdown is in a changelog entry.`\n\n\nexport default () => (\n\t<Changelog changelog={stubChangelog} />\n)\n```\n\nNote that we can also filter changelogs using the `range` prop, so if we modified the above component to be:\n\n```jsx\n<Changelog changelog={stubChangelog} range=\"^0.5.0\" />\n```\n\nWe would only see the changelog for `0.5.0` as it is the only one that matches that semver range.\n\nThe range property accepts any semver function for its filter comparison\n\nFor an example you can check out [this codesandbox](totes-a-link)\n\n### Quick and dirty props table:\n\n* `changelog`: The contents of a changelog file to be displayed. For more information on how we split and manage this, check out the `divide-changelogs` explanation below.\n* `range`: the semver range within the changelog to be displayed.\n* `entriesPerPage`: Set the number of entries to be shown per page. \n\n## Functions\nWe also export a couple of utility functions if you want to use these features but want to write your own renderer (or are not using react). We'll talk you through what they are doing so you can easily understand this package.\n\n### divideChangelog\n\nDivide changelog is the function that takes in a string, and return an array of changelogEntry objects. Its pattern looks something like this:\n\n```js\ndivideChangelog(stubChangelog)\n// outputs\n[\n    {\n        version: '1.0.0',\n        text: `## 1.0.0\n- [major] 24601`,\n    },\n    {\n        version: '0.5.0',\n        text: `## 0.5.0\n- [minor] Who am I?`,\n    },\n    {\n        version: '0.4.3',\n        text: `## 0.4.3\n- [patch] And so, Honor, you see it's true,\n- [minor] That man bears no more guilt than you!\n`,\n    },\n    {\n        version: '0.4.2',\n        text: `## 0.4.2\n- [patch] Who am I?\n- [patch] I am Jean Valjean!`,\n    },\n];\n\n\n```\n\nThe logic to divide the changelog is relatively simple, splitting the markdown file on the start of every `h2` (`##` in markdown). We then parse out the version being discussed (assuming it immediately follows the `h2`).\n\nWe also assume that we can find the version on the `h2` line to give each object a version number.\n\nThis allows you to map your changelog entries to a react component, or otherwise display, filter and analyse this information.\n\nCheck out [this sandbox]() to explore using the functions.\n\n## filterChangelog (do we need this?)\nfilterChangelog takes in an array of changelogs in the format output by `divideChangelog`, and a semver range, and returns only changelog version that match that semver range.\n\n```js\nconst narrowedChangelogs = filterChangelog(arrayOfEntries, \"^0.4.0\")\n```\n\nThe functions use a file import to ensure easy code splitting if you are not using react, but want this feature.\n\n## Importing a changelog\n\nWhen using this tool, it is going to work best if you can use your actual changelog from your git repository. Here are several strategies for reading this information in:\n\n### Webpack's Raw Loader\n\n### Fetching the raw file from your repository\n\n### Use `fs` to read it in and expose it server-side","readmeFilename":"README.md"}