FountainJS / generator-fountain-angular1

Yeoman 'fountain' generator to start a webapp with Angular 1
http://fountainjs.io
MIT License
95 stars 34 forks source link

Fountain-Angular1 Gulp tasks add an extra /src/ directory during build, breaking local copy of the app #68

Closed msholly closed 7 years ago

msholly commented 7 years ago

Hi everyone,

Didn't see anyone on Slack so I'll open a issue here. I'm having a problem with Gulp-inject I believe. I just grabbed a brand new install of this generator, and during

npm run serve

The files get copied to .tmp as intended, but then another "src" directory is added before the app's code.

fountain-angular1/.tmp/src/index.html

instead of

fountain-angular1/.tmp/index.html

Upgrading and downgrading gulp versions appear to have no affect. Changing the gulp tasks, I can get one or two files in the correct directory, but the structure gets flattened. That issue is mostly my inexperience with gulp task writing, but out of the box the issue remains.

This issue is affecting an Angular app in active development as well as a brand new Yo. This leads me to believe some dependency got updated, and now needs a new "Base" attribute to SOME gulp task or pipe. Oddly, a prototype app from a few months ago builds just fine. Copy the whole project to another folder on my machine, install and build it - and the new "/src" issue appears. No changes to package.json.

Here's my .yo-rc.json as requested.

{
  "generator-fountain-angular1": {
    "version": "0.6.0",
    "props": {
      "resolved": "C:\\Users\\Mechau\\AppData\\Roaming\\npm\\node_modules\\generator-fountain-angular1\\generators\\app\\index.js",
      "namespace": "fountain-angular1:app",
      "argv": {
        "remain": [],
        "cooked": [],
        "original": []
      },
      "skip-cache": false,
      "skip-install": false,
      "framework": "angular1",
      "modules": "inject",
      "css": "scss",
      "js": "babel",
      "sample": "hello",
      "router": "uirouter"
    }
  }
}

Node,js v5.11.0 and win32 10.0.14393, yo version 1.8.5, npm version 3.10.9

Thanks everyone!

msholly commented 7 years ago

https://github.com/FountainJS/generator-fountain-webapp/issues/150

After struggling for longer than I care to admit - found the fix for the issue in the parent generator for this Yo. You must downgrade the glob-parent dependency of glob-stream from 3.0.1 to 3.0.0.

This should be solved here I suppose, but the parent generator team should release a fix since its broken on master.

ghost commented 7 years ago

Interesting. I was seeing a problem similar to this when doing a gulp build on a windows server. There was a src folder in the dist folder containing the assets folder, which it wasn't doing before. I wasn't too worried about it because we develop on macs and deploy to windows. Haven't seen this on my local dev machine, so we just changed the Windows build script to move the folders to where they should be. Looks like it could be related to this.

Swiip commented 7 years ago

I see in your yo-rc that you're using a 0.6 version which is very old, wan you re-test with 1.0.0-rc1?

nish-nair commented 7 years ago

I have the same issue... to reproduce this, create a project using ng1-webpack-es6-sass-fountain-landing-page . Then run the command "npm run build" . Checkout the dist folder. There is an src folder in the dist folder which breaks the relative paths. because of this unwanted src folder, techs.json file cannot be loaded and throws a 404 error. dist

msholly commented 7 years ago

@Swiip Since the bug was fixed by an older glob-parent version, I didn't test with your release candidate. I might have time tomorrow to do so.

Just in case someone else stumbles on this issue, here's the fix again: https://github.com/FountainJS/generator-fountain-webapp/issues/150

Chklang commented 7 years ago

This problem is resolved? I've created a project today and i've this problem : I've a folder dist/src/app/techs/techs.json

micaelmbagira commented 7 years ago

@Chklang This is the way it should be

Chklang commented 7 years ago

So why js try to load /app/techs/techs.json and not /src/app/techs/techs.json? I've a 404 in dist mode

micaelmbagira commented 7 years ago

This is a different issue, can you describe your problem and join your .yo-rc.json in a new issue ?

Chklang commented 7 years ago

Ok thanks :)