Skip to content

Commit

Permalink
Implement Rollup and minor fixes
Browse files Browse the repository at this point in the history
Minor fixes and additions
- Found a missing / in the <strong> tag in the french translations. I've
added it.
- Fixed a missing capital letter in the English translations
- Added an editorconfig to standardize the "format document" of editors
such as VSCode

Rollup has various advantages but to list a few
- Small bundle sizes for both Node and Browser
- Treeshakeable, this is primarily awesome for browsers because there is
no reason to load in languages that are not being used. Instead by the
power of treeshaking only 1 language gets bundled by webpack.
- Single tsconfig file that defines how the lib is coded, not how its
build
- Automatically running of Terser for minification and compression
- If you need any convincing that it's a good thing to use, it's also
being used by the main React library and maaaany other packages.
- Exported the drawLocales function as both a default export and a named
export

Signed-off-by: Jeroen Claassens <support@favware.tech>
  • Loading branch information
favna committed Aug 2, 2019
1 parent f3d3331 commit 9f55cfc
Show file tree
Hide file tree
Showing 19 changed files with 2,186 additions and 2,213 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
@@ -0,0 +1,10 @@

root = true

[*]
end_of_line = lf
insert_final_newline = false
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -38,6 +38,7 @@ L.drawLocal = locale
| uk | Ukrainian |
| cs | Czech |
| sk | Slovak |
| nl | Dutch |

## Submit a language

Expand Down
2 changes: 1 addition & 1 deletion __tests__/README.test.ts
@@ -1,6 +1,6 @@
import * as fs from "fs";
import * as path from "path";
import { languages } from "../index";
import { languages } from "../src/index";

// Check if language exist in README.md
test("README", () => {
Expand Down
6 changes: 5 additions & 1 deletion __tests__/drawLocales.test.ts
@@ -1,4 +1,4 @@
import drawLocales, { languages } from "../index";
import drawLocales, { drawLocales as drawLocalesNonDefault, languages } from "../src/index";

test("drawLocales", () => {
for (const language of languages) {
Expand Down Expand Up @@ -30,3 +30,7 @@ test("drawLocales", () => {
// throw error
expect(() => drawLocales("foobar")).toThrowError("[language] not found");
});

test("should work with non-default import", () => {
expect(drawLocalesNonDefault).not.toBeUndefined();
});

0 comments on commit 9f55cfc

Please sign in to comment.