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

Commit e9ca710

Browse files
author
David Dooling
committed
Remove DSL, standardize naming
Remove DSL generating editors. Rewrite all remaining DSL editors in TypeScript. Move the AddBasicRugArchiveManifestYml editor from rug-archive to this project. Replace DSL predicates with TypeScript predicate-like functions (half the functions since we can negate!). General cleanup of names of of things. Removed the ConvertExistingProjectToRugArchiveWith* editors. There is now a ConvertExistingProjectToRugArchive editor. Once you run that you can run the AddTypeScript* editors to get what you want. Removed AddAtomistCopyrightToRug. It will be made more generic and moved to common-editors.
1 parent 116c022 commit e9ca710

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+956
-1135
lines changed

.atomist.yml

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ editor:
3333

3434
---
3535
kind: "operation"
36-
<<<<<<< Updated upstream
3736
client: "rug-cli 0.21.0-SNAPSHOT"
3837
executor:
3938
name: "UpdateRugVersion"
@@ -57,7 +56,9 @@ executor:
5756
repo: "n/a"
5857
branch: "n/a"
5958
sha: "n/a"
60-
=======
59+
60+
---
61+
kind: "operation"
6162
client: "rug-cli 0.20.0"
6263
editor:
6364
name: "atomist-rugs.rug-editors.AddRugEditor"
@@ -70,7 +71,6 @@ editor:
7071
sha: "17eefad*"
7172
parameters:
7273
- "editor_name": "AddTypescriptEditor"
73-
>>>>>>> Stashed changes
7474

7575
---
7676
kind: "operation"
@@ -119,3 +119,98 @@ editor:
119119
- "editor_name": "AddTypeScript"
120120
- "description": "adds TypeScript supporting files to a Rug archive project"
121121

122+
---
123+
kind: "operation"
124+
client: "rug-cli 0.24.0"
125+
editor:
126+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
127+
group: "atomist-rugs"
128+
artifact: "rug-editors"
129+
version: "0.11.0"
130+
origin:
131+
repo: "git@github.com:atomist-rugs/rug-editors.git"
132+
branch: "master"
133+
sha: "116c022*"
134+
parameters:
135+
- "editor_name": "ConvertExistingProjectToRugArchive"
136+
- "description": "add Rug archive files to an existing project"
137+
138+
---
139+
kind: "operation"
140+
client: "rug-cli 0.24.0"
141+
editor:
142+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
143+
group: "atomist-rugs"
144+
artifact: "rug-editors"
145+
version: "0.11.0"
146+
origin:
147+
repo: "git@github.com:atomist-rugs/rug-editors.git"
148+
branch: "master"
149+
sha: "116c022*"
150+
parameters:
151+
- "editor_name": "AddManifestYml"
152+
- "description": "add Rug archive manifest"
153+
---
154+
kind: "operation"
155+
client: "rug-cli 0.24.0"
156+
editor:
157+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
158+
group: "atomist-rugs"
159+
artifact: "rug-editors"
160+
version: "0.11.0"
161+
origin:
162+
repo: "git@github.com:atomist-rugs/rug-editors.git"
163+
branch: "master"
164+
sha: "116c022*"
165+
parameters:
166+
- "editor_name": "AddTypeScriptExecutor"
167+
- "description": "add TypeScript Rug executor to project"
168+
169+
---
170+
kind: "operation"
171+
client: "rug-cli 0.24.0"
172+
editor:
173+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
174+
group: "atomist-rugs"
175+
artifact: "rug-editors"
176+
version: "0.11.0"
177+
origin:
178+
repo: "git@github.com:atomist-rugs/rug-editors.git"
179+
branch: "master"
180+
sha: "116c022*"
181+
parameters:
182+
- "editor_name": "AddTypeScriptHandler"
183+
- "description": "add TypeScript Rug handler to project"
184+
185+
---
186+
kind: "operation"
187+
client: "rug-cli 0.24.0"
188+
editor:
189+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
190+
group: "atomist-rugs"
191+
artifact: "rug-editors"
192+
version: "0.11.0"
193+
origin:
194+
repo: "git@github.com:atomist-rugs/rug-editors.git"
195+
branch: "master"
196+
sha: "116c022*"
197+
parameters:
198+
- "editor_name": "AddTypeScriptEditor"
199+
- "description": "add TypeScript Rug editor to project"
200+
201+
---
202+
kind: "operation"
203+
client: "rug-cli 0.24.0"
204+
editor:
205+
name: "atomist-rugs.rug-editors.AddTypeScriptEditor"
206+
group: "atomist-rugs"
207+
artifact: "rug-editors"
208+
version: "0.11.0"
209+
origin:
210+
repo: "git@github.com:atomist-rugs/rug-editors.git"
211+
branch: "master"
212+
sha: "116c022*"
213+
parameters:
214+
- "editor_name": "UpdateRugVersion"
215+
- "description": "update Rug archive Rug dependency version"
216+

