-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for ESM and Deno #95)
BREAKING CHANGE: exports maps are now used, which modifies import behavior.
- Loading branch information
Showing
20 changed files
with
526 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": "*.ts", | ||
"parser": "@typescript-eslint/parser", | ||
"rules": { | ||
"no-unused-vars": "off", | ||
"no-useless-constructor": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/no-useless-constructor": "error" | ||
} | ||
} | ||
], | ||
"parserOptions": { | ||
"ecmaVersion": 2017, | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint/eslint-plugin" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
.DS_Store | ||
node_modules | ||
.nyc_output | ||
build | ||
coverage | ||
package-lock.json | ||
example.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { y18n as _y18n } from './build/lib/index.js' | ||
import { Y18NOpts } from './build/lib/index.d.ts' | ||
import shim from './lib/platform-shims/deno.ts' | ||
|
||
const y18n = (opts: Y18NOpts) => { | ||
return _y18n(opts, shim) | ||
} | ||
|
||
export default y18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import shim from './build/lib/platform-shims/node.js' | ||
import { y18n as _y18n } from './build/lib/index.js' | ||
|
||
const y18n = (opts) => { | ||
return _y18n(opts, shim) | ||
} | ||
|
||
export default y18n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { y18n as _y18n, Y18NOpts } from './index.js' | ||
import nodePlatformShim from './platform-shims/node.js' | ||
|
||
const y18n = (opts: Y18NOpts) => { | ||
return _y18n(opts, nodePlatformShim) | ||
} | ||
|
||
export default y18n |
Oops, something went wrong.