{"_id":"@bigsigmadevelopment/slate-config","_rev":"3-43021b7337af1a3a4622b825afd2b11a","name":"@bigsigmadevelopment/slate-config","dist-tags":{"latest":"1.0.0-beta.15"},"versions":{"1.0.0-beta.14":{"name":"@bigsigmadevelopment/slate-config","version":"1.0.0-beta.14","description":"Generate configurations for Slate packages by applying values from slate.config.js to override default values","main":"index.js","repository":{"type":"git","url":"https://github.com/bigsigmadevelopment/slate/tree/1.x/packages/slate-config"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bigsigmadevelopment/slate/issues"},"homepage":"https://github.com/bigsigmadevelopment/slate","_id":"@bigsigmadevelopment/slate-config@1.0.0-beta.14","_nodeVersion":"15.8.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-FFrXnQV2rmYef9G4dpCtOWjix51RgSpmfi3bVKPsuC/BUM1bvEWVvU7vHksu7LdKmfolfgxevGDl+JJR1mZmrg==","shasum":"9fe8ed57c5585d0db74d4082dffb618bb857ae1b","tarball":"https://registry.npmjs.org/@bigsigmadevelopment/slate-config/-/slate-config-1.0.0-beta.14.tgz","fileCount":7,"unpackedSize":13119,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgORoOCRA9TVsSAnZWagAA8t8P/ivPiPcj9hkLJQUrco34\nkHHYhWFsOdneN3/0ihz29gVcsGDhDcn8fUBQkBDOBiey2Kf1ZWfbeFs2Ogz1\nrgI1rZm2owNDU01tueLK7rkQ2gGEtl5BnJWF4LyglmQC4kZvGmYRVgm0y0Xc\nFNeTfH+fOArG6gekFUH2gxrjmdU/ZA3EPzz6M3k1eDikXG2UsITqdhgPs7B9\nhjkFtwwvHLTSnIQ6aJyWqbPtzjvd/mOEsXGXOqufuVuyGzKZid5QmB8EvPtU\nS1kuGshhprAziMVboT3gFZxCcSQ6A5m6xP/3vWxUB3MlyPAXpBlkoodVgSLj\ngPwBMzRa9EIFQf+p+nPQQ1FAZATUFdYs+VK8l038ZrP0TIcvUrki/LI7OzQp\nGWQttS3yq2dHkoqjhXAsISGudJd/fKtSurntMtksFbL7R7dCkQW7pDiCuRBv\nI9e/S5Ee/GLAdbO+AgtSzuwYRftFJ9bUSMa5u4uKfSlWpu2Lr6JBhr2iQXIi\nhT3RDzKquh3x2x+fLNUmxiHkAjGKIHv4AMSSJi8fvB/GLdeJ8rXvPHobsJrh\nBVcnkD4EVKfbufdLnDPe6XCWlbr6t2uYmRju+IP2fLXfGZccM+sHz0lxhaJF\ncXhTs5eaBd8RTNBNJHS66+U988YHcR1p1+HGnH3G859cia1De8HqGp2gPXL9\nTzF+\r\n=kFz2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAvPUJ/KiW6/1L0Jje7P/Xia7qzPW8uLrz+LEElt34TAAiEAkCR0QsNS4QjQShCoLzIjuzdmokpKhkaY+3za5nimm3A="}]},"_npmUser":{"name":"bigsigmadevelopment","email":"bigsigmadevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"bigsigmadevelopment","email":"bigsigmadevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slate-config_1.0.0-beta.14_1614354957682_0.08829462933354137"},"_hasShrinkwrap":false},"1.0.0-beta.15":{"name":"@bigsigmadevelopment/slate-config","version":"1.0.0-beta.15","description":"Generate configurations for Slate packages by applying values from slate.config.js to override default values","main":"index.js","repository":{"type":"git","url":"https://github.com/bigsigmadevelopment/slate/tree/1.x/packages/slate-config"},"author":"","license":"MIT","bugs":{"url":"https://github.com/bigsigmadevelopment/slate/issues"},"homepage":"https://github.com/bigsigmadevelopment/slate","_id":"@bigsigmadevelopment/slate-config@1.0.0-beta.15","_nodeVersion":"15.8.0","_npmVersion":"6.14.9","dist":{"integrity":"sha512-+wB5peYWcFpuJdnO95yc5E5tGr9fQJbI9RBMvcwT2miPFme6uf5np/dJNYjBVjWXh1mfkhYS+HmyKJpFRASG8w==","shasum":"a448c825748d5723076435e3aa728557d1025ba2","tarball":"https://registry.npmjs.org/@bigsigmadevelopment/slate-config/-/slate-config-1.0.0-beta.15.tgz","fileCount":7,"unpackedSize":13155,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPUqqCRA9TVsSAnZWagAA7f4P/iDJwgJv9kh11QKR7Xh6\nx01CRMODnDB3/ZRVaBe1cYn6r+Z8Nf749ALh0VlDb3ECC5qQJwdLjOf/DaLh\nAaD2DUzw8euaE4I8+A61zoLuYlRrfHh8FZ6qmgHGK3r3KqweWK0vSQjxBnnv\niS0gV1sX558XG5CqKCAkM98agOls8TGGIw9tKupGBqyaa+rRN47AakppA7uZ\nz5zZzcE6yf3fg60InJYc1c3YP1tIlIruerzX9yv0c6K2/k/HSaDAtHmtV0Eh\nVzPEhCyYnijtAkgppfeL3dArYdTeblCWfxHgxtvoVixFNVROAjHgnvLMeImR\nnM0vjuL3+vPOeZ7JOAoCR9v1fE8vujsL3EIFMv8wAnTY9KKrEyoUC+CTXov7\nNbuAJBS2p3cLfxGmo+DtCwKoaGs1XxNLOxgcTLwZ2B4dkWJwMYnm4kelkJGk\nEtvVj0dpsdjWqAeaE0+F5uwIcxH1ZLGGbcUxw4fZxC4NLPmlpuBGcXaZLDiF\n6+ObeTv/+6sC8kmrZkwpxMBesbCTzdRgRc9LCR3NqI4UFaYiUxTIQAfadMrR\nwPml1Oq0sQjq7M2IYewaXkoWheIrYofynaHe26H9AIGg1eYVGAahGi4jWLXz\nfPOXu+qOrVYMh/sVoTHnc/r5ijJvQkVCzvPzN3r2Z6WmGS71nS5H48IzEYQf\nwydM\r\n=Sxky\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqixI8unj0xNQCvmB3EQA9skmNm1KmPOBFpQaepX1zwAIhAPasArKExsSSJbinzBeMT82qzNUi+G9q0xNyme1TmOpV"}]},"_npmUser":{"name":"bigsigmadevelopment","email":"bigsigmadevelopment@gmail.com"},"directories":{},"maintainers":[{"name":"futuri","email":"h@futuri.dev"},{"name":"bigsigmadevelopment","email":"bigsigmadevelopment@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/slate-config_1.0.0-beta.15_1614629546090_0.9354504629629328"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-26T15:55:57.615Z","1.0.0-beta.14":"2021-02-26T15:55:57.828Z","modified":"2022-04-04T18:46:56.010Z","1.0.0-beta.15":"2021-03-01T20:12:26.244Z"},"maintainers":[{"name":"futuri","email":"h@futuri.dev"},{"name":"bigsigmadevelopment","email":"bigsigmadevelopment@gmail.com"}],"description":"Generate configurations for Slate packages by applying values from slate.config.js to override default values","homepage":"https://github.com/bigsigmadevelopment/slate","repository":{"type":"git","url":"https://github.com/bigsigmadevelopment/slate/tree/1.x/packages/slate-config"},"bugs":{"url":"https://github.com/bigsigmadevelopment/slate/issues"},"license":"MIT","readme":"# @bigsigmadevelopment/slate-config\n\nHandles all of Slate's configurable options. Slate packages can declare options in schema files and access the default values of these options in their code. Slate Config will also look for a `slate.config.js` file in the root of a Slate theme project and use any key/values declared in it to override default values declared in Slate packages.\n\n### Example Schema\n\nThe format of Slate configurations relies on a flat object structure using unique keys to access each of its configuration items.\n\n```js\nconst path = require('path');\nconst commonPaths = require('@bigsigmadevelopment/slate-config/common/paths.schema');\n\nmodule.exports = {\n  // You can divide your config items across multiple files, import them, and then\n  // spread them into your main config schema. Slate Config comes with common\n  // config items like paths which might be used in any Slate package.\n  ...commonPaths\n\n  // Configuration values can be set directly\n  'webpack.babel.enable': true,\n\n  // Or computed when the schema file is require()'d by another file\n  'paths.theme': process.cwd(),\n\n  // Or even computed when requested by Slate Config's .get() method. This allows\n  // configuration items to access other configuration items. The argument passed\n  // to the function is an instance of the SlateConfig() class.\n  'paths.theme.src': config => path.join(config.get('paths.theme'), 'src'),\n};\n```\n\n### Methods\n\n#### SlateConfig(schema)\n\nThe main class constructor which consumes a config schema and returns a config instance.\n\n```\nconst SlateConfig = require('@bigsigmadevelopment/slate-config');\nconst config = new SlateConfig(require('../../../slate-tools.schema'));\n```\n\n#### SlateConfig.prototype.get(key)\n\nFetches the value of a given config item, and throws an error if the item does not exist\n\n```\nconst themeRoot = config.get('paths.theme');\n```\n\n#### SlateConfig.prototype.set(key, value, override)\n\nSets the value of config item, and throws an error in the key already has a value set to it, unless the override boolean is set to true.\n\n```\nconfig.set('newKey', 'newValue'); // Sets new key in your config instance\nconfig.set('existingKey', 'someValue'); // Throws an error because key already exists\nconfig.set('existingKey', 'newValue', true); // Doesn't throw an error because override is set to true\n```\n\n### Testing\n\nGenerally, it's considered a best practice to add unit tests to any configuration items you use in your code to catch any future unintentional regressions. To test a configuration item, you can modify the global object used to normally store `slate.config.js` values:\n\n```\nglobal.slateUserConfig['paths.theme'] = 'some/new/path/for/testing'\n```\n","readmeFilename":"README.md"}