Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

info about upgrading projects

  • Loading branch information...
commit 72ba3c4a011d24570f13c42184ccd40b9c215f48 1 parent c90ae2a
Chris Gross authored
Showing with 45 additions and 1 deletion.
  1. +42 −0 UPGRADING.md
  2. +3 −1 app/templates/skeleton/Gruntfile.js
View
42 UPGRADING.md
@@ -0,0 +1,42 @@
+Upgrading Projects from v2.x
+-------------
+
+The following guide will describe the steps needed to take a project generated using v2 of the generator and enable it for use with v3.
+
+The new v3 generator has moved some files, made small changes how script tags and @import statements are injected, and offers users the ability to create a completely custom directory structure. To convert a v2 project to v3, do the following:
+
+1. Rename and move `js/setup.js` to `app.js`. Modify the related script tag in `index.html`.
+2. Move `css/app.less` to `app.less`. Modify the related link tag in `index.html`.
+3. In `app.less`, modify the existing @import statements and remove the `../` from the beginning of the @import statements for all partial and directive less files.
+4. In `app.less`, combine the two comment-separated sections for partial and directive less into one section. Modify the bottom comment marker of this section to be `/* Add Component LESS Above */`.
+5. In `index.html`, combine the 4 comment-separated sections for component script tags (for partials, directives, services, filters) into one section. Modify the bottom comment marker of this section to be `<!-- Add New Component JS Above -->`.
+6. Overwrite your existing `Gruntfile.js` with the content from [Gruntfile.js](app/templates/skeleton/Gruntfile.js). Do a find and replace and search for `<%%=` and replace with `<%=`.
+7. Upgrade the `grunt-dom-munger` task by doing `npm install grunt-dom-munger@3.4 --save-dev`.
+8. Create a `.yo-rc.json` file in the project root with the following content:
+
+```js
+{
+ "generator-cg-angular": {
+ "uirouter": false,
+ "partialDirectory": "partial/",
+ "directiveDirectory": "directive/",
+ "serviceDirectory": "service/",
+ "filterDirectory": "filter/",
+ "inject": {
+ "js": {
+ "file": "index.html",
+ "marker": "<!-- Add New Component JS Above -->",
+ "template": "<script src=\"<%= filename %>\"></script>"
+ },
+ "less": {
+ "file": "app.less",
+ "marker": "/* Add Component LESS Above */",
+ "template": "@import \"<%= filename %>\";"
+ }
+ }
+ }
+}
+```
+
+Thats it.
+
View
4 app/templates/skeleton/Gruntfile.js
@@ -1,6 +1,8 @@
/*jslint node: true */
'use strict';
+var pkg = require('./package.json');
+
//Using exclusion patterns slows down Grunt significantly
//instead of creating a set of patterns like '**/*.js' and '!**/node_modules/**'
//this method is used to create a set of inclusive patterns for all subdirectories
@@ -80,7 +82,7 @@ module.exports = function (grunt) {
ngtemplates: {
main: {
options: {
- module:'<%= _.slugify(appname) %>',
+ module: pkg.name,
htmlmin:'<%%= htmlmin.main.options %>'
},
src: [createFolderGlobs('*.html'),'!index.html','!_SpecRunner.html'],
Please sign in to comment.
Something went wrong with that request. Please try again.