Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nabil Koroghli
committed
Oct 26, 2017
0 parents
commit bcce347
Showing
10 changed files
with
4,564 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
if (typeof Promise === 'undefined') { | ||
// Rejection tracking prevents a common issue where React gets into an | ||
// inconsistent state due to an error, but it gets swallowed by a Promise, | ||
// and the user has no idea what causes React's erratic future behavior. | ||
require('promise/lib/rejection-tracking').enable(); | ||
window.Promise = require('promise/lib/es6-extensions.js'); | ||
} | ||
|
||
// fetch() polyfill for making API calls. | ||
require('whatwg-fetch'); | ||
|
||
// Object.assign() is commonly used with React. | ||
// It will use the native implementation if it's present and isn't buggy. | ||
Object.assign = require('object-assign'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Copyright 2004-present Facebook. All Rights Reserved. | ||
|
||
'use strict'; | ||
|
||
const tsJestPreprocessor = require('ts-jest/preprocessor'); | ||
|
||
module.exports = tsJestPreprocessor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const gulp = require("gulp"); | ||
const ts = require("gulp-typescript"); | ||
const tslint = require("gulp-tslint"); | ||
var clean = require('gulp-clean'); | ||
const merge = require('merge2'); | ||
const tsProject = ts.createProject("tsconfig.json"); | ||
|
||
gulp.task("tslint", function() { | ||
gulp.src('src/**/*.ts') | ||
.pipe(tslint({ | ||
formatter: "verbose" | ||
})) | ||
.pipe(tslint.report()); | ||
}); | ||
|
||
gulp.task("dts", ["clean"], function() { | ||
gulp.src('src/**/*.d.ts').pipe(gulp.dest('dist')); | ||
|
||
}); | ||
|
||
gulp.task("clean", function() { | ||
return gulp.src('dist') | ||
.pipe(clean()); | ||
}) | ||
|
||
|
||
gulp.task("default", ["tslint", "dts", "clean"], function () { | ||
const tsResult = tsProject.src() | ||
.pipe(tsProject()); | ||
|
||
return merge([ | ||
tsResult.dts.pipe(gulp.dest('dist')), | ||
tsResult.js.pipe(gulp.dest('dist')) | ||
]); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"name": "i18next-keys-ondemand", | ||
"version": "0.1.0", | ||
"description": "i18next plugin to request the non-translated keys when used", | ||
"main": "dist/index.js", | ||
"repository": "https://github.com/kingatlas/i18next-keys-ondemand.git", | ||
"author": "Nabil Koroghli", | ||
"license": "MIT", | ||
"scripts": { | ||
"prepublish": "yarn build", | ||
"test": "jest --watch", | ||
"build": "gulp" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"devDependencies": { | ||
"@types/jest": "^21.1.4", | ||
"gulp": "^3.9.1", | ||
"gulp-clean": "^0.3.2", | ||
"gulp-tslint": "^8.1.2", | ||
"gulp-typescript": "^3.2.2", | ||
"i18next": "^10.0.3", | ||
"jest": "^21.2.1", | ||
"merge2": "^1.2.0", | ||
"ts-jest": "^21.1.3", | ||
"tslint": "^5.8.0", | ||
"typescript": "^2.5.3" | ||
}, | ||
"dependencies": { | ||
"debounce": "^1.0.2" | ||
}, | ||
"peerDependencies": { | ||
"i18next": "10.x.x" | ||
}, | ||
"jest": { | ||
"setupTestFrameworkScriptFile": "./tests/setup.ts", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js" | ||
], | ||
"setupFiles": [ | ||
"<rootDir>/config/polyfills.js" | ||
], | ||
"transform": { | ||
"^.+\\.tsx?$": "<rootDir>/config/typescriptTransform.js" | ||
}, | ||
"testMatch": [ | ||
"**/?(*.)(spec|test).ts?(x)" | ||
], | ||
"globals": { | ||
"ts-jest": { | ||
"tsConfigFile": "tsconfig.test.json" | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.