.atomist/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
target/
2-
node_modules
2+
node_modules/
33
*.js

.atomist/editors/AddAtomistCopyrightToRug.rug

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

.atomist/editors/AddManifestYml.ts

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
17+
import { EditProject } from '@atomist/rug/operations/ProjectEditor'
18+
import { Project } from '@atomist/rug/model/Project'
19+
import { File } from '@atomist/rug/model/File'
20+
import { Pattern } from '@atomist/rug/operations/RugOperation'
21+
import { Editor, Parameter, Tags } from '@atomist/rug/operations/Decorators'
22+
import { PathExpression, PathExpressionEngine } from '@atomist/rug/tree/PathExpression'
23+
24+
import { IsRugArchive } from './RugEditorsPredicates'
25+
26+
@Editor("AddManifestYml", "add Rug archive manifest")
27+
@Tags("rug", "atomist")
28+
class AddManifestYml implements EditProject {
29+
30+
@Parameter({
31+
displayName: "Rug Archive Name",
32+
description: "name of your new Rug Archive, typically the same as the repo name",
33+
pattern: Pattern.project_name,
34+
validInput: "a valid GitHub repo name containing only alphanumeric, ., -, and _ characters",
35+
minLength: 1,
36+
maxLength: 100
37+
})
38+
archive_name: string;
39+
40+
@Parameter({
41+
displayName: "Rug Archive Group ID",
42+
description: "Maven group identifier, often used to provide a namespace for your rugs, e.g., company-rugs, typically the GitHub owner",
43+
pattern: Pattern.group_id,
44+
validInput: "a valid Maven group ID, which starts with a letter, -, or _ and contains only alphanumeric, -, and _ characters and may having leading period separated identifiers starting with letters or underscores and containing only alphanumeric and _ characters",
45+
minLength: 1,
46+
maxLength: 100
47+
})
48+
group_id: string;
49+
50+
@Parameter({
51+
displayName: "Rug Archive Version",
52+
description: "initial version of the project, e.g., 1.2.3",
53+
pattern: Pattern.semantic_version,
54+
validInput: "a valid semantic version, http://semver.org",
55+
minLength: 1,
56+
maxLength: 100,
57+
required: false,
58+
})
59+
version: string = "0.1.0";
60+
61+
edit(project: Project) {
62+
if (IsRugArchive(project)) {
63+
return;
64+
}
65+
66+
const manifestPath = ".atomist/manifest.yml";
67+
project.copyEditorBackingFileOrFail(manifestPath);
68+
69+
let eng: PathExpressionEngine = project.context().pathExpressionEngine();
70+
71+
let manifestPE = new PathExpression<Project, File>("/*[@name='.atomist']/*[@name='manifest.yml']");
72+
let manifest: File = eng.scalar(project, manifestPE);
73+
manifest.regexpReplace("(?m)^group:.*", 'group: "' + this.group_id + '"');
74+
manifest.regexpReplace("(?m)^artifact:.*", 'artifact: "' + this.archive_name + '"');
75+
manifest.regexpReplace("(?m)^version:.*", 'version: "' + this.version + '"');
76+
manifest.regexpReplace("(?m)^dependencies:\s*\n(\s*-.*\n)*", "dependencies:\n");
77+
manifest.regexpReplace("(?m)^extensions:\s*\n(\s*-.*\n)*", "extensions:\n");
78+
manifest.regexpReplace("(?m)^repo:.*\n", "");
79+
manifest.regexpReplace("(?m)^branch:.*\n", "");
80+
manifest.regexpReplace("(?m)^sha:.*\n", "");
81+
manifest.regexpReplace("(?m)^---\n", "");
82+
manifest.regexpReplace("(?m)^\n", "");
83+
}
84+
}
85+
86+
export const addManifestYml = new AddManifestYml()

.atomist/editors/AddRugEditor.rug

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

.atomist/editors/AddRugExecutor.rug

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

0 commit comments

Comments
 (0)