-
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,38 @@ jobs: | |
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/[email protected] | ||
- uses: bcoe/[email protected] | ||
id: release | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
release-type: node | ||
package-name: y18n | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- run: npm install | ||
- run: npm run compile | ||
- name: push Deno release | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN}}@github.com/yargs/y18n.git" | ||
git checkout -b deno | ||
git add -f build | ||
git commit -a -m 'chore: ${{ steps.release.outputs.tag_name }} release' | ||
git push origin +deno | ||
git tag -a ${{ steps.release.outputs.tag_name }}-deno -m 'chore: ${{ steps.release.outputs.tag_name }} release' | ||
git push origin ${{ steps.release.outputs.tag_name }}-deno | ||
if: ${{ steps.release.outputs.release_created }} | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: 'https://external-dot-oss-automation.appspot.com/' | ||
if: ${{ steps.release.outputs.release_created }} | ||
- run: npm install | ||
if: ${{ steps.release.outputs.release_created }} | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
if: ${{ steps.release.outputs.release_created }} |
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.