diff --git a/.gitignore b/.gitignore index 8d94c5f93c..ca8c43d23c 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,7 @@ coverage # Use a custom, cached location for Jest to save transpiling # on every PR .jest/cache + +# A commit deploy using `yarn bundle-with-storybooks` generates these +Emission.js +Emission.js.meta diff --git a/.travis.yml b/.travis.yml index 42c8986867..1558a033cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,9 @@ node_js: - "6.7" script: + - scripts/deploy_commit.sh - yarn ci - - yarn danger -- run -t + - yarn danger deploy: provider: script diff --git a/dangerfile.ts b/dangerfile.ts index 4182531bff..230d0b975c 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -158,5 +158,6 @@ const newBody = userBody + splitter + "\n" + bodyFooter // require Danger to submit a new body (and thus overwrite those changes.) const neuterMarkdownTicks = /- \[*.\]/g if (pr.body.replace(neuterMarkdownTicks, "-") !== newBody.replace(neuterMarkdownTicks, "-")) { - danger.github.api.pullRequests.update({...danger.github.thisPR, body: newBody }) + // See https://github.com/artsy/emission/issues/589 + // danger.github.api.pullRequests.update({...danger.github.thisPR, body: newBody }) } diff --git a/package.json b/package.json index eba905d933..d384f6d732 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "index.ios.js", "scripts": { "bundle": "react-native bundle --config \"$(pwd)\"/rn-cli.config.js --platform=ios --dev=false --entry-file=index.ios.js --bundle-output Pod/Assets/Emission.js --sourcemap-output Pod/Assets/Emission.js.map --assets-dest Pod/Assets && rm -rf Pod/Assets/assets/node_modules", + "bundle-with-storybooks": "react-native bundle --config \"$(pwd)\"/rn-cli.config.js --platform=ios --dev=true --entry-file=Example/Emission/index.ios.js --bundle-output Emission.js --assets-dest Pod/Assets", "clean-example": "cd Example && xcodebuild -workspace Emission.xcworkspace -scheme Emission -destination 'platform=iOS Simulator,name=iPhone 6' clean", "type-check": "tsc --noEmit --pretty", "lint": "tslint 'src/**/*.{ts,tsx}'", diff --git a/scripts/deploy_commit.sh b/scripts/deploy_commit.sh new file mode 100755 index 0000000000..0e8e0fa61d --- /dev/null +++ b/scripts/deploy_commit.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +if [ -z "$TRAVIS_PULL_REQUEST" ]; then + echo "Skipping deploy of the commit" + exit 0 +fi + +# Give us a CLI to work with +yarn global add s3-cli + +# Createa bundle with embedded storybooks also into Emission.js +yarn bundle-with-storybooks + +# Uploads the file to our s3 bucket - credentials are in the ENV vars for same-repo PRs +s3-cli put Emission.js "s3://artsy-emission-js/$TRAVIS_PULL_REQUEST.js" diff --git a/src/lib/components/consignments/__stories__/consignments-todo.story.tsx b/src/lib/components/consignments/__stories__/consignments-todo.story.tsx index 2a7a7e9bd2..f10d7ef0ee 100644 --- a/src/lib/components/consignments/__stories__/consignments-todo.story.tsx +++ b/src/lib/components/consignments/__stories__/consignments-todo.story.tsx @@ -11,15 +11,15 @@ interface States { [name: string]: ConsignmentSetup; } -const withArtist = { artist: { name: "Glenn Brown" } } -const withOnePhoto = { +const withArtist: ConsignmentSetup = { artist: { name: "Glenn Brown" } } +const withOnePhoto: ConsignmentSetup = { ...withArtist, photos: [ "https://d32dm0rphc51dk.cloudfront.net/VFiyokWNcBZNlfglZND_3g/small_square.jpg", ], } -const withPhotos = { +const withPhotos: ConsignmentSetup = { ...withArtist, photos: [ "https://d32dm0rphc51dk.cloudfront.net/VFiyokWNcBZNlfglZND_3g/small_square.jpg", @@ -39,17 +39,17 @@ const metadata: ConsignmentMetadata = { displayString: "5/5", } -const withMetadata = { +const withMetadata: ConsignmentSetup = { ...withPhotos, metadata, } -const withLocation = { +const withLocation: ConsignmentSetup = { ...withMetadata, location: "Huddersfield, UK", } -const withProvenance = { +const withProvenance: ConsignmentSetup = { ...withLocation, provenance: "This work has seen many hands.", }