Skip to content

Commit 68c6432

Browse files
authored
Sync new features and bugfixs from 24f4cdd (#1577)
* update to sync 4b1e758 * update to sync 24f4cdd * update yarn.lock * fix gulp issue
1 parent 8e0c1dc commit 68c6432

File tree

420 files changed

+5215
-3030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

420 files changed

+5215
-3030
lines changed

.sync

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24f4cddeae23ccb3d2b111080e64878c1d970c6b

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@
88
"packages/*"
99
],
1010
"scripts": {
11+
"setup": "echo \"Error: no setup specified\" && exit 0",
1112
"bootstrap": "lerna bootstrap",
12-
"test": "lerna run test --stream",
13+
"test": "./scripts/runAllTests.sh",
1314
"start": "lerna run start --scope ringcentral-widgets-demo --stream",
1415
"release": "lerna run release --scope ringcentral-widgets --scope ringcentral-integration",
1516
"commons:test": "lerna run test --scope ringcentral-integration --stream",

packages/babel-settings/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"babel-preset-react": "^6.24.1",
2626
"babel-register": "^6.26.0",
2727
"babel-runtime": "^6.26.0",
28-
"fs-extra": "^6.0.0",
28+
"fs-extra": "^7.0.1",
2929
"jsonc-parser": "^2.0.0"
3030
}
3131
}

