What folders should be git ignored in React Native project? - reactjs

I'm playing with Facebook/React Native, and when I run git init, I have no idea what should be ignored expect node_modules folder,
Should I commit all iOS folder?
Thanks

React Native CLI creates a .gitignore file when you start a new project:
react-native init <ProjectName>
It covers all the basics that should/can be ignored.
Source: https://github.com/facebook/react-native/blob/master/template/_gitignore

gitignore.io suggests the following .gitignore file for react-native:
Created by https://www.gitignore.io/api/reactnative
### ReactNative ###
# React Native Stack Base
### ReactNative.Xcode Stack ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
### ReactNative.Node Stack ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
### ReactNative.Buck Stack ###
buck-out/
.buckconfig.local
.buckd/
.buckversion
.fakebuckversion
### ReactNative.macOS Stack ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### ReactNative.Gradle Stack ###
.gradle
**/build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar
# Cache of project
.gradletasknamecache
# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
### ReactNative.Android Stack ###
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
# Generated files
bin/
gen/
out/
# Gradle files
.gradle/
# Local configuration file (sdk path, etc)
local.properties
# Proguard folder generated by Eclipse
proguard/
# Log Files
# Android Studio Navigation editor temp files
.navigation/
# Android Studio captures folder
captures/
# Intellij
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/dictionaries
.idea/libraries
# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
# Freeline
freeline.py
freeline/
freeline_project_description.json
### ReactNative.Linux Stack ###
*~
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
# End of https://www.gitignore.io/api/reactnative

We suggest this .gitignore: react-native/Examples/SampleApp/.gitignore.
It ignores both user-specific Xcode files and the node_modules dir.

This is a related question:What should Xcode 6 gitignore file include?
It can be divided into three categories:
IDE(Webstorm,Xcode) config
file,like:.idea/,ios/ProjectName.xcodeproj/xcuserdata
version control tools(git,svn) file, like: .git
other files,for example,.DS_Store is OSX dir config file
my answer is which have been inspected in practice:
### SVN template
.svn/
### Xcode template
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/vcs.xml
.idea/jsLibraryMappings.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
# Gradle:
.idea/gradle.xml
.idea/libraries
.idea
# Mongo Explorer plugin:
.idea/mongoSettings.xml
## File-based project format:
*.iws
## Plugin-specific files:
# IntelliJ
/out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### TortoiseGit template
# Project-level settings
/.tgitconfig
*.swp
# node_modules/,Xcode and Webstorm will spend lots of time for indexing this dir
node_modules/
# ios/Pods,
ios/Pods/
# OS X temporary files that should never be committed
.DS_Store
src/components/.DS_Store
# user personal info,for example debug info
ios/ProjectName.xcodeproj/project.xcworkspace/
ios/ProjectName.xcodeproj/xcuserdata
# Podfile versions
ios/Podfile.lock
# Created by .ignore support plugin (hsz.mobi)
Hope it helps you!

It's probably worth noting that react-native init <project-name> generates a .gitignore file for you. This will likely be up to date with React Native's current tooling and build outputs. So this should be a good starting point.
Using react-native-cli 1.0.0 and react-native 0.36.0 generated the following .gitignore file:
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IJ
#
*.iml
.idea
.gradle
local.properties
# node.js
#
node_modules/
npm-debug.log
# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore

If you look at the React Native examples:
https://github.com/facebook/react-native/tree/master/Examples
Each one has a directory with a contents similar to the iOS directory generated by react-native-cli. Looking further into the Xcode project file, it's referenced in there too, and look at the contents - there's things like the launch screen.
So yes, the iOS directory is needed.
Regarding node_modules, I suggest you look at this answer which provides more information:
https://stackoverflow.com/a/19416403/125680

Related

How to create a Makefile.txt for React app?

I am working on a take home project for a job interview where I have been tasked to create a react application with frontend and backend tests. They have instructed me that they will execute my code using "the make targets specified in Makefile(which they have provided. see later)". I have completed the application and test cases, however I am quite lost on this last step.
I understand that a makefile is used to execute essentially a script, but unsure of how to tell it to set up the application environment.
Here is a copy of the Makefile.txt
.PHONY: $(MAKECMDGOALS)
# `make setup` will be used after cloning or downloading to fulfill
# dependencies, and setup the the project in an initial state.
# This is where you might download rubygems, node_modules, packages,
# compile code, build container images, initialize a database,
# anything else that needs to happen before your server is started
# for the first time
setup:
# `make server` will be used after `make setup` in order to start
# an http server process that listens on any unreserved port
# of your choice (e.g. 8080).
server:
# `make test` will be used after `make setup` in order to run
# your test suite.
test:
Any help, understanding or clarification is appreciated.
I think it is about scripts that you have in package.json file - link, they probably want to have something like make setup script and all others that will run specific functionality for example if they type make test in terminal it will start running tests like npm test

Your app is not on your GOPATH - deploying to app Engine go1.12

