Skip to content

Commit

Permalink
chore: initial commit!
Browse files Browse the repository at this point in the history
extract Ruby component from KaniWani, remove KW specific code, begin repo setup
  • Loading branch information
DJTB committed May 1, 2018
0 parents commit f80c882
Show file tree
Hide file tree
Showing 24 changed files with 11,151 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"projectName": "hatsuon",
"projectOwner": "DJTB",
"files": [
"readme.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "DJTB",
"name": "Duncan Bay",
"avatar_url": "https://avatars2.githubusercontent.com/u/22868432?v=3",
"profile": "https://github.com/DJTB",
"contributions": [
"code",
"doc",
"infra",
"design",
"example"
]
}
],
"repoType": "github"
}
11 changes: 11 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"presets": [
[
"env",
{
"targets": { "browsers": ["last 2 versions", ">1%"] }
}
]
],
"plugins": ["add-module-exports"]
}
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
coverage
flow-typed
55 changes: 55 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"parser": "babel-eslint",
"extends": ["airbnb"],
"env": {
"node": true,
"jest": true,
"es6": true
},
"plugins": ["import"],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"rules": {
"function-paren-newline": 0,
"quotes": 0,
"arrow-parens": [2, "always"],
"camelcase": 1,
"comma-dangle": [2, "always-multiline"],
"global-require": 0,
"import/first": 0,
"import/newline-after-import": 0,
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/no-named-as-default": 0,
"import/no-unresolved": 2,
"import/no-webpack-loader-syntax": 0,
"import/prefer-default-export": 0,
"react/jsx-filename-extension": 0,
"indent": [
2,
2,
{
"SwitchCase": 1
}
],
"max-len": 0,
"newline-per-chained-call": 0,
"no-mixed-operators": 1,
"no-confusing-arrow": 0,
"no-console": 1,
"no-debugger": 1,
"no-use-before-define": 0,
"no-nested-ternary": 1,
"no-unused-expressions": [2, { "allowTernary": true }],
"object-curly-newline": 0,
"prefer-template": 1,
"class-methods-use-this": 0,
"require-yield": 0,
"valid-jsdoc": 1
}
}
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.js text eol=lf
Binary file added .github/example.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<!--- Provide a general summary of the issue in the Title above -->

