yata-fetch 2.0.2 → 2.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,10 @@
1
+ root = true
2
+
3
+ [*]
4
+ end_of_line = lf
5
+ insert_final_newline = true
6
+
7
+ [*.{js,json,yml}]
8
+ charset = utf-8
9
+ indent_style = space
10
+ indent_size = 2
@@ -9,15 +9,26 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - name: Checkout
12
- uses: actions/checkout@v2
12
+ uses: actions/checkout@v3
13
13
  - name: Setup Node
14
- uses: actions/setup-node@v2
14
+ uses: actions/setup-node@v3
15
15
  with:
16
- node-version: '16.16.0'
16
+ node-version: '25.5.0'
17
17
  registry-url: 'https://registry.npmjs.org'
18
- - name: Install dependencies and build 🔧
19
- run: npm install && npm run build
20
- - name: Publish package on NPM 📦
18
+ - name: Setup pnpm
19
+ uses: pnpm/action-setup@v4
20
+ - name: Install
21
+ run: pnpm install
22
+ - name: Build 🔧
23
+ run: pnpm build
24
+ - name: Configure npm
25
+ run: |
26
+ cat << EOF > "$HOME/.npmrc"
27
+ //registry.npmjs.org/:_authToken=$NPM_TOKEN
28
+ EOF
29
+ env:
30
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31
+ - name: Publish 📦
21
32
  run: npm publish
22
33
  env:
23
34
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -3,144 +3,41 @@ name: Test
3
3
  on:
4
4
  pull_request:
5
5
  branches:
6
- - master
6
+ - '*'
7
7
  push:
8
8
  branches:
9
9
  - master
10
10
 
11
- env:
12
- cache_version: v1
13
- node-version: 16.16.0
14
-
15
11
  jobs:
16
- dependencies:
17
- name: Install dependencies
12
+ build-lint-test:
18
13
  runs-on: ubuntu-latest
14
+
19
15
  steps:
