Skip to content
This repository has been archived by the owner on Mar 17, 2023. It is now read-only.

Commit

Permalink
FIX: bugs in build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
farthinker committed Jul 29, 2016
1 parent a0f388a commit 68be98e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 25 deletions.
3 changes: 2 additions & 1 deletion build/helpers/browserify.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = (opts) ->
through.obj (file, encoding, done) ->

try
b.add file.path
b.require file.path,
expose: file.stem
b.bundle (error, buffer) =>
handleError(error, @) if error
file.contents = buffer
Expand Down
1 change: 1 addition & 0 deletions build/helpers/umd.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = (opts) ->

through.obj (file, encoding, done) ->
opts.contents = file.contents.toString()
opts.filename = file.stem
file.contents = new Buffer tpl opts
@push file
done()
18 changes: 0 additions & 18 deletions build/publish.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,6 @@ compile = require './compile'
test = require './test'
_ = require 'lodash'

bumpVersion = (done) ->
newVersion = changelogs.lastestVersion
unless newVersion
throw new Error('Publish: Invalid version in CHANGELOG.md')
return

pkg = require '../package'
pkg.version = newVersion
fs.writeFileSync './package.json', JSON.stringify(pkg, null, 2)

bowerConfig = require '../bower.json'
bowerConfig.version = newVersion
fs.writeFileSync './bower.json', JSON.stringify(bowerConfig, null, 2)

done()
bumpVersion.displayName = 'bump-version'

createRelease = (done) ->
try
token = _.trim fs.readFileSync('.token').toString()
Expand Down Expand Up @@ -66,7 +49,6 @@ createRelease.displayName = 'create-release'
publish = gulp.series [
compile,
test,
bumpVersion,
createRelease
]..., (done) ->
done()
Expand Down
2 changes: 1 addition & 1 deletion build/templates/umd.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
}(this, function (<%= dependencies.params %>) {
var define, module, exports;
var b = <%= contents %>
return b(1);
return b('<%= filename %>');
}));
8 changes: 4 additions & 4 deletions dist/simple-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Released under the MIT license
* http://mycolorway.github.io/simple-module/license.html
*
* Date: 2016-07-13
* Date: 2016-07-29
*/
;(function(root, factory) {
if (typeof module === 'object' && module.exports) {
Expand All @@ -16,7 +16,7 @@
}
}(this, function ($) {
var define, module, exports;
var b = (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var b = require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({"simple-module":[function(require,module,exports){
var SimpleModule,
slice = [].slice;

Expand Down Expand Up @@ -113,7 +113,7 @@ SimpleModule = (function() {

module.exports = SimpleModule;

},{}]},{},[1]);
},{}]},{},[]);

return b(1);
return b('simple-module');
}));
2 changes: 1 addition & 1 deletion dist/simple-module.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 68be98e

Please sign in to comment.