mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-29 09:02:03 +00:00
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
language: node_js
|
language: node_js
|
||||||
|
|
||||||
node_js:
|
node_js:
|
||||||
- "8"
|
- "10"
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
# Install Yarn
|
# Install Yarn
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = function(api) {
|
||||||
|
api.cache(true);
|
||||||
|
|
||||||
|
return {
|
||||||
|
presets: ['./scripts/babel/preset']
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -109,5 +109,5 @@ If you're using `skpm`, you can rely on an [undocumented
|
|||||||
feature](https://github.com/sketch-pm/skpm/blob/master/lib/utils/webpackConfig.js)
|
feature](https://github.com/sketch-pm/skpm/blob/master/lib/utils/webpackConfig.js)
|
||||||
which will merge your `webpack.config.js`, `.babelrc`, or `package.json` Babel
|
which will merge your `webpack.config.js`, `.babelrc`, or `package.json` Babel
|
||||||
config into its internal webpack config. The simplest option may be to use the
|
config into its internal webpack config. The simplest option may be to use the
|
||||||
[babel-plugin-module-alias](https://www.npmjs.com/package/babel-plugin-module-alias)
|
[babel-plugin-module-resolver](https://www.npmjs.com/package/babel-plugin-module-resolver)
|
||||||
and configure it in your `package.json`.
|
and configure it in your `package.json`.
|
||||||
|
|||||||
+17
-16
@@ -5,8 +5,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "del ./packages/*/dist",
|
"clean": "del ./packages/*/dist",
|
||||||
"compile": "npm-run-all clean -p \"compile:* -- {@}\" --",
|
"compile": "npm-run-all clean -p \"compile:* -- {@}\" --",
|
||||||
"compile:commonjs": "cd packages/react-native-web && BABEL_ENV=commonjs babel src --out-dir dist/cjs --ignore \"**/__tests__\"",
|
"compile:commonjs": "cd packages/react-native-web && BABEL_ENV=commonjs babel --root-mode upward src --out-dir dist/cjs --ignore \"**/__tests__\"",
|
||||||
"compile:es": "cd packages/react-native-web && babel src --out-dir dist --ignore \"**/__tests__\"",
|
"compile:es": "cd packages/react-native-web && babel --root-mode upward src --out-dir dist --ignore \"**/__tests__\"",
|
||||||
"benchmarks": "cd packages/benchmarks && yarn build",
|
"benchmarks": "cd packages/benchmarks && yarn build",
|
||||||
"benchmarks:release": "cd packages/benchmarks && yarn release",
|
"benchmarks:release": "cd packages/benchmarks && yarn release",
|
||||||
"examples": "cd packages/examples && yarn build",
|
"examples": "cd packages/examples && yarn build",
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
"website:release": "cd packages/website && yarn release",
|
"website:release": "cd packages/website && yarn release",
|
||||||
"flow": "flow",
|
"flow": "flow",
|
||||||
"fmt": "prettier --write \"**/*.js\"",
|
"fmt": "prettier --write \"**/*.js\"",
|
||||||
"jest": "BABEL_ENV=commonjs jest --config ./scripts/jest/config.js",
|
"jest": "jest --config ./scripts/jest/config.js",
|
||||||
"lint": "yarn lint:check --fix",
|
"lint": "yarn lint:check --fix",
|
||||||
"lint:check": "eslint packages scripts",
|
"lint:check": "eslint packages scripts",
|
||||||
"precommit": "lint-staged",
|
"precommit": "lint-staged",
|
||||||
@@ -25,18 +25,18 @@
|
|||||||
"test": "yarn flow && yarn lint:check && yarn jest --runInBand"
|
"test": "yarn flow && yarn lint:check && yarn jest --runInBand"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.26.0",
|
"@babel/cli": "^7.2.3",
|
||||||
"babel-core": "^6.26.0",
|
"@babel/core": "^7.2.2",
|
||||||
"babel-eslint": "^8.2.3",
|
"@babel/plugin-proposal-class-properties": "^7.2.3",
|
||||||
"babel-loader": "^7.1.2",
|
"@babel/plugin-proposal-object-rest-spread": "^7.2.0",
|
||||||
"babel-plugin-add-module-exports": "^0.2.1",
|
"@babel/preset-env": "^7.2.3",
|
||||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
"@babel/preset-flow": "^7.0.0",
|
||||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.10",
|
"babel-eslint": "^10.0.0",
|
||||||
"babel-preset-env": "^1.6.1",
|
"babel-jest": "24.0.0-alpha.9",
|
||||||
"babel-preset-flow": "^6.23.0",
|
"babel-loader": "^8.0.0",
|
||||||
"babel-preset-react": "^6.24.1",
|
"babel-plugin-add-module-exports": "^1.0.0",
|
||||||
"babel-preset-react-native": "^4.0.0",
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.21",
|
||||||
"caniuse-api": "^2.0.0",
|
"caniuse-api": "^2.0.0",
|
||||||
"del-cli": "^1.1.0",
|
"del-cli": "^1.1.0",
|
||||||
"enzyme": "^3.6.0",
|
"enzyme": "^3.6.0",
|
||||||
@@ -50,9 +50,10 @@
|
|||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
"husky": "^0.14.3",
|
"husky": "^0.14.3",
|
||||||
"inline-style-prefixer": "^5.0.3",
|
"inline-style-prefixer": "^5.0.3",
|
||||||
"jest": "^22.4.3",
|
"jest": "24.0.0-alpha.9",
|
||||||
"jest-canvas-mock": "^1.0.2",
|
"jest-canvas-mock": "^1.0.2",
|
||||||
"lint-staged": "^7.1.0",
|
"lint-staged": "^7.1.0",
|
||||||
|
"metro-react-native-babel-preset": "^0.51.0",
|
||||||
"npm-run-all": "^4.1.3",
|
"npm-run-all": "^4.1.3",
|
||||||
"prettier": "^1.12.1",
|
"prettier": "^1.12.1",
|
||||||
"react": "^16.7.0",
|
"react": "^16.7.0",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ module.exports = {
|
|||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
cacheDirectory: false,
|
cacheDirectory: false,
|
||||||
presets: babelPreset,
|
presets: [babelPreset],
|
||||||
plugins: ['styled-jsx/babel']
|
plugins: ['styled-jsx/babel']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,12 +7,13 @@
|
|||||||
"release": "yarn build && git checkout gh-pages && rm -rf ../../examples && mv dist ../../examples && git add -A && git commit -m \"Examples deploy\" && git push origin gh-pages && git checkout -"
|
"release": "yarn build && git checkout gh-pages && rm -rf ../../examples && mv dist ../../examples && git add -A && git commit -m \"Examples deploy\" && git push origin gh-pages && git checkout -"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"babel-runtime": "^6.26.0",
|
"@babel/runtime": "^7.2.0",
|
||||||
"react": "^16.5.1",
|
"react": "^16.5.1",
|
||||||
"react-dom": "^16.5.1",
|
"react-dom": "^16.5.1",
|
||||||
"react-native-web": "0.9.13"
|
"react-native-web": "0.9.13"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/plugin-transform-runtime": "^7.2.0",
|
||||||
"babel-plugin-react-native-web": "0.9.13",
|
"babel-plugin-react-native-web": "0.9.13",
|
||||||
"babel-plugin-transform-runtime": "^6.23.0",
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
"file-loader": "^1.1.11",
|
"file-loader": "^1.1.11",
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ module.exports = {
|
|||||||
loader: 'babel-loader',
|
loader: 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
cacheDirectory: false,
|
cacheDirectory: false,
|
||||||
presets: ['react-native'],
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
plugins: [
|
plugins: [
|
||||||
// needed to support async/await
|
// needed to support async/await
|
||||||
'transform-runtime'
|
'@babel/plugin-transform-runtime'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -51,7 +51,6 @@ input::-webkit-inner-spin-button,input::-webkit-outer-spin-button,input::-webkit
|
|||||||
|
|
||||||
exports[`AppRegistry getApplication returns "element" and "getStyleElement" 1`] = `
|
exports[`AppRegistry getApplication returns "element" and "getStyleElement" 1`] = `
|
||||||
<AppContainer
|
<AppContainer
|
||||||
WrapperComponent={undefined}
|
|
||||||
rootTag={Object {}}
|
rootTag={Object {}}
|
||||||
>
|
>
|
||||||
<RootComponent />
|
<RootComponent />
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ describe('components/Text', () => {
|
|||||||
expect(component.contains(children)).toEqual(true);
|
expect(component.contains(children)).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('prop "numberOfLines"');
|
test('prop "numberOfLines"', () => {});
|
||||||
|
|
||||||
test('prop "onPress"', () => {
|
test('prop "onPress"', () => {
|
||||||
const onPress = e => {};
|
const onPress = e => {};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const testIfDocumentIsFocused = (message, fn) => {
|
|||||||
if (document.hasFocus && document.hasFocus()) {
|
if (document.hasFocus && document.hasFocus()) {
|
||||||
test(message, fn);
|
test(message, fn);
|
||||||
} else {
|
} else {
|
||||||
test.skip(`${message} – document is not focused`);
|
test.skip(`${message} – document is not focused`, () => {});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -150,8 +150,6 @@ class TextInput extends Component<*> {
|
|||||||
|
|
||||||
static State = TextInputState;
|
static State = TextInputState;
|
||||||
|
|
||||||
blur: Function;
|
|
||||||
|
|
||||||
clear() {
|
clear() {
|
||||||
this._node.value = '';
|
this._node.value = '';
|
||||||
}
|
}
|
||||||
@@ -401,6 +399,7 @@ class TextInput extends Component<*> {
|
|||||||
onSubmitEditing(e);
|
onSubmitEditing(e);
|
||||||
}
|
}
|
||||||
if (shouldBlurOnSubmit) {
|
if (shouldBlurOnSubmit) {
|
||||||
|
// $FlowFixMe
|
||||||
this.blur();
|
this.blur();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
"react-native"
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"react-native-web"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
module.exports = function(api) {
|
||||||
|
api.cache(true);
|
||||||
|
return {
|
||||||
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
|
plugins: ['react-native-web']
|
||||||
|
};
|
||||||
|
};
|
||||||
+11
-9
@@ -1,11 +1,11 @@
|
|||||||
const createConfig = ({ modules }) => ({
|
const createConfig = ({ modules }) => ({
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
'babel-preset-env',
|
'@babel/preset-env',
|
||||||
{
|
{
|
||||||
loose: true,
|
loose: true,
|
||||||
modules,
|
modules,
|
||||||
exclude: ['transform-es2015-typeof-symbol'],
|
exclude: ['transform-typeof-symbol'],
|
||||||
targets: {
|
targets: {
|
||||||
browsers: [
|
browsers: [
|
||||||
'chrome 38',
|
'chrome 38',
|
||||||
@@ -24,17 +24,19 @@ const createConfig = ({ modules }) => ({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
'babel-preset-react',
|
'@babel/preset-react',
|
||||||
'babel-preset-flow'
|
'@babel/preset-flow'
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
['babel-plugin-transform-class-properties', { loose: true }],
|
'@babel/plugin-transform-flow-strip-types',
|
||||||
['babel-plugin-transform-object-rest-spread', { useBuiltIns: true }],
|
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }],
|
||||||
['babel-plugin-transform-react-remove-prop-types', { mode: 'wrap' }]
|
['@babel/plugin-proposal-class-properties', { loose: true }],
|
||||||
|
['@babel/plugin-proposal-object-rest-spread', { useBuiltIns: true }],
|
||||||
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
|
].concat(modules ? ['babel-plugin-add-module-exports'] : [])
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports =
|
module.exports = function() {
|
||||||
process.env.BABEL_ENV === 'commonjs'
|
return process.env.BABEL_ENV === 'commonjs' || process.env.NODE_ENV === 'test'
|
||||||
? createConfig({ modules: 'commonjs' })
|
? createConfig({ modules: 'commonjs' })
|
||||||
: createConfig({ modules: false });
|
: createConfig({ modules: false });
|
||||||
|
};
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ module.exports = {
|
|||||||
rootDir: process.cwd(),
|
rootDir: process.cwd(),
|
||||||
roots: ['<rootDir>/packages'],
|
roots: ['<rootDir>/packages'],
|
||||||
setupFiles: ['jest-canvas-mock'],
|
setupFiles: ['jest-canvas-mock'],
|
||||||
setupTestFrameworkScriptFile: require.resolve('./setupFramework.js'),
|
setupFilesAfterEnv: [require.resolve('./setupFramework.js')],
|
||||||
snapshotSerializers: ['enzyme-to-json/serializer'],
|
snapshotSerializers: ['enzyme-to-json/serializer'],
|
||||||
testEnvironment: 'jsdom',
|
testEnvironment: 'jsdom',
|
||||||
timers: 'fake'
|
timers: 'fake'
|
||||||
|
|||||||
Reference in New Issue
Block a user