Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bower support #39

Closed
brunowego opened this issue Aug 25, 2015 · 16 comments
Closed

Bower support #39

brunowego opened this issue Aug 25, 2015 · 16 comments
Assignees
Labels

Comments

@brunowego
Copy link

Bower is popular and easy to use. To install elemental using bower try: bower install elementalui

@nkbt nkbt self-assigned this Aug 26, 2015
@nkbt
Copy link
Member

nkbt commented Aug 26, 2015

I'll get this done, @brunowego

@nkbt
Copy link
Member

nkbt commented Aug 26, 2015

@JedWatson could you please create a repo elemental-dist in the elementalui org? I don't have enough permissions to do that.

Here is a slightly modified script to automate bower publishing. There must be a bower.json in that repo (I'll create one).

ORG="elementalui"
NAME=$(echo 'console.log(require("./package.json").name)' | node)
REPO="$NAME-dist"
DESC=$(echo 'console.log(require("./package.json").description)' | node)
HOMEPAGE=$(echo 'console.log(require("./package.json").homepage)' | node)
VERSION=$(echo 'console.log(require("./package.json").version)' | node)

# Run only once to create repo (need github.token locally)
curl -i -X POST https://api.github.com/orgs/$ORG/repos -H "Authorization: token `cat github.token`" \
  --data '{"name":"$REPO","description":"$DESC","homepage":"$HOMEPAGE","private":false,"has_issues":true,"has_wiki":false,"has_downloads":false}'
# Then push there a bower.json

# Run every time to publish a new version
pushd .
rm -rf /tmp/dist
git clone git@github.com:$ORG/$REPO.git /tmp/dist
npm run build
cp -f ./dist/* /tmp/dist
cd /tmp/dist
git add .
git commit -m "Release"
bower version $VERSION
git push && git push --tags
popd .

# Run only once to publish
bower register $NAME  https://github.com/$ORG/$REPO.git

@nkbt
Copy link
Member

nkbt commented Aug 26, 2015

As soon as I test this script manually, I'll add it to npm scripts.

@JedWatson
Copy link
Member

@nkbt I've created the repo and made you an admin, go for it 👍

@nkbt
Copy link
Member

nkbt commented Aug 26, 2015 via email

@JedWatson
Copy link
Member

@nkbt I've just released a new version, could you update the publish npm script (or add a publish:bower one) that automates this?

@nkbt
Copy link
Member

nkbt commented Aug 28, 2015

@JedWatson I'd wait a little bit more on this.

  1. I wrote an email to the holder of elemental package (repo is deleted already, so name is virtually unused) and waiting for his response.
  2. There is some awkward issue with elementalui It is not on bower.io, but bower info elementalui gives info about this repo. I unregistered it successfully and then registered to the elemental-dist repo. But this did not change the bower internal data.
  3. As temporary solution I registered elemental-dist package, which works okay.

If you think elemental-dist is good enough, then I'll stop for now on this, fix it's version and wrap it all up into an npm script.

@nkbt
Copy link
Member

nkbt commented Sep 28, 2015

Very sorry so much time passed :(. Little update: I'm pretty close.

I wrote some shell scripts and tested on multiple projects - all seems working fine. My next task is to port them to JS, so bower publishing is windows-compatible + more testing. That should not take much time. It is going to be a fairly simple CLI tool. If you are interested, see work in progress/join https://github.com/bower-registry/bower-registry

@topgun743
Copy link

I have downloaded and installed npm, webpack, browserify, bower, GIT onto my machine.
Now using any of these (webpack, browserify, bower) how can I output one single bundle.js file that includes all the src js code related to elemental plus also their dependencies whatsoever? Would be thankful if you give me the commands/script that I can execute on command line and get my output file.
Please consider me a novice. Thanks

@nkbt
Copy link
Member

nkbt commented Oct 20, 2015

@topgun743 the easiest way would be to clone the repo an run npm run build. Compiled JS an CSS will be in the ./dist folder.

@nkbt
Copy link
Member

nkbt commented Oct 20, 2015

so

git clone git@github.com:elementalui/elemental.git
cd elemental
npm install
npm run build

@nkbt
Copy link
Member

nkbt commented Oct 20, 2015

I created a PR #84 with bower auto-publish script

So now as soon as we publish on npm, we should run npm run publish:bower too.

Script is fairly simple, though I still want to make it cross-platform JS-only.

For now I could not figure out why elementaljs (already published) cannot be re-published. So working package is elemental-dist

I guess we need to update README with Bower instructions:

bower install elemental-dist

Version 0.5.3 is published

20151021-001453

@topgun743
Copy link

Did this

git clone git@github.com:elementalui/elemental.git
cd elemental
npm install
npm run build

Took following files from dist folder:
elemental.css
elemental.js

Added these two files to my HTML page header. Executed the page but still it is complaining something like "module classnames not loaded yet". I guess full js output (independent of any dependency) is still not coming.

@nkbt
Copy link
Member

nkbt commented Oct 20, 2015

That actually looks like a bug. Classnames is in dependencies and I believe it should be included into a build.

@topgun743
Copy link

Error: Module name "classnames" has not been loaded yet for context: _. Use require([])
http://requirejs.org/docs/errors.html#notloaded

@nkbt
Copy link
Member

nkbt commented Oct 20, 2015

@topgun743 can you open another issue for this one? Sort of Compiled dist version does not include classnames

jonathanwmaddison pushed a commit to jonathanwmaddison/elemental that referenced this issue Aug 15, 2017
Bower support, fixes elementalui#39

git-svn-id: https://github.com/elementalui/elemental.git@616 773dd515-ab26-cda1-e266-ce57b7db7bff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants