Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Build] Bower Overwrites Files [!] #1310

Closed
vikeri opened this issue Nov 28, 2014 · 15 comments
Closed

[Build] Bower Overwrites Files [!] #1310

vikeri opened this issue Nov 28, 2014 · 15 comments

Comments

@vikeri
Copy link

vikeri commented Nov 28, 2014

I use semantic as a bower component in my frontend source folder, thus locating it in bower_components

After upgrading to 1.0 I decided to modify a few things with the help of the site.variables file located in src/site/globals. I did this and successfully built my own semantic.css with gulp build.

Then when updating semantic to 1.0.1 with bower update it deleted my semantic.json, theme.less files along with the site folder. Not too happy with this. I can restore the files through git but for future updates of semantic I would like to know how my customization should be done so that it will not be overwritten.

@jlukic
Copy link
Member

jlukic commented Nov 28, 2014

I assumed bower wouldn't delete files that aren't in repository. Very lame.

Perhaps adding bower ignore values for paths that shouldn't be touched. i.e. src/site

I'll have to experiment with this when I get back from the holidays.

jlukic added a commit that referenced this issue Nov 28, 2014
@jlukic jlukic changed the title bower update overwrites src/theme.less and deletes folder src/site [Build] Bower Overwrites Files [!] Nov 29, 2014
@jenil
Copy link

jenil commented Dec 20, 2014

I too did an update and lost my customization :(
I think you should also add semantic.json to the bower.json ignore list.

@jlukic
Copy link
Member

jlukic commented Dec 20, 2014

See #1385 discussion consolidated there.

@jlukic jlukic closed this as completed Dec 20, 2014
@vikeri
Copy link
Author

vikeri commented Feb 6, 2015

So if this is closed, what is the proposed solution? I read the other thread but it only seemed to be a general discussion of best practices, not anyone offering a concrete way of solving this problem. I can change to npm instead of bower if the workflow would work there.

@jlukic
Copy link
Member

jlukic commented Feb 6, 2015

@vikeri The solution will launch early next week along with other changes to build tools, like importable gulp tasks, and first party meteor integration.

NPM will be the preferred install path. It will crawl for a semantic.json and either run update or install scripts.

You can take a peek at it the underlying code here if you're interested
https://github.com/Semantic-Org/Semantic-UI/tree/meteor/tasks

I still need to do some testing, but its nearly complete.

@vikeri
Copy link
Author

vikeri commented Feb 13, 2015

Great news! So are those task folders included in the newest npm package or how would I go about exactly to install and configure it?

@jlukic
Copy link
Member

jlukic commented Feb 13, 2015

I'm still debugging some edge cases. My big fear is releasing new build tools that prevent people from working with SUI immediately. Beyond this testing, and rewriting some admin tasks meteor branch is just about done.

See readme here: https://github.com/Semantic-Org/Semantic-UI/tree/meteor/src#setup

@jlukic
Copy link
Member

jlukic commented Feb 13, 2015

Moved everything into next, i want to review a few more things before pushing

@vikeri
Copy link
Author

vikeri commented Feb 16, 2015

Ok! Thanks for keeping us posted :)

@jlukic jlukic added this to the 1.9.0 milestone Feb 16, 2015
@jlukic
Copy link
Member

jlukic commented Feb 17, 2015

1.9.0 is now published. I encourage you to check it out.

@vikeri
Copy link
Author

vikeri commented Feb 18, 2015

Good stuff! Downloaded with npm and did the install. But I'm still not 100% sure of how the supposed install config should be, my hypothesis the following:

  1. I put the install in eg. lib-semantic
  2. I exclude that folder from my git-repo so that it can be updated without showing up in git.
  3. I specify that my site folder should be outside of lib-semantic, eg. ../src/semantic since those are files that I do want to monitor with git
  4. I add the semantic.json to git

My question is hence if this accomplishes these two objectives:

  1. I can update the semantic core files with npm update without it showing up in git
  2. When I update semantic my own edits to the theme are not overwritten

@vikeri
Copy link
Author

vikeri commented Feb 18, 2015

I now tried this setup with a fresh install and even though the installer finds my semantic.json it says it can't find the files in the lib-semantic folder (correct since that folder does not exist in the repo). Thereafter it ignores the values in semantic.json it and runs the standard installation prompts with the standard defaults.

Should this be a separate issue btw?

@jlukic
Copy link
Member

jlukic commented Feb 18, 2015

@vikeri Make sure the base in semantic.json points to wherever you plopped in the files relative to semantic.json, lib-semantic/ or whatever it is for your project. This is how it resolves the path to Semantic files.

It should be able to detect the files and update them instead of triggering install.

@vikeri
Copy link
Author

vikeri commented Feb 19, 2015

The base points to the correct folder, the issue is that the folder does not exists since I do not want it to be tracked by git. This since I got the impression that those files will be overwritten when I update Semantic UI. I do not want git to notice the upgrade of a package.

I had the impression that the only files I had to change to make my own theme were those in site, hence I would like to only version that specific folder. Ideally the other folders would update and install themselves when i do npm install.

{
  "base": "lib-semantic/", // In my .gitignore and thus would like the install to create it
  "paths": {
    "source": {
      "config": "src/theme.config", 
      "definitions": "src/definitions/",
      "site": "../src/site/", // In git since that is where I customize my own theme
      "themes": "src/themes/"
    },
    "output": {
      "packaged": "dist/",
      "uncompressed": "dist/components/",
      "compressed": "dist/components/",
      "themes": "dist/themes/"
    },
    "clean": "dist/"
  },
  "permission": false,
  "rtl": false,
  "version": "1.9.1"
}

@jlukic
Copy link
Member

jlukic commented Feb 19, 2015

The new build tools no longer have issues with overwrites, there's a manual upgrade script baked in for npm.

This will only update if the installed version is different than the version in semantic.json, and only update managed files like definitions and gulp tasks.
https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/install.js#L84

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants