Skip to content

Commit

Permalink
s/facebookincubator/facebook
Browse files Browse the repository at this point in the history
Summary:
See D20136085 for ShipIt config

We've relocated repos to https://github.com/facebook/fbt, so update references.

Reviewed By: kayhadrin

Differential Revision: D20136006

fbshipit-source-id: e650b4603e0cfca58732a21e77aafeabbb735479
  • Loading branch information
John Watson authored and jwatson committed Feb 27, 2020
1 parent b275a44 commit c7b5022
Show file tree
Hide file tree
Showing 23 changed files with 80 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
@@ -1,3 +1,3 @@
## 👉 [Please follow one of these issue templates](https://github.com/facebookincubator/fbt/issues/new/choose) 👈
## 👉 [Please follow one of these issue templates](https://github.com/facebook/fbt/issues/new/choose) 👈

Note: to keep the backlog clean and actionable, issues may be immediately closed if they do not follow one of the above issue templates.
26 changes: 13 additions & 13 deletions CHANGELOG.md
Expand Up @@ -61,15 +61,15 @@ We haven't had the best track record of code/feature changes before this date, b
- Improve repository link in package.json

- 0.10.3:
- [bug] Fix IntlNumberType.get(...) to work with short locales [#85](https://github.com/facebookincubator/fbt/pull/85)
- [bug] Fix IntlNumberType.get(...) to work with short locales [#85](https://github.com/facebook/fbt/pull/85)
- Allow fbt:enum value prop to be a string literal
- Fix intlList 'react' import [issue #62](https://github.com/facebookincubator/fbt/issues/62)
- Fix intlList 'react' import [issue #62](https://github.com/facebook/fbt/issues/62)

- 0.10.2:
- [04df822](https://github.com/facebookincubator/fbt/commit/04df822) Updated package version references
- [04df822](https://github.com/facebook/fbt/commit/04df822) Updated package version references

- 0.10.0:
- [9acb1cd](https://github.com/facebookincubator/fbt/commit/9acb1cd) Make fbt translation payload getter customizable
- [9acb1cd](https://github.com/facebook/fbt/commit/9acb1cd) Make fbt translation payload getter customizable

### babel-plugin-fbt versions
<details>
Expand Down Expand Up @@ -122,20 +122,20 @@ We haven't had the best track record of code/feature changes before this date, b
- Fix manifest bug with directories ending in `.js`

- 0.10.1:
- [bug] Fix IntlNumberType.get(...) to work with short locales [#85](https://github.com/facebookincubator/fbt/pull/85)
- [bug] Fix IntlNumberType.get(...) to work with short locales [#85](https://github.com/facebook/fbt/pull/85)
- Allow jsx files to be fbt-containing candidates.

- 0.10.0:
- [435ec19](https://github.com/facebookincubator/fbt/commit/435ec19) Ignoring tests and mocks from NPM modules
- [67ed16f](https://github.com/facebookincubator/fbt/commit/67ed16f) Prune fbt:pronoun branches
- [b0247c6](https://github.com/facebookincubator/fbt/commit/b0247c6) Fix bug in translate command where reading from stdin could sometimes fail (#79)
- [0199b8d](https://github.com/facebookincubator/fbt/commit/0199b8d) Remove `bin/tiger*` in favor of standalone `fb-tiger-hash` NPM package (native JS implementation)
- [435ec19](https://github.com/facebook/fbt/commit/435ec19) Ignoring tests and mocks from NPM modules
- [67ed16f](https://github.com/facebook/fbt/commit/67ed16f) Prune fbt:pronoun branches
- [b0247c6](https://github.com/facebook/fbt/commit/b0247c6) Fix bug in translate command where reading from stdin could sometimes fail (#79)
- [0199b8d](https://github.com/facebook/fbt/commit/0199b8d) Remove `bin/tiger*` in favor of standalone `fb-tiger-hash` NPM package (native JS implementation)

- 0.9.16:
- [7d46281](https://github.com/facebookincubator/fbt/commit/7d46281) `output-dir` arg added to the translate script - output files split by locale.
- [7d46281](https://github.com/facebook/fbt/commit/7d46281) `output-dir` arg added to the translate script - output files split by locale.

- 0.9.14:
- [c11e9fd](https://github.com/facebookincubator/fbt/commit/c11e9fd) Enable custom Babel plugins for FBT collection
- [c11e9fd](https://github.com/facebook/fbt/commit/c11e9fd) Enable custom Babel plugins for FBT collection

### babel-plugin-fbt-runtime versions
- 0.9.11:
Expand All @@ -157,10 +157,10 @@ We haven't had the best track record of code/feature changes before this date, b
- Add READMEs and improve repository link in package.json

- 0.9.5:
- [435ec19](https://github.com/facebookincubator/fbt/commit/435ec19) Ignoring tests and mocks from NPM modules
- [435ec19](https://github.com/facebook/fbt/commit/435ec19) Ignoring tests and mocks from NPM modules

- 0.9.4:
- [250207c](https://github.com/facebookincubator/fbt/commit/250207c) Update peer dependencies for babel-plugin-fbt.
- [250207c](https://github.com/facebook/fbt/commit/250207c) Update peer dependencies for babel-plugin-fbt.

### fb-tiger-hash versions
- 0.1.6:
Expand Down
12 changes: 6 additions & 6 deletions README.md
@@ -1,6 +1,6 @@
<p>
<a href="https://travis-ci.com/facebookincubator/fbt">
<img src="https://img.shields.io/travis/com/facebookincubator/fbt?logo=travis" alt="Travis CI" />
<a href="https://travis-ci.com/facebook/fbt">
<img src="https://img.shields.io/travis/com/facebook/fbt?logo=travis" alt="Travis CI" />
</a>

<a href="https://twitter.com/fbt_js">
Expand All @@ -17,7 +17,7 @@
</p>

<h1 align="center">
<img src="https://facebookincubator.github.io/fbt/img/fbt.png" height="150" width="150" alt="FBT"/>
<img src="https://facebook.github.io/fbt/img/fbt.png" height="150" width="150" alt="FBT"/>
</h1>

FBT is an internationalization framework for JavaScript designed to be not just **powerful** and **flexible**, but also **simple** and **intuitive**. It helps with the following:
Expand All @@ -35,7 +35,7 @@ FBT is an internationalization framework for JavaScript designed to be not just

## Building the fbt library
```
git clone git@github.com:facebookincubator/fbt.git
git clone git@github.com:facebook/fbt.git
cd fbt
yarn install
```
Expand All @@ -58,10 +58,10 @@ of all possible variations for the given fbt phrase and accesses this
at runtime.

## Full documentation
https://facebookincubator.github.io/fbt
https://facebook.github.io/fbt

## Join the fbt community
* [Website](https://facebookincubator.github.io/fbt)
* [Website](https://facebook.github.io/fbt)
* [Facebook group](https://www.facebook.com/groups/498204277369868)
* [Discord #fbt channel in reactiflux](https://discord.gg/cQvXZr5)
* [Twitter](https://twitter.com/fbt_js)
Expand Down
2 changes: 1 addition & 1 deletion babelPresets.js
Expand Up @@ -18,7 +18,7 @@ const moduleMap = Object.assign(
);

// TODO T40028530: Remove this when we can convert to fbjs
// Depends on https://github.com/facebookincubator/fbt/issues/40
// Depends on https://github.com/facebook/fbt/issues/40
module.exports = function babelPresets() {
const plugins = [
require('@babel/plugin-syntax-class-properties'),
Expand Down
2 changes: 1 addition & 1 deletion demo-app/src/example/Example.react.js
Expand Up @@ -308,7 +308,7 @@ export default class Example extends React.Component<Props, State> {
type="submit"
onClick={e => {
window.open(
'https://github.com/facebookincubator/fbt',
'https://github.com/facebook/fbt',
'_blank',
);
}}>
Expand Down
4 changes: 2 additions & 2 deletions docs/collection.md
Expand Up @@ -4,7 +4,7 @@ title: Extracting FBTs
sidebar_label: Extracting translatable texts
---
We provide
[`collectFbt.js`](https://github.com/facebookincubator/fbt/blob/master/packages/babel-plugin-fbt/bin/collectFBT.js)
[`collectFbt.js`](https://github.com/facebook/fbt/blob/master/packages/babel-plugin-fbt/bin/collectFBT.js)
as a utility for collecting strings. It expects a JSON input of:
```
{
Expand Down Expand Up @@ -79,7 +79,7 @@ when *building* the translated payloads.

The hash of the callsite (defaulting to `jenkins` hash) is used to
look up the payload in
[`FbtTranslations`](https://github.com/facebookincubator/fbt/blob/master/runtime/nonfb/FbtTranslations.js).
[`FbtTranslations`](https://github.com/facebook/fbt/blob/master/runtime/nonfb/FbtTranslations.js).
This is basically the hash of the object you see in `jsfbt`.

See [Translating FBTs](translating) for getting your translations in
Expand Down
30 changes: 15 additions & 15 deletions docs/getting_started.md
Expand Up @@ -5,8 +5,8 @@ sidebar_label: Getting Started
---

## Try the Demo
Check out our [Github](https://github.com/facebookincubator/fbt) repository and run the Webpack demo app.
See ["Building and starting the demo app"](https://github.com/facebookincubator/fbt/tree/master/demo-app#building-and-starting-the-demo-app)
Check out our [Github](https://github.com/facebook/fbt) repository and run the Webpack demo app.
See ["Building and starting the demo app"](https://github.com/facebook/fbt/tree/master/demo-app#building-and-starting-the-demo-app)
# Integrating into your app

## NPM module dependencies
Expand All @@ -15,14 +15,14 @@ The required NPM modules to add to your `dependencies` in your app are:
* [**babel-plugin-fbt**](https://www.npmjs.com/package/babel-plugin-fbt) - The primary Babel transform
* [**babel-plugin-fbt-runtime**](https://www.npmjs.com/package/babel-plugin-fbt-runtime) - The secondary Babel transform
* Transforms the raw payloads within `fbt._(...)` so they can be used at runtime (by `fbt._`)
* NOTE: [This plugin should get merged into `babel-plugin-fbt`](https://github.com/facebookincubator/fbt/issues/125)
* NOTE: [This plugin should get merged into `babel-plugin-fbt`](https://github.com/facebook/fbt/issues/125)

If you're unfamiliar with [Babel](https://babeljs.io/), you can read through [their documentation here](https://babeljs.io/)

### Babel Plugin ordering (Caveat)
There is a plugin ordering gotcha to be aware of if you use other Babel plugins.
FBT expects to be the first plugin to visit its relevant `<fbt>` and `fbt(...)` nodes
[See this Github issue tracking this](https://github.com/facebookincubator/fbt/issues/40)
[See this Github issue tracking this](https://github.com/facebook/fbt/issues/40)

You'll hit issues if another transforms beats the `babel-plugin-fbt`
to the Babel AST, node and transforms it such that the plugin doesn't
Expand All @@ -41,34 +41,34 @@ To work around this you can use Babel's `passPerPreset` option, and ensure `babe

### Webpack Example
You'll need to add the fbt babel transforms in a manner similar to our demo-app.
[See our demo-app's Webpack config](https://github.com/facebookincubator/fbt/blob/543e0a9c5b5c74e2094da3b94e3828c1dccacb7a/demo-app/webpack.config.js#L54-L59)
[See our demo-app's Webpack config](https://github.com/facebook/fbt/blob/543e0a9c5b5c74e2094da3b94e3828c1dccacb7a/demo-app/webpack.config.js#L54-L59)

## Build-time / offline processes

### Collection
There are scripts bundled into the `babel-plugin-fbt` package that are desigend for collecting source text (and associated metadata) from your application's source.
These are:

* [manifest](https://github.com/facebookincubator/fbt/blob/master/packages/babel-plugin-fbt/bin/manifest.bin.js) -
Scans provided filesystem paths and generates a manifest of the [enumeration modules](https://facebookincubator.github.io/fbt/docs/enums)
* **NOTE**: Enum modules must end in [$FbtEnum.(js|jsx|ts|tsx)](https://github.com/facebookincubator/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/packages/babel-plugin-fbt/bin/manifest.js#L66) (i.e. `Foo$FbtEnum.js`)
* [collectFBT](https://github.com/facebookincubator/fbt/blob/master/packages/babel-plugin-fbt/bin/collectFBT.bin.js) -
* [manifest](https://github.com/facebook/fbt/blob/master/packages/babel-plugin-fbt/bin/manifest.bin.js) -
Scans provided filesystem paths and generates a manifest of the [enumeration modules](https://facebook.github.io/fbt/docs/enums)
* **NOTE**: Enum modules must end in [$FbtEnum.(js|jsx|ts|tsx)](https://github.com/facebook/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/packages/babel-plugin-fbt/bin/manifest.js#L66) (i.e. `Foo$FbtEnum.js`)
* [collectFBT](https://github.com/facebook/fbt/blob/master/packages/babel-plugin-fbt/bin/collectFBT.bin.js) -
Given source input, extract any source text and print them to STDOUT as JSON

### Translation
* [translate](https://github.com/facebookincubator/fbt/blob/master/packages/babel-plugin-fbt/bin/translate.bin.js) -
* [translate](https://github.com/facebook/fbt/blob/master/packages/babel-plugin-fbt/bin/translate.bin.js) -
Creates translation payloads for runtime
* Takes extracted source text (from `collectFBT`) and [translations provided in JSON format](https://facebookincubator.github.io/fbt/docs/translating) to produce these payloads
* Takes extracted source text (from `collectFBT`) and [translations provided in JSON format](https://facebook.github.io/fbt/docs/translating) to produce these payloads

### How to use these scripts
You can see how the demo-app [calls into these scripts here](https://github.com/facebookincubator/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/demo-app/package.json#L11-L14).
You can see how the demo-app [calls into these scripts here](https://github.com/facebook/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/demo-app/package.json#L11-L14).

The demo app [runs all these in another script, here](https://github.com/facebookincubator/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/demo-app/run_all.js)
The demo app [runs all these in another script, here](https://github.com/facebook/fbt/blob/3a5441708ca6b71c2c18fe5a952d1058a22306d1/demo-app/run_all.js)

## Runtime
The [fbt runtime](https://www.npmjs.com/package/fbt) is what resolves the translation payload table generated during the translation phase into a singular result base on all the input provided at runtime.

### Initialization
The `fbt` runtime requires that you initialize with your relevant translations via the `init` function. You can see an [example of this in the demo-app](https://github.com/facebookincubator/fbt/blob/98d0516290975f614737387748769e235bf61216/demo-app/src/example/Example.react.js#L16-L17).
The `fbt` runtime requires that you initialize with your relevant translations via the `init` function. You can see an [example of this in the demo-app](https://github.com/facebook/fbt/blob/98d0516290975f614737387748769e235bf61216/demo-app/src/example/Example.react.js#L16-L17).

If you've split your translation payloads using [the `--output-dir` option](https://github.com/facebookincubator/fbt/blob/98d0516290975f614737387748769e235bf61216/packages/babel-plugin-fbt/bin/translate.js#L145-L153) to the [`translate` script](https://github.com/facebookincubator/fbt/blob/master/packages/babel-plugin-fbt/bin/translate.js), you can still update locales on-the-fly after you've brought your payload in by updating the translation map held by `fbt`, [similar to the demo-app](https://github.com/facebookincubator/fbt/blob/98d0516290975f614737387748769e235bf61216/packages/babel-plugin-fbt/bin/translate.js#L178), or by calling into `init` with your new translations for your given locale again.
If you've split your translation payloads using [the `--output-dir` option](https://github.com/facebook/fbt/blob/98d0516290975f614737387748769e235bf61216/packages/babel-plugin-fbt/bin/translate.js#L145-L153) to the [`translate` script](https://github.com/facebook/fbt/blob/master/packages/babel-plugin-fbt/bin/translate.js), you can still update locales on-the-fly after you've brought your payload in by updating the translation map held by `fbt`, [similar to the demo-app](https://github.com/facebook/fbt/blob/98d0516290975f614737387748769e235bf61216/packages/babel-plugin-fbt/bin/translate.js#L178), or by calling into `init` with your new translations for your given locale again.

0 comments on commit c7b5022

Please sign in to comment.