From d79ef07b46b1b5d6bf4b95a9dd246a64576992f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=B2=20=E8=80=98?= Date: Thu, 23 Nov 2023 00:20:11 +0800 Subject: [PATCH 1/2] feat: export amd module --- .gitignore | 1 + package.json | 10 ++++++++-- tsconfig-amd.json | 8 ++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tsconfig-amd.json diff --git a/.gitignore b/.gitignore index bc0944b..5b97fd0 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ Thumbs.db *.pyo build esm +amd lib lib2 node_modules diff --git a/package.json b/package.json index 78a5c37..1dc5493 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pinyin", - "version": "3.0.0-alpha.7", + "version": "3.1.0", "description": "汉语拼音转换工具。", "main": "./lib/pinyin.js", "module": "./esm/pinyin.js", @@ -23,7 +23,8 @@ "scripts": { "start": "dumi dev", "prepublishOnly": "npm run build", - "build": "tsc --downlevelIteration -p tsconfig-es5.json & tsc --downlevelIteration -p tsconfig.json", + "build": "tsc --downlevelIteration -p tsconfig-es5.json & tsc --downlevelIteration -p tsconfig.json & npm run build:amd", + "build:amd": "tsc --downlevelIteration -p tsconfig-amd.json", "doc:build": "rm -rf ./src/.umi && dumi build", "doc:deploy": "npm run doc:build && cp CNAME docs-dist/dist && gh-pages -d docs-dist/dist", "lint": "eslint ./src/ ./test/", @@ -46,6 +47,7 @@ "@typescript-eslint/parser": "^5.14.0", "aurl": "^1.2.0", "aws-sdk": "^2.1011.0", + "beautify-benchmark": "^0.2.4", "benchmark": "~1.0.0", "dumi": "^1.1.30", "eslint": "^8.11.0", @@ -74,6 +76,7 @@ "data", "lib", "esm", + "amd", "index.js" ], "keywords": [ @@ -87,5 +90,8 @@ "example": "examples", "test": "test" }, + "engines": { + "install-node": "^18.0.0" + }, "license": "MIT" } diff --git a/tsconfig-amd.json b/tsconfig-amd.json new file mode 100644 index 0000000..4e0b816 --- /dev/null +++ b/tsconfig-amd.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outFile": "./amd/pinyin.js", + "module": "amd", + "target": "ES5" + } +} From 54f61cc5165e44edd6c66829cd24b96032320ab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=B2=20=E8=80=98?= Date: Thu, 23 Nov 2023 00:25:42 +0800 Subject: [PATCH 2/2] feat: Update README --- README.en-US.md | 2 +- README.ko-KR.md | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.en-US.md b/README.en-US.md index 1305f48..8892f30 100644 --- a/README.en-US.md +++ b/README.en-US.md @@ -46,7 +46,7 @@ Convert Han to pinyin. useful for phonetic notation, sorting, and searching. via npm: ```bash -npm install pinyin@alpha --save +npm install pinyin --save ``` ## Usage diff --git a/README.ko-KR.md b/README.ko-KR.md index 20d8d48..aebbe9c 100644 --- a/README.ko-KR.md +++ b/README.ko-KR.md @@ -46,7 +46,7 @@ README: [简体中文](README.md) | [English](README.en-US.md) | 한국어 via npm: ```bash -npm install pinyin@alpha --save +npm install pinyin --save ``` ## 사용법 diff --git a/README.md b/README.md index 2d6ce6e..aa0cd2d 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ README: 简体中文 | [English](README.en-US.md) | [한국어](README.ko-KR.md) via npm: ```bash -npm install pinyin@alpha --save +npm install pinyin --save ``` ## 用法