Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion acl/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = yeoman.generators.Base.extend({
this.aclDef = {
property: answers.property,
accessType: answers.accessType,
principalType: 'ROLE', // TODO support all principal types
principalType: 'ROLE', // TODO(bajtos) support all principal types
principalId: answers.role,
permission: answers.permission
};
Expand Down
22 changes: 10 additions & 12 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,17 @@ module.exports = yeoman.generators.Base.extend({
});
},

injectProjectWriteFile: function() {
/* TODO inject `this.directory` to replace `ncp` in workspace
// Modify Project.writeFile use yeoman's write
var _projectWriteFile = Project.writeFile;
Project.writeFile = function(filepath, content, encoding, cb) {
this.write(filepath, content, { encoding: encoding });
cb();
injectWorkspaceCopyRecursive: function() {
var originalMethod = Workspace.copyRecursive;
Workspace.copyRecursive = function(src, dest, cb) {
this.directory(src, dest);
process.nextTick(cb);
}.bind(this);

// Restore Project.writeFile when done
// Restore the original method when done
this.on('end', function() {
Project.writeFile = _projectWriteFile;
Workspace.copyRecursive = originalMethod;
});
*/
},

initWorkspace: function() {
Expand All @@ -48,7 +45,7 @@ module.exports = yeoman.generators.Base.extend({
if (err) return done(err);
this.templates = list.map(function(t) {
return {
// TODO - workspace does not provide template details yet
// TODO(bajtos) - workspace does not provide template details yet
// name: util.format('%s (%s)', t.name, t.description),
// value: t.name
name: t,
Expand All @@ -73,7 +70,7 @@ module.exports = yeoman.generators.Base.extend({
default: name
},
/*
TODO: not all templates are projects, some of them are mere components
TODO(bajtos) not all templates are projects, some of them are components
The only functional project template is 'api-server' at the moment
{
name: 'template',
Expand All @@ -87,6 +84,7 @@ module.exports = yeoman.generators.Base.extend({

this.prompt(prompts, function(props) {
this.appname = props.appname;
// TODO(bajtos) see the TODO comment above
//this.template = props.template;
this.template = 'api-server';

Expand Down
17 changes: 2 additions & 15 deletions lib/actions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
var workspace = require('loopback-workspace');
var Workspace = workspace.models.Workspace;

var actions = exports;

Expand All @@ -22,22 +23,8 @@ actions.loadProject = function() {
this.projectDir = this.destinationRoot();
process.env.WORKSPACE_DIR = this.projectDir;

/* TODO - validate the project
var done = this.async();
Project.isValidProjectDir(this.projectDir, function(err, isValid, message) {
if (err) {
return done(err);
}

if (!isValid) {
var msg = util.format(
'The directory %s is not a valid LoopBack project. %s',
this.projectDir,
message);
return done(new Error(msg));
}
}.bind(this));
*/
Workspace.isValidDir(done);
};

/**
Expand Down
2 changes: 1 addition & 1 deletion test/acl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('loopback:acl generator', function() {
var carAcls = def.acls;

expect(carAcls).to.eql([{
id: 1, // TODO fix workspace to not add this extra property
id: 1, // TODO(bajtos) fix workspace to not add this extra property
accessType: '*',
permission: 'AUDIT',
principalType: 'ROLE',
Expand Down
4 changes: 2 additions & 2 deletions test/app.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ describe('loopback:app generator', function() {

'rest/datasources.json',
'rest/models.json',
// TODO rest/rest.js
'rest/rest.js',

'server/config.json',
// TODO server/server.js
'server/server.js',
];

var gen = givenAppGenerator();
Expand Down