Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil Koroghli committed Oct 26, 2017
0 parents commit bcce347
Show file tree
Hide file tree
Showing 10 changed files with 4,564 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
dist
node_modules
16 changes: 16 additions & 0 deletions config/polyfills.js
@@ -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');
7 changes: 7 additions & 0 deletions config/typescriptTransform.js
@@ -0,0 +1,7 @@
// Copyright 2004-present Facebook. All Rights Reserved.

'use strict';

const tsJestPreprocessor = require('ts-jest/preprocessor');

module.exports = tsJestPreprocessor;
35 changes: 35 additions & 0 deletions gulpfile.js
@@ -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'))
]);
});
58 changes: 58 additions & 0 deletions package.json
@@ -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"
}
}
}
}

0 comments on commit bcce347

Please sign in to comment.