Skip to content

Commit

Permalink
Rename to fbtee.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer committed Dec 12, 2024
1 parent a1f81f6 commit d003be7
Show file tree
Hide file tree
Showing 257 changed files with 1,268 additions and 1,419 deletions.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ example/src/translatedFbts
example/src/translatedFbts.json
jest.config.js
packages/*/lib/
packages/babel-plugin-fbt/src/__tests__/FbtTestUtil.tsx
packages/babel-plugin-fbtee/src/__tests__/FbtTestUtil.tsx
pnpm-lock.yaml
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<h1 align="center">
<img src="https://facebook.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 **powerful**, **flexible**, and **intuitive**.
**fbtee** (Far Better Translations, Extended Edition) is an internationalization framework for JavaScript designed to be **powerful**, **flexible**, and **intuitive**.

It helps with the following:

- Organizing your source text for translation
- Composing grammatically correct translatable User Interfaces
- Eliminating verbose boilerplate for generating User Interfaces
-

## Status: In-Progress Fork
* Organizing your source text for translation
* Composing grammatically correct translatable User Interfaces
* Eliminating verbose boilerplate for generating User Interfaces

## Status: Ready for Early Adopters

This is a fork of Facebook's original fbt library, which has been archived. The aim of this fork is to create the best and most modern internationalization library for JavaScript & React.

## License
## Credits

FBT is MIT licensed, as found in the [LICENSE](LICENSE) file.
- `fbt` was originally created by [Facebook](https://github.com/facebook/fbt).
- The auto-import plugin was created by @alexandernanberg.
- [Nakazawa Tech](https://nkzw.tech) rewrote fbt into fbtee and is maintaining this project.
18 changes: 9 additions & 9 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
"type": "module",
"main": "index.js",
"scripts": {
"build:fbt": "pnpm fbt:manifest && pnpm fbt:collect && pnpm fbt:translate && pnpm fbt:translate-multiple && pnpm fbt:translate-single",
"clean:fbt": "rm -rf .enum_manifest.json .src_manifest.json .source_strings.json src/translatedFbts.json src/translatedFbts .test_*.json 2&> /dev/null || exit 0",
"build:fbtee": "pnpm fbtee:manifest && pnpm fbtee:collect && pnpm fbtee:translate && pnpm fbtee:translate-multiple && pnpm fbtee:translate-single",
"clean": "rm -rf .enum_manifest.json .src_manifest.json .source_strings.json src/translatedFbts.json src/translatedFbts .test_*.json 2&> /dev/null || exit 0",
"dev": "vite",
"fbt:collect": "fbt collect --fbt-common-path ./common_strings.json --pretty --manifest < .src_manifest.json > .source_strings.json",
"fbt:manifest": "fbt manifest --src src",
"fbt:translate": "fbt translate --translations translations/*.json --jenkins > src/translatedFbts.json",
"fbt:translate-multiple": "fbt translate --translations translations/*.json --jenkins --output-dir src/translatedFbts",
"fbt:translate-single": "fbt translate --jenkins --stdin < translation_input.json > src/translatedFbts.json"
"fbtee:collect": "fbtee collect --fbt-common-path ./common_strings.json --pretty --manifest < .src_manifest.json > .source_strings.json",
"fbtee:manifest": "fbtee manifest --src src",
"fbtee:translate": "fbtee translate --translations translations/*.json --jenkins > src/translatedFbts.json",
"fbtee:translate-multiple": "fbtee translate --translations translations/*.json --jenkins --output-dir src/translatedFbts",
"fbtee:translate-single": "fbtee translate --jenkins --stdin < translation_input.json > src/translatedFbts.json"
},
"dependencies": {
"babel-preset-fbt": "workspace:*",
"@nkzw/babel-fbtee": "workspace:*",
"classnames": "^2.5.1",
"fbt": "workspace:*",
"fbtee": "workspace:*",
"invariant": "^2.2.4",
"normalize.css": "8.0.1",
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion example/src/example/Example.react.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import classNames from 'classnames';
import { fbs, fbt, GenderConst, init, IntlVariations } from 'fbt';
import { fbs, fbt, GenderConst, init, IntlVariations } from 'fbtee';
import { ChangeEvent, useCallback, useState } from 'react';
// @ts-expect-error
import translations from '../translatedFbts.json';
Expand Down
16 changes: 8 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ export default {
projects: [
{
displayName: 'babel-plugin-fbt',
roots: ['<rootDir>/packages/babel-plugin-fbt/src'],
roots: ['<rootDir>/packages/babel-plugin-fbtee/src'],
transform: {
'\\.(j|t)sx?$': [
'<rootDir>/jest-preprocessor.js',
{
presets: [
[
'./packages/babel-preset-fbt',
'./packages/babel-fbtee',
{ fbtCommon: { Accept: '...' } },
],
],
Expand All @@ -36,20 +36,20 @@ export default {
},
{
displayName: 'babel-plugin-fbt-runtime',
roots: ['<rootDir>/packages/babel-plugin-fbt-runtime'],
roots: ['<rootDir>/packages/babel-plugin-fbtee-runtime'],
},
{
displayName: 'fbt',
modulePaths: ['<rootDir>/packages/fbt/src'],
roots: ['<rootDir>/packages/fbt/src'],
modulePaths: ['<rootDir>/packages/fbtee/src'],
roots: ['<rootDir>/packages/fbtee/src'],
testEnvironment: 'jsdom',
transform: {
'\\.(j|t)sx?$': [
'<rootDir>/jest-preprocessor.js',
{
presets: [
[
'./packages/babel-preset-fbt',
'./packages/babel-fbtee',
{ fbtCommon: { Accept: '...' } },
],
],
Expand All @@ -62,7 +62,7 @@ export default {
modulePaths: [
'<rootDir>/example/src',
'<rootDir>/example/src/example',
'<rootDir>/packages/fbt/src',
'<rootDir>/packages/fbtee/src',
],
roots: ['<rootDir>/example'],
testEnvironment: 'jsdom',
Expand All @@ -72,7 +72,7 @@ export default {
{
presets: [
[
'./packages/babel-preset-fbt',
'./packages/babel-fbtee',
{
fbtCommon: CommonStrings,
fbtEnumManifest: EnumManifest,
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "fbt-private",
"name": "@nkzw/fbtee-internal",
"version": "0.0.1",
"private": true,
"license": "MIT",
"type": "module",
"scripts": {
"build": "pnpm -r build",
"build:all": "pnpm -r build && pnpm -r build:types && pnpm install && cd example && pnpm build:fbt",
"clean": "rm -rf packages/*/lib",
"dev": "cd example && pnpm build:fbt && pnpm dev",
"build:all": "pnpm -r build && pnpm -r build:types && pnpm install && cd example && pnpm build:fbtee",
"clean": "rm -rf packages/*/lib; cd example pnpm clean",
"dev": "cd example && pnpm build:fbtee && pnpm dev",
"lint:format": "prettier --cache --check .",
"format": "prettier --write .",
"jest": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --no-warnings\" node_modules/.bin/jest",
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions packages/babel-fbtee/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "@nkzw/babel-fbtee",
"version": "0.0.1",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
"globalization",
"i18n",
"internationalization",
"l10n",
"localization",
"react",
"translation"
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/fbt.git"
},
"license": "MIT",
"type": "module",
"main": "lib/index.js",
"bin": {
"fbtee": "lib/bin.js"
},
"scripts": {
"build": "rm -f lib/index.js; pnpm build:src; pnpm build:bin",
"build:bin": "esbuild --target=node22 --platform=node --format=esm --outfile=lib/bin.js --external:@nkzw/babel-plugin-fbtee --bundle ./src/bin.tsx",
"build:src": "esbuild --target=node22 --platform=node --format=esm --outfile=lib/index.js --external:@nkzw/babel-plugin-fbtee --external:@nkzw/babel-plugin-fbtee-runtime --external:@nkzw/babel-plugin-fbtee-auto-import --bundle ./src/index.tsx",
"build:types": "dts-bundle-generator -o lib/index.d.ts src/index.tsx"
},
"dependencies": {
"@nkzw/babel-plugin-fbtee": "workspace:*",
"@nkzw/babel-plugin-fbtee-auto-import": "workspace:*",
"@nkzw/babel-plugin-fbtee-runtime": "workspace:*"
}
}
3 changes: 3 additions & 0 deletions packages/babel-fbtee/src/bin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#! /usr/bin/env node