i have an problem with appengine and go112.
i can´t deploy without an error to the cloud:
2019/09/04 14:36:10 Copying /workspace/_gopath/src/mysql to /tmp/staging/srv/gopath/src/mysql
2019/09/04 14:36:10 Your app is not on your GOPATH, this build may fail.
2019/09/04 14:36:10 Building from Go source in /tmp/staging/srv, with main package at ./...
2019/09/04 14:36:10 Building /tmp/staging/srv, saving to /tmp/staging/usr/local/bin/start
2019/09/04 14:36:11 Wrote build output to /builder/outputs/output
2019/09/04 14:36:11 Failed to build app: Your app is not on your GOPATH, please move it there and try again.
building app with command '[go build -o /tmp/staging/usr/local/bin/start ./...]', env '[PATH=/go/bin:/usr/local/go/bin:/builder/google-cloud-sdk/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin HOSTNAME=89fd1b631b04 HOME=/builder/home BUILDER_OUTPUT=/builder/outputs DEBIAN_FRONTEND=noninteractive GOROOT=/usr/local/go/ GOPATH=/go GOPATH=/tmp/staging/srv/gopath]': err=exit status 1, out=go build: cannot use -o with multiple packages.
PS C:\gopath\projects\gp-sql>
My project is under the gopath and i tried serveral modifications of it.
output of "go env"
set GOPATH=C:\gopath
set GOROOT=C:\golang
Anybody an idea what i´m missing?
Your project folder should be in "\src", not "\projects".
For standard Go setups, whatever your basic GOPATH environment variable points to, inside that folder should be a structure like:
bin/
# command executables
src/
github.com/golang/example/
.git/ # Git repository metadata
hello/
hello.go # command source
myproject1/
main.go # command source
main_test.go # test source
app.yaml # google cloud configuration
myproject2/
beepboop.go # command source
stringutil/
reverse.go # package source
reverse_test.go # test source
golang.org/x/image/
.git/ # Git repository metadata
bmp/
reader.go # package source
writer.go # package source
... (many more repositories and packages omitted) ...
This is a documented difference in the new version of go. Following this documentation should do the trick
If this doesn't work for you try creating a new GPATH folder, modify the Env Variable to make this folder you new gopath and put your application in the root of that folder.

What to include in gitignore in an EPiServer project

Tried http://www.gitignore.io/api/episerver but it only gives me the following:
# Created by http://www.gitignore.io
### EPiServer ###
######################
## EPiServer Files
######################
*License.config
Is there some community maintained .gitignore someplace on the interwebs one could use or what do you have in your projects?
I personally have the following ignored:
App_Data/Index
App_Data/blobs
modulesbin
License.config

Sencha Cmd broken: Why does 'app build' ignore any command line parameters?

I've upgraded Sencha cmd to v4 and I used to be able to build to a specific archive path and destination path. This was crucial as the build server removes the source code folder and archive path for each build. I had the paths output on the IIS server away from the build server, so that they are never lost.
However, my build process is failing now as the path parameters supplied to the sencha cmd don't do anything.
If I type:
Sencha help app build
I get the following help:
Syntax
sencha app build [options] [environment] \
[destination] \
[archive]
But supplying these parameters has no effect to the location of the output.
Can anyone point me to the documentation which shows if this has changed and how I rectify it. I can't find anything on the their site which shows how to build for production and have it output to separate paths. Also I'd like to know why the Sencha Tools change so much. This wreaks havoc on any existing build systems because things suddenly stop working.
See below:
C:\Development\Projects\IEApp>sencha app build --archive C:\temp\build\IEApp\bui
ldarchive --destination C:\temp\build\IEApp\Destination --environment production
Everything builds ok, but the C:\temp\build folder is empty.
I can not tell you where the doc is, but to get CMD to build to a different directory, this is what I do:
modify the file: .sencha\app\production.properties as follows:
# =============================================================================
# This file provides an override point for default variables defined in
# production.defaults.properties. These properties are only imported when building
# for the "production" environment.
#
# Properties defined in this file take priority over build.properties but are
# only loaded for "production" builds.
# =============================================================================
build.dir=${app.dir}/../../ExtJSApps/dashboard

Google AppEngine error: "No module named flask"

I'm following the directions provided by WebPutty's github page to put my own fork of WebPutty up on GAE. It runs fine locally. I wasn't able to run "fab deploy" successfully (got error "no module named appengine.api"), so instead tried to put it up on GAE by just doing appcfg.py update. Unfortunately, this gives me the following error when I access the URL: "No module named flask".
Would love any insight/assistance as to how to resolve.
I don't know if you already did this, but to work with GAE and python you need have the dependent packages inside your project, as Flask, Werkzeug, Jinja2 and SimpleJson.
Here there is the script I use on my project:
# set the path of your project
PATH_PROJECT=~/Development/python/projects/scheduler-i-sweated-yesterday
cd ~/Downloads
#
# Installing Flask: https://github.com/mitsuhiko/flask/tags
#
wget https://github.com/mitsuhiko/flask/archive/0.9.zip
unzip 0.9.zip
mv flask-0.9/flask $PATH_PROJECT/flask
#
# Installing Werkzeug: https://github.com/mitsuhiko/werkzeug/tags
#
wget https://github.com/mitsuhiko/werkzeug/archive/0.8.3.zip
unzip 0.8.3.zip
mv werkzeug-0.8.3/werkzeug $PATH_PROJECT/werkzeug
#
# Installing Jinja2: https://github.com/mitsuhiko/jinja2/tags
#
wget https://github.com/mitsuhiko/jinja2/archive/2.6.zip
unzip 2.6.zip
mv jinja2-2.6/jinja2 $PATH_PROJECT/jinja2
#
# Installing SimpleJson: https://github.com/simplejson/simplejson/tags
#
wget https://github.com/simplejson/simplejson/archive/v3.0.5.zip
unzip v3.0.5.zip
mv simplejson-3.0.5/simplejson $PATH_PROJECT/simplejson
Save as install_packages_dependencies.sh and after that run in the shell:
bash install_packages_dependencies.sh
I had this exact same problem. I'm on Mac OS X Lion. I fixed the problem by moving the GoogleAppEngineLauncher.app from my desktop to the application directory. fabfile.py looks for the app there. After I moved the app to where fabfile.py was looking for it, I ran "fab deploy" and everything worked perfectly. I hope this helps.

Resources