Thanks for the information, very helpfull as always.
To sum up :-
Make sure you have everything installed at https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core#prerequirements
Ensure you follow ALL the steps in https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core (pay close attention to https://docs.aspnetzero.com/documents/zero/latest/Getting-Started-Core#configure-the-project)
Do NOT include the node_modules folder into GitHub (which is why I got the problem)
If are attempting to copy a project from one PC to another I would suggest getting a FULL copy of the project files. That way if you need to you can copy the missing files (in my case the files in node_modules) you can just replace them. (Which is what I ended up doing)
How do you convert the contents of a bundled and minified .js file to something I can read and edit ?
I found https://beautifier.io/ is that all I need to do or will that cause more problems ?
To reiterate the issue I have is NOT with any of the tools, it is with the fact that Visual Studio/GitHub doesn't keep a copy of the files in node_modules (and maybe some other files as far as I can tell), so when I downloaded a copy from GitHub it was missing some required files.
In my case I had to take a complete copy of my project home on a USB thumb drive and copy over the project on the other PC. Everything works fine after that.
I suspect removing some of the file entires from the bundle-config.json and the package-mapping-config.js might not be a good idea. Since some of the missing components would be needed to run the solution correctly.
Last night I downloaded my solution from GitHub and couldn't complete the npm run create-bundles action
[23:16:51] Error: File not found with singular glob: C:/DEVL/Proof of Concept/src/POCDemo.Web.Mvc/node_modules/ion-rangeslider/css/ion.rangeSlider.skinFlat.css (if this was purposeful, use allowEmpty
option)
Got back to work and of course the files in question are where it should be.
So GitHub misses some files which I have no problems with. Running yarn doesn't do anything as it thinks everything has already installed.
So apart from copying the solution from my PC and work and taking it home is there another way to get all the files back ?
I am actually the OP, I was using the company account and my boss set me up with my own login. Thanks for the starting keywords and code locations by the way maliming they were very helpful.
Anyway here is what I ended up doing. I am still learning so I think it would be smart to put up a potential solution in case someone else can benefit from this.
TenantManger.cs
.
private readonly TenantSeedDataBuilder _seedDataBuilder;
.
await _demoDataBuilder.BuildForAsync(tenant);
await _seedDataBuilder.BuildForAsync(tenant);
TenantSeedDataBuilder.cs
public class TenantSeedDataBuilder : CrazyCatLadyDemoServiceBase, ITransientDependency
{
private readonly IRepository<State, long> _stateRepository;
private State state;
public TenantSeedDataBuilder(
IRepository<State, long> stateRepository)
{
_stateRepository = stateRepository;
}
public async Task BuildForAsync(Tenant tenant)
{
using (CurrentUnitOfWork.SetTenantId(tenant.Id))
{
BuildForInternal(tenant);
await CurrentUnitOfWork.SaveChangesAsync();
}
}
private void BuildForInternal(Tenant tenant)
{
string[] stateArray = {"Queensland", "New South Wales", "Australian Capital Territory",
"Victoria", "Tasmania", "South Australia", "Western Australia",
"Northern Territory" };
foreach (string item in stateArray)
{
state = new State
{
TenantId = tenant.Id,
Name = item
};
_stateRepository.Insert(state);
}
}
}
So what this does is create some seed values for states everytime a Tenant is created. Any feedback would be welcome of course. :-)