Create screenshot of react app when running the build script - node.js

I have recently picked up web development again after a few years and am currently learning React as well as other node functionalities.
I currently am working to revise my portfolio and was curious if there might be an existing method or practice so that when running the build command a screenshot of the app would be taken and saved to the build folder.
In essence I would like to automate the creation of screenshots for projects I'm currently working on or have worked on that would then be placed into the portfolio.
I imagine the process would be similar to the following
Write your source,
Build the app from script,
Once build has finished initiate the serve script
Take screenshot and save to build folder.
I'm aware I can do this manually with little to no effort but wanted to check for an automated solution.
Any suggestions or helpful comments are greatly welcomed, thank you in advance.

Related

What is the proper way to structure build scripts within a CRA React app?

I've built both Node.js servers, and React apps before, but I'm working on a project that requires some deployment scripting for the first time.
Specifically, I'd like to be able to have a script download a file locally and generate some json before my CRA React + Typescript build happens, in order to automate some functionality.
More generally though, I'm wondering what the best practice is for creating an arbitrary script (ideally in Typescript!) that can be run as a part of the build pipeline for a React app.
I assume this would be a node or node-ts script of some sort, but I can't figure out how to slot it into the project structure!
Bonus points if WebStorm will still be able to resolve any import/requires :)
Thanks!

How to prevent sgmf-scripts to scratch sensitive files?

Right now I’m developing a SFCC Commerce Cloud website.
Referring to SFRA recommendations, I’m using the sgmf-scripts command to create, compile and upload custom cartridges.
The problem is, each time I create a cartridge, sgmf-scripts is scratching sensitive files such as dw.json, package.json or webpack.config.js, which is pretty annoying.
Does anyone know how to avoid this behavior?
Thank you
If you are open to using Visual Studio Code, you can use this together with the Prophet Debugger. The Prophet Debugger would enable you to upload your code with each change to the Sandbox and attach VS Code to Sandbox for debugging - this takes away the need to configure multiple dw.json as Prophet Debugger reads the main dw.json
Find out more about Prophet Debugger: https://marketplace.visualstudio.com/items?itemName=SqrTT.prophet

after creating the xamarin-android in azure, how do I download the backend as well

While learning how to create Android-xamarin-azure application, I must have done steps from different tutorials. I've just created a new test application, and this picture shows what's the final screen.
This screen is showing that I've already have a connection string and a Todo table. I remember that before I was able to download a backend project. Now, I'm just being told that I've already a table, but I don't know how to download the backend project.
I'd like to download the backend project as well, so that I can start expending it.
Thanks for helping
Just follow this link. It shows how to download backend project
https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-dotnet-backend-how-to-use-server-sdk/#create-app

Cucumber JS and actually getting something done

After being completely confused and googling tutorial after tutorial, reading books about cucumber that do not cover the JS implementation, I got over the fear of flames and decided to post my question here.
I have setup Cucumber-JS on my box, running fine. I use CoffeeScript, because I am lazy. I got my features folder, have my .feature written. Got my step definition and figured out that Cucumber JS requires a 'World' thingie to be anything near useful. I also discovered just moments ago, there can be some env.js tweaking to make this setup find the rest of my app.
I am not building a web based app, as I want some core logic to be worked out first. Where my trouble starts is the part how I am supposed to continue now.
I have a folder called 'lib' in the project root. Inside it, it is going to have my JS app, which I will eventually be running through NodeJS.
What changes do I have to make to env.js, world.coffee and mystep definition to be able to test my code I am developing in lib/myapp.coffee?
Thank you!
Eventually, I found out this is no Cucumber thing. It has to do with NodeJS and the way it handles modules. I eventually ended here:
http://www.sitepoint.com/understanding-module-exports-exports-node-js/

How to steal build an app of two html files with shared dependencies in JavascriptMVC

I have an application with two html files:
app/page1.html
app/page2.html
These pages share dependencies, i.e -jquery / plugins and I want to use the "steal build" script to build them efficiently.
I found some examples and questions that describe this issue and give examples on multiple apps, but didn't give a solution for this problem.
But when I try to build with this line for example I'm getting errors:
js steal/buildjs app/page1.html app/page2.html -to app
Anyone had experience with this scenario?
Thanks,
Shai
A good soul (asavoy) created a pull request that deals with this issue, apparently it was a bug in the new version:
https://github.com/jupiterjs/steal/pull/83
I'll post an update once I'll test it out myself.

Resources