diff --git a/.gitignore b/.gitignore index 68a9b2db..d3c27b0e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ coverage/ *.js.html index.html .mailmap +bower.json +component.json \ No newline at end of file diff --git a/build/bower.json b/build/bower.json new file mode 100644 index 00000000..7dde3788 --- /dev/null +++ b/build/bower.json @@ -0,0 +1,23 @@ +{ + "name": "leaflet", + "description": "JavaScript library for mobile-friendly interactive maps", + "main": [ + "dist/leaflet.js", + "dist/leaflet.css", + "dist/leaflet-src.js", + "dist/images/layers-2x.png", + "dist/images/layers.png", + "dist/images/marker-icon-2x.png", + "dist/images/marker-icon.png", + "dist/images/marker-shadow.png" + ], + "ignore": [ + ".*", + "CHANGELOG.json", + "FAQ.md", + "debug", + "spec", + "src", + "build" + ] +} \ No newline at end of file diff --git a/build/component.json b/build/component.json new file mode 100644 index 00000000..7b9d53b3 --- /dev/null +++ b/build/component.json @@ -0,0 +1,19 @@ +{ + "name": "leaflet", + "description": "JavaScript library for mobile-friendly interactive maps", + "scripts": [ + "dist/leaflet.js", + "dist/leaflet-src.js" + ], + "images":[ + "dist/images/layers-2x.png", + "dist/images/layers.png", + "dist/images/marker-icon-2x.png", + "dist/images/marker-icon.png", + "dist/images/marker-shadow.png" + ], + "styles":[ + "dist/leaflet.css" + ], + "main": "dist/leaflet-src.js" +} \ No newline at end of file diff --git a/build/publish.sh b/build/publish.sh new file mode 100755 index 00000000..bbac38ab --- /dev/null +++ b/build/publish.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +#make sure deps are up to date +rm -r node_modules +npm install + +# get current version + VERSION=$(node --eval "console.log(require('./package.json').version);") +# Build +git checkout -b build +npm test || exit 1 +npm run prepublish +git add dist/leaflet-src.js dist/leaflet.js -f + +# create the bower and component files +copyfiles -u 1 build/*.json ./ +tin -v $VERSION +git add component.json bower.json -f + +git commit -m "build $VERSION" + +# Tag and push +echo git tag $VERSION +# git push --tags git@github.com:leaflet/leaflet.git $VERSION + +# # # Publish JS modules +# npm publish + +# # # Cleanup +# git checkout master +# git branch -D build \ No newline at end of file diff --git a/package.json b/package.json index a2fec006..802f5d23 100644 --- a/package.json +++ b/package.json @@ -12,13 +12,16 @@ "karma-mocha": "~0.1.1", "karma-coverage": "~0.2.0", "karma-phantomjs-launcher": "^0.1.2", - "karma-chrome-launcher": "^0.1.2" + "karma-chrome-launcher": "^0.1.2", + "tin": "^0.4.0", + "copyfiles": "0.0.1" }, "main": "dist/leaflet-src.js", "style": "dist/leaflet.css", "scripts": { "test": "jake test", - "prepublish": "jake build" + "prepublish": "jake build", + "publish": "./build/publish.sh" }, "repository": { "type": "git",