20
- - uses: actions/checkout@v2
21
- - name: Use Node.js ${{ matrix.node-version }}
22
- uses: actions/setup-node@v2
23
- with:
24
- node-version: ${{ env.node-version }}
25
- - name: Set lockfile_hash
26
- run: echo "lockfile_hash=${{ hashFiles('**/package-lock.json') }}" >> $GITHUB_ENV
27
- - name: Restore node_modules cache
28
- uses: actions/cache@v2
29
- id: node-modules-cache
30
- with:
31
- path: ./node_modules
32
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ env.lockfile_hash }}
33
- - name: Get npm cache directory path
34
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
35
- id: npm-cache-dir-path
36
- run: echo "::set-output name=dir::~/.npm/_cacache"
37
- - name: Restore npm cache
38
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
39
- uses: actions/cache@v2
40
- id: npm-cache
41
- with:
42
- path: ${{ steps.npm-cache-dir-path.outputs.dir }}
43
- key: ${{ runner.os }}-npm-${{ env.cache_version }}-${{ env.lockfile_hash }}
44
- restore-keys: ${{ runner.os }}-npm-${{ env.cache_version }}-
45
- - name: Install dependencies
46
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
47
- run: npm ci
48
- lint_scripts:
49
- name: Lint JavaScript
50
- needs: dependencies
51
- runs-on: ubuntu-latest
52
- steps:
53
- - uses: actions/checkout@v2
54
- - name: Use Node.js ${{ matrix.node-version }}
55
- uses: actions/setup-node@v2
56
- with:
57
- node-version: ${{ env.node-version }}
58
- - name: Restore node_modules cache
59
- uses: actions/cache@v2
60
- id: node-modules-cache
61
- with:
62
- path: ./node_modules
63
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ hashFiles('**/package-lock.json') }}
64
- - name: Lint
65
- run: npm run lint:eslint
66
- lint_format:
67
- name: Lint Formatting
68
- needs: dependencies
69
- runs-on: ubuntu-latest
70
- steps:
71
- - uses: actions/checkout@v2
72
- - name: Use Node.js ${{ matrix.node-version }}
73
- uses: actions/setup-node@v2
74
- with:
75
- node-version: ${{ env.node-version }}
76
- - name: Restore node_modules cache
77
- uses: actions/cache@v2
78
- id: node-modules-cache
79
- with:
80
- path: ./node_modules
81
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ hashFiles('**/package-lock.json') }}
82
- - name: Lint format
83
- run: npm run lint:fmt
84
- lint_types:
85
- name: Lint Typings
86
- needs: dependencies
87
- runs-on: ubuntu-latest
88
- steps:
89
- - uses: actions/checkout@v2
90
- - name: Use Node.js ${{ matrix.node-version }}
91
- uses: actions/setup-node@v2
92
- with:
93
- node-version: ${{ env.node-version }}
94
- - name: Restore node_modules cache
95
- uses: actions/cache@v2
96
- id: node-modules-cache
97
- with:
98
- path: ./node_modules
99
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ hashFiles('**/package-lock.json') }}
100
- - name: Lint
101
- run: npm run lint:ts
102
- build:
103
- name: Build application
104
- needs:
105
- - dependencies
106
- - lint_types
107
- runs-on: ubuntu-latest
108
- steps:
109
- - uses: actions/checkout@v2
110
- - name: Use Node.js ${{ matrix.node-version }}
111
- uses: actions/setup-node@v2
112
- with:
113
- node-version: ${{ env.node-version }}
114
- - name: Restore node_modules cache
115
- uses: actions/cache@v2
116
- id: node-modules-cache
117
- with:
118
- path: ./node_modules
119
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ hashFiles('**/package-lock.json') }}
120
- - name: Build app
121
- run: npm run build
122
- test_unit:
123
- name: Unit Tests
124
- needs:
125
- - build
126
- - lint_scripts
127
- - lint_format
128
- - lint_types
129
- runs-on: ubuntu-latest
130
- continue-on-error: false
131
- outputs:
132
- test-results: ${{ steps.status.outputs.test-results }}
133
- steps:
134
- - uses: actions/checkout@v2
135
- - name: Use Node.js ${{ matrix.node-version }}
136
- uses: actions/setup-node@v2
137
- with:
138
- node-version: ${{ env.node-version }}
139
- - name: Restore node_modules cache
140
- uses: actions/cache@v2
141
- id: node-modules-cache
16
+ - name: Checkout
17
+ uses: actions/checkout@v3
18
+
19
+ - name: Setup Node
20
+ uses: actions/setup-node@v3
142
21
  with:
143
- path: ./node_modules
144
- key: ${{ runner.os }}-node-modules-${{ env.cache_version }}-${{ hashFiles('**/package-lock.json') }}
145
- - name: Run tests
146
- run: npm run test
22
+ node-version: '25.5.0'
23
+
24
+ - name: Setup pnpm
25
+ uses: pnpm/action-setup@v4
26
+
27
+ - name: Install
28
+ run: pnpm install
29
+
30
+ - name: Lint Scripts
31
+ run: pnpm lint:eslint
32
+
33
+ - name: Lint Format
34
+ run: pnpm lint:fmt
35
+
36
+ - name: Lint Types
37
+ run: pnpm lint:ts
38
+
39
+ - name: Unit Test
40
+ run: pnpm test
41
+
42
+ - name: Build
43
+ run: pnpm build
package/.tool-versions CHANGED
@@ -1 +1,2 @@
1
- nodejs 16.16.0
1
+ nodejs 22.14.0
2
+ pnpm 10.4.1
package/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # yata-fetch
2
2
 
