@jsverse/transloco-utils 7.0.0
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/CHANGELOG.md +61 -0
- package/package.json +38 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -0
- package/src/lib/transloco-utils.d.ts +2 -0
- package/src/lib/transloco-utils.js +12 -0
- package/src/lib/transloco-utils.types.d.ts +18 -0
- package/src/lib/transloco-utils.types.js +2 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
|
+
|
|
5
|
+
# [7.0.0](https://github.com/jsverse/transloco/compare/transloco-utils-6.0.0...transloco-utils-7.0.0) (2024-03-23)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### chore
|
|
9
|
+
|
|
10
|
+
* **utils:** ๐ค update scope to jsverse ([89662d0](https://github.com/jsverse/transloco/commit/89662d0d950d233bed5502fa7a182f42cdad2838))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* **utils:** ๐งจ The package is noe published under the jsverse scope
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# [6.0.0](https://github.com/jsverse/transloco/compare/transloco-utils-5.0.0...transloco-utils-6.0.0) (2024-03-23)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# [5.0.0](https://github.com/jsverse/transloco/compare/transloco-utils-4.0.0...transloco-utils-5.0.0) (2023-07-30)
|
|
24
|
+
|
|
25
|
+
# [4.0.0](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.5...transloco-utils-4.0.0) (2023-06-17)
|
|
26
|
+
|
|
27
|
+
### chore
|
|
28
|
+
|
|
29
|
+
- ๐ค upgrade to angular v16 ([#661](https://github.com/jsverse/transloco/issues/661)) ([08db7e7](https://github.com/jsverse/transloco/commit/08db7e7d1f64846fa0b07123dee8ff5bff20b4f0))
|
|
30
|
+
- **utils:** ๐ค min node version is 16 ([4c31b86](https://github.com/jsverse/transloco/commit/4c31b865ec57786ea961a414ef07510532afcddc))
|
|
31
|
+
|
|
32
|
+
### BREAKING CHANGES
|
|
33
|
+
|
|
34
|
+
- **utils:** ๐งจ min node version is 16
|
|
35
|
+
- ๐งจ Angular 16
|
|
36
|
+
|
|
37
|
+
## [3.0.5](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.4...transloco-utils-3.0.5) (2023-05-18)
|
|
38
|
+
|
|
39
|
+
## [3.0.4](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.3...transloco-utils-3.0.4) (2022-07-19)
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
- **utils:** ๐ remove peer dependencies ([39b46e8](https://github.com/jsverse/transloco/commit/39b46e871ddf73ac8e23ce3e169ba9c09c8c9f97))
|
|
44
|
+
|
|
45
|
+
## [3.0.3](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.2...transloco-utils-3.0.3) (2022-07-19)
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
- **utils:** ๐ add missing declaration files ([b7c4c23](https://github.com/jsverse/transloco/commit/b7c4c23ba2c9b337615166f94106b416a4ed0377))
|
|
50
|
+
|
|
51
|
+
## [3.0.2](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.1...transloco-utils-3.0.2) (2021-10-28)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
- **utils:** ๐ global config scoped libs type ([65359bb](https://github.com/jsverse/transloco/commit/65359bb503a94dea9ff24b16fe2e06a3bb15cffc))
|
|
56
|
+
|
|
57
|
+
## [3.0.1](https://github.com/jsverse/transloco/compare/transloco-utils-3.0.0...transloco-utils-3.0.1) (2021-10-28)
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
- **utils:** ๐ wrong config search ([29afbf9](https://github.com/jsverse/transloco/commit/29afbf9164607c7e941451031a8f6bf426ff3a6d))
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jsverse/transloco-utils",
|
|
3
|
+
"version": "7.0.0",
|
|
4
|
+
"description": "Transloco utils library",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=16"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/jsverse/transloco/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://jsverse.github.io/transloco/",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/jsverse/transloco"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"angular",
|
|
22
|
+
"angular 2",
|
|
23
|
+
"i18n",
|
|
24
|
+
"translate",
|
|
25
|
+
"angular translate",
|
|
26
|
+
"angular i18n",
|
|
27
|
+
"transloco",
|
|
28
|
+
"comments",
|
|
29
|
+
"build",
|
|
30
|
+
"optimize"
|
|
31
|
+
],
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"cosmiconfig": "^8.1.3",
|
|
35
|
+
"tslib": "^2.3.0"
|
|
36
|
+
},
|
|
37
|
+
"type": "commonjs"
|
|
38
|
+
}
|
package/src/index.d.ts
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGlobalConfig = void 0;
|
|
4
|
+
var transloco_utils_1 = require("./lib/transloco-utils");
|
|
5
|
+
Object.defineProperty(exports, "getGlobalConfig", { enumerable: true, get: function () { return transloco_utils_1.getGlobalConfig; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGlobalConfig = void 0;
|
|
4
|
+
const path = require("node:path");
|
|
5
|
+
const cosmiconfig_1 = require("cosmiconfig");
|
|
6
|
+
function getGlobalConfig(searchPath = '') {
|
|
7
|
+
const explorer = (0, cosmiconfig_1.cosmiconfigSync)('transloco');
|
|
8
|
+
const resolvedPath = path.resolve(process.cwd(), searchPath);
|
|
9
|
+
const configSearch = explorer.search(resolvedPath);
|
|
10
|
+
return configSearch ? configSearch.config : {};
|
|
11
|
+
}
|
|
12
|
+
exports.getGlobalConfig = getGlobalConfig;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TranslocoGlobalConfig {
|
|
2
|
+
rootTranslationsPath?: string;
|
|
3
|
+
defaultLang?: string;
|
|
4
|
+
scopedLibs?: string[] | Array<{
|
|
5
|
+
src: string;
|
|
6
|
+
dist: string[];
|
|
7
|
+
}>;
|
|
8
|
+
scopePathMap?: Record<string, string>;
|
|
9
|
+
langs?: string[];
|
|
10
|
+
keysManager?: {
|
|
11
|
+
input?: string | string[];
|
|
12
|
+
output?: string;
|
|
13
|
+
marker?: string;
|
|
14
|
+
addMissingKeys?: boolean;
|
|
15
|
+
replace?: boolean;
|
|
16
|
+
defaultValue?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|