Skip to content
This repository was archived by the owner on Mar 19, 2019. It is now read-only.

Commit e7fd1d6

Browse files
author
David Dooling
committed
Remove project_name parameter from generator
The project_name parameter no longer needs to be declared so it was removed from the generator created by AddTypeScriptGenerator. Minor cleanup. Closes #32
1 parent 7ecce68 commit e7fd1d6

File tree

4 files changed

+22
-15
lines changed

4 files changed

+22
-15
lines changed

.atomist/editors/HavePathExpressionEngine.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright © 2017 Atomist, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
import { EditProject } from '@atomist/rug/operations/ProjectEditor'
218
import { Project } from '@atomist/rug/model/Project'
319
import { PathExpression, PathExpressionEngine } from '@atomist/rug/tree/PathExpression'

.atomist/editors/TypeScriptGenerator.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
11
import { PopulateProject } from '@atomist/rug/operations/ProjectGenerator'
2-
import { Project } from '@atomist/rug/model/Core'
2+
import { Project } from '@atomist/rug/model/Project'
33
import { Pattern } from '@atomist/rug/operations/RugOperation'
44
import { Generator, Parameter, Tags } from '@atomist/rug/operations/Decorators'
55

66
@Generator("TypeScriptGenerator", "sample TypeScript generator used by AddTypeScriptGenerator")
77
@Tags("documentation")
88
class TypeScriptGenerator implements PopulateProject {
99

10-
// this is only necessary to avoid https://github.com/atomist/rug-resolver/issues/17
11-
@Parameter({
12-
displayName: "Project Name",
13-
description: "name of project to be created",
14-
pattern: Pattern.project_name,
15-
validInput: "a valid GitHub project name consisting of alphanumeric, ., -, and _ characters",
16-
minLength: 1,
17-
maxLength: 100
18-
})
19-
project_name: string;
20-
2110
populate(project: Project) {
22-
project.deleteFile(".atomist.yml");
11+
console.log(`Creating ${project.name()}`);
2312
}
2413
}
2514

.atomist/tests/TypeScriptGenerator.rt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
scenario TypeScriptGenerator should create a new project based on this archive
22

3-
let project_name = "my-project-name"
4-
53
given
64
Empty
75

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1717
- AddTypeScript and ConvertExistingProjectToGenerator no longer add
1818
the node_modules directory
1919

20+
- Generators no longer require the project_name parameter be
21+
declared so its was removed from the generator added by
22+
AddTypeScriptGenerator
23+
2024
### Removed
2125

2226
- UpdateRugVersion has been moved to rug-upgrade

0 commit comments

Comments
 (0)