Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into danger-edit-pr
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed May 26, 2017
2 parents b245f87 + 94e1fb6 commit eadef31
Show file tree
Hide file tree
Showing 61 changed files with 5,359 additions and 806 deletions.
23 changes: 18 additions & 5 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
const path = require("path");
const webpack = require("webpack");

const {
OccurenceOrderPlugin,
includePaths,
excludePaths
} = require("@storybook/react-native/dist/server/config/utils");

module.exports = {
devtool: "#inline-source-map", // Otherwise getting errors about e.g. `Relay` not being defined.
resolve: {
extensions: ["", ".js", ".jsx", ".ts", ".tsx"],
extensions: [".js", ".jsx", ".ts", ".tsx"]
},
module: {
loaders: [
{
test: /\.tsx?$/,
exclude: /node_modules/,
loaders: ["awesome-typescript-loader?configFileName=./tsconfig.json&silent=true&transpileOnly=true&target=es6&useBabel=true&useCache=true"],
},
],
loaders: [
"awesome-typescript-loader?configFileName=./tsconfig.json&silent=true&transpileOnly=true&target=es6&useBabel=true&useCache=true"
]
}
]
},
}
plugins: [
new OccurenceOrderPlugin(),
new webpack.HotModuleReplacementPlugin()
]
};
25 changes: 23 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"*.js": "javascriptreact",
"*.snap": "javascriptreact"
},
"eslint.enable": false,
"flow.enabled": false,
"files.trimTrailingWhitespace": true,
"editor.renderWhitespace": "boundary",
"editor.rulers": [120],
Expand All @@ -30,5 +32,24 @@
".vscode/.react/*": true
},
"clang.compilationDatabase": "${workspaceRoot}/Example/compile_commands.json",
"typescript.tsdk": "./node_modules/typescript/lib"
}
"typescript.tsdk": "./node_modules/typescript/lib",
"spellchecker.ignoreWordsList": [
"orta",
"sarah",
"luc",
"mzikherman",
"CHANGELOG",
"Eigen",
"scrollview",
"blankspace",
"ESLint",
"GeneVC",
"keychain",
"linting",
"inline",
"iPad",
"iPhone",
"ListView",
"ARTemporaryAPIModule"
]
}
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
### Master

#### Consignments

- [dev] Adds component for consignments todo - orta
- [dev] Adds a root component for the Consignments flow - orta
- [dev] Adds storybooks for consignments - orta
- Added the Welcome/Overview screen for consignments - orta

### Emission

- [dev] Allows toggling the back button by pressing space - orta

### 1.3.6

- Fixes missing compiled bundle - alloy
Expand Down Expand Up @@ -103,7 +114,7 @@
### 1.1.0-beta.4

- GeneVC scrolls as expected, and can request data from Eigen - orta
- Fix crash that would occur when tapping the failed to load view retry button a second time - alloy
- Fix crash that would occur when tapping the "failed to load" view retry button a second time - alloy
- Make tapping the search bar open the search VC - sarah

### 1.1.0-beta.3
Expand All @@ -119,7 +130,7 @@
- [dev] Turns on "keychain sharing" to fix a keychain bug in sim - orta
- GeneVC now shows about information, and trending artists - orta
- GeneVC now shows artworks for the gene - orta
- Show bid now call to action on artworks that are in an auction - alloy
- Show "bid now" call to action on artworks that are in an auction - alloy

### 1.1.0-beta.2

Expand Down
12 changes: 12 additions & 0 deletions Example/Emission/ARRootViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#import <Emission/ARHomeComponentViewController.h>
#import <Emission/ARGeneComponentViewController.h>
#import <Emission/ARWorksForYouComponentViewController.h>
#import <Emission/ARComponentViewController.h>
#import "ARStorybookComponentViewController.h"

@implementation ARRootViewController
Expand Down Expand Up @@ -57,6 +58,7 @@ - (ARSectionData *)jumpToViewControllersSection
[sectionData addCellData:self.jumpToGene];
[sectionData addCellData:self.jumpToRefinedGene];
[sectionData addCellData:self.jumpToWorksForYou];
[sectionData addCellData:self.jumpToConsignments];

return sectionData;
}
Expand Down Expand Up @@ -147,6 +149,16 @@ - (ARCellData *)jumpToWorksForYou
}];
}


- (ARCellData *)jumpToConsignments
{
return [self tappableCellDataWithTitle:@"Start Consignment Flow" selection:^{
id viewController = [[ARComponentViewController alloc] initWithEmission: nil moduleName:@"Consignments" initialProperties: @{}];
[self.navigationController pushViewController:viewController animated:YES];
}];
}


- (ARCellData *)generateStagingSwitch
{
BOOL useStaging = [[NSUserDefaults standardUserDefaults] boolForKey:ARUseStagingDefault];
Expand Down
11 changes: 11 additions & 0 deletions Example/Emission/EigenLikeNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ - (void)viewDidLoad
[backButton alignLeadingEdgeWithView:self.view predicate:@"12"];
[backButton constrainWidth:@"40" height:@"40"];
_backButton = backButton;

UIKeyCommand *command = [UIKeyCommand keyCommandWithInput:@" " modifierFlags:0 action:@selector(toggleNav)];
[self addKeyCommand: command];
}

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
Expand Down Expand Up @@ -60,4 +63,12 @@ - (UIInterfaceOrientationMask)supportedInterfaceOrientations;
return self.topViewController.supportedInterfaceOrientations;
}

