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

Provide source files (allow npm install via git with a building step) #256

Closed
wants to merge 1 commit into from

Conversation

MoOx
Copy link
Contributor

@MoOx MoOx commented Nov 17, 2016

Without this change, if you use npm to install the repo (or a fork 😉) you get a folder with just a package.json, which sucks.

With this change, you get the source files too and allow to build yourself “dist” (using cd node_modules/react-native-web && npm install, build is in prepublish and prepublish is run in install with npm@2/3, with npm@4 you need to add npm run build)

Without this change, if you use npm to install the repo (or a fork 😉)
you get a folder with just a package.json, which sucks.

With this change, you get the source files too and allow to build
yourself “dist” (using `cd node_modules/react-native-web && npm
install`, build is in prepublish and prepublish is run in install with
npm@2/3, with npm@4 you need to add `npm run build`)
@MoOx
Copy link
Contributor Author

MoOx commented Nov 17, 2016

Tests fails because of react@15.4.0. See #255.

FYI, "npm run build" fail because of missing webpack.config.js, but at least you have the files transpiled. Alternatively, I guess we can consume the src files directly.

@RangerMauve
Copy link

Wouldn't this make the package size a lot larger? And couldn't people wanting to build from source just make use of the git repo?

@MoOx
Copy link
Contributor Author

MoOx commented Nov 17, 2016

Wouldn't this make the package size a lot larger?

Obviously yes, but just .js files, so not that much imo.

And couldn't people wanting to build from source just make use of the git repo?

It's not easy when you share your project with teammates (or I don't have an easy answer)

@necolas
Copy link
Owner

necolas commented Nov 17, 2016

Why do you need the source files?

@MoOx
Copy link
Contributor Author

MoOx commented Nov 17, 2016

npm install https://github.com/MoOx/react-native-web#react-15.4.0 works, but take in consideration the package.json "files" section, so it remove everything that is not "dist" (except LICENSE, package.json and README).

@necolas
Copy link
Owner

necolas commented Nov 23, 2016

I don't understand why you're trying to build the package in your project. If you're trying to use a subset of the modules, you can import them directly from 'dist' into a local module and alias that to react-native. For tree-shaking / es-next support I'm planning to include modules for that in the package at some point. Closing this for now.

@necolas necolas closed this Nov 23, 2016
@MoOx
Copy link
Contributor Author

MoOx commented Nov 25, 2016

If you want to use a fork (eg react 15.4 partial support - I don't use touchable), the easiest way is to install from git. But when installing from git, .npmignore is considered so you end up with an empty folder.

@MoOx MoOx deleted the allow-git-npm-install branch November 25, 2016 18:44
@MoOx MoOx restored the allow-git-npm-install branch November 25, 2016 18:44
@necolas
Copy link
Owner

necolas commented Nov 25, 2016

OK doesn't hurt to make that easier. Added in 945fff0

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.

None yet

3 participants