diff --git a/.eslintrc b/.eslintrc index 3d22176..f49472a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,4 +1,4 @@ { - "extends": ["@yandex-cloud/eslint-config", "@yandex-cloud/eslint-config/server"], + "extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/server"], "root": true } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ac47c0..7d137e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,14 @@ +name: Release + on: push: branches: [main] -name: release - jobs: release: runs-on: ubuntu-latest steps: - - uses: yandex-cloud/ui-release-action@main - with: - github-token: ${{ secrets.YC_UI_BOT_GITHUB_TOKEN }} - npm-token: ${{ secrets.YC_UI_BOT_NPM_TOKEN }} - node-version: 14 + - uses: gravity-ui/release-action@v1 + with: + github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }} + npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }} diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..38f11c6 --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +registry=https://registry.npmjs.org diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..8351c19 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +14 diff --git a/README.md b/README.md index 00926f2..862dd85 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ ## I18N utilities -Utilities in the I18N package are designed for internationalization of Yandex Cloud UI services. +Utilities in the I18N package are designed for internationalization of Gravity UI services. ### Breaking changes in 0.6.0 @@ -10,7 +10,7 @@ Utilities in the I18N package are designed for internationalization of Yandex Cl ### Install -`npm install --save @yandex-cloud/i18n` +`npm install --save @gravity-ui/i18n` ### API @@ -141,7 +141,7 @@ The configuration function accepts an object with languages as keys, and plurali A pluralization function accepts a number and the `PluralForm` enum, and is expected to return one of the enum values depending on the provided number. ```js -const {I18N} = require('@yandex-cloud/i18n'); +const {I18N} = require('@gravity-ui/i18n'); const i18n = new I18N(); @@ -226,7 +226,7 @@ In your `ui/utils/i18n` directories (where you configure i18n and export it to b ```ts // Example from the console -import {I18NFn} from '@yandex-cloud/i18n'; +import {I18NFn} from '@gravity-ui/i18n'; // This must be a typed import! import type Keysets from '../../../dist/public/build/i18n/data.json'; diff --git a/package-lock.json b/package-lock.json index c639758..26c61c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@yandex-cloud/i18n", + "name": "@gravity-ui/i18n", "version": "0.6.0", "lockfileVersion": 1, "requires": true, @@ -938,6 +938,50 @@ } } }, + "@gravity-ui/eslint-config": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@gravity-ui/eslint-config/-/eslint-config-1.0.2.tgz", + "integrity": "sha512-988w7swpqZ8bwhPTNSVNvwJK3hJ4EBKA4dY7Sd0sTgXtjKLZhpff/I7Rncr76c8pgcXsvmHD2++kPnXe5oqx2Q==", + "dev": true, + "requires": { + "@babel/core": "7.16.0", + "@babel/eslint-parser": "7.16.3", + "@babel/preset-react": "7.16.0", + "@typescript-eslint/eslint-plugin": "5.3.1", + "@typescript-eslint/parser": "5.3.1", + "eslint-config-prettier": "8.3.0", + "eslint-plugin-prettier": "4.0.0", + "eslint-plugin-react": "7.27.0", + "eslint-plugin-react-hooks": "4.3.0", + "eslint-plugin-security": "1.4.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==" + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@gravity-ui/tsconfig": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gravity-ui/tsconfig/-/tsconfig-1.0.0.tgz", + "integrity": "sha512-C7uWrCTD6g+rvSFYTPaOMMf4YUWyA5eRSXsJ1AsigGc7yQC/lhugGNqeUo5efz+zpmZ80oG/BIJPCx0nIZizDg==", + "dev": true + }, "@humanwhocodes/config-array": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", @@ -1691,142 +1735,85 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.5.0.tgz", - "integrity": "sha512-4bV6fulqbuaO9UMXU0Ia0o6z6if+kmMRW8rMRyfqXj/eGrZZRGedS4n0adeGNnjr8LKAM495hrQ7Tea52UWmQA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.3.1.tgz", + "integrity": "sha512-cFImaoIr5Ojj358xI/SDhjog57OK2NqlpxwdcgyxDA3bJlZcJq5CPzUXtpD7CxI2Hm6ATU7w5fQnnkVnmwpHqw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.5.0", - "@typescript-eslint/scope-manager": "5.5.0", + "@typescript-eslint/experimental-utils": "5.3.1", + "@typescript-eslint/scope-manager": "5.3.1", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", "regexpp": "^3.2.0", - "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/experimental-utils": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.5.0.tgz", - "integrity": "sha512-kjWeeVU+4lQ1SLYErRKV5yDXbWDPkpbzTUUlfAUifPYvpX0qZlrcCZ96/6oWxt3QxtK5WVhXz+KsnwW9cIW+3A==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.3.1.tgz", + "integrity": "sha512-RgFn5asjZ5daUhbK5Sp0peq0SSMytqcrkNfU4pnDma2D8P3ElZ6JbYjY8IMSFfZAJ0f3x3tnO3vXHweYg0g59w==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.5.0", - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/typescript-estree": "5.5.0", + "@typescript-eslint/scope-manager": "5.3.1", + "@typescript-eslint/types": "5.3.1", + "@typescript-eslint/typescript-estree": "5.3.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.5.0.tgz", - "integrity": "sha512-JsXBU+kgQOAgzUn2jPrLA+Rd0Y1dswOlX3hp8MuRO1hQDs6xgHtbCXEiAu7bz5hyVURxbXcA2draasMbNqrhmg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.3.1.tgz", + "integrity": "sha512-TD+ONlx5c+Qhk21x9gsJAMRohWAUMavSOmJgv3JGy9dgPhuBd5Wok0lmMClZDyJNLLZK1JRKiATzCKZNUmoyfw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.5.0", - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/typescript-estree": "5.5.0", + "@typescript-eslint/scope-manager": "5.3.1", + "@typescript-eslint/types": "5.3.1", + "@typescript-eslint/typescript-estree": "5.3.1", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.5.0.tgz", - "integrity": "sha512-0/r656RmRLo7CbN4Mdd+xZyPJ/fPCKhYdU6mnZx+8msAD8nJSP8EyCFkzbd6vNVZzZvWlMYrSNekqGrCBqFQhg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.3.1.tgz", + "integrity": "sha512-XksFVBgAq0Y9H40BDbuPOTUIp7dn4u8oOuhcgGq7EoDP50eqcafkMVGrypyVGvDYHzjhdUCUwuwVUK4JhkMAMg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/visitor-keys": "5.5.0" + "@typescript-eslint/types": "5.3.1", + "@typescript-eslint/visitor-keys": "5.3.1" } }, "@typescript-eslint/types": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.5.0.tgz", - "integrity": "sha512-OaYTqkW3GnuHxqsxxJ6KypIKd5Uw7bFiQJZRyNi1jbMJnK3Hc/DR4KwB6KJj6PBRkJJoaNwzMNv9vtTk87JhOg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.3.1.tgz", + "integrity": "sha512-bG7HeBLolxKHtdHG54Uac750eXuQQPpdJfCYuw4ZI3bZ7+GgKClMWM8jExBtp7NSP4m8PmLRM8+lhzkYnSmSxQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.5.0.tgz", - "integrity": "sha512-pVn8btYUiYrjonhMAO0yG8lm7RApzy2L4RC7Td/mC/qFkyf6vRbGyZozoA94+w6D2Y2GRqpMoCWcwx/EUOzyoQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.3.1.tgz", + "integrity": "sha512-PwFbh/PKDVo/Wct6N3w+E4rLZxUDgsoII/GrWM2A62ETOzJd4M6s0Mu7w4CWsZraTbaC5UQI+dLeyOIFF1PquQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.5.0", - "@typescript-eslint/visitor-keys": "5.5.0", + "@typescript-eslint/types": "5.3.1", + "@typescript-eslint/visitor-keys": "5.3.1", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", - "semver": "^7.3.5", "tsutils": "^3.21.0" - }, - "dependencies": { - "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@typescript-eslint/visitor-keys": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.5.0.tgz", - "integrity": "sha512-4GzJ1kRtsWzHhdM40tv0ZKHNSbkDhF0Woi/TDwVJX6UICwJItvP7ZTXbjTkCdrors7ww0sYe0t+cIKDAJwZ7Kw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.5.0", - "eslint-visitor-keys": "^3.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", - "dev": true - } - } - }, - "@yandex-cloud/eslint-config": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@yandex-cloud/eslint-config/-/eslint-config-1.0.0.tgz", - "integrity": "sha512-+OLxe3We35fgOHTi0p8sfDS2Xz5BJIilV7k3LC755BujZZ4l7vSukCvixKVGkoQL6DonnW+59x6T1V580WKGxA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.3.1.tgz", + "integrity": "sha512-3cHUzUuVTuNHx0Gjjt5pEHa87+lzyqOiHXy/Gz+SJOCW1mpw9xQHIIEwnKn+Thph1mgWyZ90nboOcSuZr/jTTQ==", "dev": true, "requires": { - "@babel/core": "^7.16.0", - "@babel/eslint-parser": "^7.16.3", - "@babel/preset-react": "^7.16.0", - "@typescript-eslint/eslint-plugin": "^5.3.1", - "@typescript-eslint/parser": "^5.3.1", - "eslint-config-prettier": "^8.3.0", - "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-react": "^7.27.0", - "eslint-plugin-react-hooks": "^4.3.0", - "eslint-plugin-security": "^1.4.0" + "@typescript-eslint/types": "5.3.1" } }, - "@yandex-cloud/tsconfig": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@yandex-cloud/tsconfig/-/tsconfig-1.0.0.tgz", - "integrity": "sha512-fBMHxFHypWHa+IRzhLTcpSv9pg8sAyUhMqWkilhp/3M7PQ3pjAufkFGyqp6CSdb7a0u4p8pYL8CqG6ePV5OJRQ==", - "dev": true - }, "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", @@ -2920,15 +2907,14 @@ } }, "eslint-plugin-react": { - "version": "7.27.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.27.1.tgz", - "integrity": "sha512-meyunDjMMYeWr/4EBLTV1op3iSG3mjT/pz5gti38UzfM4OPpNc2m0t2xvKCOMU5D6FSdd34BIMFOvQbW+i8GAA==", + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.27.0.tgz", + "integrity": "sha512-0Ut+CkzpppgFtoIhdzi2LpdpxxBvgFf99eFqWxJnUrO7mMe0eOiNpou6rvNYeVVV6lWZvTah0BFne7k5xHjARg==", "dev": true, "requires": { "array-includes": "^3.1.4", "array.prototype.flatmap": "^1.2.5", "doctrine": "^2.1.0", - "estraverse": "^5.3.0", "jsx-ast-utils": "^2.4.1 || ^3.0.0", "minimatch": "^3.0.4", "object.entries": "^1.1.5", @@ -2941,12 +2927,6 @@ "string.prototype.matchall": "^4.0.6" }, "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -3355,14 +3335,6 @@ "ignore": "^5.1.4", "merge2": "^1.3.0", "slash": "^3.0.0" - }, - "dependencies": { - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - } } }, "graceful-fs": { @@ -5357,7 +5329,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -6839,8 +6810,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "yaml": { "version": "1.10.2", diff --git a/package.json b/package.json index c3e6d95..c7b4633 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { - "name": "@yandex-cloud/i18n", - "description": "i18n library for Yandex Cloud UI services", + "name": "@gravity-ui/i18n", + "description": "i18n library for Gravity UI services", "version": "0.6.0", "license": "MIT", "main": "build/cjs/index.js", "module": "build/esm/index.js", "types": "build/esm/index.d.ts", - "repository": "git@github.com:yandex-cloud/i18n", + "repository": "git@github.com:gravity-ui/i18n", "scripts": { "build": "npm run build:clean && npm run build:compile", "build:compile": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json", @@ -26,9 +26,9 @@ "devDependencies": { "@commitlint/cli": "15.0.0", "@commitlint/config-conventional": "15.0.0", + "@gravity-ui/eslint-config": "^1.0.0", + "@gravity-ui/tsconfig": "^1.0.0", "@types/jest": "27.4.1", - "@yandex-cloud/eslint-config": "^1.0.0", - "@yandex-cloud/tsconfig": "^1.0.0", "eslint": "8.3.0", "jest": "27.5.1", "ts-jest": "27.1.3", diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 5f695f4..71c3bf2 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -1,5 +1,5 @@ { - "extends": "@yandex-cloud/tsconfig/tsconfig", + "extends": "@gravity-ui/tsconfig/tsconfig", "compilerOptions": { "outDir": "build/cjs", "declaration": true diff --git a/tsconfig.json b/tsconfig.json index 391864c..1c06f60 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@yandex-cloud/tsconfig/tsconfig", + "extends": "@gravity-ui/tsconfig/tsconfig", "compilerOptions": { "outDir": "build/esm", "module": "esnext",