- (void)toggleNav
{
[UIView animateWithDuration:0.1 animations:^{
CGFloat alpha = [self.backButton alpha];
[self.backButton setAlpha:!alpha];
}];
}

@end
10 changes: 5 additions & 5 deletions Example/Emission/index.storybooks.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AppRegistry } from 'react-native';
import { getStorybookUI, configure } from '@kadira/react-native-storybook';
import { AppRegistry } from "react-native";
import { getStorybookUI, configure } from "@storybook/react-native";

// import your stories
configure(() => {
require("../../src/storiesRoot")
require("../../src/storiesRegistry");
}, module);

const StorybookUI = getStorybookUI({port: 9001, host: 'localhost'});
AppRegistry.registerComponent('Storybook', () => StorybookUI);
const StorybookUI = getStorybookUI({ port: 9001, host: "localhost" });
AppRegistry.registerComponent("Storybook", () => StorybookUI);
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,27 +111,28 @@ failed to identify this call site. Make sure it is being used verbatim as `Relay
- https://github.com/facebook/relay/tree/master/examples
- https://github.com/fbsamples/f8app/

* TypeScript:
- https://www.typescriptlang.org
- https://github.com/basarat/typescript-book

* Testing:
- https://facebook.github.io/jest/
- https://facebook.github.io/jest/docs/api.html#content
- https://facebook.github.io/jest/blog/2016/07/27/jest-14.html

* Flow:
- http://flowtype.org/docs/type-annotations.html
- http://flowtype.org/docs/react.html
- http://flowtype.org/docs/quick-reference.html (and the rest of the language reference)

* Flexbox:
- https://css-tricks.com/snippets/css/a-guide-to-flexbox/
- http://blog.krawaller.se/posts/a-react-app-demonstrating-css3-flexbox/
- https://egghead.io/courses/flexbox-fundamentals

* React Native Storybooks:
- https://github.com/kadirahq/react-native-storybook
- https://github.com/kadirahq/react-storybook
- https://github.com/storybooks/storybook/
- https://github.com/storybooks/storybook/tree/master/app/react-native

* React Native Debugger:
- https://github.com/jhen0409/react-native-debugger


[React Native]: http://facebook.github.io/react-native/
[Eigen]: https://github.com/artsy/eigen
[yarn]: https://yarnpkg.com
Expand Down
25 changes: 11 additions & 14 deletions dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@

import { danger, fail, warn } from "danger"
import { compact, includes, remove, uniq } from "lodash"
import { compact, includes, uniq } from "lodash"

// For now you can ignore these 3 errors, I'm not sure why
// they are being raised. They definitely exist in the node runtime.
const fs = require("fs") // tslint:disable-line
const os = require("os") // tslint:disable-line
const path = require("path") // tslint:disable-line
import * as fs from "fs"
import * as path from "path"

import * as recurseSync from "recursive-readdir-sync"
const allFiles = recurseSync("./src")

// Setup
const pr = danger.github.pr
const modified = danger.git.modified_files
const newFiles = danger.git.created_files
const bodyAndTitle = (pr.body + pr.title).toLowerCase()

// Custom modifiers for people submitting PRs to be able to say "skip this"
const trivialPR = bodyAndTitle.includes("trivial")
const acceptedNoTests = bodyAndTitle.includes("skip new tests")

const typescriptOnly = (file: string) => includes(file, ".ts")
const filesOnly = (file: string) => fs.existsSync(file) && fs.lstatSync(file).isFile()

// Custom subsets of known files
const modifiedAppFiles = modified.filter(p => includes(p, "lib/")).filter(p => filesOnly(p))
const modifiedTestFiles = modified.filter(p => includes(p, "__tests__")).filter(p => filesOnly(p))
const modifiedAppFiles = modified.filter(p => includes(p, "lib/")).filter(p => filesOnly(p) && typescriptOnly(p))

// Modified or Created can be treated the same a lot of the time
const touchedFiles = modified.concat(danger.git.created_files).filter(p => filesOnly(p))
const touchedAppOnlyFiles = touchedFiles.filter(p => includes(p, "src/lib/") && !includes(p, "__tests__"))
const touchedComponents = touchedFiles.filter(p => includes(p, "src/lib/components") && !includes(p, "__tests__"))

const touchedTestFiles = touchedFiles.filter(p => includes(p, "__tests__"))
const touchedStoryFiles = touchedFiles.filter(p => includes(p, "__stories__"))
const touchedAppOnlyFiles = touchedFiles.filter(p =>
includes(p, "src/lib/") && !includes(p, "__tests__") && typescriptOnly(p))

const touchedComponents = touchedFiles.filter(p =>
includes(p, "src/lib/components") && !includes(p, "__tests__"))

// Rules

Expand Down Expand Up @@ -78,6 +74,7 @@ const testFilesThatDontExist = correspondingTestsForAppFiles
.filter(f => !f.includes("__stories__")) // skip stories
.filter(f => !f.includes("app_registry")) // skip registry, kinda untestable
.filter(f => !f.includes("routes")) // skip routes, kinda untestable
.filter(f => !f.includes("native_modules")) // skip native_modules
.filter(f => !fs.existsSync(f))

if (testFilesThatDontExist.length > 0) {
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,30 +85,32 @@
"typescript": "^2.3.2"
},
"devDependencies": {
"@kadira/react-native-storybook": "^2.3.0",
"@storybook/react-native": "^3.0.0-alpha.0",
"@types/enzyme": "^2.8.0",
"@types/jest": "^19.2.2",
"@types/lodash": "^4.14.53",
"@types/react-native": "^0.43.9",
"@types/react-relay": "^0.9.10",
"@types/react-test-renderer": "^15.5.0",
"apphub": "^0.5.1",
"babel-jest": "^18.0.0",
"babel-polyfill": "^6.13.0",
"babel-preset-react-native": "^1.9.1",
"babel-relay-plugin": "https://github.com/alloy/relay/releases/download/v0.9.3/babel-relay-plugin-0.9.3.tgz",
"concurrently": "^2.2.0",
"danger": "^0.18.0",
"danger": "^0.19.0",
"enzyme": "^2.8.2",
"husky": "^0.13.3",
"jest": "^19.0.2",
"jest": "^20.0.3",
"jest-fetch-mock": "^1.0.7",
"jest-react-native": "^17.0.3",
"lint-staged": "^3.4.1",
"react-dom": "^15.5.4",
"react-storybooks-relay-container": "^1.0.0",
"react-test-renderer": "^15.5.4",
"recursive-readdir-sync": "^1.0.6",
"relay2ts": "^0.2.0",
"ts-jest": "^19.0.10",
"ts-jest": "^20.0.3",
"tslint": "^4.5.0"
},
"peerDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions src/data/colors.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// In TypeScript 2.4 this can turn into an Enum
// https://github.com/Microsoft/TypeScript/pull/15486

export default {
"gray-light": "#f8f8f8",
"gray-regular": "#e5e5e5",
Expand Down
8 changes: 8 additions & 0 deletions src/data/fonts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// In TypeScript 2.4 this can turn into an Enum
// https://github.com/Microsoft/TypeScript/pull/15486

export default {
"garamond-regular": "AGaramondPro-Regular",
"garamond-italic": "AGaramondPro-Italic",
"avant-garde-regular": "Avant Garde Gothic ITCW01Dm",
}
2 changes: 2 additions & 0 deletions src/lib/app_registry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as React from "react"
import { AppRegistry, ViewProperties } from "react-native"
import * as Relay from "react-relay"

import Consignments from "./components/consignments"
import LoadFailureView from "./components/load_failure_view"
import Spinner from "./components/spinner"
import Containers from "./containers/index"
Expand Down Expand Up @@ -99,6 +100,7 @@ class MyAccount extends RootContainer {
}
}

AppRegistry.registerComponent("Consignments", () => Consignments)
AppRegistry.registerComponent("Artist", () => Artist)
AppRegistry.registerComponent("Home", () => Home)
AppRegistry.registerComponent("Gene", () => Gene)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { storiesOf } from "@kadira/react-native-storybook"
import { storiesOf } from "@storybook/react-native"
import * as React from "react"
import { View } from "react-native"
import StubContainer from "react-storybooks-relay-container"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { storiesOf } from "@kadira/react-native-storybook"
import { storiesOf } from "@storybook/react-native"
import * as React from "react"
import { View } from "react-native"
import { RootContainer } from "react-relay"
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/artist/artworks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import SerifText from "../../text/serif"

import colors from "../../../../data/colors"

const PageSize = 10

interface Props extends ViewProperties {
artist: {
counts: {
Expand Down
1 change: 0 additions & 1 deletion src/lib/components/artwork_grids/infinite_scroll_grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// 4. Update height of grid to encompass all items.

import * as React from "react"
import * as Relay from "react-relay"

import {
Dimensions,
Expand Down
7 changes: 2 additions & 5 deletions src/lib/components/buttons/__stories__/buttons.story.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import { action, storiesOf } from "@kadira/react-native-storybook"
import { action, storiesOf } from "@storybook/react-native"
import * as React from "react"
import { View } from "react-native"

import { RootContainer } from "react-relay"
import StubContainer from "react-storybooks-relay-container"

import FlatWhite from "../flat_white"
import InvertedButton from "../inverted_button"
import NavigationButton from "../navigation_button"

const smallButton = { height: 26, width: 320, marginBottom: 20 }
const largeButton = { height: 26, width: 320, marginBottom: 20 }

storiesOf("Buttons")
storiesOf("Artsy Buttons")
.addDecorator((story) => (
<View style={{ marginTop: 60, marginLeft: 20, marginRight: 20 }}>{story()}</View>
))
Expand Down
Loading

0 comments on commit eadef31

Please sign in to comment.