From 25f4e87aface34f7b11ba454963e845fbc9d7c02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guilherme=20Zu=CC=88hlke=20O=27Connor?= Date: Sun, 4 Mar 2018 17:05:58 +0000 Subject: [PATCH] Bundle built files into npm package --- package.json | 7 +++--- scripts/copybundledfiles.sh | 7 ++++++ yarn.lock | 45 +++++++++++++++++++++++++++++++++++-- 3 files changed, 54 insertions(+), 5 deletions(-) create mode 100755 scripts/copybundledfiles.sh diff --git a/package.json b/package.json index 7d227fc..c8c65e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-memory-game", - "version": "0.1.11", + "version": "0.1.15", "private": false, "main": "lib/index.js", "repository": { @@ -11,6 +11,7 @@ } }, "dependencies": { + "copyfiles": "^1.2.0", "lodash": "^4.17.5", "prop-types": "^15.6.0", "react": "^16.2.0", @@ -23,8 +24,8 @@ "scripts": { "start": "react-scripts start", "compile": "babel --presets es2015,stage-0,react -d lib/ src/module/", - "postcompile": "cp ./src/module/*.css ./lib", - "prepublish": "npm run compile", + "postcompile": "cp ./src/module/*.css ./lib; ./scripts/copybundledfiles.sh", + "prepublish": "npm run compile; npm run build", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "watch:test": "react-scripts test --env=jsdom", diff --git a/scripts/copybundledfiles.sh b/scripts/copybundledfiles.sh new file mode 100755 index 0000000..dfb9291 --- /dev/null +++ b/scripts/copybundledfiles.sh @@ -0,0 +1,7 @@ +#! #!/usr/bin/env bash + +mkdir -p ./lib/bundled +cp ./build/static/js/main*.js ./lib/bundled/react-memory-game.js +cp ./build/static/js/main*.js.map ./lib/bundled/react-memory-game.js.map +cp ./build/static/css/main*.css ./lib/bundled/react-memory-game.css +cp ./build/static/css/main*.css.map ./lib/bundled/react-memory-game.css.map \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index b83aebe..ecc5867 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1792,6 +1792,17 @@ cookie@0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" +copyfiles@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/copyfiles/-/copyfiles-1.2.0.tgz#a8da3ac41aa2220ae29bd3c58b6984294f2c593c" + dependencies: + glob "^7.0.5" + ltcdr "^2.2.1" + minimatch "^3.0.3" + mkdirp "^0.5.1" + noms "0.0.0" + through2 "^2.0.1" + core-js@^1.0.0: version "1.2.7" resolved "https://registry.yarnpkg.com/core-js/-/core-js-1.2.7.tgz#652294c14651db28fa93bd2d5ff2983a4f08c636" @@ -4543,6 +4554,10 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" +ltcdr@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ltcdr/-/ltcdr-2.2.1.tgz#5ab87ad1d4c1dab8e8c08bbf037ee0c1902287cf" + macaddress@^0.2.8: version "0.2.8" resolved "https://registry.yarnpkg.com/macaddress/-/macaddress-0.2.8.tgz#5904dc537c39ec6dbefeae902327135fa8511f12" @@ -4834,6 +4849,13 @@ nomnom@~1.6.2: colors "0.5.x" underscore "~1.4.4" +noms@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/noms/-/noms-0.0.0.tgz#da8ebd9f3af9d6760919b27d9cdc8092a7332859" + dependencies: + inherits "^2.0.1" + readable-stream "~1.0.31" + nopt@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" @@ -5919,7 +5941,7 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" -readable-stream@1.0: +readable-stream@1.0, readable-stream@~1.0.31: version "1.0.34" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-1.0.34.tgz#125820e34bc842d2f2aaafafe4c2916ee32c157c" dependencies: @@ -5940,6 +5962,18 @@ readable-stream@^2.0.1, readable-stream@^2.0.2, readable-stream@^2.0.6, readable string_decoder "~1.0.3" util-deprecate "~1.0.1" +readable-stream@^2.1.5: + version "2.3.5" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.5.tgz#b4f85003a938cbb6ecbce2a124fb1012bd1a838d" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + readdirp@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" @@ -6763,6 +6797,13 @@ throat@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.2.0.tgz#50cb0670edbc40237b9e347d7e1f88e4620af836" +through2@^2.0.1: + version "2.0.3" + resolved "https://registry.yarnpkg.com/through2/-/through2-2.0.3.tgz#0004569b37c7c74ba39c43f3ced78d1ad94140be" + dependencies: + readable-stream "^2.1.5" + xtend "~4.0.1" + through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" @@ -7301,7 +7342,7 @@ xml-name-validator@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-2.0.1.tgz#4d8b8f1eccd3419aa362061becef515e1e559635" -xtend@^4.0.0, xtend@^4.0.1: +xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz#a5c6d532be656e23db820efb943a1f04998d63af"