Pārlūkot izejas kodu

Automatically build all things (also umd) and inject into website

Kevin van Zonneveld 9 gadi atpakaļ
vecāks
revīzija
e2bad4e730
3 mainītis faili ar 12 papildinājumiem un 4 dzēšanām
  1. 1 1
      package.json
  2. 6 1
      website/src/guide/contributing.md
  3. 5 2
      website/update.js

+ 1 - 1
package.json

@@ -16,7 +16,7 @@
     "test": "bin/test",
     "test": "bin/test",
     "watch:css": "nodemon -e src/scss -x \"npm run build:css\"",
     "watch:css": "nodemon -e src/scss -x \"npm run build:css\"",
     "watch:examples": "cd website && node build-examples.js watch",
     "watch:examples": "cd website && node build-examples.js watch",
-    "watch:js": "nodemon --watch src -e js --ignore src/scss -x \"npm run build:lib\"",
+    "watch:js": "nodemon --watch src -e js --ignore src/scss -x \"npm run build && node website/update.js\"",
     "web:clean": "cd website && ./node_modules/.bin/hexo clean",
     "web:clean": "cd website && ./node_modules/.bin/hexo clean",
     "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate",
     "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate",
     "web:deploy": "npm run web:install && npm run web:build && ./bin/web-deploy",
     "web:deploy": "npm run web:install && npm run web:build && ./bin/web-deploy",

+ 6 - 1
website/src/guide/contributing.md

@@ -119,7 +119,6 @@ h1 {
 }
 }
 ```
 ```
 
 
-
 ## Website Development
 ## Website Development
 
 
 We keep the [uppyjs.io](http://uppyjs.io) website in `./website` for so it's easy to keep docs & code in sync as we're still iterating at high velocity. For those reading this screaming murder, [HashiCorp does this](https://github.com/hashicorp/terraform/tree/master/website) for all their projects, and it's working well for them on a scale vastly more impressive than Uppy's.
 We keep the [uppyjs.io](http://uppyjs.io) website in `./website` for so it's easy to keep docs & code in sync as we're still iterating at high velocity. For those reading this screaming murder, [HashiCorp does this](https://github.com/hashicorp/terraform/tree/master/website) for all their projects, and it's working well for them on a scale vastly more impressive than Uppy's.
@@ -137,3 +136,9 @@ For local previews on http://127.0.0.1:4000 type:
 ```bash
 ```bash
 npm run web
 npm run web
 ```
 ```
+
+If you want to work on Uppy itself, and see its changes reflected in the website, open a new tab and type:
+
+```bash
+npm run watch:js
+```

+ 5 - 2
website/update.js

@@ -1,5 +1,6 @@
-var fs         = require('fs')
-var path       = require('path')
+var fs    = require('fs')
+var path  = require('path')
+var chalk = require('chalk');
 
 
 var webRoot  = __dirname;
 var webRoot  = __dirname;
 var uppyRoot = path.dirname(__dirname);
 var uppyRoot = path.dirname(__dirname);
@@ -36,3 +37,5 @@ fs.writeFileSync(
   webRoot + '/themes/uppy/source/js/uppy.js',
   webRoot + '/themes/uppy/source/js/uppy.js',
   fs.readFileSync(locations.dev, 'utf-8')
   fs.readFileSync(locations.dev, 'utf-8')
 );
 );
+
+console.info(chalk.green('✓ injected: uppy build into site'));