{"_id":"@asyarb/use-static-query","_rev":"5-d3422131976cebd3a5c6484626bfec4e","name":"@asyarb/use-static-query","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.1":{"name":"@asyarb/use-static-query","version":"0.1.1","description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","main":"dist/index.js","module":"dist/index.module.js","types":"dist/src/src/index.d.ts","exports":{".":"./dist/index.modern.js","./next":"./dist/next.modern.js"},"scripts":{"build":"microbundle src/index.ts src/next.tsx --jsx React.createElement --format modern,es,cjs","dev":"microbundle watch src/index.ts src/next.tsx --jsx React.createElement","test":"jest","prepare":"yarn build","release":"standard-version"},"dependencies":{"react-is":"^17.0.1","react-ssr-prepass":"^1.2.1"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@testing-library/jest-dom":"^5.11.6","@testing-library/react":"^11.2.2","@types/jest":"^26.0.19","@types/react":"^17.0.0","@types/testing-library__jest-dom":"^5.9.5","@types/testing-library__react":"^10.2.0","husky":"^4.3.6","jest":"^26.6.3","microbundle":"^0.13.0","next":"^10.0.4","prettier":"^2.2.1","react":"^17.0.1","react-dom":"^17.0.1","standard-version":"^9.0.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"peerDependencies":{"react":"^16.12"},"prettier":{"semi":false,"printWidth":80,"singleQuote":true},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2020 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@asyarb/use-static-query@0.1.1","dist":{"shasum":"381fd412ad6154029bac559df850d71366e93ef5","integrity":"sha512-flIGyIT+WWoo9ukeKwystyslM7klPawOtungtpesBcOMgXf807FDOkSg1wGqqqNxFAiz4REWofuHf3JNqBJl2g==","tarball":"https://registry.npmjs.org/@asyarb/use-static-query/-/use-static-query-0.1.1.tgz","fileCount":32,"unpackedSize":69436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5rtWCRA9TVsSAnZWagAAA6AP/A8V8g77ZRGJ2pwPkREV\n0Y9Avjn4gu01dXlhPNa6UEtnqRguzeLMcYHGxhWEZNWM1MNdww3kv5dopCiP\n1LDof4XcNRMmdcnyLut3U+S1haK9hRv/BpW+pRk9KIS5kG00mJzYNpPok1lc\ntzDnwh33bn18uzZ8vQHR3Sk/iI6dva5N4Il3s7VAt8nY1ptvBgFHjOyYKiar\nYuMnEg96b88RPeOW8QD6WgJc7ykwzt01nBpqwFv2qzd6VW9FRz3Df64kMqnj\nVxbVk4oWoEb4EEf/gDHc2UCGlDsEYoI2kU3zT0PzdFB6hakG6s/3U1zaInaC\n0gX3uZiNjBCTr2Lk7LcGGQkwThZmHU2AfJ3b0D0OfQMclrLJVKkZxxxknfFD\nzSTvoRmEelANZZ85J8OIgZSs/qE8sV0HmV4faH/MBMgy9gORNoAMfm9bziiu\nnN9+a4bWfln1XGrqgg2h1ZRFq4fI2mXWWMY2T8cf0Sa47ZQN/wwyUAtKpIbL\nmK2ZqgU3K6tHQIPNuqFm3MUEcRKsNixIxLE860FG9xnXrjxy1q2JHx+LS8JO\n1h9mp/vkfptcaqsX9fiTJmpOCuwunnHMFr9fWol4Ok3WZPA0RlG9r+s/tVt4\nVnW/fgzZ3JkNc51fojEaxIYG+ynEs82286mrEfVt1MzX0GmN5kvW1UhdDlO9\nNP3J\r\n=m1U2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID8Jqq8/8WU+UhTVDRViRRVpZ4nKsxejQign6kKzsVs6AiA3i0dBR+/Nn3lVvJxb5D0N+7g7JxDT7wHFXSCr/UrilQ=="}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-static-query_0.1.1_1608956757697_0.7206673902144265"},"_hasShrinkwrap":false},"0.1.2":{"name":"@asyarb/use-static-query","version":"0.1.2","description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","main":"dist/use-static-query.js","module":"dist/use-static-query.module.js","types":"dist/src/src/use-static-query.d.ts","exports":{".":"./dist/index.modern.js","./next":"./dist/next.modern.js"},"scripts":{"prebuild":"rimraf dist","build":"microbundle src/index.ts src/next.tsx --jsx React.createElement --format modern,es,cjs -o dist","postbuild":"cp ./dist/src/*.ts ./dist && rimraf ./dist/src && rimraf ./dist/tests && mv ./dist/index.d.ts ./dist/use-static-query.d.ts","test":"jest","prepare":"yarn build","release":"standard-version"},"dependencies":{"react-is":"^17.0.1","react-ssr-prepass":"^1.2.1"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@testing-library/jest-dom":"^5.11.6","@testing-library/react":"^11.2.2","@types/jest":"^26.0.19","@types/react":"^17.0.0","@types/testing-library__jest-dom":"^5.9.5","@types/testing-library__react":"^10.2.0","husky":"^4.3.6","jest":"^26.6.3","microbundle":"^0.13.0","next":"^10.0.4","prettier":"^2.2.1","react":"^17.0.1","react-dom":"^17.0.1","rimraf":"^3.0.2","standard-version":"^9.0.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"peerDependencies":{"react":"^16.12"},"prettier":{"semi":false,"printWidth":80,"singleQuote":true},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2020 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@asyarb/use-static-query@0.1.2","dist":{"shasum":"840a5baedd6d89e491863830cc86317f585ac98c","integrity":"sha512-kH6SMA6JAG/sXD+4QScFeTUhFNe6ApI0S568uUPfB6Z6EA2yjLN3XQMAzgly5TSOu6g1qQz4x1V68jXdEGtA3g==","tarball":"https://registry.npmjs.org/@asyarb/use-static-query/-/use-static-query-0.1.2.tgz","fileCount":23,"unpackedSize":61399,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5sBpCRA9TVsSAnZWagAARc0P/j1B3gvaTBufc2XY/5MU\nF50EyB9POI66gkWeNxFnkA4Ko0txfY6N3kKvVHEi64N2sIyARsFNd4JApOuG\nL6jwiHH2iE/s4lZ5kC5Q7PW8lpBW5B8BPEvRRFwOVLjjGaxfn2A9pe+y3qrs\neL4IGryQ5syqGKkj6PmM4G1fmArJE+L77wMs9OtXhoFA+8nP2y940aH7XGJ8\n+D2iocpH4YAFqcOJ8IGuWtoEyQbmJGc1YcHu7pjL5ch/gPXu07uG7keH+SZ0\nqATUtVwtRmhQQKj89StFryIfnCIVOpnrun6G5owbTYBr8jvCl8bsYaaP7kfW\n2E6DwUNWdprzw8wAJIHkU5uR7Txvd2kpl9/UX+ZSnZr1TkCPEs6wXg12Jg57\n5nfIGVhRQ+g7eO7dzlhgCulamtJVW7BiePmvMc/V9wNrxgmvVY57fz03sCG8\n6o3ZhUTC5TBLsI5YseLBNYJlYABWbBMvRBZcvDISsRfVhKzznSml6fBxbByk\n0VhgAIZN8f+trz0ecIDTUb+jZSOiyPsp9sG7FFlUxPfTIeODyIvWot1/vOm9\n2RYbQC8jXKKBrWM89kzZyGo7DQCky3R5so1F/JaTu8twcp9iJqD3wLB1WxSH\noEs1tQKHbP1dCe3jyr2nAI5rRIjvY0mw7Gj+luXkkadhQGPQ8YRZmwR50Njc\nO9rH\r\n=u5OL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCfWTlDOCKcEIlwH3su+oxMBgC34dj/y/l8e/lVVbiMfwIhANTpDUn8JSIsKvXr0X/jzFNMyK//J/ElTu856xhUIY4K"}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-static-query_0.1.2_1608958057028_0.5112008568789073"},"_hasShrinkwrap":false},"0.1.3":{"name":"@asyarb/use-static-query","version":"0.1.3","description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","main":"dist/use-static-query.js","module":"dist/use-static-query.module.js","types":"dist/use-static-query.d.ts","exports":{".":"./dist/index.modern.js","./next":"./dist/next.modern.js"},"scripts":{"prebuild":"rimraf dist","build":"microbundle src/index.ts src/next.tsx --jsx React.createElement --format modern,es,cjs -o dist","postbuild":"cp ./dist/src/*.ts ./dist && rimraf ./dist/src && rimraf ./dist/tests && mv ./dist/index.d.ts ./dist/use-static-query.d.ts","test":"jest","prepare":"yarn build","release":"standard-version"},"dependencies":{"react-is":"^17.0.1","react-ssr-prepass":"^1.2.1"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@testing-library/jest-dom":"^5.11.6","@testing-library/react":"^11.2.2","@types/jest":"^26.0.19","@types/react":"^17.0.0","@types/testing-library__jest-dom":"^5.9.5","@types/testing-library__react":"^10.2.0","husky":"^4.3.6","jest":"^26.6.3","microbundle":"^0.13.0","next":"^10.0.4","prettier":"^2.2.1","react":"^17.0.1","react-dom":"^17.0.1","rimraf":"^3.0.2","standard-version":"^9.0.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"peerDependencies":{"react":"^16.12"},"prettier":{"semi":false,"printWidth":80,"singleQuote":true},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2020 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@asyarb/use-static-query@0.1.3","dist":{"shasum":"8b9cd3f036847a9ebb26a8486e710034ffe1fa1e","integrity":"sha512-ZXGRiURUbTjwPxB5ILlU2O+4CJn5oVXAyBdch0b8eOJPe8bK3RXCwan0f5nJkZobqXDBIoUhJp0ejJZRFDoi/Q==","tarball":"https://registry.npmjs.org/@asyarb/use-static-query/-/use-static-query-0.1.3.tgz","fileCount":23,"unpackedSize":61616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf5sEWCRA9TVsSAnZWagAA4f8P/2/rVw7AoDvPnyfdWnUn\neAGUzL9kx7vZUbLrWGgYfO+HKO8/yNC8GGN8ajqLpMZ/rVTkf32roL0IaHXI\nsH1GOujDDd1rDFicYqa3UCTnXrrLpssAKq7QWzrDmP+K9Boc1RN8BceEvm/u\nI3uSFQ5uOKcdoISEojfWeNUqTARr4HWh+EO25nUv09BSRPzGhW/VBvX69lbK\nQGT6/CduMAMoTKYO9a+XeZagVVz/3L5YBU8SkQ2C/pRNbDJSkmNTSkdyYxmk\nbsKVSKXEKvIUmz9tDf2kftLFQyNBEbi0oNWo5djCuWN63+miik61w72FLbM0\n9MZcOe/+jzYa58Ckb87BvZ0OoP6DO4cMzmZLKD4rcReWsK+9Va9FU0Ik0wgf\nKNDiwgGwuMxR+iW0vs2rDxw6RUTYjLcBHzBcs/6cqRX0RHWj7jRz4tRU0riI\nXMhBcfM6b81b0DPPzEAM2KgnkvNuQA5wQke/kiEkgyRY2H+VsxnXGGnKu8WA\nLPKi+uFBX0yDQMgUBAnYAwW1r8vSZdRBXZHoxw2Yvn4HnBTRo+4LfDRWI3Jp\nSZYj8D2yYZcaHmVtEz5Rvjq5sEKJ3Frd5ULVxdwTw5j1OXlmCFneg62d4o/O\nvjen8a7v2rOSXmAMJRSuHpKlUWKrI2jbutZtSPwvt9HLwg5SGWi4nWOxEzl2\ngAuZ\r\n=Y2rX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwOnoCPlFXs710IzSyreICw5v8uT9/Y29NOZGhIU0fGAiEA4L8Hek/Ok3yvdplbo2E8iq8v5kCXpmcOHtVeOd40Vt8="}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-static-query_0.1.3_1608958230197_0.6626468591134342"},"_hasShrinkwrap":false},"0.2.0":{"name":"@asyarb/use-static-query","version":"0.2.0","description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","main":"dist/use-static-query.js","module":"dist/use-static-query.module.js","types":"dist/use-static-query.d.ts","exports":{".":"./dist/index.modern.js","./next":"./dist/next.modern.js"},"scripts":{"prebuild":"rimraf dist","build":"microbundle src/index.ts src/next.tsx --jsx React.createElement --format modern,es,cjs -o dist","postbuild":"cp ./dist/src/*.ts ./dist && rimraf ./dist/src && rimraf ./dist/tests && mv ./dist/index.d.ts ./dist/use-static-query.d.ts","watch":"yarn build --watch --no-compress","test":"jest","prepare":"yarn build","release":"standard-version"},"dependencies":{"react-is":"^17.0.1","react-ssr-prepass":"^1.2.1"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@testing-library/jest-dom":"^5.11.6","@testing-library/react":"^11.2.2","@types/jest":"^26.0.19","@types/react":"^17.0.0","@types/testing-library__jest-dom":"^5.9.5","@types/testing-library__react":"^10.2.0","husky":"^4.3.6","jest":"^26.6.3","microbundle":"^0.13.0","next":"^10.0.4","prettier":"^2.2.1","react":"^17.0.1","react-dom":"^17.0.1","rimraf":"^3.0.2","standard-version":"^9.0.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"peerDependencies":{"react":"^16.12"},"prettier":{"semi":false,"printWidth":80,"singleQuote":true},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2020 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@asyarb/use-static-query@0.2.0","dist":{"shasum":"56019b7ec4c13a06e349e4c40ec0e80d62151669","integrity":"sha512-w+jKiP+Jc8h3swJt4BQmC8c12ID6DBM9C9FwXTsPN/zeo8mRfBiHg033yfdp6vkK7VqKdrCa4grEEFFO8S/kDg==","tarball":"https://registry.npmjs.org/@asyarb/use-static-query/-/use-static-query-0.2.0.tgz","fileCount":24,"unpackedSize":64708,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNisgCRA9TVsSAnZWagAAOY0P/RGNKwDBSYh3tzTcCtws\n4xoszmBMGu8R58abG4I3rMbQ1lxk13ag4IBQK1Sb7KYLr5z2S0wXHame5yV6\nSaTLK0S4ikCrJ8NE+PiVM4xODZpjEA1jMvl1n7mbqZYnBGUW/03gQFCGVBfV\nrk4oXwYnHjkTlrR0YAtUFWtcK1pJ6rHzsQBUDUsf8P5ivLoAzSyoJgwIY6Os\n0Zm873/XbxUeNQP07ubwKuHcT49BEAQKr3N++/aKLx+XEWiWp/VojIjlxFD8\nQqBcrRlqbg365nG1jgAj1iw9JlVXqMCYoVYCPGpT67U/rwE9eDhxcIYeCs5F\n0xhodBs2XnRpG/x1vO20S7irs7tWt2gtiNqQFuZargLArcY2xudE+b68TvwJ\nVWeKnVNDea0+WUWwnQ4b5Q0aIxcqGDCLWKjNdG+amnGzqggFNG7OHvQOGLQH\nmFdLIUk0JvjCEKDOIXauJOZZG/U28MxfbBH3Rxrh2du4EOIxomzILl/7Y+pq\n9JPFC1KvLwfFxD9dgHsMWjRMH3Rhm862tpIT5SnMaOl1t3nSqOe2pBj0DIGN\nndOSkP/cN9DRNJhA5pv/Gq7g2uD2gTL6c/DVfmjtk0T28lDs1YQ6rKELj8iw\n63L3CfapNLOOmD1BGljtAbwheeJmTLT7hCF1do5iuusXmdHz7HY1Tss3UXwn\nwJWy\r\n=xyBp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw72DayQ1TlHGtwf5ukCFh8S+AK2wquzoTEFj95zbmzAIhAMyHRbjpZ1hvMfBA8x9SwyAtBB93KPadfxVMpHKurl7W"}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-static-query_0.2.0_1614162719702_0.15666303375510915"},"_hasShrinkwrap":false},"0.3.0":{"name":"@asyarb/use-static-query","version":"0.3.0","description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","main":"dist/use-static-query.js","module":"dist/use-static-query.module.js","types":"dist/use-static-query.d.ts","exports":{".":"./dist/index.modern.js","./next":"./dist/next.modern.js"},"scripts":{"prebuild":"rimraf dist","build":"microbundle src/index.ts src/next.tsx src/preload.tsx --jsx React.createElement --format modern,es,cjs -o dist","postbuild":"cp ./dist/src/*.ts ./dist && rimraf ./dist/src && rimraf ./dist/tests && mv ./dist/index.d.ts ./dist/use-static-query.d.ts","watch":"yarn build --watch --no-compress","test":"jest","prepare":"yarn build","release":"standard-version"},"dependencies":{"react-is":"^17.0.1","react-ssr-prepass":"^1.2.1"},"devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@testing-library/jest-dom":"^5.11.6","@testing-library/react":"^11.2.2","@types/jest":"^26.0.19","@types/react":"^17.0.0","@types/testing-library__jest-dom":"^5.9.5","@types/testing-library__react":"^10.2.0","husky":"^4.3.6","jest":"^26.6.3","microbundle":"^0.13.0","next":"^10.0.4","prettier":"^2.2.1","react":"^17.0.1","react-dom":"^17.0.1","rimraf":"^3.0.2","standard-version":"^9.0.0","ts-jest":"^26.4.4","typescript":"^4.1.3"},"peerDependencies":{"react":"^16.12"},"prettier":{"semi":false,"printWidth":80,"singleQuote":true},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"commitlint":{"extends":["@commitlint/config-conventional"]},"licenseText":"Copyright 2020 Anthony Yarbrough\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","_id":"@asyarb/use-static-query@0.3.0","dist":{"shasum":"11156fd0ab9f73b40a266a9a980bd86216db4f01","integrity":"sha512-WrorsNcFg/+NztbodkoCoEWeY8b7woJ94zIB8z6CMIyHHFZzBvYt1sdXygmCQCU1koeduAcDIAJleNSmHjdZcw==","tarball":"https://registry.npmjs.org/@asyarb/use-static-query/-/use-static-query-0.3.0.tgz","fileCount":30,"unpackedSize":73940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNi7oCRA9TVsSAnZWagAAKn8QAJ1VjT5ZE4eRFgYxW5pa\ntFR75jL4SsgBPaHFftE17M8HipQFXGU9vPnf0n83k1rWSz6qAD2AVM5Ae78x\nxHj22Wqe6zzWcA3cONeCfBA0X1S5Ym9BAEaMbHRql0VPTu4hmFXxj+XD599n\neQxM8GeSz/s1c37pprfAddnZ2yXjxEaYEatVduDdBGzpxSZA8hmIpTqbIhRv\nwXDlI91bqNdYqAsmDXpdR3bOzFc6Csu90vzo/l3vbPzRG7te9SZMSV7jPd5B\n/ZGuky3nPj+rAvoJ5qKuEioJ5VM1C3p0AJzx0wmK47zQN5zgNN5R3IPKvF8e\na5f2BCJLQD3jW9aLQSLmbAUtyi7/OgN5hz8JNcpU27Uh5tvDZjIcHNfMYJbI\nEHq8yWKqAalVIWbFWiFZn2VpU6Iod8mSpyf3ITXu+2Y2FSBbFBMH7dAzhEGo\noZxfQGtKAy78He9rGEjIznA3HbXGD2vdXQA0MITSlwwyp1UKjmz5aT9Ht48M\nfP0B0ewX1PPKiJdQxLt+FjKOrzDbO1CQpTimPJnEewZ+vdXPvI768ShyA4bd\nmW7neXgCQ1r+XeYD5m9YI2d0vKi1OVBjhSWekGY42MhBnG9vocwm1IZMABKq\n7SLCK+KL3n2WKJ890prneuV1zElJjqqM3BZRV7E8i/7mJ2WxruKuErluhzK5\nPUkc\r\n=4eMa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICQvOjMxxC65qyRDizW6jlS0v3IxKEJRKT22/SqobHMvAiEA1Qcg+SeiQSdaybMMlw69Gf0Yhe6vudyHPSUWmBRU8EE="}]},"_npmUser":{"name":"asyarb","email":"asyarb@hawaii.edu"},"directories":{},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/use-static-query_0.3.0_1614163688427_0.5703684099845623"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-26T04:25:57.638Z","0.1.1":"2020-12-26T04:25:57.882Z","modified":"2022-04-04T16:00:51.231Z","0.1.2":"2020-12-26T04:47:37.161Z","0.1.3":"2020-12-26T04:50:30.356Z","0.2.0":"2021-02-24T10:31:59.908Z","0.3.0":"2021-02-24T10:48:08.559Z"},"maintainers":[{"name":"asyarb","email":"asyarb@hawaii.edu"}],"description":"Data fetching hook tailored for use in static sites.","repository":{"type":"git","url":"https://github.com/asyarb/use-cached-query"},"author":{"name":"Anthony Yarbrough","email":"asyarb@hawaii.edu"},"license":"MIT","readme":"# Use Static Query <!-- omit in toc -->\n\nA framework-agnostic data fetching hook and cache solution tailored for use\nin static sites.\n\n**NOTE**: This library has not been released yet and is still being actively\ndeveloped. The API detailed below may change at any time.\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Motiviation](#motiviation)\n  - [Is this like Gatsby's `useStaticQuery`?](#is-this-like-gatsbys-usestaticquery)\n  - [Isn't this also like React Query's `useQuery`?](#isnt-this-also-like-react-querys-usequery)\n- [API](#api)\n  - [`useStaticQuery()`](#usestaticquery)\n    - [Arguments](#arguments)\n  - [`<CacheProvider>`](#cacheprovider)\n    - [Options](#options)\n  - [`StaticCache`](#staticcache)\n  - [`staticCache.preload`](#staticcachepreload)\n    - [Arguments](#arguments-1)\n  - [`staticCache.serialize`](#staticcacheserialize)\n  - [`staticCache.get`](#staticcacheget)\n    - [Options](#options-1)\n    - [Returns](#returns)\n  - [`staticCache.set`](#staticcacheset)\n    - [Options](#options-2)\n  - [`StaticCache.fromSerializedCache`](#staticcachefromserializedcache)\n    - [Options](#options-3)\n    - [Returns](#returns-1)\n- [License](#license)\n\n## Installation\n\n```bash\n# npm\nnpm i @asyarb/use-static-query\n\n# yarn\nyarn add @asyarb/use-static-query\n```\n\n## Usage\n\nThe example below uses NextJS, but it can be adapted to be used in any rendering\ncontext.\n\n```jsx\n// components/Example.js\nimport { useStaticQuery } from '@asyarb/use-static-query'\n\n// Any API request that happens at build-time.\nasync function fetchPosts() {\n  return [{ id: 1, text: 'text' }]\n}\n\nlet Example = ({ pageId }) => {\n  //                        ↓ Function that returns a Promise.\n  let posts = useStaticQuery(fetchPosts, 'posts')\n  //                                     ↑ Cache key.\n\n  return (\n    <div>\n      {posts.map((p) => (\n        <Post key={p.id}>{p.text}</Post>\n      ))}\n    </div>\n  )\n}\n\n// ---------------------------------------------------------------------\n// pages/index.js\nimport { StaticCache } from '@asyarb/use-static-query'\n\nlet IndexPage = () => {\n  return (\n    <div>\n      <Posts />\n    </div>\n  )\n}\n\nexport default IndexPage\n\nexport async function getStaticProps() {\n  // At build time, we'll traverse our component tree\n  // and fill our cache with the results of our static queries.\n  let cache = new StaticCache()\n  await cache.preload(<IndexPage />)\n\n  return {\n    props: {\n      // Here, we serialize our cache and send it client-side.\n      serializedCache: cache.serialize(),\n    },\n  }\n}\n\n// ---------------------------------------------------------------------\n// pages/_app.js\nimport { StaticCache, CacheProvider } from '@asyarb/use-static-query'\n\nlet App = ({ pageProps, Component }) => {\n  // At run-time, read the cache we serialized in `getStaticProps` and\n  // hydrate it into our provider. This will feed the statically cached\n  // data to our components at runtime.\n  let cache = StaticCache.fromSerializedCache(pageProps.serializedCache)\n\n  return (\n    <CacheProvider cache={cache}>\n      <Component {...pageProps} />\n    </CacheProvider>\n  )\n}\n```\n\nIf you need to pass variables to a `useStaticQuery` function at build-time, consider using function composition:\n\n```jsx\n// components/Example.js\nimport { useStaticQuery } from '@asyarb/use-static-query'\n\nlet fetchRelatedPosts = (pageId) => async () => {\n  // use `pageId` here as needed:\n  return Posts.findRelated(pageId)\n}\n\nlet Example = ({ pageId }) => {\n  let posts = useStaticQuery(\n    fetchRelatedPosts(pageId),\n    `relatedPosts-${pageId}` // Use a cache-key with the variable:\n  )\n\n  return (\n    <div>\n      {posts.map((p) => (\n        <Post key={p.id}>{p.text}</Post>\n      ))}\n    </div>\n  )\n}\n```\n\n## Motiviation\n\nA lot of React-based static site generators provide APIs to source data into\npages at build-time, but often require you to orchestrate your data fetching\nin a central location (e.g. NextJS's `getStaticProps`).\n\nIn simple cases this works, but this can get quickly out of hand when you\nneed to pass your data down through several layers of components. Instead,\nthis package allows developers to declare their data dependencies from the\nbottom up, similar to how they would in a typical React app.\n\n### Is this like Gatsby's `useStaticQuery`?\n\nIf you've used Gatby's `useStaticQuery` hook before, this hook is similar but\nhas key differences:\n\n- Not tied to GraphQL.\n- Can have more than one instance of the hook in a file.\n- Not reliant on compile-time juju.\n- Allows for the use of variables via closures.\n\n### Isn't this also like React Query's `useQuery`?\n\nYes! The API was primarily inspired by React Query, but was tailored down for\nuse in SSG. Technically, you could use React Query in a very similar way with\ntheir latest `hydration` APIs, but this package provides a few niceities in\ncomparison:\n\n- No need to explicitly run `prefetchQuery` to get your data into your cache.\n- No need to prevent refetching at runtime if that isn't what you want.\n- Smaller bundle size, due to not having to support as many features.\n\nIf you're writing an app that _does_ have runtime reads & writes,\nyou should definitely choose a solution like React Query instead of this.\n\n## API\n\n### `useStaticQuery()`\n\nA React hook for fetching and reading static data. At build-time, this hook\nwill populate a cache with data. At run-time, this hook will only read data\nfrom cache unless the `disableRuntime` option is set to `false`.\n\n```tsx\nfunction useStaticQuery<T>(\n  promiseFn: () => Promise<T>,\n  cacheKey: string | number,\n  { disableRuntime = true }?: { disableRuntime?: boolean }\n): T\n```\n\n#### Arguments\n\n- `promiseFn: () => Promise<T>`\n  - **Required**\n  - The function that the query will use to fetch data at build-time.\n  - Must return a promise that will resolve data.\n  - Errors will be thrown as received. (You probably don't want to build your\n    site if data-fetching failed somewhere.)\n- `cacheKey: string | number`\n  - **Required**\n  - The cache key to use for this query.\n  - If you plan on using variables via composition, your `cacheKey` should\n    contain your variable in some capacity.\n- `Options`\n  - **Default:** `true`\n  - `disableRuntime` if set to `false`, the hook will attempt to perform a\n    query at **run-time** if there is no cached data available for the provided\n    `cacheKey`. If set to `true`, the hook will **only** read from the cache at\n    run-time. In most SSG contexts, you want this to be `true`.\n\n### `<CacheProvider>`\n\nThe React context provider that should be wrapped around the root component\nof your app. Provides access to the cache to callers of\n`useStaticQuery`.\n\n#### Options\n\n- `cache: StaticCache`\n  - **Required**\n  - Instance of `StaticCache`.\n- `children: React.ReactNode`\n\n### `StaticCache`\n\n`StaticCache` is the primary mechanism that manages all of the data of static queries. If needed, a cache object and its data can be accessed via a typical `get()` and `set()` pattern as well.\n\nAn instance of `StaticCache` has the following properties and methods:\n\n- [`preload(node: React.ReactNode)`](#staticcachepreload)\n- [`serialize()`](#staticcacheserialize)\n- [`get(key: string | number)`](#staticcacheget)\n- [`set(key: string | number, value: T)`](#staticcacheset)\n\n`StaticCache` also has the following static methods available:\n\n- [`fromSerializedCache(serializedCache?: string)`](#staticcachefromserializedcache)\n\n### `staticCache.preload`\n\n`preload` is an async method to traverse a React component tree and fill the `StaticCache` instance with the resulting data from the `useStaticQuery` hooks.\n\nThis function should only be called at build-time or in a server-side\ncontext.\n\n```jsx\nlet cache = new StaticCache()\nawait cache.preload(<Page />)\n```\n\n#### Arguments\n\n- `node: React.ReactNode`\n  - **Required**\n  - The React component tree to traverse and fill the cache with.\n\n### `staticCache.serialize`\n\n`serialize` is a function to serialize a `StaticCache` object to be sent to a client-side runtime.\n\n```jsx\nlet cache = new StaticCache()\nlet serializedCache = cache.serialize()\n```\n\n### `staticCache.get`\n\nA function to read cached values at a provided `cacheKey`. Use this to read\nvalues from your cache imperatively.\n\n```jsx\nlet posts = cache.get('posts')\n```\n\n#### Options\n\n- `key: string | number`\n  - **Required**\n  - The key to lookup in the cache.\n\n#### Returns\n\n- The value at the provided `key` or `undefined`.\n\n### `staticCache.set`\n\nA function to write `value` to the cache at the provided `cacheKey`. Use this to write\nvalues from your cache imperatively.\n\n```jsx\ncache.set('posts', [{ id: 1, text: 'text' }])\n```\n\n#### Options\n\n- `key: string | number`\n  - **Required**\n  - The key to write to the cache.\n- `value: T`\n  - **Required**\n  - The value to write to the cache.\n\n### `StaticCache.fromSerializedCache`\n\n`fromSerializedCache` is a static method on `StaticCache` that is used to instantiate a new `StaticCache` instance from a serialized instance made via `staticCache.serialize()`. This is typically ran at runtime to rehydrate your app with your build-time cache.\n\n```jsx\nlet cache = StaticCache.fromSerializedCache(pageProps.serializedCache)\n```\n\n#### Options\n\n- `serializedCache: string `\n  - **Required**\n  - The serialized cache to attempt to hydrate from.\n\n#### Returns\n\nAn instance of `StaticCache` whose data reflects the serialized cache it was instantiated from.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}