0.3.4 • Published 5 years ago

react-intl-cra v0.3.4

Weekly downloads
2,668
License
MIT
Repository
github
Last release
5 years ago

⚠️ Deprecated - This repository is no longer maintained

Please use react-intl.macro or react-app-rewired solution.

react-intl-cra

Extract messages of Creact React App from the command line.

Travis Codecov Status npm package npm downloads

prettier license

This is just a workaround for create-react-app #1227 and react-intl #869 in unofficial way.

Installation

$ yarn add react-intl-cra --dev

Demo

Standalone example based on Create-React-App: https://github.com/evenchange4/react-intl-po-example

$ react-intl-cra './src/**/*.js' -o messages.json

Output:

// messages.json

[
  {
    "id": "Account.account",
    "description": "Title",
    "defaultMessage": "帳戶",
    "filepath": "./src/containers/Account/messages.js"
  },
  {
    "id": "Account.myTestDevices",
    "defaultMessage": "我的測試裝置",
    "filepath": "./src/containers/Account/messages.js"
  },
  ...
]

API

$ react-intl-cra --help

Usage: react-intl-cra <pattern> [options]

<pattern> Glob pattern to specify files.
          Needs to be surrounded with quotes to prevent shell globbing.
          Guide to globs: https://github.com/isaacs/node-glob

Options:
  -o, --out-file  Output into a single file                             [string]
  -h, --help      Show help                                            [boolean]
  -v, --version   Show version number                                  [boolean]

Examples:
  react-intl-cra 'src/App.js'                   One file.
  react-intl-cra 'src/**/*.js'                  Pattern to specify files
  react-intl-cra 'src/**/*.js' -o message.json  Output into a single file.


For more information go to https://github.com/evenchange4/react-intl-cra

NPM Usage

import extract from 'react-intl-cra';

const result = extract('./src/**/*.js');

Development

Requirements

  • node >= 9
  • yarn >= 1.3.2
$ yarn install --pure-lockfile
$ yarn start

Test

$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch

NPM Release

Any git tags.

  1. Create a new git tag
  2. Update CHANGELOG.md
$ npm version patch
$ npm run changelog

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests ($ yarn test).

CHANGELOG

LICENSE

MIT: http://michaelhsu.mit-license.org

0.3.4

5 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.12

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

7 years ago

0.2.8

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago