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

prepare umd build before publish #108

Closed
wants to merge 1 commit into from
Closed

prepare umd build before publish #108

wants to merge 1 commit into from

Conversation

just-boris
Copy link
Contributor

  • added browserify build on prepublish hook
  • added example how to use UMD build
  • updated package.json to exclude unnecessary files from npm package (examples and test)

@just-boris
Copy link
Contributor Author

fixes #105

@@ -10,7 +10,11 @@
"test:browser": "standard && npm run deps && NODE_ENV=test zuul tests/browser/*",
"test:browser:local": "standard && npm run deps && NODE_ENV=test zuul --local 8080 -- tests/browser/*",
"test:cov": "npm run test:server:cov && npm run test:browser",
"test": "npm run test:server && npm run test:browser"
"test": "npm run test:server && npm run test:browser",
"start": "http-server",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon this script should best be scoped to examples/vanilla

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It uses files from dist directory. So we need to serve from project root.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A relative path can be passed as the first argument to http-server to determine the location served:

$ http-server ../../

@yoshuawuyts
Copy link
Member

Wooh, thanks! - Just left one comment; rest looks brilliant to me! ✨

@just-boris
Copy link
Contributor Author

just-boris commented Jul 3, 2016

I realised that it is possible to open the example, as any local html-file with file:// protocol.
No need to keep http-server at all

@yoshuawuyts
Copy link
Member

Could you remove the .gitkeep file?

@just-boris
Copy link
Contributor Author

just-boris commented Jul 3, 2016

@yoshuawuyts now we are writing output file using standard > operator.
.gitkeep is used to create this directory after git clone, because > fails if target directory doesn't exist.

Do you know any other solution how to automatically create the dist folder if it doesn't exist?

@yoshuawuyts
Copy link
Member

Gehe, unix tools to the rescue!

$ mkdir -p 'dist/'

@just-boris
Copy link
Contributor Author

Done.

Added this as first step of prepublish script.

@timwis
Copy link
Member

timwis commented Jul 4, 2016

This is awesome! One thing as a heads up: 3.0 separates choo.view into require('choo/html'), a separate file from index.js, so I imagine this script may need to be updated to publish both when that's ready.

@yoshuawuyts
Copy link
Member

@timwis ooh; good call hey

@yoshuawuyts yoshuawuyts mentioned this pull request Jul 6, 2016
@yoshuawuyts yoshuawuyts mentioned this pull request Jul 12, 2016
@yoshuawuyts
Copy link
Member

yoshuawuyts commented Jul 12, 2016

I've merged the commits into #159 and rebased onto master to resolve the merge conflicts. Heaps thanks! We should land this soonish, ready for 3.1

@just-boris
Copy link
Contributor Author

Good. Anyway I was glad to help you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants