unicorn-demo-app 6.2.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unicorn-demo-app",
3
- "version": "6.2.0",
3
+ "version": "7.0.1",
4
4
  "main": "src/index.js",
5
5
  "author": "Ethan Sharabi <ethan.shar@gmail.com>",
6
6
  "license": "MIT",
@@ -13,7 +13,7 @@
13
13
  },
14
14
  "scripts": {
15
15
  "release": "node ./scripts/release.js",
16
- "jenkinsRelease": "node ./scripts/jenkinsRelease.js"
16
+ "bkRelease": "node ./scripts/bkRelease.js"
17
17
  },
18
18
  "devDependencies": {
19
19
  "react-native-ui-lib": "*",
@@ -2,12 +2,22 @@ const exec = require('shell-utils').exec;
2
2
  const semver = require('semver');
3
3
  const _ = require('lodash');
4
4
  const p = require('path');
5
+ const cp = require('child_process');
5
6
 
6
7
  // Workaround JS
7
- const isRelease = process.env.RELEASE_BUILD === 'true';
8
- const branch = process.env.BRANCH;
9
8
 
10
- const ONLY_ON_BRANCH = `origin/${branch || 'master'}`;
9
+ const isRelease = process.env.BUILDKITE_MESSAGE.match(/^release$/i);
10
+ let VERSION;
11
+ if (isRelease) {
12
+ VERSION = cp.execSync(`buildkite-agent meta-data get version`).toString();
13
+ }
14
+
15
+
16
+
17
+ // const isRelease = process.env.RELEASE_BUILD === 'true';
18
+ // const branch = process.env.BRANCH;
19
+
20
+ // const ONLY_ON_BRANCH = `origin/${branch || 'master'}`;
11
21
  const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
12
22
  const VERSION_INC = 'patch';
13
23
 
@@ -15,37 +25,37 @@ function run() {
15
25
  if (!validateEnv()) {
16
26
  return;
17
27
  }
18
- setupGit();
28
+ // setupGit();
19
29
  createNpmRc();
20
30
  versionTagAndPublish();
21
31
  }
22
32
 
23
33
  function validateEnv() {
24
- if (!process.env.JENKINS_CI) {
34
+ if (!process.env.CI) {
25
35
  throw new Error('releasing is only available from CI');
26
36
  }
27
37
 
28
- if (!process.env.JENKINS_MASTER) {
29
- console.log('not publishing on a different build');
30
- return false;
31
- }
38
+ // if (!process.env.JENKINS_MASTER) {
39
+ // console.log('not publishing on a different build');
40
+ // return false;
41
+ // }
32
42
 
33
- if (process.env.GIT_BRANCH !== ONLY_ON_BRANCH) {
34
- console.log(`not publishing on branch ${process.env.GIT_BRANCH}`);
35
- return false;
36
- }
43
+ // if (process.env.GIT_BRANCH !== ONLY_ON_BRANCH) {
44
+ // console.log(`not publishing on branch ${process.env.GIT_BRANCH}`);
45
+ // return false;
46
+ // }
37
47
 
38
48
  return true;
39
49
  }
40
50
 
41
- function setupGit() {
42
- exec.execSyncSilent('git config --global push.default simple');
43
- exec.execSyncSilent(`git config --global user.email "${process.env.GIT_EMAIL}"`);
44
- exec.execSyncSilent(`git config --global user.name "${process.env.GIT_USER}"`);
45
- const remoteUrl = new RegExp('https?://(\\S+)').exec(exec.execSyncRead('git remote -v'))[1];
46
- exec.execSyncSilent(`git remote add deploy "https://${process.env.GIT_USER}:${process.env.GIT_TOKEN}@${remoteUrl}"`);
47
- // exec.execSync(`git checkout ${ONLY_ON_BRANCH}`);
48
- }
51
+ // function setupGit() {
52
+ // exec.execSyncSilent('git config --global push.default simple');
53
+ // exec.execSyncSilent(`git config --global user.email "${process.env.GIT_EMAIL}"`);
54
+ // exec.execSyncSilent(`git config --global user.name "${process.env.GIT_USER}"`);
55
+ // const remoteUrl = new RegExp('https?://(\\S+)').exec(exec.execSyncRead('git remote -v'))[1];
56
+ // exec.execSyncSilent(`git remote add deploy "https://${process.env.GIT_USER}:${process.env.GIT_TOKEN}@${remoteUrl}"`);
57
+ // // exec.execSync(`git checkout ${ONLY_ON_BRANCH}`);
58
+ // }
49
59
 
50
60
  function createNpmRc() {
51
61
  exec.execSync('rm -f package-lock.json');
@@ -57,7 +67,7 @@ function versionTagAndPublish() {
57
67
  const currentPublished = findCurrentPublishedVersion();
58
68
  console.log(`current published version: ${currentPublished}`);
59
69
 
60
- const version = isRelease ? process.env.VERSION : `${currentPublished}-snapshot.${process.env.BUILD_ID}`;
70
+ const version = isRelease ? VERSION : `${currentPublished}-snapshot.${process.env.BUILDKITE_BUILD_NUMBER}`;
61
71
  console.log(`Publishing version: ${version}`);
62
72
 
63
73
  tryPublishAndTag(version);
@@ -117,6 +117,7 @@ class CarouselScreen extends Component<Props, State> {
117
117
  pageControlProps={{onPagePress: this.onPagePress, limitShownPages}}
118
118
  // showCounter
119
119
  allowAccessibleLayout
120
+ loop
120
121
  >
121
122
  {_.map([...Array(numberOfPagesShown)], (item, index) => (
122
123
  <Page style={{backgroundColor: BACKGROUND_COLORS[index]}} key={index}>