## I'm submitting a…
<!-- Check one of the following options with "x" -->
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [ ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
- [ ] Feature request
- [ ] Documentation issue or request
- [ ] Support request

## Expected Behavior
<!--- If you‘re describing a bug, tell us what should happen -->
<!--- If you‘re suggesting a change/improvement, tell us how it should work -->

## Current Behavior
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
<!--- reproduce this bug. Include code or screenshot if relevant -->
1.
2.
3.
4.

## Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
- hatsuon version: <!-- run `npm ls hatsuon` -->
- Node version: <!-- run `node -v` -->
- NPM version: <!-- run `npm -v` -->
- Yarn version (if you use Yarn):
- Operating system: <!-- Mac, Linux, Windows -->
- Link to your project:
53 changes: 53 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!--- Provide a general summary of your changes in the Title above -->

## PR Type

<!--- What types of changes does your code introduce? -->

<!-- Put an `x` in all the boxes that apply: -->

* [ ] Bugfix
* [ ] Feature
* [ ] Code style update (whitespace, formatting, missing semicolons, etc.)
* [ ] Refactoring (no functional changes, no api changes)
* [ ] Build related changes
* [ ] CI related changes
* [ ] Documentation content changes
* [ ] Other… Please describe:

## Description

<!--- Describe your changes in detail -->

<!--- Why is this change required? What problem does it solve? -->

<!--- If it fixes an open issue, please link to the issue here. -->

## How Has This Been Tested?

<!--- Please describe in detail how you tested your changes. -->

<!--- Include details of your testing environment, and the tests you ran to -->

<!--- see how your change affects other areas of the code, etc. -->

## Screenshots (if appropriate):

## Does this PR introduce a breaking change?

<!-- If this PR contains a breaking change, -->

<!-- please also describe the impact and migration path for existing applications -->

* [ ] Yes
* [ ] No

## Checklist:

<!--- Put an `x` in all the boxes that apply. -->

<!--- If you‘re unsure about any of these, don‘t hesitate to ask. We‘re here to help! -->

* [ ] My change requires a change to the documentation.
* [ ] I have updated the documentation accordingly.
* [ ] I have read the [`contributing.md`](https://github.com/DJTB/hatsuon/blob/master/contributing.md).
61 changes: 61 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# compiled
dist
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: node_js

cache:
directories:
- ~/.npm

notifications:
email: false

node_js: '8'

script: npm start validate

after_success: npx codecov

deploy:
provider: script
skip_cleanup: true
script: npx semantic-release

branches:
except: /^v\d+\.\d+\.\d+$/
24 changes: 24 additions & 0 deletions .wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
process.env.BABEL_ENV = 'test';

module.exports = (wallaby) => {
return {
files: ['src/**/*.js', '!src/**/*.test.js'],
tests: ['src/**/*.test.js'],

env: {
type: 'node',
runner: 'node',
},

testFramework: 'jest',

compilers: {
'**/*.js': wallaby.compilers.babel(require('./package.json').babel), // eslint-disable-line global-require
},

setup() {
const jestConfig = require('./package.json').jest; // eslint-disable-line global-require
wallaby.testFramework.configure(jestConfig);
},
};
};
72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# React Furi

> Good Lookin' Furigana
[![npm](https://img.shields.io/npm/v/react-furi.svg?style=flat-square)](https://www.npmjs.com/package/react-furi)
[![npm](https://img.shields.io/npm/dt/react-furi.svg?style=flat-square)](https://npm-stat.com/charts.html?package=react-furi&from=2016-04-01)
[![Travis branch](https://img.shields.io/travis/DJTB/react-furi/master.svg?style=flat-square)](https://travis-ci.org/DJTB/react-furi)
[![Codecov branch](https://img.shields.io/codecov/c/github/DJTB/react-furi/master.svg?style=flat-square)](https://codecov.io/github/DJTB/react-furi)
<br />
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Code of Conduct](https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square)](./code_of_conduct.md)

## REPO is WIP

Component extracted from a production site.
Currently missing from repo:

* bundling
* render tests
* NPM publish
* example demo
* plain css => removal of styled-components as dependency

## Why?

The [Ruby](https://developer.mozilla.org/ja/docs/Web/HTML/Element/ruby) element often has less than ideal rendering. This React component allows you to use furigana data from [JmdictFurigana](https://github.com/Doublevil/JmdictFurigana) to render only the necessary readings over their respective characters. Also allows better styling control of your furigana, props to easily show/hide furigana, and fallbacks to render similarly to Ruby tags, but without unnecessary trailing [okurigana](https://en.wikipedia.org/wiki/Okurigana).

<!--
## Installation
```sh
npm install --save react-furi
```
## Demo
[Examples](https://djtb.github.io/react-furi)
-->

## Usage

```js
import ReactFuri from 'react-furi';
const MyComponent = () => <ReactFuri word="考え方" furi="0:かんがえ;2:かた" />;
```

![Example Render](.github/example.png)

## Related

* [JmdictFurigana](https://github.com/Doublevil/JmdictFurigana) : Furigana dictionary
* [Wanakana](https://github.com/WaniKani/WanaKana) : Japanese romaji <-> kana transliteration
* [Hatsuon](https://github.com/DJTB/hatsuon) : Japanese pitch accent tools

## Contributors

Thanks goes to these people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<!-- prettier-ignore -->
| [<img src="https://avatars3.githubusercontent.com/u/5353151?s=100" width="100px;"/><br /><sub><b>Duncan Bay</b></sub>](https://github.com/DJTB)<br />[💻](https://github.com/DJTB/react-furi/commits?author=DJTB "Code") [📖](https://github.com/DJTB/react-furi/commits?author=DJTB "Documentation") [🚇](#infra-DJTB "Infrastructure (Hosting, Build-Tools, etc)") [🎨](#design-DJTB "Design") |
| :---: |

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## License

MIT &copy; [Duncan Bay](https://github.com/DJTB)
Loading

0 comments on commit f80c882

Please sign in to comment.