{"_id":"@campus-online/gatsby-source-git","_rev":"1-21aab5334e5f3dcfaa35525f4cc8b3ca","name":"@campus-online/gatsby-source-git","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"@campus-online/gatsby-source-git","version":"0.0.0","description":"Source plugin for pulling files into Gatsby from git repositories","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/campus-online/gatsby-source-git.git"},"keywords":["gatsby","gatsby-plugin","gatsby-source-plugin","git"],"author":{"name":"Leonardo Dino"},"license":"MIT","peerDependencies":{"gatsby":"^2.0.0"},"bugs":{"url":"https://github.com/campus-online/gatsby-source-git/issues"},"homepage":"https://github.com/campus-online/gatsby-source-git#readme","dependencies":{"fast-glob":"^2.2.3","gatsby-source-filesystem":"^2.0.4","git-url-parse":"^11.1.1","simple-git":"^1.105.0"},"licenseText":"MIT License\n\nCopyright (c) 2018 Stephen Tweeddale\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@campus-online/gatsby-source-git@0.0.0","dist":{"shasum":"3afca03dd85c03f11b7705fd645537e83b76a064","integrity":"sha512-/kClFRzDajg/FBTKI4vn3Sqnu8cmm9co18U6Rhu4SnZ+LS/DyAmTa3fTt/83ux6hZDjmdSf1Viu0fwV7HhHo3Q==","tarball":"https://registry.npmjs.org/@campus-online/gatsby-source-git/-/gatsby-source-git-0.0.0.tgz","fileCount":7,"unpackedSize":9936,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLxg+CRA9TVsSAnZWagAAxQEP/jft/dZfjhcAasH7La2d\n3f+hgb5OO67HoBUIJ6PHL1Df1bAZsthXRGsnJdW9VCNT/shkq0iobOS52nYG\nosJCJ2+O9StEImij7ByeRsyZIPTI1OqcMRPMfFXBj37i7yXl2omdFvXZ4+ui\nw8LDM0/ASFnXAvr5qh1usDPVFSe4E2PFgpyR7/Q2/3PiM9NY+MuETQai2WI2\nk6pD6ccEG/N0RUF6JZGApaBmmgKIS2mb78B2Ny7Zh7zcpXMpgkV8K2+ZngJd\nvAEg/sft0Jn7iH7tBGtzfwSLy06rRyE5dNAV79B3q1N8edXAPJ7FIKtxabZl\nL08r4MncMZ/igrKSjlA9xY3WpyiQ/mHtDGUdCt8n7CEwIvSMPCZIEEVRZrIU\nzKFjVVCX/MqYFMFUhFEQ+GUc+IYDLWI3BTI57fd7jeJTsjcuUcCUJpbsh3zq\nblXA9L8TGOxXYfAEnH45tIxe+tb4UfCx/2Fbf6UpJ1OMlbC08w7DangVrpsE\nM91t4ATRVkUnLYWEmTxriEIhjzSxlTl/5HYEo9Wbsz3DCiSYON32I6HqxrLy\noSzdsTded7E68aAdnhHILY4IdBAJts2L7uVJcYGVIHtG8a3606EOtA/DeTvM\nLvej4GdxoyN1tmPelCMBhS4ZFWp1I7izRCbOJdcTJtnqPRd97vIG+ImIYhbK\nsrJ4\r\n=EKq3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCkAw3X2i4HCyRLIYZOjAhE0btVDxNW0KAaLb2I5i/8AiBtszJZXeAMJnHts+oypF33THMnqlcmVQgOgLX0c4pJLA=="}]},"maintainers":[{"name":"leonardodino","email":"leonardo@kunstdesign.com.br"}],"_npmUser":{"name":"leonardodino","email":"leonardo@kunstdesign.com.br"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-source-git_0.0.0_1546590270276_0.8048106762289771"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-04T08:24:30.114Z","0.0.0":"2019-01-04T08:24:30.390Z","modified":"2022-04-04T21:35:21.912Z"},"maintainers":[{"name":"leonardodino","email":"leonardo@kunstdesign.com.br"}],"description":"Source plugin for pulling files into Gatsby from git repositories","homepage":"https://github.com/campus-online/gatsby-source-git#readme","keywords":["gatsby","gatsby-plugin","gatsby-source-plugin","git"],"repository":{"type":"git","url":"git+https://github.com/campus-online/gatsby-source-git.git"},"author":{"name":"Leonardo Dino"},"bugs":{"url":"https://github.com/campus-online/gatsby-source-git/issues"},"license":"MIT","readme":"# gatsby-source-git\n\nSource plugin for pulling files into the Gatsby graph from abitrary Git repositories (hosted anywhere). This is useful if the markdown files you wish to render can't live within your gatsby codebase, or if need to aggregate content from disparate repositories.\n\nIt clones the repo(s) you configure (a shallow clone, into your cache folder if\nyou're interested), and then sucks the files into the graph as `File` nodes, as\nif you'd configured\n[`gatsby-source-filesystem`](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/)\non that directory. As such, all the tranformer plugins that operate on files\nshould work exactly as they do with `gatsby-source-filesystem` eg with\n`gatsby-transformer-remark`, `gatsby-transformer-json` etc.\n\nThe only difference is that the `File` nodes created by this plugin will\nalso have a `gitRemote` field, which will provide you with various bits of\nGit related information. The fields on the `gitRemote` node are\nmostly provided by\n[IonicaBazau/git-url-parse](https://github.com/IonicaBizau/git-url-parse), with\nthe addition of `ref` and `weblink` fields, which are\nthe 2 main things you probably want if you're constructing \"edit on github\"\nstyle links.\n\n## Requirements\n\nRequires [git](http://git-scm.com/downloads) to be installed, and to be callable using the command `git`.\n\nIdeally we'd use [nodegit](https://github.com/nodegit/nodegit), but it doesn't support shallow clones (see [libgit2/libgit2#3058](https://github.com/libgit2/libgit2/issues/3058)) which would have a significant effect on build times if you wanted to read files from git repositories with large histories.\n\nOnly public repositories are supported right now. But a PR should be simple enough if you want that.\n\n## Install\n\nNot published on npm yet, so for now:\n\n`npm install --save stevetweeddale/gatsby-source-git`\n\n## How to use\n\n```javascript\n// In your gatsby-config.js\nmodule.exports = {\n  plugins: [\n    // You can have multiple instances of this plugin\n    // to read source nodes from different repositories.\n    {\n      resolve: `gatsby-source-git`,\n      options: {\n        name: `repo-one`,\n        remote: `https://bitbucket.org/stevetweeddale/markdown-test.git`,\n        // Optionally supply a branch. If none supplied, you'll get the default branch.\n        branch: `develop`,\n        // Tailor which files get imported eg. import the docs folder from a codebase.\n        patterns: `docs/**`\n      }\n    },\n    {\n      resolve: `gatsby-source-git`,\n      options: {\n        name: `repo-two`,\n        remote: `https://bitbucket.org/stevetweeddale/markdown-test.git`,\n        // Multiple patterns and negation supported. See https://github.com/mrmlnc/fast-glob\n        patterns: [`*`, `!*.md`]\n      }\n    },\n    {\n      resolve: `gatsby-source-git`,\n      options: {\n        name: `repo-three`,\n        remote: `https://bitbucket.org/stevetweeddale/markdown-test.git`,\n        // Multiple \"sourceInstanceName\" on the same repo via object.\n        patterns: {\n          articles: `docs/articles/*.md`,\n          authors: `docs/authors/*.md`,\n        }\n      }\n    }\n  ]\n};\n```\n\n## How to query\n\nYou can query file nodes exactly as you would node query for nodes created with\n[`gatsby-source-filesystem`](https://www.gatsbyjs.org/packages/gatsby-source-filesystem/),\neg:\n\n```graphql\n{\n  allFile {\n    edges {\n      node {\n        extension\n        dir\n        modifiedTime\n      }\n    }\n  }\n}\n```\n\nSimilarly, you can filter by the `name` you specified in the config by using\n`sourceInstanceName`:\n\n```graphql\n{\n  allFile(filter: { sourceInstanceName: { eq: \"repo-one\" } }) {\n    edges {\n      node {\n        extension\n        dir\n        modifiedTime\n      }\n    }\n  }\n}\n```\n\nAnd access some information about the git repo:\n\n```graphql\n{\n  allFile {\n    edges {\n      node {\n        gitRemote {\n          webLink\n          ref\n        }\n      }\n    }\n  }\n}\n```\n","readmeFilename":"README.md"}