Skip to content

Commit 3788e5d

Browse files
author
minwe
committed
add static properties and events templates
1 parent 03bcfee commit 3788e5d

File tree

8 files changed

+1703
-83
lines changed

8 files changed

+1703
-83
lines changed

README.md

Lines changed: 501 additions & 35 deletions
Large diffs are not rendered by default.

gulpfile.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var docTpl = Handlebars.compile(fs.readFileSync('src/doc.hbs', 'utf8'));
1111
var readme = fs.readFileSync('README.md', 'utf8');
1212

1313
var templates = yaml.safeLoad(fs.readFileSync('src/template.yaml', 'utf8'));
14+
var eventsTpl = yaml.safeLoad(fs.readFileSync('src/envents.yaml', 'utf8'));
1415

1516
var processTpl = function(tpl) {
1617
tpl = JSON.stringify(tpl);
@@ -26,7 +27,7 @@ for (var k in templates) {
2627
if (templates.hasOwnProperty(k)) {
2728
var t = templates[k];
2829
var tpl = t.tpl.next || t.tpl;
29-
tpl = tpl.replace(/: function/g, '');
30+
tpl = tpl.replace(/: function/g, '').replace(/},/g, '}');
3031

3132
var snippet = {
3233
name: k,
@@ -55,6 +56,24 @@ for (var k in templates) {
5556
}
5657
}
5758

59+
function processEnventsTpl(eventsMap) {
60+
for (var key in eventsMap) {
61+
if (eventsMap.hasOwnProperty(key)) {
62+
var tplName = eventsMap[key];
63+
var tpl = `${key}={$END$}`;
64+
data.push({
65+
name: tplName,
66+
description: key,
67+
tpl: JSON.stringify(tpl),
68+
tplRaw: tpl
69+
});
70+
71+
}
72+
}
73+
}
74+
75+
processEnventsTpl(eventsTpl);
76+
5877
fs.writeFileSync('jetbrains/templates/ReactJS.xml', template(data));
5978
fs.writeFileSync('README.md', readme.replace(
6079
/(<!--DOC_START-->)[\s\S]*(<!--DOC_END-->)/g,

jetbrains-react.jar

1.11 KB
Binary file not shown.

jetbrains/installed.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)