What code do I need to enter to make expo project function? - github

I am not a developer, but I had an app built a couple months ago. The developer we had won't help us at all anymore (not sure why).
Please excuse me if I don't use proper terms.
So the project was done on Expo. I no longer have access to the original expo project, but I have all the code he wrote in a Github repository.
Is is possible to take the code from Github and paste it into Expo XDE and possibly reproduce the app on Expo? (Or Does that sound possible?)
Please let me know.

Yes, you could do this. It is important, that you copy all project files from the GitHub repository into your new Expo project. Don't forget to download all necessary libraries into your new Expo project, e.g. via npm install.

I'm a complete react native noob, I've been doing this, and I love it:
Develop prototype on https://snack.expo.io
Here I can develop and test on the browser, test on my phones, and on emulators. It's great.
When I'm ready to build, I download the code package from the Snack IDE
This downloads a zip file with everything except Expo and imported libraries.
I unzip and go into the folder with my terminal and install the libraries.
Inside the folder, I run these commands to install Expo and the regular libraries:
$ npm install expo # install expo
$ npm install # install a bunch of required libraries
# Then I run these two lines until my project builds
$ npm run web # try to run - it will tell me which libraries to install, one by one
$ npm install <library> # install each library
Eventually I'll move to using command-line only, but this is both a no-brainer for a noob like me and it's like training wheels for me to learn npm and expo.

Related

Programming in Swift on Linux

I would like to prepare the environment for working with Swift on Ubuntu 16.04.
I installed Swift and Atom editor.
I installed the Script package, which allows me to run code from the Atom editor.
Generally it is nice when I compile and run one file (Ctrl+Shift+B shortcut).
The problem is when I would like to build a project composed of several files.
Classes defined in the other files (not the one I compile) are not visible (compilation error).
Is it possible to configure the editor to compile and run the entire project?
How to import external library, eg ObjectMapper ?
You can use the Atom package build. It allows you to create custom build commands and such by using common build providers. You can build with a Makefile or JSON or CSON or YAML or even Javascript. It provides enough flexibility that you can build just about anything. Just make your build file so that it points to all the files to build with the right compiler (probably swiftc in your case). With a Javascript build file, you can even specify a command to run before and after the build, say, to run your newly built program.
There's a great open source project I have been watching called Marathon. It's a package manager and they have been Working on a deployment on linux. I'm not sure how much success they have had, but you can follow along here and maybe help out.
https://github.com/JohnSundell/Marathon/issues/37
Edit: It looks like it does work on linux!
git clone https://github.com/JohnSundell/Marathon.git
$ cd Marathon
$ swift build -c release
$ cp -f .build/release/Marathon /usr/local/bin/marathon
For dependencies, you should use Swift Package Manager.
You can check how Vapor is built - it is prepared for build apps for Ubuntu too.
Also, Vapor toolbox would help you with other projects
https://docs.vapor.codes/2.0/getting-started/install-on-ubuntu/
You can build a Swift project using VS Code + Swift Development Environment extension
If steps on the link above are not clear enough, I've put more details in a blog post

Component-preload.js generation

