{"_id":"@allthings/babel-plugin-react-intl","_rev":"33-806c424da892d2f7e9c632bb20800c2f","name":"@allthings/babel-plugin-react-intl","dist-tags":{"latest":"3.0.2"},"versions":{"3.0.2":{"name":"@allthings/babel-plugin-react-intl","version":"3.0.2","keywords":["babel-plugin","react-intl"],"author":{"name":"Eric Ferraiuolo","email":"edf@ericf.me"},"license":"BSD-3-Clause","_id":"@allthings/babel-plugin-react-intl@3.0.2","maintainers":[{"name":"janrembold","email":"janrembold@gmail.com"},{"name":"hasznosl","email":"hasznos.laszlo@gmail.com"},{"name":"fabian.weniger","email":"f.weniger@gmail.com"},{"name":"kialysa","email":"kialysa@yahoo.com"},{"name":"moritzs","email":"mr.mosch@gmail.com"},{"name":"blueimp","email":"mail@blueimp.net"},{"name":"dan-lee","email":"daniellehr@gmx.de"},{"name":"adieuadieu","email":"marco@luethy.net"},{"name":"yamafaktory","email":"yamafaktory@gmail.com"},{"name":"fivenp","email":"mh@fivenp.com"}],"homepage":"https://github.com/yahoo/babel-plugin-react-intl#readme","bugs":{"url":"https://github.com/yahoo/babel-plugin-react-intl/issues"},"dist":{"shasum":"b04bc86eee875c68622f0512f02d1f907af9aed7","tarball":"https://registry.npmjs.org/@allthings/babel-plugin-react-intl/-/babel-plugin-react-intl-3.0.2.tgz","fileCount":24,"integrity":"sha512-+6Cdvn6BIotYQFfRq0LAqs3+mK/0Ygif34ptNdCey78kjmEFFGunL3YuHejDe7LPdB5n6uTNSfPP+hiTQazNyw==","signatures":[{"sig":"MEUCICjfVAr+wKUhV272ZOIA8byoXlc6f4D65rx0rkEkW7nmAiEAuXuRanUsrY0ib9pW8dq/h/7jXPI2GJR9QjStSJx7Azg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":50758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJciTqLCRA9TVsSAnZWagAAa7QP/2lFlCCpZW6sO6NMQE5Y\n7IeNu6B8fAFf+CuKuebnp6mH+wzRCHzMt1xTRcOEqXuHZyLsfPcZB+H2cQ21\n4pF5DRMc2Zy1lJjcnO++lM+yDsqhWTU3YO6JWmNpWK77zajNp89kig2VJ5CX\n2PzcAcq3fK4HqyDYSyVuzjskZVpi2s26BJ2G7CFvh2QaHgDU7Min9lqMn9Mh\n0fhP6Tgo0XUK9C8QGVasg7+mAyecgJNWXG5pbZw2yRNWLWMesBF8MZIIpRQa\nVWH01aU9bUmejxBEoadoo67XQqvEvz4rLInF9OYm00K1mZioI1O46O70j3QD\nTst4DaC1waMehcmqGA+zU1uAnDUmB9XwxJveaNsy7ZuIdh9OXaOuNMkohdKt\nyEtCqAxm3Pu5rXkobSRTdhfGppHkD8SCC/ZSsNcbGWSGs1eZg/AADVP8uU6H\nmYgo4JafqSWbGUzzf5st7uP5dAPGJMu4SOTKMQOBdEncGw8mgjjKJ/dQTnuz\nr+nyOWbV67+9rBPugZJCNR7yGxIhjLwOAfvnaXlDlAJ9lrU+uH5fDjVdiBaQ\n2MmVCpicsKuGIMWXkrmmQ86R9kATD2VNU2HSJncJY8u0eJ23mY/pMzDQsX4O\nI1CNCBc8RHgNDLZsGUn3Bcn7VDqIzKJsCEg5At6NZvcUTKxH2HM+23EFeT8q\nuybm\r\n=c2h4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","scripts":{"lint":"eslint src/","test":"cross-env NODE_ENV=test mocha --compilers js:@babel/register","build":"babel src/ --out-dir lib/","clean":"rimraf lib/","prepublish":"npm run clean && npm run build","preversion":"npm run lint && npm run clean && npm run build","build:fixtures":"babel-node ./scripts/build-fixtures.js"},"_npmUser":{"name":"dan-lee","email":"daniellehr@gmx.de"},"repository":{"url":"git+https://github.com/yahoo/babel-plugin-react-intl.git","type":"git"},"description":"Extracts string messages for translation from modules that use React Intl.","directories":{},"licenseText":"Copyright (c) 2015, Yahoo Inc.\n\nLicensed under the terms of the New BSD license. See below for terms.\n\nRedistribution and use of this software in source and binary forms,\nwith or without modification, are permitted provided that the following\nconditions are met:\n\n* Redistributions of source code must retain the above\n  copyright notice, this list of conditions and the\n  following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the\n  following disclaimer in the documentation and/or other\n  materials provided with the distribution.\n\n* Neither the name of Yahoo Inc. nor the names of its\n  contributors may be used to endorse or promote products\n  derived from this software without specific prior\n  written permission of Yahoo Inc.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS\nIS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\nTO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\nPARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n","dependencies":{"mkdirp":"^0.5.1","@babel/runtime":"^7.0.0","intl-messageformat-parser":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"uuid":"^3.3.2","mocha":"^3.0.2","eslint":"^3.14.1","rimraf":"^2.4.3","cross-env":"^3.1.4","@babel/cli":"^7.0.0","@babel/core":"^7.0.0","@babel/node":"^7.0.0","power-assert":"^1.4.1","@babel/register":"^7.0.0","@babel/preset-env":"^7.0.0","@babel/preset-react":"^7.0.0","eslint-plugin-react":"^6.1.2","babel-plugin-espower":"^3.0.0","@babel/plugin-transform-runtime":"^7.0.0","@babel/plugin-proposal-object-rest-spread":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/babel-plugin-react-intl_3.0.2_1552497290414_0.20498966612340963","host":"s3://npm-registry-packages"}}},"time":{"created":"2019-03-13T17:14:50.256Z","modified":"2025-04-10T08:57:56.898Z","3.0.2":"2019-03-13T17:14:50.589Z"},"bugs":{"url":"https://github.com/yahoo/babel-plugin-react-intl/issues"},"author":{"name":"Eric Ferraiuolo","email":"edf@ericf.me"},"license":"BSD-3-Clause","homepage":"https://github.com/yahoo/babel-plugin-react-intl#readme","keywords":["babel-plugin","react-intl"],"repository":{"url":"git+https://github.com/yahoo/babel-plugin-react-intl.git","type":"git"},"description":"Extracts string messages for translation from modules that use React Intl.","maintainers":[{"email":"ege.oegretmen@allthings.me","name":"egeallthings"},{"email":"npm@stylive.com","name":"dmz23"},{"email":"festerkevin98@gmail.com","name":"itmustbemagic"},{"email":"bot@allthings.me","name":"allthings-bot"},{"email":"nitin33singh@gmail.com","name":"nitin33singh"}],"readme":"# babel-plugin-react-intl\n\n_This has been forked off from [`babel-plugin-react-intl`](https://github.com/yahoo/babel-plugin-react-intl) with some additional options_\n\nExtracts string messages for translation from modules that use [React Intl][].\n## Dependencies\n\n### React Intl\nThis Babel plugin works with React Intl v2.x\n  \n### Babel\n- **3.x** of this plugin works with Babel 7\n- **2.x** works with Babel 6\n- **1.x** works with Babel 5\n\n## Installation\n\n```sh\n$ yarn add --dev @allthings/babel-plugin-react-intl\n```\n\n## Usage\n\n**This Babel plugin only visits ES6 modules which `import` React Intl.**\n\nThe default message descriptors for the app's default language will be extracted from: `defineMessages()`, `<FormattedMessage>`, and `<FormattedHTMLMessage>`; all of which are named exports of the React Intl package.\n\nIf a message descriptor has a `description`, it'll be removed from the source after it's extracted to save bytes since it isn't used at runtime.\n\n### Via `.babelrc` (Recommended)\n\n**.babelrc**\n\n```json\n{\n  \"plugins\": [\n    [\"react-intl\", {\n        \"messagesDir\": \"./build/messages/\"\n    }]\n  ]\n}\n```\n\n#### Options\n\n- **`messagesDir`**: The target location where the plugin will output a `.json` file corresponding to each component from which React Intl messages were extracted. If not provided, the extracted message descriptors will only be accessible via Babel's API.\n\n- **`enforceDescriptions`**: Whether message declarations _must_ contain a `description` to provide context to translators. Defaults to: `false`.\n\n- **`extractSourceLocation`**: Whether the metadata about the location of the message in the source file should be extracted. If `true`, then `file`, `start`, and `end` fields will exist for each extracted message descriptors. Defaults to `false`.\n\n- **`moduleSourceName`**: The ES6 module source name of the React Intl package. Defaults to: `\"react-intl\"`, but can be changed to another name/path to React Intl.\n\n- **`additionalComponentNames`**: To visit more than the components and `defineMessages` provided by `react-intl` set this option to the following format:\n\n  ```\n  \"additionalComponentNames\": {\n    \"react-lingo\": [\"default\", \"LingoFormattedMessage\"]\n  }\n  ```  \n\n### Via Node API\n\nThe extract message descriptors are available via the `metadata` property on the object returned from Babel's `transform()` API:\n\n```javascript\nrequire('@babel/core').transform('code', {\n  plugins: ['react-intl']\n}) // => { code, map, ast, metadata['react-intl'].messages };\n```\n\n\n[React Intl]: http://formatjs.io/react/\n","readmeFilename":"README.md"}