Skip to content
This repository was archived by the owner on Nov 14, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
90b5ea1
a cli that does something
hkasemir Sep 18, 2018
4271a5a
add some organization and rcfile abilities
hkasemir Sep 25, 2018
bf7974a
working CLI for jsx components
hkasemir Sep 25, 2018
438afc3
add Loc components
hkasemir Sep 25, 2018
02a09da
allow using jsx and object spreads
hkasemir Sep 25, 2018
786746d
add logging for undefined localizationKeys
hkasemir Sep 25, 2018
378691c
add export for components
hkasemir Sep 25, 2018
ad180a5
clear out tests
hkasemir Sep 25, 2018
c993757
add pseudolocalize function
hkasemir Sep 25, 2018
2ed1c6d
reorganize folders
hkasemir Sep 25, 2018
a3b548c
update readme docs
hkasemir Sep 27, 2018
931897c
clean up CLI, add some self-documentation and options
hkasemir Sep 28, 2018
c8e9d69
apply apache-2.0 license
hkasemir Sep 28, 2018
bd361de
fix typo in Localized id
hkasemir Sep 28, 2018
f8eb8d4
add repo and keywords to package.json
hkasemir Sep 28, 2018
7ce1a27
add some tests
hkasemir Oct 1, 2018
1d44c32
add tests for makeLocalizedElement
hkasemir Oct 1, 2018
e4c430b
add tests for augmentLoc
hkasemir Oct 1, 2018
8c31ce6
add test for getSourceStrings
hkasemir Oct 1, 2018
65e4718
add tests for extracting shorthand
hkasemir Oct 1, 2018
d771801
remove unnecesary / useless things
hkasemir Oct 1, 2018
8f97327
clean up
hkasemir Oct 1, 2018
ee42465
add info about comments
hkasemir Oct 1, 2018
9891199
cleanup
hkasemir Oct 1, 2018
785fec8
is not acutally on npm yet
hkasemir Oct 1, 2018
9eb942b
initial file restructure
hkasemir Nov 20, 2018
43e2412
update broken file paths to successfully bootstrap and test
hkasemir Nov 20, 2018
4539f79
update readmes
hkasemir Nov 20, 2018
60722f1
add codeowners file
hkasemir Nov 20, 2018
f9af06b
clean out package.json in root
hkasemir Nov 20, 2018
c89a992
Merge pull request #2 from udacity/hkasemir/use-lerna
hkasemir Nov 20, 2018
5c8ecee
v0.1.1
hkasemir Nov 20, 2018
40818a7
include basic circleci file
hkasemir Nov 20, 2018
cb3ad84
install lerna as sudo
hkasemir Nov 20, 2018
368c770
Merge pull request #6 from udacity/hkasemir/circleci
hkasemir Nov 21, 2018
7b73870
move constants out of shared folder
hkasemir Dec 11, 2018
8c48196
Merge pull request #10 from udacity/hkasemir/standard-element-constants
hkasemir Dec 11, 2018
944c59b
v0.1.2
hkasemir Dec 11, 2018
4cecde0
include npm install instructions
hkasemir Dec 13, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

17 changes: 17 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
- image: circleci/node:8.11

working_directory: ~/fluent-react-utils

steps:
- checkout

- run: sudo npm install -g lerna
- run: lerna bootstrap
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @hkasemir
28 changes: 10 additions & 18 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
The MIT License (MIT)
Copyright 2018 Udacity

Copyright (c) 2018 Dineshkumar Pandiyan <flexdinesh@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this what we want all our work licensed under? I'm kinda curious why not MIT - though they're both very permissive

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ultimately we decided to use this because it is what the base fluent package is licensed under, and so it made sense to use the same one since they will be used together.