We are about to close a SAPUI5 application, one of the last steps is to make a Component-Preload.js file to improve performance. I read different guides around the web, all of them need Node.js that I have installed. I'm not expert about that package and I can't figure how to make one of that guides work. I'm developing with NetBeans. As far as I see there is not an official tool (am I right?) to generate that file. Can someone with more experience than me suggest a working, well-explained guide to perform that task?
I don't know if this could help, that's my working tree:
There are several main ways of doing it.
You can use SAP Web IDE to generate it. This assumes that you are using WebIDE to develop your application (which is not true based on your question). The regular version of WebIDE generates this file during the "client build" just before application deployment.
The "multi cloud" version of WebIDE can use a grunt build to do it. You can find more info here if you are interested: https://www.sap.com/developer/tutorials/webide-grunt-basic.html.
Use the new UI5 command line tools (https://npmjs.com/package/#ui5/cli):
Run npm i -g #ui5/cli to install the tools globally.
Open the root of your project with your terminal.
Run ui5 build preload to build the preload.
Use the #sap/grunt-sapui5-bestpractice-build pre-configured grunt tasks. The downside is that they are more-or-less black boxes which do not allow that much customisation. You can find an example setup on SAP's GitHub repository jenkins-pipelines. In a nutshell:
You need to define an .npmrc file which adds the #sap npm registry: #sap:registry=https://npm.sap.com.
Run a npm init command such that you generate a package.json file. This file describes your application and your dependencies (runtime dependencies and dev dependencies; you will only have dev dependencies for now, as you just want to build your app). Make sure to mark the package as private. See the npm docu (at the end of the license chapter).
Then you can install grunt and the build configuration: npm i grunt -D and npm i #sap/grunt-sapui5-bestpractice-build -D.
Lastly you need to define a simple Gruntfile (you can then run the build by just running grunt):
module.exports = function (grunt) {
'use strict';
grunt.loadNpmTasks('#sap/grunt-sapui5-bestpractice-build');
grunt.registerTask('default', [
'lint',
'clean',
'build'
]);
};
You can use the official grunt_openui5 plugin to generate the preload file(s). In order to be able to do this, you need to have node installed:
Create a package.json (e.g. through npm init).
Install grunt by writting in the console: npm install grunt-cli --save-dev.
Install the official openui5 grunt plugin: npm install grunt-openui5 --save-dev.
Now you have all the tools necessary, you just need to tell grunt what it has to do. You should create a Gruntfile.js in the root of your project. In this file you should configure the grunt openui5 task as described in the official github page (I linked it above). You can find a similar file here (it has more build steps like minification and copying the result files in a separate directory).
You can then run the grunt build by simply running grunt <task_name> in the console. If you registered your build task as the grunt default task (like in the sample file: grunt.registerTask('default', [...]);) then you just have to write grunt.
I think you should be able to integrate such a command line script (i.e. to run grunt) inside your IDE as an external tool.
You can use the unofficial gulp-openui5 tool to generate it. I would not recommend this if you are not already using gulp for your builds (as it is not a tool built by SAP). The procedure is the same, but using gulp for building the app instead of grunt (so you need to install node, npm init, install gulp, create the Gulpfile, etc).
Note that for most of the above methods, you need nodejs, which you can download and install from here: https://nodejs.org/en/download/.

Does the self-contained version of fastlane support dev builds?

When using the version of fastlane installed from Homebrew, I don't know how to use a development build of a plugin. I see fastlane add_plugin still generates a Pluginfile. If I try adding gem "fastlane-plugin-xxx", git: "https://github.com/yyy/xxx" or something similar using a :path argument, it always tries to install the version from RubyGems.
I have two specific cases where this makes things inconvenient:
I'm building a new plugin for a client. I want mobile devs to review it internally before it is published.
A user reported an error from a published plugin. I want them to try a dev version from the master branch in order to get more information.
In both cases, I think it's necessary to use Ruby and the Bundler. Not everyone has lots of Ruby experience, so getting someone set up can be an obstacle.
Edited 2017-07-06:
Part of the answer is obvious. When you run fastlane add_plugin, it prompts you if it cannot find the gem:
[jdee#Jimmy-Dees-MacBookPro TestApp]$ fastlane add_plugin my_new_action
[10:46:28]: Seems like the plugin is not available on RubyGems, what do you want to do?
1. Git URL
2. Local Path
3. RubyGems.org ('fastlane-plugin-my_new_action' seems to not be available there)
?
This works well with the fastlane gem, e.g. with RVM:
gem install fastlane
fastlane add_plugin my_new_action
The self-contained binary from Homebrew also prompts you for a Git URL or a local path, but I consistently get build failures from native extensions in the json gem on OS X Sierra. This may be due to plugin dependencies, but I'm not sure. This can still be a little awkward for the use cases above, and I'm surprised that this fails with the self-contained version, which I'd expect to be more robust than using Ruby. At least this removes the need for bundle install and bundle exec.
The answer here is basically that the self-contained version of Fastlane does not really work with plugins. In particular, when fastlane add_plugin or fastlane install_plugins runs bundle install, it tries to install the json gem, a dependency of the fastlane gem, which has native dependencies, and it cannot find <stdio.h>, presumably because /usr/include is screened out in the self-contained bundle in order to insulate it from the system Ruby. After this, you can run bundle install and bundle exec yourself, but in general a Gemfile is required to work with Fastlane plugins. The CLI will even tell you to run bundle exec once you have a Gemfile.
When using the fastlane gem, fastlane add_plugin will usually work, but again you will have a Gemfile and want to run bundle exec fastlane afterward.
You can just modify your Pluginfile to use a path or a git repo and rerun bundle install. There's not a much easier way to do this at the moment.

How do I get debugging to work after building VS Code from source?

I built VS Code from source following the guide How to Contribute. It seems to build fine and launches in Electron.
Problem:
When I try to build vscode-samples, both with the included JavaScript and TypeScript versions (I ran npm install on each first), I'm not able to enter debug mode with F5. It says "Error: No extension installed for 'node' debugging."
Also...
I tried running and debugging an extension I had previously worked on for VS Code (I'm able to do this on the distribution available on http://code.visualstudio.com.
However, I'm getting a similar error:"No extension installed for 'extensionHost' debugging."
Any help would be greatly appreciated. Thanks!
The Dev build version that you are running does not include the node-debugger extension required for debugging node apps.
Lots of VSCode functionality are implemented as extensions, when the product is shipped those extensions are bundled into the released version.
if you need to run the node debugger extension within the build version, you need to add the extension to the OSS build extensions folder, to do that:
cd ~/.vscode-oss-dev/extensions/
git clone https://github.com/Microsoft/vscode-node-debug && cd vscode-node-debug
npm install && gulp build
This will pull the node extensions to dev build extension folder, then will build the extension. Next time you run, the dev build will load this extension, you will be able to do node debugging.

Why does Yeoman generator not work when installed through npm?

Code
GitHub version: https://github.com/trevordmiller/generator-code-deck
npm version: https://www.npmjs.org/package/generator-code-deck
Background
I have built a Yeoman generator which is working perfectly locally (using npm link after cloning the repo from GitHub). However, when I npm publish the generator to npm and install it via npm install -g generator-code-deck, running the generator throws no such file or directory and cannot find module errors:
These errors don't make sense to me, because 1. the files and folders are obviously there (as shown by the screenshot doodles) and 2. the generator is working via a symbolic link to the local repo; why should the npm package be any different?
I have been searching online to find an answer but I can't find anything. Does anyone know why these errors are happening when trying to install via npm, but not via a symbolic link? Does anyone know how to fix this so that I can release the official npm version of the Yeoman generator? Any help would be much appreciated!
Chances are you're not publishing all files to npm.
This can be caused by a .npmignore file or by the files key of your package.json.