Menu icon Foundation
Updating Foundation for Emails 2.2.1

Hey Guys, 

I want to update my version of Foundation to the new 2.2.1 release of foundation.  I'm curious with all my existing projects as to what the easiest process for doing that is? 

Should I just copy the package.json file from the source code and run an npm update? Or should I use foundation update? 

Any guidance / best practice would be appreciated. 

Sincerely,

Corey Schaaf

FFE2emailupdatingversions

Hey Guys, 

I want to update my version of Foundation to the new 2.2.1 release of foundation.  I'm curious with all my existing projects as to what the easiest process for doing that is? 

Should I just copy the package.json file from the source code and run an npm update? Or should I use foundation update? 

Any guidance / best practice would be appreciated. 

Sincerely,

Corey Schaaf

Rafi Benkual about 3 years ago

Hey Corey,

Foundation update should do it! It's based on the foundation-emails.template which already will have all the updates. If there were new variables added, you add them manually. 

You can see the changes here: https://github.com/zurb/foundation-emails-template/commit/14934dbb5777c439caa843052e2e210977fedd35

What would be awesome if to add this updating info into the docs - maybe here? Is that something you can help with?

Rafi Benkual about 3 years ago

I should mention that in the release notes there will be a 

Sass Settings Changes

section with these listed out.

Corey Schaaf about 3 years ago

@rafi I went about it (probably the most difficult way)

I deleted the node modules folder. I then copied the package.json file from here: 

https://github.com/zurb/foundation-emails

(note if you made any modifications or tweaks to items in the node modules folder you'll have to re-add them)

After copying the package.json file, I used command line and navigated to the root of my project folder.

I then ran the command npm install

this re-installed all components in the nodemodules folder based on the dependencies of the package.json file.

This left all my .scss in tact as well as all my variables and partials that I created.

The one thing you will need to update is the reference in the app.scss folder

the import statement for: 

@import 'foundation';  needs to change to 

@import 'foundation-emails';

This was done so there's no collisions with sites / emails projects.

 

Corey Schaaf about 3 years ago

@rai I tried to update one of my other projects using just 

foundation update

However, it says "nothing to update. you're good"

 

Rafi Benkual about 3 years ago

Ok, so there is one important step: 

Update package.json to point to 

"inky": "^1.3.6",

and 
  "dependencies": {
    "foundation-emails": "^2.2.1"
  },

 

Then foundation update

Rafi Benkual about 3 years ago

It probably didn't update Foundation-emails automatically because it's a point release and not a minor.

Corey Schaaf about 3 years ago

@rafi I have been unable to update my projects (even doing the above).  I was able to get a new project working, but updating an existing one is proving to be difficult. 

I went the same route as before: I deleted the nodemodules folder (as I've done in the past when running into problems).  I also copied the following into package.json file and then ran npm install inside my project directory.

{
  "name": "foundation-emails-template",
  "version": "1.0.0",
  "description": "Basic template for a Foundation for Emails project.",
  "repository": "zurb/foundation-emails-template",
  "main": "gulpfile.babel.js",
  "scripts": {
    "start": "gulp",
    "build": "gulp --production",
    "zip": "gulp zip --production",
    "litmus": "gulp litmus --production"
  },
  "author": "ZURB <foundation@zurb.com>",
  "license": "MIT",
  "dependencies": {
    "foundation-emails": "^2.2.1"
  },
  "devDependencies": {
    "babel-core": "^6.3.26",
    "babel-preset-es2015": "^6.3.13",
    "babel-register": "^6.7.2",
    "beepbeep": "^1.2.0",
    "browser-sync": "^2.11.0",
    "colors": "^1.1.2",
    "gulp": "git+https://github.com/gulpjs/gulp.git#4.0",
    "gulp-awspublish": "^3.0.1",
    "gulp-cli": "^1.1.0",
    "gulp-html-src": "^1.0.0",
    "gulp-htmlmin": "^1.1.1",
    "gulp-if": "^2.0.0",
    "gulp-imagemin": "^2.4.0",
    "gulp-inline-css": "^3.0.0",
    "gulp-litmus": "0.0.7",
    "gulp-load-plugins": "^1.1.0",
    "gulp-rename": "^1.2.2",
    "gulp-replace": "^0.5.4",
    "gulp-sass": "^2.1.0",
    "gulp-sourcemaps": "^1.6.0",
    "gulp-zip": "^3.2.0",
    "inky": "^1.3.6",
    "lazypipe": "^1.0.1",
    "merge-stream": "^1.0.0",
    "panini": "^1.3.0",
    "rimraf": "^2.3.3",
    "siphon-media-query": "^1.0.0",
    "yargs": "^4.1.0"
  },
  "babel": {
    "presets": ["es2015"]
  }
}

 

There were not errors during the installation and the nodemodules folder was re-installed. 

I ran foundation update just to be sure and it said everything was good. 

When I went to run the foundation build command: it through the following error again. It seems to be happening on the babel-registermodule.js:327  - can't find 'gulp-chmod'

Any help you can give would be appreciated. 

 

Rafi Benkual about 3 years ago

Here's how I updated our internal templates project:

1. Open the package.json file and make 2 updates:

Change Foundation for Emails dependency to latest version:

and Inky

Save the file.

2. Because the foundation-emails file name has changed, you will update the app.scss file with then new import name:

@import 'foundation-emails';

3. in the terminal, make sure you are in the project you are updating, run 

npm update

4. That's it! run 

npm start

Rafi Benkual about 3 years ago

@corey You might try deleting the node_modules folder and run npm i again. I tried with a few projects and could not replicate this error.

Corey Schaaf about 3 years ago

@rafi I was able to get the installation.  Turns out a dependency that we added (not part of the zurb stack) was causing the problem. I took package.json file from a new build and added our dependencies to it and then modified the gulpfile.babel.js to include those dependencies and everything seems to be working as it should. Sorry for the headache and appreciate the help in solving the problem. 

Jarryd Fillmore about 3 years ago

+1!

Corey Schaaf about 3 years ago

@rafi I submitted a patch for this issue:

https://github.com/zurb/foundation-emails/compare/develop...coreyschaaf:patch-1?expand=1