Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
62 changes: 0 additions & 62 deletions .circleci/config.yml

This file was deleted.

1 change: 0 additions & 1 deletion .coveralls.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on:
pull_request:
branches:
- main
- stage
push:
branches:
- main
- stage

name: Test Coveralls

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
project:
- korean
steps:
- uses: actions/checkout@v1
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install
run: npm install
- name: Test ${{ matrix.project }}
run: npx nx run @romanize/${{ matrix.project }}:coverage
- name: Coveralls
uses: coverallsapp/github-action@v2
with:
base-path: packages/${{ matrix.project }}
parallel: true
flag-name: ${{ matrix.project }}

finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true



24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
push:
branches:
- main

name: Publish package to NPM

jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
project:
- korean
steps:
- uses: actions/checkout@v1
- name: Use Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: npm install
run: npm install
- name: Deploy to NPM
run: npx nx run @romanize/${{ matrix.project }}:deploy
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@romanize/cli",
"version": "0.1.0",
"version": "0.1.1",
"description": "CLI for romanize utilities",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"bin": {
"romanize": "dist/index.js"
},
Expand Down
20 changes: 20 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@romanize/core",
"version": "0.1.0",
"description": "Core utilities for romanize packages",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/",
"package.json"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Kenneth Tang",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/Kenny477/romanize"
}
}
Empty file.
Empty file.
Empty file added packages/japanese/index.ts
Empty file.
27 changes: 27 additions & 0 deletions packages/japanese/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@romanize/japanese",
"version": "0.1.0",
"description": "Romanize Japanese Hiragana, Katakana, and Kanji",
"main": "dist/index.js",
"scripts": {
"test": "jest"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Kenny477/romanize.git"
},
"keywords": [
"japanese",
"hiragana",
"katakana",
"kanji",
"romanization",
"hepburn"
],
"author": "Kenneth Tang",
"license": "MIT",
"bugs": {
"url": "https://github.com/Kenny477/romanize/issues"
},
"homepage": "https://github.com/Kenny477/romanize#readme"
}
61 changes: 50 additions & 11 deletions packages/korean/__tests__/romanize.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { romanize } from "../index";
import { RomanizationSystem, romanize } from "../index";

test('romanizeHangul1', () => {
expect(romanize('훌')).toEqual('hul');
Expand All @@ -12,14 +12,47 @@ test('romanizeHangul1', () => {
eoneusae yeoreum jina gaeul`);
})

const tests = {
"안녕하세요": "annyeonghaseyo",
"안녕": "annyeong",
"안녕하십니까": "annyeonghasimnikka",
"좋고": "joko",
"놓다": "nota",
"잡혀": "japyeo",
"낳지": "nachi",
const tests: Record<string, Record<RomanizationSystem, string>> = {
"안녕하세요": {
[RomanizationSystem.REVISED]: "annyeonghaseyo",
[RomanizationSystem.MCCUNE]: "annyŏnghaseyo",
[RomanizationSystem.YALE]: "annyenghaseyyo",
},
"안녕": {
[RomanizationSystem.REVISED]: "annyeong",
[RomanizationSystem.MCCUNE]: "annyŏng",
[RomanizationSystem.YALE]: "annyeng",
},
"안녕하십니까": {
[RomanizationSystem.REVISED]: "annyeonghasimnikka",
[RomanizationSystem.MCCUNE]: "annyŏnghasimnikka",
[RomanizationSystem.YALE]: "annyenghasipnikka",
},
// "좋고": {
// [RomanizationSystem.REVISED]: "joko",
// [RomanizationSystem.MCCUNE]: "chok'o",
// [RomanizationSystem.YALE]: "cohko",
// },
// "놓다": {
// [RomanizationSystem.REVISED]: "nota",
// [RomanizationSystem.MCCUNE]: "not'a",
// [RomanizationSystem.YALE]: "nohta",
// },
// "잡혀": {
// [RomanizationSystem.REVISED]: "japyeo",
// [RomanizationSystem.MCCUNE]: "chap'yŏ",
// [RomanizationSystem.YALE]: "caphye",
// },
// "낳지": {
// [RomanizationSystem.REVISED]: "nachi",
// [RomanizationSystem.MCCUNE]: "nach'i",
// [RomanizationSystem.YALE]: "nahci",
// },
// "김치": {
// [RomanizationSystem.REVISED]: "gimchi",
// [RomanizationSystem.MCCUNE]: "kimch'i",
// [RomanizationSystem.YALE]: "kimchi",
// },
// "학여울": "hangnyeoul",
// "알약": "allyak",
// "백마": "baengma",
Expand All @@ -33,6 +66,12 @@ const tests = {

test('romanizeHangul2', () => {
for (const [hangul, romanized] of Object.entries(tests)) {
expect(romanize(hangul)).toEqual(romanized);
for (const system of Object.values(RomanizationSystem)) {
expect(romanize(hangul, { system })).toEqual(romanized[system]);
}
}
})
})

test('romanizeNotHangul', () => {
expect(() => romanize("我")).toThrowError('Not a Hangul string');
});
9 changes: 6 additions & 3 deletions packages/korean/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "@romanize/korean",
"version": "0.1.1",
"version": "0.1.2",
"description": "Romanize Korean Hangul",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/",
"package.json"
],
"scripts": {
"build": "npm run clean && tsc --outDir dist",
"prebuild": "npm run clean && tsc --noEmit",
"build": "esbuild index.ts --bundle --minify --sourcemap --outdir=dist",
"clean": "rimraf dist",
"test": "jest",
"coverage": "jest --coverage --ci",
"deploy": "npm run build && npm publish --access public"
"predeploy": "npm run build",
"deploy": "npm publish --access public"
},
"author": "Kenneth Tang",
"license": "MIT",
Expand Down
Loading