{"_id":"@prismicio/babel-transform-config","_rev":"76-eaf7dbf59f8841ffb860083e487e5026","name":"@prismicio/babel-transform-config","dist-tags":{"alpha":"0.0.6-alpha.aead22d","latest":"0.0.6"},"versions":{"0.0.5":{"name":"@prismicio/babel-transform-config","version":"0.0.5","keywords":["Babel","Babylon","AST","Next","Nuxt","Gatsby"],"author":{"name":"Hugo Villain"},"license":"ISC","_id":"@prismicio/babel-transform-config@0.0.5","maintainers":[{"name":"veloce","email":"vincent.velociter@gmail.com"},{"name":"fares.droubi","email":"fares.droubi@gmail.com"},{"name":"odim","email":"mehdi.eddemli@prismic.io"},{"name":"gholgot","email":"jacomelli.pro@gmail.com"},{"name":"michel.chau","email":"michel.chau@prismic.io"},{"name":"sprite","email":"marcmcintosh1987@gmail.com"},{"name":"amaurycahuet","email":"amaury.cahuet@prismic.io"},{"name":"raulgon","email":"raul.gonzalez@prismic.io"},{"name":"ahafidi","email":"abdelhafid.hafidi@prismic.io"},{"name":"hypervillain","email":"hugo.villain@prismic.io"},{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},{"name":"sre","email":"srenault.contact@gmail.com"},{"name":"raph22","email":"assieraphael22@gmail.com"},{"name":"prismic","email":"adm@prismic.io"}],"dist":{"shasum":"da8ef453b3dfdd9112dbc6a807857953244a5799","tarball":"https://registry.npmjs.org/@prismicio/babel-transform-config/-/babel-transform-config-0.0.5.tgz","fileCount":12,"integrity":"sha512-Kl8uh3tibeSZ2klk53YfwVk9kl1RiQ+RAo9LJ3dCK5BLSn70mgr/1DqfJEuw3GMQlaAadepWvt+Bs5CyeKX5CA==","signatures":[{"sig":"MEUCIQDVMJD6/lrrQu/vKAa8W0dVlNijoWEuaiITaa84XoebtAIgDYNxxnyfdIu9FsE2HdsieLDyiTsU0bxL8//hU3To/Mo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16453,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJegxElCRA9TVsSAnZWagAAxmUP/jDeMoM21mvGHCTP2GAB\nSaNRzivIL/SbJ5mJYnR4iQ9RkpYIQ1LPwucoNsKJcwuNhkz2FYUji0pXS3tl\nv52vTGW1zzhoipXz7y2FVWoTMrLmESJACTe1Z1aO58OAzqqzFgyKBun6E31i\nc3muijUsyCc6NrTxlkoOFoMvhVswEPaF5MZW6l8o5Y4BXV9DKddoWmuvL0pp\nw2tsMr8MzmRTvcJ1dBHBhNYgtp42hfqWmKzUDfw+EtZnGdEnxjWeD1dn7vt6\noWP/pgPQxZpDwdEyHxUiqcqUjQ62WyqLR1UTPBz2ug41npV75M0fxkuaP5cF\nkUM/PND1x60UvpzCThw7+QqRFLE5h3ftMNUHT69lj5XIojG4VuAluHM/sG60\nB+onJI1OCKrPXS1Tnsm9ZaSx92+Becv+O4YQXHS3ttaVVHuAilR0fF/iMfC1\nd2R1hxp/z8O2AqN3eVn9HucnoovqJr2l/b0oiZj1sWcHXHzwE0q8pTbLy6Tx\nkQ7aKZezxDN3UDhR71s6Fnt1pLYNJ2NohVAC7/pSmEcljRLgGfmZ2galXF3W\nH+7wxABSfElaip3CTit3uw8d3G/SmU9NcoSy6OeK+pWv2nL4R0sXfI6MEQGG\nkfgnzYQ9xiAsJxkVLxMbl6rItjUErKN1/UyCCr1dczpiHTQpnaNr8W0bdh4H\nZEXR\r\n=u/PU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"abd6ca06dea04c19bae12d340338f256775a8ee5","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},"_npmVersion":"6.14.4","description":"Transform JS config files (Next, Nuxt, Gatsby)","directories":{},"_nodeVersion":"13.12.0","dependencies":{"consola":"^2.11.3","@babel/core":"^7.8.7","@babel/template":"^7.8.6","@babel/traverse":"^7.8.6","@babel/preset-env":"^7.8.7","@babel/standalone":"^7.8.8","@babel/plugin-syntax-jsx":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/plugin-transform-arrow-functions":"^7.8.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/babel-transform-config_0.0.5_1585647909071_0.07534166983269963","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported."},"0.0.6-alpha.ea631c8":{"name":"@prismicio/babel-transform-config","version":"0.0.6-alpha.ea631c8","keywords":["Babel","Babylon","AST","Next","Nuxt","Gatsby"],"author":{"name":"Hugo Villain"},"license":"ISC","_id":"@prismicio/babel-transform-config@0.0.6-alpha.ea631c8","maintainers":[{"name":"amaurycahuet","email":"amaury.cahuet@prismic.io"},{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},{"name":"fares.droubi","email":"fares.droubi@gmail.com"},{"name":"gholgot","email":"jacomelli.pro@gmail.com"},{"name":"hypervillain","email":"hugo.p.villain@gmail.com"},{"name":"michel.chau","email":"michel.chau@prismic.io"},{"name":"odim","email":"mehdi.eddemli@prismic.io"},{"name":"prismic","email":"adm@prismic.io"},{"name":"prismic-ci","email":"infrastructure-updates@prismic.io"},{"name":"raph22","email":"assieraphael22@gmail.com"},{"name":"raulgon","email":"raul.gonzalez@prismic.io"},{"name":"sprite","email":"marcmcintosh1987@gmail.com"},{"name":"sre","email":"srenault.contact@gmail.com"},{"name":"veloce","email":"vincent.velociter@gmail.com"}],"contributors":[{"url":"@arnaudlewis","name":"Arnaud lewis"}],"dist":{"shasum":"8c32f299076115cb09309a3af42cbd939f2ad337","tarball":"https://registry.npmjs.org/@prismicio/babel-transform-config/-/babel-transform-config-0.0.6-alpha.ea631c8.tgz","fileCount":15,"integrity":"sha512-/NPjPm9d4NObTmeBuP8T7fxiX1TyAqEWdSGuCX7QuWkx/GVM+RTX3zrDXXAGP6JJewC6zPEVMTyrKQYq8J2pDA==","signatures":[{"sig":"MEUCIQCBVOEn4kyfa/h4CSmr+rF01bwE7rik9Wxu/cwsM91YUQIgASjoYc7fE/wIOCCJ2+OAUlo3/9db+wOtP25MBOpzR6c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJep++QCRA9TVsSAnZWagAAx3sP/3JU86SkgumH5dNc+c7q\nm//JV1lgivU4oBzaLAJiUCyZSXUbp92bQUaRnDPojkQWjmYTLEG7y01kpzaa\noBjXHf/xgVEMWFPNtmmQHdETpCLXxUGB+WEoMzjNWcd7dZCzxusnhOMWgqJi\nCeAz5WtWlPuVj47JTxVlrah6i48bgpkdgDtpGqSsWXtC5dPJzQ9GCNjWcx1q\nzAdlBPHVU4DpxKsqRsxTJ9K1tKb7ejkp3NVrbEZxs802RcM01S08qLyDuwU7\nclltfVSxqTjzNxXlb4u/2CFlf9MgmWzypcszRerS+hlQjxeHcdlLlx9qs84g\nQWbCq2GkZ/tCQWNKboVHeghm8oBRIj4Jg3KehBvlUWyseMYfS/CXNxmdmxuP\npRS1+Sy2jz0cfKxZGJXQ1EYwEzllozLThDW7tS2bfE+wQohzGX9A6slrdk/a\nZLkweKrJ0FMWbXJtH+AXTVYSEsLbmqt7DXXCH3DWGpxLsbozBAEkPqmpLM7B\nJHaZ0GSS+mSH3g2gWASZJuU6YDbacvyRaP1eb83nB+BxA7vK3sVaiaY4PBTH\nVtg8HN+av6rZ/zWJEiFWqFGdCJhtBk6Yn3figRx0FErhnJc35DtJqEXVgGYp\nU2E4RUicKsOaPA/Q+miAz45kGI5tLSC9KbVFN0BiwYTiTsW4YcWPjz3kLv+K\n7w5T\r\n=ilCM\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"## babel-transform-config\nIf you ever wanted to update a Nuxt or Next config file programmatically.\n#### Readme: wip\nSimplest way to understand what it does:\n\n````bash\ngit clone https://github.com/prismicio/babel-transform-config;\ncd babel-transform-config && npm install;\nnode examples/nuxt.simple.js\n````\nThis should display some info 👇\n\n##### 1/ previous code:\n\nThe actual `nuxt.config.js` file that was read from file.\nSomething like:\n```javascript\nexport default {\n  css: [],\n  modules: ['@org/my-nuxt-module'],\n  build: {\n    webpack : {}\n  },\n};\n````\n\n##### 2/ args passed :\nThe arguments that were passed to `babel-transform-config`.\nSomething like:\n```javascript\nconst args = {\n  css: ['path/to/file'],\n  modules: [\n    ['my-module', { config: true }]\n  ],\n  transpile: ['my-other-module']\n}\n// will be used like this:\n// transformConfig(code, 'nuxt', args)\n````\n\n##### 3/ the transpiled code :\nWhat you came for:\n```javascript\nexport default {\n  css: [\"path/to/file\"],\n  modules: ['@org/my-nuxt-module', [\"my-module\", {\n    \"config\": true\n  }]],\n  build: {\n    webpack: {},\n    transpile: [\"my-other-module\"]\n  }\n};\n````\n\n## Using the module\n\nThis package exports a `transformConfig` function that takes as arguments some code, a framework key, and key-value params that will help the module transform these arguments.\n\nFor example, these arguments:\n````javascript\nconst args = {\n    script: ['path/to/script-file.js']\n}\ntransformConfig(myNuxtConfig, 'nuxt', args)\n````\n\n`transformConfig` will try & match your script key and transform your arguments into:\n````javascript\ntransforms: [{\n    'head:script': {\n        action: 'create:merge',\n        value: ['path/to/script-file.js']\n    }\n],\n````\nThis will help the underlying Babel plugin perform the right actions, based on what it knows of your framework. The complete call:\n\n````javascript\nconst fs = require('fs')\nconst transformConfig = require('babel-transform-config')\n\nconst code = fs.readFileSync('path/to/config', 'utf8')\nconst args = { script: ['path/to/script-file.js'] }\n\nconst { code: updatedCode} = transformConfig(code, 'nuxt', args)\n\n// ⚠️ this is experimental, please log things first\nfs.writeFileSync('path/to/config', updatedCode, 'utf8')\n\n````\n\n## Direct transform / Babel plugin\n\nRight now, `transformConfig` only supports Nuxt framexwork. If you want to use things for yourself with another framework, you should use the lower-level transform method:\n\n```javascript\nconst { transform } = require('babel-transform-config')\n\nconst transforms = {\n  'head:script': { // create or replace export default { head: { script: [] }}\n    action: 'create:replace',\n    value: ['my/script.js']\n  },\n  'deleteMe': { // delete export default { deleteMe: ... }\n    action: 'delete'\n  },\n  'build:transpile': { // merges export default { babel: { transpile: arrayOrObject } }\n    action: 'merge',\n    value: ['path/to/file']\n  }\n}\nconst { code: updatedCode } = transform(yourCustomCode, transforms)\n\n`````\n\n👆 See `examples/transform`.\n\n\n#### Quick note\n\nThis package does not work well with nested elements, especially when object patterns are similar.\n\n\n","gitHead":"fb0a4ac0085d98f0cff8cd23b3795188db3cfe82","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},"_npmVersion":"6.13.4","description":"Transform JS config files (Next, Nuxt, Gatsby)","directories":{},"_nodeVersion":"12.16.1","dependencies":{"consola":"^2.11.3","@babel/core":"^7.8.7","@babel/template":"^7.8.6","@babel/traverse":"^7.8.6","@babel/preset-env":"^7.8.7","@babel/standalone":"^7.8.8","@babel/plugin-syntax-jsx":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/plugin-transform-arrow-functions":"^7.8.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/babel-transform-config_0.0.6-alpha.ea631c8_1588064143902_0.497598494691442","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported."},"0.0.6-alpha.aead22d":{"name":"@prismicio/babel-transform-config","version":"0.0.6-alpha.aead22d","keywords":["Babel","Babylon","AST","Next","Nuxt","Gatsby"],"author":{"name":"Hugo Villain"},"license":"ISC","_id":"@prismicio/babel-transform-config@0.0.6-alpha.aead22d","maintainers":[{"name":"amaurycahuet","email":"amaury.cahuet@prismic.io"},{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},{"name":"fares.droubi","email":"fares.droubi@gmail.com"},{"name":"gholgot","email":"jacomelli.pro@gmail.com"},{"name":"hypervillain","email":"hugo.p.villain@gmail.com"},{"name":"michel.chau","email":"michel.chau@prismic.io"},{"name":"odim","email":"mehdi.eddemli@prismic.io"},{"name":"prismic","email":"adm@prismic.io"},{"name":"prismic-ci","email":"infrastructure-updates@prismic.io"},{"name":"raph22","email":"assieraphael22@gmail.com"},{"name":"raulgon","email":"raul.gonzalez@prismic.io"},{"name":"sprite","email":"marcmcintosh1987@gmail.com"},{"name":"sre","email":"srenault.contact@gmail.com"},{"name":"veloce","email":"vincent.velociter@gmail.com"}],"contributors":[{"url":"@arnaudlewis","name":"Arnaud lewis"}],"dist":{"shasum":"1c9cc03fb8deafd1d5bac0aef26a4c6e5cef8821","tarball":"https://registry.npmjs.org/@prismicio/babel-transform-config/-/babel-transform-config-0.0.6-alpha.aead22d.tgz","fileCount":15,"integrity":"sha512-eRgErvEpbUzY9xP8S/0zSPrz63feTDJr/cFfkAo7XVKmy3EBXBm4XCfjb3CfKgH/ojj4t7DA90n0V6B9VIKoZw==","signatures":[{"sig":"MEUCIAa/aA9fYrD4WStVgLKtpuJ3Y+E7rCWJADGhCUFwUpyoAiEA7CTi424bT9Gw9NwZkVPOQoWk2xlXMx4/S82Dt6xhv4I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":20577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeqZR/CRA9TVsSAnZWagAAM6oP/2Uxr4iVwyHMkOCopNAd\nTFnR3P1JF1GQcRPN/8YJ4hHQVPPsaE6dxoxsZRwfuDrKgOAlOdshlNUAUmmd\njeI9O8lLfD/YisgBaBBtIV0y7BkFyED9o82+1OSdHEXXHmFgv4zJ8ZMOz4B1\nvsKwKrcECmNleomm8KYh1xn5Tpt/oKkieRj6h/bLMTISjaJ3X4kXXvb7SskK\nA0+tB7+XI4YzdGIRv2PcSICQB4+Kb1X5560P5OXPk1SQO2EJpGzZZjQzhioF\nMWSfyniKCVExWftTi6g3Q+WG2hC0HdJQ+QcyHsoRaIfU7AdtQtdOuVbGnMIz\nmISgPnAL9yifkqqCucJEfxmy1BXsLGE75StFNzP0HWdwCtnJ4ql04imofiDH\nI5pYkn2CWIuGdxCviC7UXh3GLZ9NqjUsLAoc42xxs1nwWDHa6b3FR909mzWU\nUmYNyw8UKrahok7IafNwKYZTC7dWhmo0ull2QkwkFI2E7qFNrA1SIHhkp2Pr\n9aDZDoRQN09+kXQEiRJEgRY5VH/CjbZgcBe+L7H/MJUOUBhqIPBhVlHkjE0k\nlaKOQoQfQFyTXiwRSbWom2ZBGeuo37wwfg1m2HEsz3u1lLR0yo0KydQh2Qj8\n2cbqj4KtESCOATT72Q/WAqOKJOHTJuF4D84hrgEdbqQTEbZAe+jecVCbJ9g/\n3H+/\r\n=zL6r\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","readme":"## babel-transform-config\nIf you ever wanted to update a Nuxt or Next config file programmatically.\n#### Readme: wip\nSimplest way to understand what it does:\n\n````bash\ngit clone https://github.com/prismicio/babel-transform-config;\ncd babel-transform-config && npm install;\nnode examples/nuxt.simple.js\n````\nThis should display some info 👇\n\n##### 1/ previous code:\n\nThe actual `nuxt.config.js` file that was read from file.\nSomething like:\n```javascript\nexport default {\n  css: [],\n  modules: ['@org/my-nuxt-module'],\n  build: {\n    webpack : {}\n  },\n};\n````\n\n##### 2/ args passed :\nThe arguments that were passed to `babel-transform-config`.\nSomething like:\n```javascript\nconst args = {\n  css: ['path/to/file'],\n  modules: [\n    ['my-module', { config: true }]\n  ],\n  transpile: ['my-other-module']\n}\n// will be used like this:\n// transformConfig(code, 'nuxt', args)\n````\n\n##### 3/ the transpiled code :\nWhat you came for:\n```javascript\nexport default {\n  css: [\"path/to/file\"],\n  modules: ['@org/my-nuxt-module', [\"my-module\", {\n    \"config\": true\n  }]],\n  build: {\n    webpack: {},\n    transpile: [\"my-other-module\"]\n  }\n};\n````\n\n## Using the module\n\nThis package exports a `transformConfig` function that takes as arguments some code, a framework key, and key-value params that will help the module transform these arguments.\n\nFor example, these arguments:\n````javascript\nconst args = {\n    script: ['path/to/script-file.js']\n}\ntransformConfig(myNuxtConfig, 'nuxt', args)\n````\n\n`transformConfig` will try & match your script key and transform your arguments into:\n````javascript\ntransforms: [{\n    'head:script': {\n        action: 'create:merge',\n        value: ['path/to/script-file.js']\n    }\n],\n````\nThis will help the underlying Babel plugin perform the right actions, based on what it knows of your framework. The complete call:\n\n````javascript\nconst fs = require('fs')\nconst transformConfig = require('babel-transform-config')\n\nconst code = fs.readFileSync('path/to/config', 'utf8')\nconst args = { script: ['path/to/script-file.js'] }\n\nconst { code: updatedCode} = transformConfig(code, 'nuxt', args)\n\n// ⚠️ this is experimental, please log things first\nfs.writeFileSync('path/to/config', updatedCode, 'utf8')\n\n````\n\n## Direct transform / Babel plugin\n\nRight now, `transformConfig` only supports Nuxt framexwork. If you want to use things for yourself with another framework, you should use the lower-level transform method:\n\n```javascript\nconst { transform } = require('babel-transform-config')\n\nconst transforms = {\n  'head:script': { // create or replace export default { head: { script: [] }}\n    action: 'create:replace',\n    value: ['my/script.js']\n  },\n  'deleteMe': { // delete export default { deleteMe: ... }\n    action: 'delete'\n  },\n  'build:transpile': { // merges export default { babel: { transpile: arrayOrObject } }\n    action: 'merge',\n    value: ['path/to/file']\n  }\n}\nconst { code: updatedCode } = transform(yourCustomCode, transforms)\n\n`````\n\n👆 See `examples/transform`.\n\n\n#### Quick note\n\nThis package does not work well with nested elements, especially when object patterns are similar.\n\n\n","gitHead":"07b9e464d2528b67de3fd47798d532f1579c9a0b","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},"_npmVersion":"6.13.4","description":"Transform JS config files (Next, Nuxt, Gatsby)","directories":{},"_nodeVersion":"12.16.1","dependencies":{"consola":"^2.11.3","@babel/core":"^7.8.7","@babel/template":"^7.8.6","@babel/traverse":"^7.8.6","@babel/preset-env":"^7.8.7","@babel/standalone":"^7.8.8","@babel/plugin-syntax-jsx":"^7.8.3","@babel/plugin-transform-runtime":"^7.8.3","@babel/plugin-transform-arrow-functions":"^7.8.3"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/babel-transform-config_0.0.6-alpha.aead22d_1588171903312_0.4270804518137934","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported."},"0.0.6":{"name":"@prismicio/babel-transform-config","version":"0.0.6","keywords":["Babel","Babylon","AST","Next","Nuxt","Gatsby"],"author":{"name":"Hugo Villain"},"license":"ISC","_id":"@prismicio/babel-transform-config@0.0.6","maintainers":[{"name":"lihbr","email":"hello@lihbr.com"},{"name":"prismic-ci","email":"infrastructure-updates@prismic.io"},{"name":"veloce","email":"vincent.velociter@gmail.com"},{"name":"fares.droubi","email":"fares.droubi@gmail.com"},{"name":"odim","email":"mehdi.eddemli@prismic.io"},{"name":"gholgot","email":"jacomelli.pro@gmail.com"},{"name":"michel.chau","email":"michel.chau@prismic.io"},{"name":"sprite","email":"marcmcintosh1987@gmail.com"},{"name":"amaurycahuet","email":"amaury.cahuet@prismic.io"},{"name":"raulgon","email":"raul.gonzalez@prismic.io"},{"name":"hypervillain","email":"hugo.p.villain@gmail.com"},{"name":"arnaudlewis","email":"arnaud.lewis@gmail.com"},{"name":"sre","email":"srenault.contact@gmail.com"},{"name":"raph22","email":"assieraphael22@gmail.com"},{"name":"prismic","email":"adm@prismic.io"}],"contributors":[{"url":"@arnaudlewis","name":"Arnaud lewis"}],"homepage":"https://github.com/prismicio/babel-transform-config#readme","bugs":{"url":"https://github.com/prismicio/babel-transform-config/issues"},"dist":{"shasum":"031282aac6bd3bd22ce4bbbda72edf3b3a44cd9e","tarball":"https://registry.npmjs.org/@prismicio/babel-transform-config/-/babel-transform-config-0.0.6.tgz","fileCount":22,"integrity":"sha512-8qWs3yPGNICs1o0poZaMhIQNOW9uczjlRum56WTky0UbQpQ73nXVV1pzAmx13tZfPcEE+DhWZPMARG/q87NtJw==","signatures":[{"sig":"MEQCIB9Mg+Fe+qVdo8kiCZtaVrekPdKT3PnOPoUGZ9iBIsNOAiAeevfqhtaLHFGiclf9n+AI2DShoErh/ing5kF6WRp/eA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":41612,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfcys8CRA9TVsSAnZWagAAOG4QAIO3ci8BmUjWwy0VMX2+\n6X8/d2ghV0lxgU+pOFml96Q1NF/xNn2R+o1u/1hIHuHOlw9ZxrIImsysJmqU\nRcBvnrMIIdDwzkXkgTkYConXLAoLxM5ynVai/ogjnMp7bvEWHA3Lx5AdQbSj\nN4M83R7zlmMYOz+C5zsubqYqsoypPa9/fBxzn1ly6DPNu00tlGJFFxR5RGiL\nky9AJ4akAWusdKJ6UsHk2PjDCCbqoP+cC5Jld/i1A3MTUz0TMR0t9zTevwo+\nNirN8bSBqsm4EekeHXa+Sans0uHaQT0d1NxjUNRM2ZKY/fq1+iJvkMtOzRJT\neSVqTR59RIEFqyOcdpOLXo9t0ftW/BDEnL58oqcN5YOjzFYSSlQo/te45O0z\nKBX7/K8Ob+uxhWQs7OAHYZvNeWkK0fATgOenAY95b4uX00mZId6noJNIzjjl\nGamQS0Eaj1FDC46MAYexJqbz+oUFCezip3j2+LuVzlo73q8ttsVOPWNy5gjq\nyT5fvflSWWdcNWWS1Rve1QAoVvm/Q4jS1XEV3e7OPPvLkExMg/wHZ0MwiOBa\nTpZxj4p6DTiRDnL7cVNByaqlrHHSjAUNgj2dxF5NnxRFyPEyen93zlOC7G5R\nmmpGHwDRSnLH1OxK9weRMqbBvkdN6dKKGUTLtVYcDAaUzq8c/Gl0OnLK4HEu\nwsuy\r\n=Vy5Q\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.js","gitHead":"57d43f19320ea9ad9e01bd1af502fe210d8f9fd4","scripts":{"jest":"jest","lint":"eslint --ext .js,.ts .","test":"yarn lint && yarn jest"},"_npmUser":{"name":"lihbr","email":"hello@lihbr.com"},"repository":{"url":"git+https://github.com/prismicio/babel-transform-config.git","type":"git"},"_npmVersion":"6.12.1","description":"Transform JS config files (Next, Nuxt, Gatsby)","directories":{},"_nodeVersion":"12.13.1","dependencies":{"consola":"^2.15.0","@babel/core":"^7.11.6","@babel/template":"^7.10.4","@babel/traverse":"^7.11.5","@babel/preset-env":"^7.11.5","@babel/standalone":"^7.11.6","@babel/plugin-syntax-jsx":"^7.10.4","@babel/plugin-transform-runtime":"^7.11.5","@babel/plugin-transform-arrow-functions":"^7.10.4"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^26.4.2","eslint":"^7.10.0","prettier":"^2.1.2","babel-eslint":"^10.1.0","eslint-loader":"^4.0.2","eslint-config-prettier":"^6.12.0","eslint-plugin-prettier":"^3.1.4"},"_npmOperationalInternal":{"tmp":"tmp/babel-transform-config_0.0.6_1601383228241_0.5047972824833575","host":"s3://npm-registry-packages"},"deprecated":"Package no longer supported."}},"time":{"created":"2020-03-31T09:45:09.070Z","modified":"2026-08-03T03:13:00.945Z","0.0.5":"2020-03-31T09:45:09.338Z","0.0.6-alpha.ea631c8":"2020-04-28T08:55:44.014Z","0.0.6-alpha.aead22d":"2020-04-29T14:51:43.420Z","0.0.6":"2020-09-29T12:40:28.388Z"},"bugs":{"url":"https://github.com/prismicio/babel-transform-config/issues"},"author":{"name":"Hugo Villain"},"license":"ISC","homepage":"https://github.com/prismicio/babel-transform-config#readme","keywords":["Babel","Babylon","AST","Next","Nuxt","Gatsby"],"repository":{"url":"git+https://github.com/prismicio/babel-transform-config.git","type":"git"},"description":"Transform JS config files (Next, Nuxt, Gatsby)","contributors":[{"url":"@arnaudlewis","name":"Arnaud lewis"}],"maintainers":[{"name":"angeloashmore","email":"angeloashmore@gmail.com"},{"name":"ari-prismic","email":"aurelien.richez@prismic.io"},{"name":"arnaudlewis","email":"social.alws@icloud.com"},{"name":"artemine","email":"ezekiel.ravidat@gmail.com"},{"name":"bapmrl","email":"bapmrl@gmail.com"},{"name":"boubiyeah","email":"boubiyeah@hotmail.com"},{"name":"filipeue","email":"dacomaco123@gmail.com"},{"name":"gholgot","email":"jacomelli.pro@gmail.com"},{"name":"jomifepe","email":"jmfp-b@live.com.pt"},{"name":"levimykel","email":"levimykel@gmail.com"},{"name":"lihbr","email":"hello@lihbr.com"},{"name":"michel.chau","email":"michel.chau@prismic.io"},{"name":"odim","email":"mehdi.eddemli@prismic.io"},{"name":"paulyvpg","email":"paulina.gavilan@prismic.io"},{"name":"pribeiro89","email":"patricia.ribeiro@prismic.io"},{"name":"prismic","email":"adm@prismic.io"},{"name":"prismic-ci","email":"infrastructure-updates@prismic.io"},{"name":"relisui","email":"vladyslav.nayko-marc@prismic.io"},{"name":"ruben-prismic","email":"ruben.goncalves@prismic.io"},{"name":"samuelhorn","email":"samuel@samuelhorn.com"},{"name":"sre","email":"dev.arebati@proton.me"},{"name":"tomaboro","email":"tomaboro96@gmail.com"}],"readme":"## babel-transform-config\nIf you ever wanted to update a Nuxt or Next config file programmatically.\n#### Readme: wip\nSimplest way to understand what it does:\n\n````bash\ngit clone https://github.com/prismicio/babel-transform-config;\ncd babel-transform-config && npm install;\nnode examples/nuxt.simple.js\n````\nThis should display some info 👇\n\n##### 1/ previous code:\n\nThe actual `nuxt.config.js` file that was read from file.\nSomething like:\n```javascript\nexport default {\n  css: [],\n  modules: ['@org/my-nuxt-module'],\n  build: {\n    webpack : {}\n  },\n};\n````\n\n##### 2/ args passed :\nThe arguments that were passed to `babel-transform-config`.\nSomething like:\n```javascript\nconst args = {\n  css: ['path/to/file'],\n  modules: [\n    ['my-module', { config: true }]\n  ],\n  transpile: ['my-other-module']\n}\n// will be used like this:\n// transformConfig(code, 'nuxt', args)\n````\n\n##### 3/ the transpiled code :\nWhat you came for:\n```javascript\nexport default {\n  css: [\"path/to/file\"],\n  modules: ['@org/my-nuxt-module', [\"my-module\", {\n    \"config\": true\n  }]],\n  build: {\n    webpack: {},\n    transpile: [\"my-other-module\"]\n  }\n};\n````\n\n## Using the module\n\nThis package exports a `transformConfig` function that takes as arguments some code, a framework key, and key-value params that will help the module transform these arguments.\n\nFor example, these arguments:\n````javascript\nconst args = {\n    script: ['path/to/script-file.js']\n}\ntransformConfig(myNuxtConfig, 'nuxt', args)\n````\n\n`transformConfig` will try & match your script key and transform your arguments into:\n````javascript\ntransforms: [{\n    'head:script': {\n        action: 'create:merge',\n        value: ['path/to/script-file.js']\n    }\n],\n````\nThis will help the underlying Babel plugin perform the right actions, based on what it knows of your framework. The complete call:\n\n````javascript\nconst fs = require('fs')\nconst transformConfig = require('babel-transform-config')\n\nconst code = fs.readFileSync('path/to/config', 'utf8')\nconst args = { script: ['path/to/script-file.js'] }\n\nconst { code: updatedCode} = transformConfig(code, 'nuxt', args)\n\n// ⚠️ this is experimental, please log things first\nfs.writeFileSync('path/to/config', updatedCode, 'utf8')\n\n````\n\n## Direct transform / Babel plugin\n\nRight now, `transformConfig` only supports Nuxt framexwork. If you want to use things for yourself with another framework, you should use the lower-level transform method:\n\n```javascript\nconst { transform } = require('babel-transform-config')\n\nconst transforms = {\n  'head:script': { // create or replace export default { head: { script: [] }}\n    action: 'create:replace',\n    value: ['my/script.js']\n  },\n  'deleteMe': { // delete export default { deleteMe: ... }\n    action: 'delete'\n  },\n  'build:transpile': { // merges export default { babel: { transpile: arrayOrObject } }\n    action: 'merge',\n    value: ['path/to/file']\n  }\n}\nconst { code: updatedCode } = transform(yourCustomCode, transforms)\n\n`````\n\n👆 See `examples/transform`.\n\n\n#### Quick note\n\nThis package does not work well with nested elements, especially when object patterns are similar.\n\n\n","readmeFilename":"README.md"}