Skip to content

Commit 8d45fbd

Browse files
committed
Merge pull request #1277 from kingcody/chore/update-yeoman-generator
chore(gen): update yeoman-generator to `~0.20.3`
2 parents 4511e7c + 2c98c91 commit 8d45fbd

File tree

10 files changed

+14
-28
lines changed

10 files changed

+14
-28
lines changed

Diff for: app/generator.js

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default class Generator extends Base {
3030
return {
3131

3232
init: function () {
33-
this.pkg = require('../package.json');
3433
this.filters = {};
3534

3635
// init shared generator properies and methods

Diff for: app/templates/Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= pkg.name %> <%= pkg.version %>
1+
// Generated on <%= (new Date).toISOString().split('T')[0] %> using <%= rootGeneratorName() %> <%= rootGeneratorVersion() %>
22
'use strict';
33

44
module.exports = function (grunt) {

Diff for: app/templates/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <%= lodash.slugify(lodash.humanize(appname)) %>
22

3-
This project was generated with the [Angular Full-Stack Generator](https://github.com/DaftMonk/generator-angular-fullstack) version <%= pkg.version %>.
3+
This project was generated with the [Angular Full-Stack Generator](https://github.com/DaftMonk/generator-angular-fullstack) version <%= rootGeneratorVersion() %>.
44

55
## Getting Started
66

Diff for: app/templates/client/app/app(coffee).coffee

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
angular.module '<%= scriptAppName %>', [<%= angularModules %>]
3+
angular.module '<%= scriptAppName %>', [<%- angularModules %>]
44
<% if (filters.ngroute) { %>.config ($routeProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) ->
55
$routeProvider
66
.otherwise

Diff for: app/templates/client/app/app(js).js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
angular.module('<%= scriptAppName %>', [<%= angularModules %>])
3+
angular.module('<%= scriptAppName %>', [<%- angularModules %>])
44
<% if (filters.ngroute) { %>.config(function($routeProvider, $locationProvider<% if (filters.auth) { %>, $httpProvider<% } %>) {
55
$routeProvider
66
.otherwise({

Diff for: app/templates/client/components/footer/footer(html).html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="container">
2-
<p>Angular Fullstack v<%= pkg.version %> |
2+
<p>Angular Fullstack v<%= rootGeneratorVersion() %> |
33
<a href="https://twitter.com/tyhenkel">@tyhenkel</a> |
44
<a href="https://github.com/DaftMonk/generator-angular-fullstack/issues?state=open">Issues</a>
55
</p>

Diff for: app/templates/client/components/footer/footer(jade).jade

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.container
22
p
3-
| Angular Fullstack v<%= pkg.version %>
3+
| Angular Fullstack v<%= rootGeneratorVersion() %>
44
= ' | '
55
a(href='https://twitter.com/tyhenkel') @tyhenkel
66
= ' | '

Diff for: generator-base.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ export function genBase(self) {
1616
self.lodash = lodash;
1717
self.yoWelcome = yoWelcome;
1818

19-
try {
20-
self.appname = require(path.join(process.cwd(), 'bower.json')).name;
21-
} catch (e) {
22-
self.appname = self.name || path.basename(process.cwd());
23-
}
24-
self.appname = lodash.camelize(lodash.slugify(lodash.humanize(self.appname)));
19+
self.appname = lodash.camelize(lodash.slugify(
20+
lodash.humanize(self.determineAppname())
21+
));
2522
self.scriptAppName = self.appname + genUtils.appSuffix(self);
2623

2724
self.filters = self.filters || self.config.get('filters');

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"glob": "^5.0.14",
4141
"lodash": "^3.10.1",
4242
"underscore.string": "^3.1.1",
43-
"yeoman-generator": "~0.19.2",
43+
"yeoman-generator": "~0.20.3",
4444
"yeoman-welcome": "^1.0.1"
4545
},
4646
"devDependencies": {

Diff for: util.js

+4-14
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,9 @@ export function appSuffix(self) {
6868
return (typeof suffix === 'string') ? self.lodash.classify(suffix) : '';
6969
}
7070

71-
function destinationPath(self, filepath) {
72-
filepath = path.normalize(filepath);
73-
if (!path.isAbsolute(filepath)) {
74-
filepath = path.join(self.destinationRoot(), filepath);
75-
}
76-
77-
return filepath;
78-
}
79-
8071
export function relativeRequire(to, fr) {
81-
var self = this;
82-
fr = destinationPath(self, fr || self.filePath);
83-
to = destinationPath(self, to);
72+
fr = this.destinationPath(fr || this.filePath);
73+
to = this.destinationPath(to);
8474
return path.relative(path.dirname(fr), to)
8575
.replace(/\\/g, '/') // convert win32 separator to posix
8676
.replace(/^(?!\.\.)(.*)/, './$1') // prefix non parent path with ./
@@ -148,10 +138,10 @@ export function processDirectory(source, destination) {
148138

149139
if(templateIsUsable(self, filteredFile)) {
150140
if(copy) {
151-
self.copy(src, dest);
141+
self.fs.copy(src, dest);
152142
} else {
153143
self.filePath = dest;
154-
self.template(src, dest);
144+
self.fs.copyTpl(src, dest, self);
155145
delete self.filePath;
156146
}
157147
}

0 commit comments

Comments
 (0)