you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
http://www.apache.org/licenses/LICENSE-2.0

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
42 changes: 12 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,19 @@
# NPM Module Boilerplate
# fluent-react-utils
String extraction and helper components for using [fluent-react](https://github.com/projectfluent/fluent.js/tree/master/fluent-react) in your projects.

[![Build Status](https://travis-ci.org/flexdinesh/npm-module-boilerplate.svg?branch=master)](https://travis-ci.org/flexdinesh/npm-module-boilerplate) [![dependencies Status](https://david-dm.org/flexdinesh/npm-module-boilerplate/status.svg)](https://david-dm.org/flexdinesh/npm-module-boilerplate) [![devDependencies Status](https://david-dm.org/flexdinesh/npm-module-boilerplate/dev-status.svg)](https://david-dm.org/flexdinesh/npm-module-boilerplate?type=dev) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

**Start developing your NPM module in seconds** ✨
This is a mono-repo containing two packages:
## [fluent-react-components](./packages/components)
Helper components to write cleaner jsx with fluent-react.

Readymade boilerplate setup with all the best practices to kick start your npm/node module development.
## [fluent-react-extract](./packages/extraction)
CLI for extracting strings for localization into ftl files.

Happy hacking =)

# Features
# Contributing

* **ES6/ESNext** - Write _ES6_ code and _Babel_ will transpile it to ES5 for backwards compatibility
* **Test** - _Mocha_ with _Istanbul_ coverage
* **Lint** - Preconfigured _ESlint_ with _Airbnb_ config
* **CI** - _TravisCI_ configuration setup
* **Minify** - Built code will be minified for performance
To get started developing locally, install dependencies and build the packages using

# Commands
- `npm run clean` - Remove `lib/` directory
- `npm test` - Run tests with linting and coverage results.
- `npm test:only` - Run tests without linting or coverage.
- `npm test:watch` - You can even re-run tests on file changes!
- `npm test:prod` - Run tests with minified code.
- `npm run test:examples` - Test written examples on pure JS for better understanding module usage.
- `npm run lint` - Run ESlint with airbnb-config
- `npm run cover` - Get coverage report for your code.
- `npm run build` - Babel will transpile ES6 => ES5 and minify the code.
- `npm run prepublish` - Hook for npm. Do all the checks before publishing your module.

# Installation
Just clone this repo and remove `.git` folder.


# License

MIT © Dinesh Pandiyan
```
$ lerna bootstrap
```
11 changes: 0 additions & 11 deletions examples/example.js

This file was deleted.

5 changes: 0 additions & 5 deletions examples/index.js

This file was deleted.

6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.1.2"
}
53 changes: 20 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,27 @@
"name": "fluent-react-utils",
"version": "0.1.0",
"description": "Utilities for fluent-react",
"main": "./lib/index.js",
"scripts": {
"clean": "rimraf lib",
"test": "npm run lint && npm run cover",
"test:prod": "cross-env BABEL_ENV=production npm run test",
"test:only": "mocha --require babel-core/register --require babel-polyfill --recursive",
"test:watch": "npm test -- --watch",
"test:examples": "node examples/",
"cover": "istanbul cover _mocha -- --require babel-core/register --require babel-polyfill --recursive",
"lint": "eslint src test",
"build": "cross-env BABEL_ENV=production babel src --out-dir lib",
"prepublish": "npm run clean && npm run lint && npm run test && npm run build"
"build": "lerna bootstrap"
},
"files": [
"lib",
"src"
"keywords": [
"udacity",
"fluent",
"localization",
"l10n",
"ftl",
"translate",
"translation",
"fluent-react",
"internationalization",
"i18n",
"components",
"react"
],
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^8.2.1",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-preset-minify": "^0.3.0",
"chai": "^4.1.2",
"cross-env": "^5.1.3",
"eslint": "^4.16.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"istanbul": "^1.0.0-alpha",
"mocha": "^5.0.0",
"rimraf": "^2.6.2"
}
"repository": {
"type": "git",
"url": "https://github.com/udacity/fluent-react-utils"
},
"license": "Apache-2.0",
"dependencies": {}
}
18 changes: 18 additions & 0 deletions packages/components/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have separate .babelrc and .eslintrc files for each package? Is there any way to have a single of each rc file at the root level?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#14

"env": {
"development": {
"presets": ["env", "react", "es2015"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't need es2015 along side env afaik

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#15

"plugins": [
"add-module-exports",
"transform-object-rest-spread"
]
},
"production": {
"presets": ["env", "react", "es2015", "minify"],
"plugins": [
"add-module-exports",
"transform-object-rest-spread"
]
}
}
}
21 changes: 21 additions & 0 deletions packages/components/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"mocha": true
},
"rules": {
"comma-dangle": ["error", "only-multiline"],
"consistent-return": "off",
"import/prefer-default-export": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"import/extensions": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-has-content": "off",
"jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/heading-has-content": "off",
"no-console": "off",
"react/jsx-filename-extension": "off"
}
}
Loading