@enonic-types/lib-i18n 7.11.0-B1 → 7.11.0-B4

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.
Files changed (2) hide show
  1. package/README.md +18 -28
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -5,67 +5,57 @@
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm i --save-dev @enonic/lib-i18n
8
+ npm i --save-dev @enonic-types/lib-i18n
9
9
  ```
10
10
 
11
11
  ## Use
12
12
 
13
- Add the corresponding types to your `tsconfig.json` file that is used for application's server-side TypeScript code.
14
-
15
- `tsconfig.json`
16
- ```json
17
- {
18
- "compilerOptions": {
19
- "types": [
20
- "@enonic-types/lib-i18n"
21
- ]
22
- }
23
- }
24
- ```
25
-
26
13
  ### Require and custom imports
27
14
 
28
- To make `require` work out of box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP global objects, e.g. `log`, `app`, `__`, etc, requiring library by the default path will return typed object.
15
+ To make `require` work out of the box, you must install and add the `@enonic-types/global` types. Aside from providing definitions for XP
16
+ global objects, e.g. `log`, `app`, `__`, etc, requiring a library by the default path will return typed object.
29
17
 
30
18
  `tsconfig.json`
31
- ```diff
19
+
20
+ ```json
32
21
  {
33
22
  "compilerOptions": {
34
23
  "types": [
35
- + "@enonic-types/global"
36
- "@enonic-types/lib-i18n"
24
+ "@enonic-types/global"
37
25
  ]
38
26
  }
39
27
  }
40
28
  ```
41
29
 
42
30
  `example.ts`
31
+
43
32
  ```ts
44
33
  const {localize, getPhrases, getSupportedLocales} = require('/lib/xp/i18n');
45
34
  ```
46
35
 
47
- More detailed explanation on how it works and how to type custom import function can be found [here](https://github.com/enonic/xp/tree/master/modules/lib/typescript/README.md).
36
+ More detailed explanation on how it works and how to type custom import function can be
37
+ found [here](https://developer.enonic.com/docs/xp/stable/api).
48
38
 
49
39
  ### ES6-style import
50
40
 
51
- If you are planning to use `import` in your code and transpile it with the default `tsc` TypeScript compiler, you'll need to add proper types mapping to your configuration.
41
+ If you are planning to use `import` in your code and transpile it with the default `tsc` TypeScript compiler, you'll need to add proper
42
+ types mapping to your configuration.
52
43
 
53
44
  `tsconfig.json`
54
- ```diff
45
+
46
+ ```json
55
47
  {
56
48
  "compilerOptions": {
57
- "types": [
58
- "@enonic-types/lib-i18n"
59
- ]
60
- + "baseUrl": "./",
61
- + "paths": {
62
- + "/lib/xp/i18n": ["node_modules/@enonic-types/lib-i18n"],
63
- + }
49
+ "baseUrl": "./",
50
+ "paths": {
51
+ "/lib/xp/i18n": ["node_modules/@enonic-types/lib-i18n"]
52
+ }
64
53
  }
65
54
  }
66
55
  ```
67
56
 
68
57
  `example.ts`
58
+
69
59
  ```ts
70
60
  import {localize, getPhrases, getSupportedLocales} from '/lib/xp/i18n';
71
61
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-i18n",
3
- "version": "7.11.0-B1",
3
+ "version": "7.11.0-B4",
4
4
  "description": "Type definitions for lib-i18n.",
5
5
  "types": "i18n.d.ts",
6
6
  "files": [
@@ -26,6 +26,7 @@
26
26
  "url": "https://github.com/enonic/xp/issues"
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
+ "dependencies": {},
29
30
  "publishConfig": {
30
31
  "access": "public"
31
32
  }