Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .sync
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24f4cddeae23ccb3d2b111080e64878c1d970c6b
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"packages/*"
],
"scripts": {
"setup": "echo \"Error: no setup specified\" && exit 0",
"bootstrap": "lerna bootstrap",
"test": "lerna run test --stream",
"test": "./scripts/runAllTests.sh",
"start": "lerna run start --scope ringcentral-widgets-demo --stream",
"release": "lerna run release --scope ringcentral-widgets --scope ringcentral-integration",
"commons:test": "lerna run test --scope ringcentral-integration --stream",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"babel-preset-react": "^6.24.1",
"babel-register": "^6.26.0",
"babel-runtime": "^6.26.0",
"fs-extra": "^6.0.0",
"fs-extra": "^7.0.1",
"jsonc-parser": "^2.0.0"
}
}
9 changes: 6 additions & 3 deletions packages/eslint-settings/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const localeSettings = require('@ringcentral-integration/locale-settings');

module.exports = {
extends: "airbnb",
parserOptions: {
Expand All @@ -10,6 +12,9 @@ module.exports = {
// jest: true,
// jasmine: true
},
globals: {
"$": true,
},
rules: {
"max-len": [
2,
Expand Down Expand Up @@ -93,9 +98,7 @@ module.exports = {
}
},
{
// files: ['**/i18n/*.js', '**/phoneSourceNames/*.js','**/phoneTypeNames/*.js'],
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',
'**/ja-JP.js', '**/pt-BR.js', '**/zh-CN.js', '**/zh-TW.js', '**/es-ES.js', '**/en-AU.js', '**/en-CA.js', '**/en-US.js'],
files: localeSettings.supportedLocales.map(locale => `**/${locale}.js`),
rules: {
"quotes": 0,
}
Expand Down
1 change: 1 addition & 0 deletions packages/eslint-settings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"scripts": {},
"dependencies": {
"@ringcentral-integration/locale-settings": "*",
"babel-eslint": "^8.2.3",
"eslint": "^4.12.0",
"eslint-config-airbnb": "^16.1.0",
Expand Down
114 changes: 65 additions & 49 deletions packages/glip-widgets/gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ import fs from 'fs-extra';
import babel from 'gulp-babel';
import sourcemaps from 'gulp-sourcemaps';
import execa from 'execa';
import transformLoader from '@ringcentral-integration/locale-loader/lib/transformLoader';
import exportLocale from '@ringcentral-integration/locale-loader/lib/exportLocale';
import importLocale from '@ringcentral-integration/locale-loader/lib/importLocale';
import consolidateLocale from '@ringcentral-integration/locale-loader/lib/consolidateLocale';
import localeSettings from 'locale-settings';
import * as localeLoader from '@ringcentral-integration/locale-loader';
import localeSettings from '@ringcentral-integration/locale-settings';

async function getVersionFromTag() {
let tag = process.env.TRAVIS_TAG;
Expand All @@ -28,57 +25,60 @@ async function getVersionFromTag() {
}

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

gulp.task('build', ['clean', 'copy'], () => (
gulp.src([
export function clean() {
return fs.remove(BUILD_PATH);
}
export function copy() {
return gulp.src([
'./**',
'!./**/*.js',
'!./test{/**,}',
'!./coverage{/**,}',
'!./node_modules{/**,}',
'!package-lock.json'
]).pipe(gulp.dest(BUILD_PATH))
}
export function compile() {
return gulp.src([
'./**/*.js',
'!./**/*.test.js',
'!./coverage{/**,}',
'!./node_modules{/**,}',
'!gulpfile.babel.js']
).pipe(transformLoader({
).pipe(localeLoader.transformLoader({
...localeSettings,
}))
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(BUILD_PATH))
));
.pipe(gulp.dest(BUILD_PATH));
}

gulp.task('copy', ['clean'], () => (
gulp.src([
'./**',
'!./**/*.js',
'!./test{/**,}',
'!./coverage{/**,}',
'!./node_modules{/**,}',
'!package-lock.json'
]).pipe(gulp.dest(BUILD_PATH))
));

export const build = gulp.series(clean, gulp.parallel(copy, compile));

const RELEASE_PATH = path.resolve(__dirname, '../../release/glip-widgets');
gulp.task('release-clean', async () => {

export async function releaseClean() {
if (!await fs.exists(RELEASE_PATH)) {
await execa.shell(`mkdir -p ${RELEASE_PATH}`);
}
const files = (await fs.readdir(RELEASE_PATH)).filter(file => !/^\./.test(file));
for (const file of files) {
await fs.remove(path.resolve(RELEASE_PATH, file));
}
});
}

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

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

gulp.task('export-locale', () => exportLocale({
...localeSettings,
}));
gulp.task('export-locale-full', () => exportLocale({
...localeSettings,
exportType: 'full'
}));
gulp.task('export-locale-translated', () => exportLocale({
...localeSettings,
exportType: 'translated'
}));
gulp.task('import-locale', () => importLocale({
...localeSettings,
}));
gulp.task('consolidate-locale', () => consolidateLocale({
...localeSettings,
sourceFolder: path.resolve(__dirname, 'lib/countryNames'),
}));
export const release = gulp.series(
gulp.parallel(build, releaseClean),
gulp.parallel(releaseCopy, generatePackage),
);

export function exportLocale() {
return localeLoader.exportLocale({
...localeSettings,
});
}
export function exportFullLocale() {
return localeLoader.exportLocale({
...localeSettings,
exportType: 'full',
});
}

export function exportTranslatedLocale() {
return localeLoader.exportLocale({
...localeSettings,
exportType: 'translated'
});
}
export function importLocale() {
return localeLoader.importLocale({
...localeSettings,
});
}
export function consolidateLocale() {
return localeLoader.consolidateLocale({
...localeSettings,
sourceFolder: path.resolve(__dirname, 'lib/countryNames'),
});
}
23 changes: 11 additions & 12 deletions packages/glip-widgets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"description": "RingCentral Integration Glip Widgets Library",
"main": "index.js",
"scripts": {
"build": "gulp build",
"gulp": "gulp",
"release": "gulp release",
"build": "yarn gulp build",
"release": "yarn gulp release",
"eslint": "eslint --quiet ."
},
"repository": {
Expand All @@ -31,29 +30,29 @@
},
"devDependencies": {
"@ringcentral-integration/locale-loader": "^2.0.0",
"locale-settings": "0.0.1",
"autoprefixer": "^8.4.1",
"execa": "^0.10.0",
"fs-extra": "^6.0.0",
"gulp": "^3.9.1",
"@ringcentral-integration/locale-settings": "*",
"autoprefixer": "^9.3.1",
"execa": "^1.0.0",
"fs-extra": "^7.0.1",
"gulp": "^4.0.0",
"gulp-babel": "^7.0.1",
"gulp-istanbul": "^1.1.1",
"gulp-sourcemaps": "^2.4.0",
"identity-obj-proxy": "^3.0.0",
"react-svg-loader": "^2.1.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0",
"yargs": "^12.0.1"
"yargs": "^12.0.5"
},
"dependencies": {
"classnames": "^2.2.5",
"core-js": "^2.5.6",
"core-js": "^2.5.7",
"immutable": "^3.7.4",
"prop-types": "^15.5.10",
"ramda": "^0.25.0",
"rc-editor-mention": "https://github.com/embbnux/editor-mention#release",
"react-virtualized": "^9.19.1",
"react-emojione": "^5.0.0",
"react-markdown": "^3.1.4"
"react-markdown": "^3.1.4",
"react-virtualized": "^9.19.1"
}
}
21 changes: 21 additions & 0 deletions packages/i18n/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 RingCentral, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions packages/i18n/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# I18n
39 changes: 23 additions & 16 deletions packages/i18n/gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ import sourcemaps from 'gulp-sourcemaps';
import cp from 'child_process';

const BUILD_PATH = path.resolve(__dirname, '../../build/i18n');
gulp.task('clean', async () => (
fs.remove(path.resolve(__dirname, 'build'))
));

gulp.task('build', ['clean'], () => (
gulp.src([
export function clean() {
return fs.remove(BUILD_PATH);
}
export function compile() {
return gulp.src([
'./lib/**/*.js',
'!./lib/**/*.test.js',
'./*.js',
Expand All @@ -22,8 +21,10 @@ gulp.task('build', ['clean'], () => (
.pipe(sourcemaps.init())
.pipe(babel())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(BUILD_PATH))
));
.pipe(gulp.dest(BUILD_PATH));
}

export const build = gulp.series(clean, compile);

async function exec(command) {
return new Promise((resolve, reject) => {
Expand Down Expand Up @@ -51,22 +52,23 @@ async function getVersionFromTag() {
}

const RELEASE_PATH = path.resolve(__dirname, '../../release/i18n');
gulp.task('release-clean', async () => {

export async function releaseClean() {
if (!await fs.exists(RELEASE_PATH)) {
await fs.mkdirp(RELEASE_PATH);
}
const files = (await fs.readdir(RELEASE_PATH)).filter(file => !/^\./.test(file));
for (const file of files) {
await fs.remove(path.resolve(RELEASE_PATH, file));
}
});
}

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

gulp.task('release', ['release-copy'], async () => {
export async function generatePackage() {
const packageInfo = JSON.parse(await fs.readFile(path.resolve(__dirname, 'package.json')));
delete packageInfo.scripts;
delete packageInfo.devDependencies;
Expand All @@ -75,4 +77,9 @@ gulp.task('release', ['release-copy'], async () => {
packageInfo.version = version;
}
await fs.writeFile(path.resolve(RELEASE_PATH, 'package.json'), JSON.stringify(packageInfo, null, 2));
});
}

export const release = gulp.series(
gulp.parallel(build, releaseClean),
gulp.parallel(releaseCopy, generatePackage),
);
4 changes: 2 additions & 2 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"devDependencies": {
"faker": "^4.1.0",
"fs-extra": "^6.0.0",
"gulp": "^3.9.1",
"fs-extra": "^7.0.1",
"gulp": "^4.0.0",
"gulp-babel": "^7.0.1",
"gulp-sourcemaps": "^2.6.4",
"jest": "^22.4.3"
Expand Down
Loading