packages/eslint-settings/.eslintrc.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const localeSettings = require('@ringcentral-integration/locale-settings');
2+
13
module.exports = {
24
extends: "airbnb",
35
parserOptions: {
@@ -10,6 +12,9 @@ module.exports = {
1012
// jest: true,
1113
// jasmine: true
1214
},
15+
globals: {
16+
"$": true,
17+
},
1318
rules: {
1419
"max-len": [
1520
2,
@@ -93,9 +98,7 @@ module.exports = {
9398
}
9499
},
95100
{
96-
// files: ['**/i18n/*.js', '**/phoneSourceNames/*.js','**/phoneTypeNames/*.js'],
97-
files: ['**/de-DE.js', '**/de-AU.js', '**/de-CA.js', '**/en-GB.js', '**/de-US.js', '**/es-419.js', '**/de-ES.js', '**/fr-CA.js', '**/fr-FR.js', '**/it-IT.js',
98-
'**/ja-JP.js', '**/pt-BR.js', '**/zh-CN.js', '**/zh-TW.js', '**/es-ES.js', '**/en-AU.js', '**/en-CA.js', '**/en-US.js'],
101+
files: localeSettings.supportedLocales.map(locale => `**/${locale}.js`),
99102
rules: {
100103
"quotes": 0,
101104
}

packages/eslint-settings/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"scripts": {},
1414
"dependencies": {
15+
"@ringcentral-integration/locale-settings": "*",
1516
"babel-eslint": "^8.2.3",
1617
"eslint": "^4.12.0",
1718
"eslint-config-airbnb": "^16.1.0",

packages/glip-widgets/gulpfile.babel.js

Lines changed: 65 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,8 @@ import fs from 'fs-extra';
44
import babel from 'gulp-babel';
55
import sourcemaps from 'gulp-sourcemaps';
66
import execa from 'execa';
7-
import transformLoader from '@ringcentral-integration/locale-loader/lib/transformLoader';
8-
import exportLocale from '@ringcentral-integration/locale-loader/lib/exportLocale';
9-
import importLocale from '@ringcentral-integration/locale-loader/lib/importLocale';
10-
import consolidateLocale from '@ringcentral-integration/locale-loader/lib/consolidateLocale';
11-
import localeSettings from 'locale-settings';
7+
import * as localeLoader from '@ringcentral-integration/locale-loader';
8+
import localeSettings from '@ringcentral-integration/locale-settings';
129

1310
async function getVersionFromTag() {
1411
let tag = process.env.TRAVIS_TAG;
@@ -28,57 +25,60 @@ async function getVersionFromTag() {
2825
}
2926

3027
const BUILD_PATH = path.resolve(__dirname, '../../build/glip-widgets');
31-
gulp.task('clean', async () => (
32-
fs.remove(BUILD_PATH)
33-
));
3428

35-
gulp.task('build', ['clean', 'copy'], () => (
36-
gulp.src([
29+
export function clean() {
30+
return fs.remove(BUILD_PATH);
31+
}
32+
export function copy() {
33+
return gulp.src([
34+
'./**',
35+
'!./**/*.js',
36+
'!./test{/**,}',
37+
'!./coverage{/**,}',
38+
'!./node_modules{/**,}',
39+
'!package-lock.json'
40+
]).pipe(gulp.dest(BUILD_PATH))
41+
}
42+
export function compile() {
43+
return gulp.src([
3744
'./**/*.js',
3845
'!./**/*.test.js',
3946
'!./coverage{/**,}',
4047
'!./node_modules{/**,}',
4148
'!gulpfile.babel.js']
42-
).pipe(transformLoader({
49+
).pipe(localeLoader.transformLoader({
4350
...localeSettings,
4451
}))
4552
.pipe(sourcemaps.init())
4653
.pipe(babel())
4754
.pipe(sourcemaps.write('.'))
48-
.pipe(gulp.dest(BUILD_PATH))
49-
));
55+
.pipe(gulp.dest(BUILD_PATH));
56+
}
5057

51-
gulp.task('copy', ['clean'], () => (
52-
gulp.src([
53-
'./**',
54-
'!./**/*.js',
55-
'!./test{/**,}',
56-
'!./coverage{/**,}',
57-
'!./node_modules{/**,}',
58-
'!package-lock.json'
59-
]).pipe(gulp.dest(BUILD_PATH))
60-
));
58+
59+
export const build = gulp.series(clean, gulp.parallel(copy, compile));
6160

6261
const RELEASE_PATH = path.resolve(__dirname, '../../release/glip-widgets');
63-
gulp.task('release-clean', async () => {
62+
63+
export async function releaseClean() {
6464
if (!await fs.exists(RELEASE_PATH)) {
6565
await execa.shell(`mkdir -p ${RELEASE_PATH}`);
6666
}
6767
const files = (await fs.readdir(RELEASE_PATH)).filter(file => !/^\./.test(file));
6868
for (const file of files) {
6969
await fs.remove(path.resolve(RELEASE_PATH, file));
7070
}
71-
});
71+
}
7272

73-
gulp.task('release-copy', ['build', 'release-clean'], () => (
74-
gulp.src([
73+
export function releaseCopy() {
74+
return gulp.src([
7575
`${BUILD_PATH}/**`,
7676
`${__dirname}/README.md`,
7777
`${__dirname}/LICENSE`
78-
]).pipe(gulp.dest(RELEASE_PATH))
79-
));
78+
]).pipe(gulp.dest(RELEASE_PATH));
79+
}
8080

81-
gulp.task('release', ['release-copy'], async () => {
81+
export async function generatePackage() {
8282
const packageInfo = JSON.parse(await fs.readFile(path.resolve(BUILD_PATH, 'package.json')));
8383
delete packageInfo.scripts;
8484
delete packageInfo.jest;
@@ -89,23 +89,39 @@ gulp.task('release', ['release-copy'], async () => {
8989
packageInfo.name = 'ringcentral-widgets';
9090
}
9191
await fs.writeFile(path.resolve(RELEASE_PATH, 'package.json'), JSON.stringify(packageInfo, null, 2));
92-
});
92+
}
9393

94-
gulp.task('export-locale', () => exportLocale({
95-
...localeSettings,
96-
}));
97-
gulp.task('export-locale-full', () => exportLocale({
98-
...localeSettings,
99-
exportType: 'full'
100-
}));
101-
gulp.task('export-locale-translated', () => exportLocale({
102-
...localeSettings,
103-
exportType: 'translated'
104-
}));
105-
gulp.task('import-locale', () => importLocale({
106-
...localeSettings,
107-
}));
108-
gulp.task('consolidate-locale', () => consolidateLocale({
109-
...localeSettings,
110-
sourceFolder: path.resolve(__dirname, 'lib/countryNames'),
111-
}));
94+
export const release = gulp.series(
95+
gulp.parallel(build, releaseClean),
96+
gulp.parallel(releaseCopy, generatePackage),
97+
);
98+
99+
export function exportLocale() {
100+
return localeLoader.exportLocale({
101+
...localeSettings,
102+
});
103+
}
104+
export function exportFullLocale() {
105+
return localeLoader.exportLocale({
106+
...localeSettings,
107+
exportType: 'full',
108+
});
109+
}
110+
111+
export function exportTranslatedLocale() {
112+
return localeLoader.exportLocale({
113+
...localeSettings,
114+
exportType: 'translated'
115+
});
116+
}
117+
export function importLocale() {
118+
return localeLoader.importLocale({
119+
...localeSettings,
120+
});
121+
}
122+
export function consolidateLocale() {
123+
return localeLoader.consolidateLocale({
124+
...localeSettings,
125+
sourceFolder: path.resolve(__dirname, 'lib/countryNames'),
126+
});
127+
}

packages/glip-widgets/package.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
"description": "RingCentral Integration Glip Widgets Library",
55
"main": "index.js",
66
"scripts": {
7-
"build": "gulp build",
8-
"gulp": "gulp",
9-
"release": "gulp release",
7+
"build": "yarn gulp build",
8+
"release": "yarn gulp release",
109
"eslint": "eslint --quiet ."
1110
},
1211
"repository": {
@@ -31,29 +30,29 @@
3130
},
3231
"devDependencies": {
3332
"@ringcentral-integration/locale-loader": "^2.0.0",
34-
"locale-settings": "0.0.1",
35-
"autoprefixer": "^8.4.1",
36-
"execa": "^0.10.0",
37-
"fs-extra": "^6.0.0",
38-
"gulp": "^3.9.1",
33+
"@ringcentral-integration/locale-settings": "*",
34+
"autoprefixer": "^9.3.1",
35+
"execa": "^1.0.0",
36+
"fs-extra": "^7.0.1",
37+
"gulp": "^4.0.0",
3938
"gulp-babel": "^7.0.1",
4039
"gulp-istanbul": "^1.1.1",
4140
"gulp-sourcemaps": "^2.4.0",
4241
"identity-obj-proxy": "^3.0.0",
4342
"react-svg-loader": "^2.1.0",
4443
"redux-logger": "^3.0.6",
4544
"redux-thunk": "^2.2.0",
46-
"yargs": "^12.0.1"
45+
"yargs": "^12.0.5"
4746
},
4847
"dependencies": {
4948
"classnames": "^2.2.5",
50-
"core-js": "^2.5.6",
49+
"core-js": "^2.5.7",
5150
"immutable": "^3.7.4",
5251
"prop-types": "^15.5.10",
5352
"ramda": "^0.25.0",
5453
"rc-editor-mention": "https://github.com/embbnux/editor-mention#release",
55-
"react-virtualized": "^9.19.1",
5654
"react-emojione": "^5.0.0",
57-
"react-markdown": "^3.1.4"
55+
"react-markdown": "^3.1.4",
56+
"react-virtualized": "^9.19.1"
5857
}
5958
}

packages/i18n/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 RingCentral, Inc.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

packages/i18n/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# I18n

packages/i18n/gulpfile.babel.js

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ import sourcemaps from 'gulp-sourcemaps';
66
import cp from 'child_process';
77

88
const BUILD_PATH = path.resolve(__dirname, '../../build/i18n');
9-
gulp.task('clean', async () => (
10-
fs.remove(path.resolve(__dirname, 'build'))
11-
));
12-
13-
gulp.task('build', ['clean'], () => (
14-
gulp.src([
9+
export function clean() {
10+
return fs.remove(BUILD_PATH);
11+
}
12+
export function compile() {
13+
return gulp.src([
1514
'./lib/**/*.js',
1615
'!./lib/**/*.test.js',
1716
'./*.js',
@@ -22,8 +21,10 @@ gulp.task('build', ['clean'], () => (
2221
.pipe(sourcemaps.init())
2322
.pipe(babel())
2423
.pipe(sourcemaps.write('.'))
25-
.pipe(gulp.dest(BUILD_PATH))
26-
));
24+
.pipe(gulp.dest(BUILD_PATH));
25+
}
26+
27+
export const build = gulp.series(clean, compile);
2728

2829
async function exec(command) {
2930
return new Promise((resolve, reject) => {
@@ -51,22 +52,23 @@ async function getVersionFromTag() {
5152
}
5253

5354
const RELEASE_PATH = path.resolve(__dirname, '../../release/i18n');
54-
gulp.task('release-clean', async () => {
55+
56+
export async function releaseClean() {
5557
if (!await fs.exists(RELEASE_PATH)) {
5658
await fs.mkdirp(RELEASE_PATH);
5759
}
5860
const files = (await fs.readdir(RELEASE_PATH)).filter(file => !/^\./.test(file));
5961
for (const file of files) {
6062
await fs.remove(path.resolve(RELEASE_PATH, file));
6163
}
62-
});
64+
}
6365

64-
gulp.task('release-copy', ['build', 'release-clean'], () => (
65-
gulp.src([`${BUILD_PATH}/**`, `${__dirname}/README.md`, `${__dirname}/LICENSE`])
66-
.pipe(gulp.dest(RELEASE_PATH))
67-
));
66+
export function releaseCopy() {
67+
return gulp.src([`${BUILD_PATH}/**`, `${__dirname}/README.md`, `${__dirname}/LICENSE`])
68+
.pipe(gulp.dest(RELEASE_PATH));
69+
}
6870

69-
gulp.task('release', ['release-copy'], async () => {
71+
export async function generatePackage() {
7072
const packageInfo = JSON.parse(await fs.readFile(path.resolve(__dirname, 'package.json')));
7173
delete packageInfo.scripts;
7274
delete packageInfo.devDependencies;
@@ -75,4 +77,9 @@ gulp.task('release', ['release-copy'], async () => {
7577
packageInfo.version = version;
7678
}
7779
await fs.writeFile(path.resolve(RELEASE_PATH, 'package.json'), JSON.stringify(packageInfo, null, 2));
78-
});
80+
}
81+
82+
export const release = gulp.series(
83+
gulp.parallel(build, releaseClean),
84+
gulp.parallel(releaseCopy, generatePackage),
85+
);

0 commit comments

Comments
 (0)