Parcourir la source

Build system fixes

Artur Paikin il y a 9 ans
Parent
commit
b88a5fe776
2 fichiers modifiés avec 9 ajouts et 21 suppressions
  1. 4 4
      package.json
  2. 5 17
      website/update.js

+ 4 - 4
package.json

@@ -18,7 +18,7 @@
     "start": "npm run build && npm run web",
     "start": "npm run build && npm run web",
     "test:phantom": "zuul test/spec/upload.js --phantom",
     "test:phantom": "zuul test/spec/upload.js --phantom",
     "test": "bin/test",
     "test": "bin/test",
-    "test:unit": "./node_modules/.bin/babel-node test/core.spec.js",
+    "test:unit": "node test/index.js",
     "watch:all": "parallelshell \"npm run watch\" \"npm run web\"",
     "watch:all": "parallelshell \"npm run watch\" \"npm run web\"",
     "watch:css": "nodemon --watch src --ext scss -x \"npm run build && node website/update.js\"",
     "watch:css": "nodemon --watch src --ext scss -x \"npm run build && node website/update.js\"",
     "watch:examples": "cd website && node build-examples.js watch",
     "watch:examples": "cd website && node build-examples.js watch",
@@ -29,7 +29,7 @@
     "web:deploy": "npm run web:install && npm run web:disc && npm run docs && npm run web:build && ./bin/web-deploy",
     "web:deploy": "npm run web:install && npm run web:disc && npm run docs && npm run web:build && ./bin/web-deploy",
     "web:disc": "npm run build:umd:fullpath && discify dist/uppy-fp.js --output website/src/_disc.html && echo '---\nlayout: false\n---\n' |cat - website/src/_disc.html > website/src/disc.html && rm website/src/_disc.html",
     "web:disc": "npm run build:umd:fullpath && discify dist/uppy-fp.js --output website/src/_disc.html && echo '---\nlayout: false\n---\n' |cat - website/src/_disc.html > website/src/disc.html && rm website/src/_disc.html",
     "web:install": "cd website && rm -rf node_modules/hexo-renderer-uppyexamples && npm install",
     "web:install": "cd website && rm -rf node_modules/hexo-renderer-uppyexamples && npm install",
-    "web:preview": "cd website && ./node_modules/.bin/hexo server --debug & npm run watch:examples",
+    "web:preview": "cd website && parallelshell \"./node_modules/.bin/hexo server --debug\" \"node build-examples.js watch\"",
     "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: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 web:install && npm run web:clean && npm run web:build && npm run web:preview"
     "web": "npm run web:install && npm run web:clean && npm run web:build && npm run web:preview"
   },
   },
@@ -44,16 +44,16 @@
   },
   },
   "homepage": "https://github.com/transloadit/uppy#readme",
   "homepage": "https://github.com/transloadit/uppy#readme",
   "devDependencies": {
   "devDependencies": {
-    "babel-eslint": "4.1.5",
     "babel": "5.8.34",
     "babel": "5.8.34",
+    "babel-eslint": "4.1.5",
     "babelify": "6.4.0",
     "babelify": "6.4.0",
     "browser-sync": "2.10.0",
     "browser-sync": "2.10.0",
     "browserify": "12.0.1",
     "browserify": "12.0.1",
     "chalk": "1.1.1",
     "chalk": "1.1.1",
     "disc": "1.3.2",
     "disc": "1.3.2",
+    "eslint": "1.10.3",
     "eslint-config-standard": "4.4.0",
     "eslint-config-standard": "4.4.0",
     "eslint-plugin-standard": "1.3.1",
     "eslint-plugin-standard": "1.3.1",
-    "eslint": "1.10.3",
     "http-server": "0.8.5",
     "http-server": "0.8.5",
     "multi-glob": "1.0.1",
     "multi-glob": "1.0.1",
     "node-notifier": "4.4.0",
     "node-notifier": "4.4.0",

+ 5 - 17
website/update.js

@@ -33,25 +33,13 @@ fs.writeFileSync(
     })
     })
 )
 )
 
 
-// Copy latest uppy version into website so the CDN example can use it
-// fs.writeFileSync(
-//   webRoot + '/themes/uppy/source/js/uppy.js',
-//   fs.readFileSync(locations.dev, 'utf-8')
-// );
-// console.info(chalk.green('✓ injected: '), chalk.dim('uppy.js build into site'));
-//
-//
-// fs.writeFileSync(
-//   webRoot + '/themes/uppy/source/css/uppy.css',
-//   fs.readFileSync(locations.css, 'utf-8')
-// );
-// console.info(chalk.green('✓ injected: '), chalk.dim('uppy.css build into site'));
-
-// Copy latest uppy version into website so the CDN example can use it
 var exec = require('child_process').exec
 var exec = require('child_process').exec
-exec('cp -fR ./dist/. ./website/themes/uppy/source/uppy', function (error, stdout, stderr) {
+exec('cp -fR ' + uppyRoot + '/dist/ ' + webRoot + '/themes/uppy/source/uppy', function (error, stdout, stderr) {
   if (error) {
   if (error) {
-    console.error(chalk.red('x failed to inject: '), chalk.dim('uppy umd build into site'))
+    console.error(
+      chalk.red('x failed to inject: '),
+      chalk.dim('uppy umd build into site, because: ' + error)
+    )
     return
     return
   }
   }
   console.info(chalk.green('✓ injected: '), chalk.dim('uppy umd build into site'))
   console.info(chalk.green('✓ injected: '), chalk.dim('uppy umd build into site'))