Skip to content
This repository was archived by the owner on May 17, 2019. It is now read-only.

Commit eaee49a

Browse files
lhoriefusion-bot[bot]
authored and
fusion-bot[bot]
committed
Migrate to fusion-core 0.3.0-x (DI API)
#20
1 parent 7e2d556 commit eaee49a

File tree

3 files changed

+40
-35
lines changed

3 files changed

+40
-35
lines changed

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@
3333
"prepublish": "npm run transpile"
3434
},
3535
"dependencies": {
36-
"fusion-plugin-i18n": "^0.1.9",
36+
"fusion-plugin-i18n": "^0.2.1",
3737
"prop-types": "^15.6.0"
3838
},
3939
"peerDependencies": {
40-
"fusion-core": "^0.2.3",
41-
"fusion-react": "^0.1.9",
40+
"fusion-core": "^0.3.0-2",
41+
"fusion-react": "^0.2.0",
42+
"fusion-tokens": "0.0.4",
4243
"react": "14.x - 16.x"
4344
},
4445
"devDependencies": {
@@ -52,8 +53,9 @@
5253
"eslint-plugin-prettier": "^2.3.1",
5354
"eslint-plugin-react": "^7.4.0",
5455
"flow-bin": "^0.59.0",
55-
"fusion-core": "^0.2.3",
56-
"fusion-react": "^0.1.9",
56+
"fusion-core": "^0.3.0-2",
57+
"fusion-react": "^0.2.0",
58+
"fusion-tokens": "0.0.4",
5759
"fusion-react-async": "0.1.4",
5860
"nyc": "^11.3.0",
5961
"prettier": "1.8.2",

src/__tests__/__node__/index.js

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,15 @@ import test from 'tape-cup';
44
import Plugin from '../../plugin';
55
import withI18n from '../../hoc';
66

7-
function getTranslationsLoader(translations, locale) {
8-
return {
9-
of() {
10-
return {
11-
translations,
12-
locale,
13-
};
14-
},
15-
};
16-
}
17-
187
test('plugin', t => {
198
const data = {test: 'hello', interpolated: 'hi ${value}'};
209

21-
const TranslationsLoader = getTranslationsLoader(data, 'en-US');
22-
2310
t.equals(typeof Plugin, 'function');
2411

25-
const I18n = Plugin({TranslationsLoader});
26-
const ctx = {headers: {'accept-language': 'en-US'}};
12+
const I18n = Plugin({
13+
loadTranslations: () => ({translations: data, locale: 'en-US'}),
14+
});
15+
const ctx = {headers: {'accept-language': 'en-US'}, memoized: new Map()};
2716
t.equals(typeof I18n.of(ctx).translate, 'function');
2817
t.end();
2918
});

yarn.lock

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,29 +2165,35 @@ functional-red-black-tree@^1.0.1:
21652165
version "1.0.1"
21662166
resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327"
21672167

2168-
fusion-core@^0.2.3:
2169-
version "0.2.3"
2170-
resolved "https://registry.yarnpkg.com/fusion-core/-/fusion-core-0.2.3.tgz#88d51f3198dea341ca7d9538cd6db5888241d6e8"
2168+
fusion-core@^0.3.0-2:
2169+
version "0.3.0-2"
2170+
resolved "https://registry.yarnpkg.com/fusion-core/-/fusion-core-0.3.0-2.tgz#cbbe19f688d00b8a2ee948293e6098dbd1a10988"
21712171
dependencies:
21722172
koa "^2.3.0"
21732173
koa-compose "^4.0.0"
21742174
node-mocks-http "^1.6.6"
2175+
toposort "^1.0.6"
21752176

2176-
fusion-plugin-i18n@^0.1.9:
2177-
version "0.1.9"
2178-
resolved "https://registry.yarnpkg.com/fusion-plugin-i18n/-/fusion-plugin-i18n-0.1.9.tgz#aced058d2e67c5086c3f1835728b2c3b592d68ab"
2177+
fusion-plugin-i18n@^0.2.1:
2178+
version "0.2.1"
2179+
resolved "https://registry.yarnpkg.com/fusion-plugin-i18n/-/fusion-plugin-i18n-0.2.1.tgz#567d92067e655452e30abf8cff76dd3366bbf472"
21792180
dependencies:
2180-
rollup "^0.49.2"
2181+
locale "^0.1.0"
2182+
rollup "^0.52.0"
21812183

21822184
fusion-react-async@0.1.4:
21832185
version "0.1.4"
21842186
resolved "https://registry.yarnpkg.com/fusion-react-async/-/fusion-react-async-0.1.4.tgz#f664a5bbe37aafd73e5b721586606940bda20398"
21852187
dependencies:
21862188
prop-types "^15.5.8"
21872189

2188-
fusion-react@^0.1.9:
2189-
version "0.1.9"
2190-
resolved "https://registry.yarnpkg.com/fusion-react/-/fusion-react-0.1.9.tgz#9313fc3fe221003c3c5b2592cb4512bfcc1e0095"
2190+
fusion-react@^0.2.0:
2191+
version "0.2.0"
2192+
resolved "https://registry.yarnpkg.com/fusion-react/-/fusion-react-0.2.0.tgz#3363df120f145089a06b5965a668e4fb3aa9028b"
2193+
2194+
fusion-tokens@0.0.4:
2195+
version "0.0.4"
2196+
resolved "https://registry.yarnpkg.com/fusion-tokens/-/fusion-tokens-0.0.4.tgz#b84c58e2de8e06d3e63c2c182da7e023ccfb50ec"
21912197

21922198
gauge@~2.7.3:
21932199
version "2.7.4"
@@ -2964,6 +2970,10 @@ loader-utils@^1.1.0:
29642970
emojis-list "^2.0.0"
29652971
json5 "^0.5.0"
29662972

2973+
locale@^0.1.0:
2974+
version "0.1.0"
2975+
resolved "https://registry.yarnpkg.com/locale/-/locale-0.1.0.tgz#3b5bf70614fdab48ac3e3fbc648147cb65443bde"
2976+
29672977
locate-path@^2.0.0:
29682978
version "2.0.0"
29692979
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e"
@@ -3937,14 +3947,14 @@ rollup-pluginutils@^2.0.1:
39373947
estree-walker "^0.3.0"
39383948
micromatch "^2.3.11"
39393949

3940-
rollup@^0.49.2:
3941-
version "0.49.3"
3942-
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.49.3.tgz#4cce32643dd8cf2154c69ff0e43470067db0adbf"
3943-
39443950
rollup@^0.51.1:
39453951
version "0.51.5"
39463952
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.51.5.tgz#5caf9101fcaefe344065701ece7de697631a8035"
39473953

3954+
rollup@^0.52.0:
3955+
version "0.52.3"
3956+
resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.52.3.tgz#020d99fffe9619351e47b3894fd397c26f5e1bf6"
3957+
39483958
run-async@^2.2.0:
39493959
version "2.3.0"
39503960
resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0"
@@ -4344,7 +4354,11 @@ to-object-path@^0.3.0:
43444354
dependencies:
43454355
kind-of "^3.0.2"
43464356

4347-
tough-cookie@~2.3.0:
4357+
toposort@^1.0.6:
4358+
version "1.0.6"
4359+
resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.6.tgz#c31748e55d210effc00fdcdc7d6e68d7d7bb9cec"
4360+
4361+
tough-cookie@~2.3.0, tough-cookie@~2.3.3:
43484362
version "2.3.3"
43494363
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"
43504364
dependencies:

0 commit comments

Comments
 (0)