Skip to content

Commit

Permalink
add publish script for component and bower
Browse files Browse the repository at this point in the history
This reverts commit 5543a16.
  • Loading branch information
calvinmetcalf authored and Calvin Metcalf committed Mar 20, 2014
1 parent cf68863 commit ce4b77f
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ coverage/
*.js.html
index.html
.mailmap
bower.json
component.json
23 changes: 23 additions & 0 deletions build/bower.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
19 changes: 19 additions & 0 deletions build/component.json
Original file line number Diff line number Diff line change
@@ -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"
}
31 changes: 31 additions & 0 deletions build/publish.sh
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit ce4b77f

Please sign in to comment.