jedwatson / react-component-gulp-tasks Goto Github PK
View Code? Open in Web Editor NEWCommon Gulp tasks I use across my React Component projects
License: MIT License
Common Gulp tasks I use across my React Component projects
License: MIT License
From src/less
to dist/css
Also in example
Should be optional based on config rules
The requirement gulp-git uses require-dir 1.0
Since require-dir is broken with the new require from node 8 (this issue got fixed in require-dir 0.3.2) I get the following error:
node_modules/require-dir/index.js:93
if (!require.extensions.hasOwnProperty(ext)) {
^
TypeError: require.extensions.hasOwnProperty is not a function
at requireDir (node_modules/require-dir/index.js:93:37)
at Object.<anonymous> (node_modules/gulp-git/index.js:4:18)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (tasks/release.js:1:73)
If we update to gulp-git ^2.0.0 we would solve this problem, but I am not sure if this introduces other compatibility problems.
I might be having the same issue as closed issue #14 .
My component's example relies on react-images. The component itself does not. I have it listed in devDependencies. When i use it in my example app file it causes the js error 'Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render
method, or you have multiple copies of React loaded'
Need to update build tasks to use Babel 6
Might be nice to have server port configurable, instead of hard coded to 8000 like it is now in the tasks/dev.js file.
Right now I am having to change the actual file in my node_modules folder to a different number in order to get the Elemental UI dev server up.
browserify-shim incorrectly rewrites require('react') to (window.React).
in a new version of browserify-shim, it rewrites to this (which is still broken):
var React = (typeof window !== "undefined" ? window.React : typeof global !== "undefined" ? global.React : null);
This might not be a bug but by the design of browserify-shim. It should be mentioned in your docs that the output of react-components-gulp-tasks will not be A/UMD compatible.
I was able to successfully make a UMD build using webpack.
How do you include the these css files into component as dependencies?
For past couple days, I was trying to create a react component which based on couple of other react components as well, such as fix-data-table. I couldn't find a way to require css file into project. Am I missing anything here?
Thanks so much for the help.
I have my github account set up with SSH authentication, the key for which requires a passphrase be entered. When using the publish script, every git operation crashes the script without an opportunity to put in the ssh-key passphrase
The example building code doesn't take devDependencies
into account.
ie: If you add something to devDependencies
that's only needed for the examples and tests. Then require it from the examples. The build script will generate an app.js with a bunch of duplicate deps. This will include a second copy of React which will cause the examples to break.
This is important because React has been split into react
and react-dom
.
Both react-input-autosize
and react-select
do not require react-dom
in peerDeps as functions from there are not needed in the components. However the examples do require react-dom
to do things correctly and avoid deprecation warnings.
This means that for examples and tests we'll need to add react-dom
to the devDependencies
. But that will break the examples until this is fixed.
I just encountered this tool in a project I'm contributing to. I was surprised that gulp release
did not trigger a clean + build. Would you be open to a pull request to change this behavior?
https://github.com/JedWatson/react-component-gulp-tasks/blob/master/tasks/release.js
my current node version: 9.6.1
and npm version is : 5.6.0
this is react project using gulp. when i run this project with this command gulp dev
, it occurs the error like that:
> gulp dev
G:\KCY\react-heatmap\node_modules\react-component-gulp-tasks\node_modules\require-dir\index.js:93
if (!require.extensions.hasOwnProperty(ext)) {
^
TypeError: require.extensions.hasOwnProperty is not a function
at requireDir (G:\KCY\react-heatmap\node_modules\react-component-gulp-tasks\node_modules\require-dir\index.js:93:37)
at Object.<anonymous> (G:\KCY\react-heatmap\node_modules\react-component-gulp-tasks\node_modules\gulp-git\index.js:4:18)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Module.require (module.js:606:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (G:\KCY\react-heatmap\node_modules\react-component-gulp-tasks\tasks\release.js:1:73)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `gulp dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging
output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2018-06-02T02_09_32_952Z-debug.log
i am not sure why i got this error.
if you want, I can upload my package.json file.
npm install --save-dev react-component-build-tasks in README should be npm install --save-dev react-component-gulp-tasks.
:)
Need to support some way of duplicating static files during gh-pages
deployment to work around react-router + GitHub Pages limitations.
Should build a transpiled version to /lib
from /src
for use in node
Also means reactify
can be removed from dependencies for browserify - it and webpack won't need to apply any additional transformations.
SET NODE_ENV=production & gulp release
[16:36:17] Using gulpfile ~\Documents\Projects\example-project\gulpfile.js
[16:36:17] Starting 'publish:tag'...
[16:36:17] Starting 'publish:npm'...
[16:36:17] Starting 'build:example:files'...
[16:36:17] Starting 'build:example:css'...
[16:36:17] Starting 'build:example:scripts'...
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn npm ENOENT
at exports._errnoException (util.js:1026:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Moto\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "release"
npm ERR! node v6.9.1
npm ERR! npm v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! [email protected] release: SET NODE_ENV=production & gulp release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] release script 'SET NODE_ENV=production & gulp release'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the react-material-grid package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! SET NODE_ENV=production & gulp release
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-material-grid
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls react-material-grid
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Moto\Documents\Projects\example-project\npm-debug.log
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.