Skip to content

Commit c987b28

Browse files
authored
fix(cli): remove copyright header from generated app (#991)
* fix(cli): remove copyright header from generated app use `.template` extension for templates. Rename during project generation. Removes copyright headers from templates. Fixes #944 * fixup! apply feedback - use RegExp for matching instead of extname
1 parent f13f603 commit c987b28

23 files changed

+51
-99
lines changed

packages/cli/generators/app/templates/index.js

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const application = (module.exports = require('./dist'));
2+
3+
if (require.main === module) {
4+
// Run the application
5+
application.main();
6+
}

packages/cli/generators/app/templates/src/application.ts renamed to packages/cli/generators/app/templates/src/application.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {ApplicationConfig} from '@loopback/core';
72
import {RestApplication, RestServer} from '@loopback/rest';
83
import {PingController} from './controllers/ping.controller';

packages/cli/generators/app/templates/src/controllers/ping.controller.ts renamed to packages/cli/generators/app/templates/src/controllers/ping.controller.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {ServerRequest} from '@loopback/rest';
72
import {get} from '@loopback/openapi-v2';
83
import {inject} from '@loopback/context';

packages/cli/generators/app/templates/src/index.ts renamed to packages/cli/generators/app/templates/src/index.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {<%= project.applicationName %>} from './application';
72
import {ApplicationConfig} from '@loopback/core';
83

packages/cli/generators/app/templates/src/sequence.ts renamed to packages/cli/generators/app/templates/src/sequence.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {Context, inject} from '@loopback/context';
72
import {
83
FindRoute,

packages/cli/generators/app/templates/test/ping.controller.test.ts renamed to packages/cli/generators/app/templates/test/ping.controller.test.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2017,2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {createClientForHandler, supertest} from '@loopback/testlab';
72
import {RestServer} from '@loopback/rest';
83
import {<%= project.applicationName %>} from '../';

packages/cli/generators/controller/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ module.exports = class ControllerGenerator extends ArtifactGenerator {
186186
debug(`Artifact filename set to: ${this.artifactInfo.filename}`);
187187
}
188188
// renames the file
189-
let template = 'controller-template.ts';
189+
let template = 'controller-template.ts.template';
190190
switch (this.artifactInfo.controllerType) {
191191
case ControllerGenerator.REST:
192-
template = 'controller-rest-template.ts';
192+
template = 'controller-rest-template.ts.template';
193193
break;
194194
default:
195195
break;

packages/cli/generators/controller/templates/src/controllers/controller-rest-template.ts renamed to packages/cli/generators/controller/templates/src/controllers/controller-rest-template.ts.template

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// Copyright IBM Corp. 2018. All Rights Reserved.
2-
// Node module: @loopback/cli
3-
// This file is licensed under the MIT License.
4-
// License text available at https://opensource.org/licenses/MIT
5-
61
import {Filter, Where} from '@loopback/repository';
72
import {post, param, get, put, patch, del} from '@loopback/openapi-v2';
83
import {inject} from '@loopback/context';

packages/cli/generators/controller/templates/src/controllers/controller-template.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)