Explorar el Código

Merge pull request #56 from transloadit/bundle-module

Decide on single-noun terminology
Kevin van Zonneveld hace 9 años
padre
commit
ef50b505af

+ 2 - 2
.browsersync.js

@@ -18,14 +18,14 @@ module.exports = {
             "port": 8080
             "port": 8080
         }
         }
     },
     },
-    "files": [ "examples/cdn/*"],
+    "files": [ "examples/bundle/*"],
     "index": "index.html",
     "index": "index.html",
     "watchOptions": {},
     "watchOptions": {},
     "server": true,
     "server": true,
     "proxy": false,
     "proxy": false,
     "port": 3000,
     "port": 3000,
     "middleware": false,
     "middleware": false,
-    "serveStatic": ["examples/cdn"],
+    "serveStatic": ["examples/bundle"],
     "ghostMode": {
     "ghostMode": {
         "clicks": true,
         "clicks": true,
         "scroll": true,
         "scroll": true,

+ 1 - 1
CHANGELOG.md

@@ -45,7 +45,6 @@ Ideas that will be planned into a release at one point
 ## 0.0.3 (March 01, 2016)
 ## 0.0.3 (March 01, 2016)
 
 
 - [ ] core: clean up package.json. We've accumulated duplication and weirdness by hacking just for our current problem without keeping a wider view of what was already there (@arturi)
 - [ ] core: clean up package.json. We've accumulated duplication and weirdness by hacking just for our current problem without keeping a wider view of what was already there (@arturi)
-- [ ] core: Decide on single-noun terminology (npm, umd, dist, package, cdn, module -> bundler -> bundle), and call it that through-out (@kvz)
 - [ ] google: Add basic Google Drive plugin example (can just use `target: "<string>"` so long as modal is in the works by @arturi) (@hedgerh)
 - [ ] google: Add basic Google Drive plugin example (can just use `target: "<string>"` so long as modal is in the works by @arturi) (@hedgerh)
 - [ ] meta: Decide on tagline(s) (@kvz, @hedgerh, @arturi, @tim-kos)
 - [ ] meta: Decide on tagline(s) (@kvz, @hedgerh, @arturi, @tim-kos)
 - [ ] modal: Add barely working Modal plugin that can be used as a target (#53, #50, @arturi)
 - [ ] modal: Add barely working Modal plugin that can be used as a target (#53, #50, @arturi)
@@ -54,6 +53,7 @@ Ideas that will be planned into a release at one point
 - [x] core: Allow users to set DOM elements or other plugins as targets (@arturi)
 - [x] core: Allow users to set DOM elements or other plugins as targets (@arturi)
 - [x] core: Create a progressbar/spinner/etc plugin (#18, @arturi)
 - [x] core: Create a progressbar/spinner/etc plugin (#18, @arturi)
 - [x] core: Decide on how we ship default styles: separate css file, inline (@kvz, @hedgerh, @arturi, @tim-kos)
 - [x] core: Decide on how we ship default styles: separate css file, inline (@kvz, @hedgerh, @arturi, @tim-kos)
+- [x] core: Decide on single-noun terminology (npm, umd, dist, package, cdn, module -> bundler -> bundle), and call it that through-out (@kvz)
 - [x] server: `package.json` (@hedgerh)
 - [x] server: `package.json` (@hedgerh)
 - [x] test: Fix and enable commented out `use plugins` & other core unit test (@arturi)
 - [x] test: Fix and enable commented out `use plugins` & other core unit test (@arturi)
 
 

+ 0 - 0
bin/build-umd → bin/build-bundle


+ 0 - 0
bin/build-umd-locale → bin/build-bundle-locale


+ 7 - 7
package.json

@@ -13,23 +13,23 @@
     "test": "npm run lint && npm run test:unit",
     "test": "npm run lint && npm run test:unit",
       "test:phantom": "zuul test/spec/upload.js --phantom",
       "test:phantom": "zuul test/spec/upload.js --phantom",
       "test:unit": "node test/index.js",
       "test:unit": "node test/index.js",
-    "build": "npm run build:lib && npm run build:umd && npm run build:umd:min && npm run build:css",
-      "build:js": "npm run build:lib && npm run build:umd && npm run build:umd:min",
+    "build": "npm run build:lib && npm run build:bundle && npm run build:bundle:min && npm run build:css",
+      "build:js": "npm run build:lib && npm run build:bundle && npm run build:bundle:min",
       "build:css": "bin/build-css",
       "build:css": "bin/build-css",
       "build:lib": "babel src -d lib --stage 0",
       "build:lib": "babel src -d lib --stage 0",
-      "build:umd:fullpath": "env OUT=uppy-fp.js ./bin/build-umd --full-paths",
-      "build:umd:min": "./bin/build-umd",
-      "build:umd": "./bin/build-umd && ./bin/build-umd-locale",
+      "build:bundle:fullpath": "env OUT=uppy-fp.js ./bin/build-bundle --full-paths",
+      "build:bundle:min": "./bin/build-bundle",
+      "build:bundle": "./bin/build-bundle && ./bin/build-bundle-locale",
     "watch": "parallelshell 'npm run watch:js' 'npm run watch:css' && node website/update.js",
     "watch": "parallelshell 'npm run watch:js' 'npm run watch:css' && node website/update.js",
       "watch:fast": "parallelshell 'npm run watch:css' 'npm run web:preview'",
       "watch:fast": "parallelshell 'npm run watch:css' 'npm run web:preview'",
-      "watch:js": "nodemon --watch src --ext js -x 'npm run build:umd && node website/update.js'",
+      "watch:js": "nodemon --watch src --ext js -x 'npm run build:bundle && node website/update.js'",
       "watch:css": "nodemon --watch src --ext scss -x 'npm run build:css && node website/update.js'",
       "watch:css": "nodemon --watch src --ext scss -x 'npm run build:css && node website/update.js'",
     "web": "npm run web:install && npm run web:clean && npm run web:build",
     "web": "npm run web:install && npm run web:clean && npm run web:build",
       "web:preview": "cd website && parallelshell 'node build-examples.js watch' './node_modules/.bin/hexo server'",
       "web:preview": "cd website && parallelshell 'node build-examples.js watch' './node_modules/.bin/hexo server'",
       "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",
       "web:build": "cd website && node update.js && ./node_modules/.bin/hexo generate --silent && node build-examples.js",
       "web:clean": "cd website && ./node_modules/.bin/hexo clean",
       "web:clean": "cd website && ./node_modules/.bin/hexo clean",
       "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:bundle: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 && npm install",
       "web:install": "cd website && npm install",
       "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"
   },
   },

+ 1 - 1
website/src/_data/design_goals.yml

@@ -1,6 +1,6 @@
  - "Lightweight / easy on dependencies"
  - "Lightweight / easy on dependencies"
  - "ES6, with transpiled ES5 versions available"
  - "ES6, with transpiled ES5 versions available"
- - "Usable from CDN, as well as local individual imports"
+ - "Usable as a bundle straight from a CDN, as well as a module to import"
  - "Resumable file uploads via the open tus standard"
  - "Resumable file uploads via the open tus standard"
  - "Robust: retries for all-the-things, avoid showing ‘weird errors’"
  - "Robust: retries for all-the-things, avoid showing ‘weird errors’"
  - "Themable UI with a beautiful default"
  - "Themable UI with a beautiful default"

+ 4 - 3
website/src/examples/cdn/index.ejs

@@ -1,12 +1,13 @@
 ---
 ---
-title: CDN
+title: Bundle
 layout: example
 layout: example
 type: examples
 type: examples
 order: 0
 order: 0
 ---
 ---
 
 
 {% blockquote %}
 {% blockquote %}
-This example showcases sourcing a pre-built dist straight from a CDN.
+This example showcases sourcing a pre-built bundle, that a browser can request
+straight from a CDN.
 {% endblockquote %}
 {% endblockquote %}
 
 
 <% include app.html %>
 <% include app.html %>
@@ -20,4 +21,4 @@ This example showcases sourcing a pre-built dist straight from a CDN.
 <p>
 <p>
   On this page we're using the following HTML & JS snippet:
   On this page we're using the following HTML & JS snippet:
 </p>
 </p>
-{% include_code lang:html cdn/app.html %}
+{% include_code lang:html bundle/app.html %}

+ 4 - 3
website/src/examples/i18n/index.ejs

@@ -7,7 +7,8 @@ order: 4
 
 
 {% blockquote %}
 {% blockquote %}
 Here you'll see a demo of how you might set Uppy to work with language packs (i18n).
 Here you'll see a demo of how you might set Uppy to work with language packs (i18n).
-Actually, two examples: pre-built bundled version ready to use with &lt;script&gt; tag & module version to be used with tools like Webpack & Browserify.
+Actually, two examples: pre-built bundle version ready to use with a &lt;script&gt; tag
+and the module, that you can bundle yourself with tools like Webpack, Browserify or Rollup.
 {% endblockquote %}
 {% endblockquote %}
 
 
 <link rel="stylesheet" href="app.css">
 <link rel="stylesheet" href="app.css">
@@ -21,12 +22,12 @@ Actually, two examples: pre-built bundled version ready to use with &lt;script&g
 </p>
 </p>
 
 
 <p>
 <p>
-  To load from CDN we're using the following HTML and JavaScript:
+  To load the pre-build bundle from a CDN we're using the following HTML and JavaScript:
 </p>
 </p>
 {% include_code lang:html i18n/app.html %}
 {% include_code lang:html i18n/app.html %}
 
 
 <p>
 <p>
-  Or, if we want the UMD version, this JavaScript:
+  Or, if we want this as module that we can bundle ourselves, this JavaScript:
 </p>
 </p>
 {% include_code lang:js i18n/app.es6 %}
 {% include_code lang:js i18n/app.es6 %}
 
 

+ 1 - 1
website/src/guide/getting-started.md

@@ -20,4 +20,4 @@ $ npm install --save uppy
 
 
 ## Standalone & CDN
 ## Standalone & CDN
 
 
-{% include_code lang:html cdn/app.html %}
+{% include_code lang:html bundle/app.html %}

+ 1 - 1
website/themes/uppy/layout/partials/main_menu.ejs

@@ -6,5 +6,5 @@
 </li> -->
 </li> -->
 <li><a href="/guide/" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li>
 <li><a href="/guide/" class="nav-link<%- page.path.match(/guide/) ? ' current' : '' %>">Guide</a></li>
 <li><a href="/api/" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API</a></li>
 <li><a href="/api/" class="nav-link<%- page.path.match(/api/) ? ' current' : '' %>">API</a></li>
-<li><a href="/examples/cdn/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
+<li><a href="/examples/bundle/" class="nav-link<%- page.path.match(/examples/) ? ' current' : '' %>">Examples</a></li>
 <li><a href="https://github.com/transloadit/uppy" class="nav-link">Github</a></li>
 <li><a href="https://github.com/transloadit/uppy" class="nav-link">Github</a></li>

+ 2 - 2
website/update.js

@@ -43,9 +43,9 @@ exec('cp -fR ' + uppyRoot + '/dist/ ' + webRoot + '/themes/uppy/source/uppy', fu
   if (error) {
   if (error) {
     console.error(
     console.error(
       chalk.red('x failed to inject: '),
       chalk.red('x failed to inject: '),
-      chalk.dim('uppy umd build into site, because: ' + error)
+      chalk.dim('uppy bundle 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 bundle into site'))
 })
 })