3
- ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/dzbo/yata-fetch/Test) [![NPM](https://img.shields.io/npm/v/yata-fetch)](https://www.npmjs.com/package/yata-fetch) ![NPM](https://img.shields.io/npm/l/yata-fetch) ![npms.io (maintenance)](https://img.shields.io/npms-io/quality-score/yata-fetch) ![npms.io (maintenance)](https://img.shields.io/npms-io/maintenance-score/yata-fetch)
3
+ [![NPM](https://img.shields.io/npm/v/yata-fetch)](https://www.npmjs.com/package/yata-fetch) ![NPM](https://img.shields.io/npm/l/yata-fetch) ![npms.io (maintenance)](https://img.shields.io/npms-io/quality-score/yata-fetch) ![npms.io (maintenance)](https://img.shields.io/npms-io/maintenance-score/yata-fetch)
4
4
 
5
5
  Welcome to Yata integration package, this package will allow you to easy get your translations from [Yata](https://run.yatapp.net/) service.
6
6
 
7
7
  ## Installation
8
8
 
9
+ `pnpm add yata-fetch -D`
9
10
  `npm install yata-fetch -D`
10
11
 
11
12
  ## Usage
@@ -29,9 +30,7 @@ Example `.yata.json` file:
29
30
  {
30
31
  "token": "MY_YATA_API_TOKEN",
31
32
  "project": "XXX",
32
- "locales": [
33
- "en_US", "de_DE"
34
- ],
33
+ "locales": ["en_US", "de_DE"],
35
34
  "format": "yml",
36
35
  "root": false,
37
36
  "outputPath": "./translations",
@@ -66,9 +65,7 @@ Example:
66
65
  $ yata-fetch --config .yata.json --locale en_US
67
66
  ```
68
67
 
69
- Hint:
70
-
71
- It's best to create scripts for generating translations in `package.json` file. For example:
68
+ It's recommended to create scripts for generating translations in `package.json` file. For example:
72
69
 
73
70
  ```json
74
71
  "scripts": {
@@ -77,7 +74,7 @@ It's best to create scripts for generating translations in `package.json` file.
77
74
  }
78
75
  ```
79
76
 
80
- and simply call with `npm run yata-fetch`
77
+ and simply call with `pnpm yata-fetch` or `npm run yata-fetch`
81
78
 
82
79
  ## Problems?
83
80
 
@@ -91,21 +88,27 @@ Want help to develop this package? Please open a Pull Request.
91
88
 
92
89
  ### Installation
93
90
 
94
- ```
91
+ ```bash
95
92
  git clone <this repository>
96
- npm install
93
+ pnpm install
97
94
  ```
98
95
 
99
96
  ### Running Tests
100
97
 
101
- ```
102
- npm run test
98
+ ```bash
99
+ pnpm test
103
100
  ```
104
101
 
105
102
  ### Building
106
103
 
104
+ ```bash
105
+ pnpm build
107
106
  ```
108
- npm run build
107
+
108
+ ### Upgrading
109
+
110
+ ```bash
111
+ pnpm update --interactive
109
112
  ```
110
113
 
111
114
  ### Release
@@ -114,6 +117,7 @@ npm run build
114
117
  npm version <major|minor|patch>
115
118
  git push origin --tags
116
119
  ```
120
+
117
121
  Optionally create new release entry in Github Releases.
118
122
  When Github Action detect new version there will be automatic release to NPM.
119
123
 
package/bin/yata-fetch.js CHANGED
File without changes
@@ -0,0 +1,26 @@
1
+ import eslint from '@eslint/js'
2
+ import tseslint from 'typescript-eslint'
3
+ import globals from 'globals'
4
+
5
+ export default tseslint.config(
6
+ eslint.configs.recommended,
7
+ ...tseslint.configs.recommended,
8
+ {
9
+ languageOptions: {
10
+ globals: {
11
+ ...globals.browser,
12
+ ...globals.node,
13
+ },
14
+ parserOptions: {
15
+ ecmaVersion: 'latest',
16
+ sourceType: 'module',
17
+ },
18
+ },
19
+ rules: {
20
+ '@typescript-eslint/no-require-imports': 'off',
21
+ },
22
+ },
23
+ {
24
+ ignores: ['dist/**', 'node_modules/**'],
25
+ }
26
+ )
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "yata-fetch",
3
- "version": "2.0.2",
3
+ "version": "2.1.6",
4
+ "packageManager": "pnpm@10.4.1",
4
5
  "type": "module",
5
6
  "description": "Adds CLI interface for importing translation files from Yata",
6
7
  "license": "MIT",
@@ -17,36 +18,40 @@
17
18
  "type": "git",
18
19
  "url": "git://github.com/dzbo/yata-fetch.git"
19
20
  },
20
- "bin": {
21
- "yata-fetch": "./bin/yata-fetch.js"
22
- },
21
+ "bin": "./bin/yata-fetch.js",
23
22
  "scripts": {
24
23
  "build": "vite build",
25
24
  "generate": "node bin/yata-fetch.js --config test/fixtures/yata.json",
26
25
  "test": "vitest run",
27
26
  "coverage": "vitest run --coverage",
28
27
  "lint": "npm-run-all --aggregate-output --continue-on-error --parallel \"lint:*\"",
29
- "lint:eslint": "eslint src --ext .js,.ts,.vue",
28
+ "lint:eslint": "eslint src",
30
29
  "lint:ts": "tsc --noEmit",
31
- "lint:fmt": "prettier --check --loglevel=warn --write ."
30
+ "lint:fmt": "prettier --check --log-level=warn --write ."
32
31
  },
33
32
  "dependencies": {
34
- "nconf": "0.12.0"
33
+ "nconf": "0.13.0"
35
34
  },
36
35
  "devDependencies": {
37
- "@commitlint/cli": "17.0.3",
38
- "@commitlint/config-conventional": "17.0.3",
39
- "@types/nconf": "0.10.3",
40
- "@types/node": "18.6.5",
41
- "@typescript-eslint/eslint-plugin": "5.33.0",
42
- "@typescript-eslint/parser": "5.33.0",
43
- "c8": "7.12.0",
44
- "eslint": "8.21.0",
45
- "husky": "8.0.1",
36
+ "@eslint/js": "9.39.2",
37
+ "@types/nconf": "0.10.7",
38
+ "@types/node": "25.2.0",
39
+ "@typescript-eslint/eslint-plugin": "8.54.0",
40
+ "@typescript-eslint/parser": "8.54.0",
41
+ "@vitest/coverage-v8": "4.0.18",
42
+ "c8": "10.1.3",
43
+ "eslint": "9.39.2",
44
+ "globals": "17.3.0",
46
45
  "npm-run-all": "4.1.5",
47
- "prettier": "2.7.1",
48
- "typescript": "^4.7.4",
49
- "vite": "^3.0.4",
50
- "vitest": "0.21.0"
46
+ "prettier": "3.8.1",
47
+ "typescript": "^5.9.3",
48
+ "typescript-eslint": "8.54.0",
49
+ "vite": "^7.3.1",
50
+ "vitest": "4.0.18"
51
+ },
52
+ "pnpm": {
53
+ "onlyBuiltDependencies": [
54
+ "esbuild"
55
+ ]
51
56
  }
52
57
  }
package/.eslintrc.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "env": {
3
- "browser": true,
4
- "es2021": true,
5
- "node": true
6
- },
7
- "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
8
- "parser": "@typescript-eslint/parser",
9
- "parserOptions": {
10
- "ecmaVersion": "latest",
11
- "sourceType": "module"
12
- },
13
- "plugins": ["@typescript-eslint"],
14
- "rules": {
15
- "@typescript-eslint/no-var-requires": 0
16
- }
17
- }
package/.husky/commit-msg DELETED
@@ -1,4 +0,0 @@
1
- #!/bin/sh
2
- . "$(dirname "$0")/_/husky.sh"
3
-
4
- npx --no -- commitlint --edit "${1}"
@@ -1 +0,0 @@
1
- module.exports = {extends: ['@commitlint/config-conventional']}