import('@nkzw/babel-plugin-fbtee/lib/bin.js');
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import fbt, { PluginOptions } from 'babel-plugin-fbt';
import autoImport from 'babel-plugin-fbt-auto-import';
import fbtRuntime from 'babel-plugin-fbt-runtime';
import fbt, { PluginOptions } from '@nkzw/babel-plugin-fbtee';
import autoImport from '@nkzw/babel-plugin-fbtee-auto-import';
import fbtRuntime from '@nkzw/babel-plugin-fbtee-runtime';

export default function preset(
_: unknown,
Expand Down
29 changes: 0 additions & 29 deletions packages/babel-plugin-fbt-auto-import/README.md

This file was deleted.

29 changes: 0 additions & 29 deletions packages/babel-plugin-fbt-runtime/README.md

This file was deleted.

29 changes: 0 additions & 29 deletions packages/babel-plugin-fbt/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "babel-plugin-fbt-auto-import",
"version": "0.0.0",
"description": "Auto-import fbt when using <fbt> components.",
"name": "@nkzw/babel-plugin-fbtee-auto-import",
"version": "0.0.1",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
"globalization",
"i18n",
"internationalization",
"l10n",
"localization",
"react",
"translation"
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/fbt.git"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function autoImport() {
) {
const declaration = importDeclaration(
[importSpecifier(identifier('fbt'), identifier('fbt'))],
stringLiteral('fbt')
stringLiteral('fbtee')
);

if (root) {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{
"name": "babel-plugin-fbt-runtime",
"version": "0.0.0",
"description": "The secondary FBT Babel transform, for E2E use",
"name": "@nkzw/babel-plugin-fbtee-runtime",
"version": "0.0.1",
"description": "The JavaScript & React Internationalization Framework.",
"keywords": [
"fbt",
"globalization",
"i18n",
"internationalization",
"l10n",
"localization",
"react",
"translation"
],
"repository": {
"type": "git",
"url": "https://github.com/facebook/fbt.git"
Expand All @@ -21,9 +31,9 @@
"invariant": "^2.2.4"
},
"devDependencies": {
"babel-plugin-fbt-auto-import": "workspace:*"
"@nkzw/babel-plugin-fbtee-auto-import": "workspace:*"
},
"peerDependencies": {
"babel-plugin-fbt": "workspace:*"
"@nkzw/babel-plugin-fbtee": "workspace:*"
}
}
Loading

0 comments on commit d003be7

Please sign in to comment.