-
Notifications
You must be signed in to change notification settings - Fork 111
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
1 parent
b0e9e4a
commit d803c3e
Showing
29 changed files
with
460 additions
and
232 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
language: node_js | ||
node_js: | ||
- 6.0 | ||
script: cd packages/kyt-core && npm install && cd ../kyt-cli && npm install && cd ../kyt-utils && npm install && cd ../.. && npm run lint && npm install && npm test && npm run e2e | ||
script: npm install && cd packages/kyt-core && npm install && cd ../kyt-cli && npm install && cd ../kyt-utils && npm install && cd ../.. && npm run lint && npm test && npm run e2e |
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
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
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,5 @@ | ||
{ | ||
"rules": { | ||
"no-var": 0 | ||
} | ||
} |
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,22 @@ | ||
var babelPresetLatest = require('babel-preset-latest'); | ||
var babelTransformRuntime = require('babel-plugin-transform-runtime'); | ||
var babelTransformModules = require('babel-plugin-transform-es2015-modules-commonjs'); | ||
|
||
module.exports = function(context, opts) { | ||
opts = opts || {}; | ||
return { | ||
// modules are handled by webpack, don't transform them | ||
presets: [[babelPresetLatest, { modules: false }]], | ||
|
||
// provide the ability to opt into babel-plugin-transform-runtime inclusion | ||
plugins: [opts.includeRuntime === true && babelTransformRuntime].filter(Boolean), | ||
|
||
env: { | ||
test: { | ||
plugins: [ | ||
[babelTransformModules, { loose: true }], | ||
], | ||
}, | ||
}, | ||
}; | ||
}; |
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,15 @@ | ||
{ | ||
"name": "babel-preset-kyt-core", | ||
"version": "0.1.0-alpha.1", | ||
"description": "an opinionated babel preset, best used with kyt", | ||
"main": "lib/index.js", | ||
"author": "NYTimes", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"babel-plugin-transform-es2015-modules-commonjs": "6.16.0", | ||
"babel-plugin-transform-runtime": "6.15.0", | ||
"babel-preset-latest": "6.16.0" | ||
}, | ||
"keywords": ["babel", "babel-preset", "kyt"], | ||
"files": ["lib"] | ||
} |
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,5 @@ | ||
{ | ||
"rules": { | ||
"no-var": 0 | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
packages/babel-presets/babel-preset-kyt-react/lib/index.js
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,31 @@ | ||
var babelPresetReact = require('babel-preset-react'); | ||
var reactRemovePropTypes = require('babel-plugin-transform-react-remove-prop-types'); | ||
var reactTransformConstant = require('babel-plugin-transform-react-constant-elements'); | ||
var reactTransformInline = require('babel-plugin-transform-react-inline-elements'); | ||
var reactTransformJsxSource = require('babel-plugin-transform-react-jsx-source'); | ||
var babelPresetKytCore = require('babel-preset-kyt-core'); | ||
|
||
module.exports = function(context, opts) { | ||
opts = opts || {}; | ||
return { | ||
presets: [ | ||
babelPresetReact, | ||
// pass options through to core preset | ||
[babelPresetKytCore, opts.coreOptions || {}], | ||
], | ||
env: { | ||
development: { | ||
plugins: [ | ||
reactTransformJsxSource, | ||
], | ||
}, | ||
production: { | ||
plugins: [ | ||
reactRemovePropTypes, | ||
reactTransformConstant, | ||
reactTransformInline, | ||
], | ||
}, | ||
}, | ||
}; | ||
}; |
25 changes: 25 additions & 0 deletions
25
packages/babel-presets/babel-preset-kyt-react/package.json
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,25 @@ | ||
{ | ||
"name": "babel-preset-kyt-react", | ||
"version": "0.1.0-alpha.1", | ||
"description": "an opinionated babel preset for react apps, best used with kyt", | ||
"main": "lib/index.js", | ||
"author": "NYTimes", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"babel-plugin-transform-react-constant-elements": "6.9.1", | ||
"babel-plugin-transform-react-inline-elements": "^6.8.0", | ||
"babel-plugin-transform-react-jsx-source": "6.9.0", | ||
"babel-plugin-transform-react-remove-prop-types": "0.2.10", | ||
"babel-preset-kyt-core": "0.1.0-alpha.1", | ||
"babel-preset-react": "6.16.0" | ||
}, | ||
"keywords": [ | ||
"babel", | ||
"babel-preset", | ||
"kyt", | ||
"react" | ||
], | ||
"files": [ | ||
"lib" | ||
] | ||
} |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
coverage | ||
**/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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
const jest = require('../jest'); | ||
// can't call this `jest` because that's a global in tests | ||
const jestConfig = require('../jest'); | ||
|
||
it('jest() returns a jest config', () => { | ||
it('jestConfig() returns a jest config', () => { | ||
const rootDir = 'rootDir'; | ||
const jestConfig = jest(rootDir); | ||
const config = jestConfig(rootDir); | ||
|
||
expect(typeof jestConfig).toBe('object'); | ||
expect(jestConfig.moduleNameMapper).toBeDefined(); | ||
expect(jestConfig.scriptPreprocessor).toBeDefined(); | ||
expect(jestConfig.testPathIgnorePatterns).toBeDefined(); | ||
expect(jestConfig.testEnvironment).toBeDefined(); | ||
expect(jestConfig.testRegex).toBeDefined(); | ||
expect(jestConfig.collectCoverageFrom).toBeDefined(); | ||
expect(jestConfig.rootDir).toBe(rootDir); | ||
expect(typeof config).toBe('object'); | ||
expect(config.moduleNameMapper).toBeDefined(); | ||
expect(config.scriptPreprocessor).toBeDefined(); | ||
expect(config.testPathIgnorePatterns).toBeDefined(); | ||
expect(config.testEnvironment).toBeDefined(); | ||
expect(config.testRegex).toBeDefined(); | ||
expect(config.collectCoverageFrom).toBeDefined(); | ||
expect(config.rootDir).toBe(rootDir); | ||
}); |
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
Oops, something went wrong.