Переглянути джерело

Merge branch 'master' of https://github.com/transloadit/uppy

Artur Paikin 6 роки тому
батько
коміт
0bf15714a1
6 змінених файлів з 313 додано та 254 видалено
  1. 4 2
      bin/endtoend-build-ci
  2. 4 7
      bin/release
  3. 35 0
      bin/sync-version-numbers
  4. 6 2
      lerna.json
  5. 261 241
      package-lock.json
  6. 3 2
      package.json

+ 4 - 2
bin/endtoend-build-ci

@@ -16,6 +16,8 @@ VERDACCIO_REGISTRY=http://localhost:4002
 cleanup() {
   rm -rf "${__root}/test/endtoend/node_modules"
   rm -rf "${__root}/test/endtoend/tmp"
+  git reset
+  git checkout -- .
 }
 function on_exit() {
   # revert to public registry
@@ -46,12 +48,12 @@ git checkout -- package-lock.json
 
 # Simulate a publish of everything, to the local registry,
 # without changing things in git
-lerna version prerelease --yes \
+ENDTOEND=1 lerna version prerelease --yes \
   --exact \
   --force-publish \
   --npm-client=npm \
   --no-push
-lerna publish from-git --yes \
+ENDTOEND=1 lerna publish from-git --yes \
   --registry="$VERDACCIO_REGISTRY" \
   --no-verify-access \
   --npm-client=npm

+ 4 - 7
bin/release

@@ -47,7 +47,7 @@ set -o xtrace
 # Update README before publishing `uppy`
 # So up-to-date contributors are shown on the npm page.
 npm run contributors:save
-git commit -m "Update contributors" README.md
+git add README.md
 
 # Add readme file to the main `uppy` package.
 cp README.md packages/uppy/README.md
@@ -55,13 +55,10 @@ cp README.md packages/uppy/README.md
 npm run clean
 npm run build
 
-lerna publish --message="Release" --exact
+git commit -m "Release"
+lerna version --amend --no-push --exact
 
-# Replace version numbers in URLs
-version_files="./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/"
-main_package_version=$(node -p "require('./packages/uppy/package.json').version")
-replace-x -r 'uppy/v\d+\.\d+\.\d+/dist' "uppy/v$main_package_version/dist" $version_files --exclude=node_modules
-git commit -m "Change Uppy version references to v$main_package_version" $version_files
+lerna publish from-git
 
 git push
 git push --tags

+ 35 - 0
bin/sync-version-numbers

@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# Called by the `version` npm script.
+# This is run _after_ lerna updates the version numbers,
+# but _before_ it commits, so we have time to update the
+# version numbers throughout the repo and add it to the
+# release commit.
+# NOTE this _amends_ the previous commit, which should
+# already be a "Release" commit generated by bin/release.
+
+set -o pipefail
+set -o errexit
+set -o nounset
+
+# Set magic variables for current file & dir
+__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
+__base="$(basename ${__file} .sh)"
+__root="$(cd "$(dirname "${__dir}")" && pwd)"
+
+if [ "$ENDTOEND" = "1" ]; then
+  echo "Publishing for e2e tests, skipping version number sync."
+  exit 0
+fi
+
+commit_message="$(git log -1 --pretty=%B)"
+if [ "$commit_message" != "Release" ]; then
+  echo "Last commit is not a release commit, but '$commit_message'"
+  exit 1
+fi
+
+version_files="./examples/ README.md bin/upload-to-cdn.sh website/src/examples/ website/src/docs/ website/themes/uppy/layout/"
+main_package_version=$(node -p "require('./packages/uppy/package.json').version")
+replace-x -r 'uppy/v\d+\.\d+\.\d+/dist' "uppy/v$main_package_version/dist" $version_files --exclude=node_modules
+git add $version_files # add changes to the Release commit

+ 6 - 2
lerna.json

@@ -1,8 +1,12 @@
 {
-  "lerna": "2.11.0",
+  "version": "independent",
   "packages": [
     "packages/*",
     "packages/@uppy/*"
   ],
-  "version": "independent"
+  "command": {
+    "bootstrap": {
+      "hoist": true
+    }
+  }
 }

Різницю між файлами не показано, бо вона завелика
+ 261 - 241
package-lock.json


+ 3 - 2
package.json

@@ -49,7 +49,7 @@
     "isomorphic-fetch": "2.2.1",
     "jest": "^23.5.0",
     "json3": "^3.3.2",
-    "lerna": "^3.4.0",
+    "lerna": "^3.4.3",
     "lint-staged": "^6.1.1",
     "minify-stream": "^1.2.0",
     "mkdirp": "0.5.1",
@@ -91,6 +91,7 @@
     "lint": "eslint . --cache",
     "lint-staged": "lint-staged",
     "release": "./bin/release",
+    "version": "./bin/sync-version-numbers",
     "start:companion": "sh ./bin/companion",
     "start": "npm-run-all --parallel watch start:companion web:preview",
     "test:registry": "verdaccio --listen 4002 --config test/endtoend/verdaccio.yaml",
@@ -126,7 +127,7 @@
     "web:update:frontpage:code:sample": "cd website && ./node_modules/.bin/hexo generate && cp -f public/frontpage-code-sample.html ./themes/uppy/layout/partials/frontpage-code-sample.html",
     "web": "npm-run-all web:clean web:build",
     "uploadcdn": "bin/upload-to-cdn.sh",
-    "bootstrap": "lerna bootstrap --hoist",
+    "bootstrap": "lerna bootstrap",
     "contributors": "githubcontrib --owner transloadit --repo uppy --cols 6 $([ \"${GITHUB_TOKEN:-}\" == \"\" ] && echo \"\" || echo \"--authToken ${GITHUB_TOKEN}\") --showlogin true --sortOrder desc",
     "contributors:save": "replace-x -m '<!--contributors-->[\\s\\S]+<!--/contributors-->' \"<!--contributors-->\n## Contributors\n\n$(npm run --silent contributors)\n<!--/contributors-->\" README.md"
   },

Деякі файли не було показано, через те що забагато файлів було змінено