Skip to content

Commit 26e5bf4

Browse files
committed
Update dependencies: @messageformat/core v3, dot-properties v1, refresh lockfile
1 parent 648810f commit 26e5bf4

File tree

6 files changed

+194
-75
lines changed

6 files changed

+194
-75
lines changed

README.md

+2-8
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ Property values are parsed directly as ICU MessageFormat. With the default optio
66

77
[dot-properties]: https://www.npmjs.com/package/dot-properties
88
[messageformat]: https://messageformat.github.io/
9-
[as in Java Resource Bundles]: https://docs.oracle.com/javase/9/docs/api/java/util/ResourceBundle.html#getBundle-java.lang.String-java.util.Locale-java.lang.ClassLoader-
9+
[as in java resource bundles]: https://docs.oracle.com/javase/9/docs/api/java/util/ResourceBundle.html#getBundle-java.lang.String-java.util.Locale-java.lang.ClassLoader-
1010

1111
## Installation
1212

1313
```sh
14-
npm install messageformat@next messageformat-properties-loader
14+
npm install messageformat-properties-loader
1515
```
1616

17-
Starting from version 0.4.0, the loader requires messageformat v3, currently in beta.
18-
19-
2017
## Usage
2118

2219
For a working demo of the following, run `npm install && npm run build` in the [`example/`](./example/) directory, and then open `example/dist/index.html` in a browser.
2320

24-
2521
#### Webpack configuration
2622

2723
```js
@@ -43,7 +39,6 @@ For a working demo of the following, run `npm install && npm run build` in the [
4339

4440
Default option values are shown above, though none are required.
4541

46-
4742
#### messages_en.properties
4843

4944
```
@@ -53,7 +48,6 @@ errors.wrong_length: {src} is the wrong length (should be {count, plural, one{1
5348
errors.equal_to: {src} must be equal to {count}
5449
```
5550

56-
5751
#### example.js
5852

5953
```js

example/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
"webpack-cli": "^3.3.11"
1616
},
1717
"dependencies": {
18-
"messageformat-runtime": "^3.0.0-beta.0"
18+
"@messageformat/runtime": "^3.0.0-beta.0"
1919
}
2020
}

example/src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Messages from 'messageformat-runtime/messages'
1+
import Messages from '@messageformat/runtime/messages'
22
import en from './messages_en.properties'
33

44
const messages = new Messages({ en })

index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
const MessageFormat = require('@messageformat/core')
2+
const compileModule = require('@messageformat/core/compile-module')
13
const { parse } = require('dot-properties')
24
const loaderUtils = require('loader-utils')
3-
const MessageFormat = require('messageformat')
4-
const compileModule = require('messageformat/compile-module');
55
const path = require('path')
66
const uv = require('uv')
77

@@ -32,7 +32,7 @@ module.exports = function messageformatPropertiesLoader(content) {
3232
defaultLocale || 'en'
3333
)
3434
const mf = new MessageFormat(locale, mfOpt)
35-
return compileModule(mf, messages);
35+
return compileModule(mf, messages)
3636
}
3737

3838
// get content as Buffer rather than string

package-lock.json

+185-55
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,14 @@
2323
"node": ">=6.0"
2424
},
2525
"dependencies": {
26-
"dot-properties": "^0.4.0",
26+
"@messageformat/core": "^3.0.1",
27+
"dot-properties": "^1.0.1",
2728
"loader-utils": "^2.0.0",
2829
"uv": "^1.1.0"
2930
},
30-
"peerDependencies": {
31-
"messageformat": "^3.0.0-beta"
32-
},
3331
"prettier": {
3432
"trailingComma": "none",
3533
"semi": false,
3634
"singleQuote": true
37-
},
38-
"devDependencies": {
39-
"messageformat": "^3.0.0-beta.1"
4035
}
4136
}

0 commit comments

Comments
 (0)