fomantic-ui 2.9.1-beta.17 → 2.9.1-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +109 -0
- package/.github/workflows/ci.yml +13 -3
- package/dist/components/accordion.css +1 -1
- package/dist/components/accordion.js +569 -598
- package/dist/components/accordion.min.css +1 -1
- package/dist/components/accordion.min.js +2 -2
- package/dist/components/ad.css +1 -1
- package/dist/components/ad.min.css +1 -1
- package/dist/components/api.js +1161 -1184
- package/dist/components/api.min.js +2 -2
- package/dist/components/breadcrumb.css +1 -1
- package/dist/components/breadcrumb.min.css +1 -1
- package/dist/components/button.css +1 -1
- package/dist/components/button.min.css +1 -1
- package/dist/components/calendar.css +1 -1
- package/dist/components/calendar.js +1895 -1818
- package/dist/components/calendar.min.css +1 -1
- package/dist/components/calendar.min.js +2 -2
- package/dist/components/card.css +1 -1
- package/dist/components/card.min.css +1 -1
- package/dist/components/checkbox.css +1 -1
- package/dist/components/checkbox.js +842 -841
- package/dist/components/checkbox.min.css +1 -1
- package/dist/components/checkbox.min.js +2 -2
- package/dist/components/comment.css +1 -1
- package/dist/components/comment.min.css +1 -1
- package/dist/components/container.css +3 -1
- package/dist/components/container.min.css +2 -2
- package/dist/components/dimmer.css +1 -1
- package/dist/components/dimmer.js +708 -737
- package/dist/components/dimmer.min.css +1 -1
- package/dist/components/dimmer.min.js +2 -2
- package/dist/components/divider.css +1 -1
- package/dist/components/divider.min.css +1 -1
- package/dist/components/dropdown.css +11 -8
- package/dist/components/dropdown.js +4161 -4238
- package/dist/components/dropdown.min.css +2 -2
- package/dist/components/dropdown.min.js +2 -2
- package/dist/components/embed.css +1 -1
- package/dist/components/embed.js +651 -675
- package/dist/components/embed.min.css +1 -1
- package/dist/components/embed.min.js +2 -2
- package/dist/components/feed.css +1 -1
- package/dist/components/feed.min.css +1 -1
- package/dist/components/flag.css +1 -1
- package/dist/components/flag.min.css +1 -1
- package/dist/components/flyout.css +6 -3
- package/dist/components/flyout.js +1464 -1467
- package/dist/components/flyout.min.css +2 -2
- package/dist/components/flyout.min.js +2 -2
- package/dist/components/form.css +1 -1
- package/dist/components/form.js +1979 -2004
- package/dist/components/form.min.css +1 -1
- package/dist/components/form.min.js +2 -2
- package/dist/components/grid.css +1 -1
- package/dist/components/grid.min.css +1 -1
- package/dist/components/header.css +1 -1
- package/dist/components/header.min.css +1 -1
- package/dist/components/icon.css +1 -1
- package/dist/components/icon.min.css +1 -1
- package/dist/components/image.css +1 -1
- package/dist/components/image.min.css +1 -1
- package/dist/components/input.css +1 -1
- package/dist/components/input.min.css +1 -1
- package/dist/components/item.css +1 -1
- package/dist/components/item.min.css +1 -1
- package/dist/components/label.css +1 -1
- package/dist/components/label.min.css +1 -1
- package/dist/components/list.css +1 -1
- package/dist/components/list.min.css +1 -1
- package/dist/components/loader.css +1 -1
- package/dist/components/loader.min.css +1 -1
- package/dist/components/message.css +1 -1
- package/dist/components/message.min.css +1 -1
- package/dist/components/modal.css +7 -1
- package/dist/components/modal.js +1491 -1487
- package/dist/components/modal.min.css +2 -2
- package/dist/components/modal.min.js +2 -2
- package/dist/components/nag.css +1 -1
- package/dist/components/nag.js +518 -529
- package/dist/components/nag.min.css +1 -1
- package/dist/components/nag.min.js +2 -2
- package/dist/components/placeholder.css +1 -1
- package/dist/components/placeholder.min.css +1 -1
- package/dist/components/popup.css +1 -1
- package/dist/components/popup.js +1437 -1456
- package/dist/components/popup.min.css +1 -1
- package/dist/components/popup.min.js +2 -2
- package/dist/components/progress.css +1 -1
- package/dist/components/progress.js +969 -997
- package/dist/components/progress.min.css +1 -1
- package/dist/components/progress.min.js +2 -2
- package/dist/components/rail.css +1 -1
- package/dist/components/rail.min.css +1 -1
- package/dist/components/rating.css +1 -1
- package/dist/components/rating.js +505 -523
- package/dist/components/rating.min.css +1 -1
- package/dist/components/rating.min.js +2 -2
- package/dist/components/reset.css +1 -1
- package/dist/components/reset.min.css +1 -1
- package/dist/components/reveal.css +1 -1
- package/dist/components/reveal.min.css +1 -1
- package/dist/components/search.css +3 -1
- package/dist/components/search.js +1498 -1534
- package/dist/components/search.min.css +2 -2
- package/dist/components/search.min.js +2 -2
- package/dist/components/segment.css +3 -1
- package/dist/components/segment.min.css +2 -2
- package/dist/components/shape.css +1 -1
- package/dist/components/shape.js +792 -809
- package/dist/components/shape.min.css +1 -1
- package/dist/components/shape.min.js +2 -2
- package/dist/components/sidebar.css +3 -1
- package/dist/components/sidebar.js +1071 -1098
- package/dist/components/sidebar.min.css +2 -2
- package/dist/components/sidebar.min.js +2 -2
- package/dist/components/site.css +1 -1
- package/dist/components/site.js +462 -471
- package/dist/components/site.min.css +1 -1
- package/dist/components/site.min.js +2 -2
- package/dist/components/slider.js +1287 -1311
- package/dist/components/slider.min.js +2 -2
- package/dist/components/state.js +639 -657
- package/dist/components/state.min.js +2 -2
- package/dist/components/statistic.css +1 -1
- package/dist/components/statistic.min.css +1 -1
- package/dist/components/step.css +1 -1
- package/dist/components/step.min.css +1 -1
- package/dist/components/sticky.css +1 -1
- package/dist/components/sticky.js +857 -903
- package/dist/components/sticky.min.css +1 -1
- package/dist/components/sticky.min.js +2 -2
- package/dist/components/tab.css +1 -1
- package/dist/components/tab.js +922 -963
- package/dist/components/tab.min.css +1 -1
- package/dist/components/tab.min.js +2 -2
- package/dist/components/table.css +5 -1
- package/dist/components/table.min.css +2 -2
- package/dist/components/text.css +1 -1
- package/dist/components/text.min.css +1 -1
- package/dist/components/toast.css +1 -1
- package/dist/components/toast.js +886 -890
- package/dist/components/toast.min.css +1 -1
- package/dist/components/toast.min.js +2 -2
- package/dist/components/transition.css +1 -1
- package/dist/components/transition.js +1041 -1077
- package/dist/components/transition.min.css +1 -1
- package/dist/components/transition.min.js +2 -2
- package/dist/components/visibility.js +1220 -1244
- package/dist/components/visibility.min.js +2 -2
- package/dist/semantic.css +84 -60
- package/dist/semantic.js +28949 -29435
- package/dist/semantic.min.css +2 -2
- package/dist/semantic.min.js +2 -2
- package/examples/assets/show-examples.js +13 -13
- package/gulpfile.js +9 -10
- package/package.json +5 -2
- package/scripts/nightly-version.js +81 -75
- package/src/definitions/behaviors/api.js +1162 -1185
- package/src/definitions/behaviors/form.js +1978 -2003
- package/src/definitions/behaviors/state.js +645 -663
- package/src/definitions/behaviors/visibility.js +1219 -1243
- package/src/definitions/collections/table.less +2 -0
- package/src/definitions/elements/container.less +1 -0
- package/src/definitions/elements/segment.less +1 -0
- package/src/definitions/globals/site.js +461 -470
- package/src/definitions/modules/accordion.js +568 -597
- package/src/definitions/modules/calendar.js +1894 -1817
- package/src/definitions/modules/checkbox.js +841 -840
- package/src/definitions/modules/dimmer.js +707 -736
- package/src/definitions/modules/dropdown.js +4160 -4237
- package/src/definitions/modules/dropdown.less +5 -8
- package/src/definitions/modules/embed.js +650 -674
- package/src/definitions/modules/flyout.js +1463 -1466
- package/src/definitions/modules/flyout.less +15 -12
- package/src/definitions/modules/modal.js +1490 -1486
- package/src/definitions/modules/modal.less +3 -0
- package/src/definitions/modules/nag.js +517 -528
- package/src/definitions/modules/popup.js +1436 -1455
- package/src/definitions/modules/progress.js +968 -996
- package/src/definitions/modules/rating.js +504 -522
- package/src/definitions/modules/search.js +1497 -1533
- package/src/definitions/modules/search.less +1 -0
- package/src/definitions/modules/shape.js +791 -808
- package/src/definitions/modules/sidebar.js +1070 -1097
- package/src/definitions/modules/sidebar.less +1 -0
- package/src/definitions/modules/slider.js +1286 -1310
- package/src/definitions/modules/sticky.js +873 -919
- package/src/definitions/modules/tab.js +921 -962
- package/src/definitions/modules/toast.js +885 -889
- package/src/definitions/modules/transition.js +1040 -1076
- package/src/themes/default/elements/container.variables +0 -7
- package/src/themes/default/elements/segment.variables +0 -7
- package/src/themes/default/globals/site.variables +7 -0
- package/src/themes/default/globals/variation.variables +1 -0
- package/tasks/admin/components/create.js +274 -276
- package/tasks/admin/components/init.js +123 -130
- package/tasks/admin/components/update.js +149 -157
- package/tasks/admin/distributions/create.js +184 -187
- package/tasks/admin/distributions/init.js +123 -130
- package/tasks/admin/distributions/update.js +145 -152
- package/tasks/admin/publish.js +5 -7
- package/tasks/admin/register.js +36 -38
- package/tasks/admin/release.js +8 -10
- package/tasks/build/assets.js +42 -39
- package/tasks/build/css.js +225 -216
- package/tasks/build/javascript.js +118 -113
- package/tasks/build.js +10 -10
- package/tasks/check-install.js +14 -16
- package/tasks/clean.js +5 -5
- package/tasks/collections/admin.js +34 -36
- package/tasks/collections/build.js +18 -20
- package/tasks/collections/docs.js +9 -11
- package/tasks/collections/install.js +9 -11
- package/tasks/collections/rtl.js +9 -11
- package/tasks/collections/various.js +8 -10
- package/tasks/config/admin/github.js +17 -17
- package/tasks/config/admin/oauth.example.js +4 -4
- package/tasks/config/admin/release.js +98 -98
- package/tasks/config/admin/templates/component-package.js +9 -10
- package/tasks/config/admin/templates/css-package.js +18 -20
- package/tasks/config/admin/templates/less-package.js +11 -13
- package/tasks/config/defaults.js +116 -116
- package/tasks/config/docs.js +23 -23
- package/tasks/config/npm/gulpfile.js +8 -9
- package/tasks/config/project/config.js +127 -134
- package/tasks/config/project/install.js +715 -713
- package/tasks/config/project/release.js +32 -38
- package/tasks/config/tasks.js +163 -164
- package/tasks/config/user.js +23 -29
- package/tasks/docs/build.js +97 -95
- package/tasks/docs/metadata.js +90 -96
- package/tasks/docs/serve.js +80 -81
- package/tasks/install.js +370 -378
- package/tasks/rtl/build.js +2 -2
- package/tasks/rtl/watch.js +2 -2
- package/tasks/version.js +4 -4
- package/tasks/watch.js +28 -30
- package/test/meteor/assets.js +10 -13
- package/test/meteor/fonts.js +12 -13
- package/test/modules/accordion.spec.js +6 -8
- package/test/modules/checkbox.spec.js +5 -7
- package/test/modules/dropdown.spec.js +5 -7
- package/test/modules/modal.spec.js +6 -8
- package/test/modules/module.spec.js +158 -178
- package/test/modules/popup.spec.js +5 -7
- package/test/modules/search.spec.js +5 -7
- package/test/modules/shape.spec.js +5 -7
- package/test/modules/sidebar.spec.js +5 -7
- package/test/modules/tab.spec.js +6 -8
- package/test/modules/transition.spec.js +5 -7
- package/test/modules/video.spec.js +5 -7
@@ -13,157 +13,150 @@
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
var
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
version = project.version
|
16
|
+
gulp = require('gulp'),
|
17
|
+
|
18
|
+
// node dependencies
|
19
|
+
console = require('better-console'),
|
20
|
+
del = require('del'),
|
21
|
+
fs = require('fs'),
|
22
|
+
path = require('path'),
|
23
|
+
git = require('gulp-git'),
|
24
|
+
mkdirp = require('mkdirp'),
|
25
|
+
|
26
|
+
// admin files
|
27
|
+
github = require('../../config/admin/github.js'),
|
28
|
+
release = require('../../config/admin/release'),
|
29
|
+
project = require('../../config/project/release'),
|
30
|
+
|
31
|
+
// oAuth configuration for GitHub
|
32
|
+
oAuth = fs.existsSync(__dirname + '/../../config/admin/oauth.js')
|
33
|
+
? require('../../config/admin/oauth')
|
34
|
+
: false,
|
35
|
+
|
36
|
+
// shorthand
|
37
|
+
version = project.version
|
39
38
|
;
|
40
39
|
|
41
|
-
module.exports = function(callback) {
|
40
|
+
module.exports = function (callback) {
|
41
|
+
var
|
42
|
+
index = -1,
|
43
|
+
total = release.components.length,
|
44
|
+
timer,
|
45
|
+
stream,
|
46
|
+
stepRepo
|
47
|
+
;
|
42
48
|
|
43
|
-
|
44
|
-
|
45
|
-
total = release.components.length,
|
46
|
-
timer,
|
47
|
-
stream,
|
48
|
-
stepRepo
|
49
|
-
;
|
49
|
+
if (!oAuth) {
|
50
|
+
console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js');
|
50
51
|
|
51
|
-
|
52
|
-
|
53
|
-
return;
|
54
|
-
}
|
52
|
+
return;
|
53
|
+
}
|
55
54
|
|
56
|
-
|
57
|
-
|
55
|
+
// Do Git commands synchronously per component, to avoid issues
|
56
|
+
stepRepo = function () {
|
57
|
+
index += 1;
|
58
58
|
|
59
|
-
|
59
|
+
if (index >= total) {
|
60
|
+
callback();
|
60
61
|
|
61
|
-
|
62
|
-
|
63
|
-
return;
|
64
|
-
}
|
65
|
-
|
66
|
-
var
|
67
|
-
component = release.components[index],
|
68
|
-
outputDirectory = path.resolve(release.outputRoot + component),
|
69
|
-
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
|
70
|
-
repoName = release.componentRepoRoot + capitalizedComponent,
|
71
|
-
|
72
|
-
gitOptions = { cwd: outputDirectory },
|
73
|
-
pullOptions = { args: '-q', cwd: outputDirectory, quiet: true },
|
74
|
-
resetOptions = { args: '-q --hard', cwd: outputDirectory, quiet: true },
|
75
|
-
|
76
|
-
gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git',
|
77
|
-
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
|
78
|
-
localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git'))
|
79
|
-
;
|
62
|
+
return;
|
63
|
+
}
|
80
64
|
|
81
|
-
|
65
|
+
var
|
66
|
+
component = release.components[index],
|
67
|
+
outputDirectory = path.resolve(release.outputRoot + component),
|
68
|
+
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
|
69
|
+
repoName = release.componentRepoRoot + capitalizedComponent,
|
82
70
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
}
|
71
|
+
gitOptions = { cwd: outputDirectory },
|
72
|
+
pullOptions = { args: '-q', cwd: outputDirectory, quiet: true },
|
73
|
+
resetOptions = { args: '-q --hard', cwd: outputDirectory, quiet: true },
|
87
74
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
}
|
75
|
+
gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git',
|
76
|
+
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
|
77
|
+
localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git'))
|
78
|
+
;
|
93
79
|
|
94
|
-
|
95
|
-
function setupRepo() {
|
96
|
-
if(localRepoSetup) {
|
97
|
-
addRemote();
|
98
|
-
}
|
99
|
-
else {
|
100
|
-
initRepo();
|
101
|
-
}
|
102
|
-
}
|
80
|
+
console.log('Processing repository: ' + outputDirectory);
|
103
81
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
if(error) {
|
108
|
-
console.error('Error initializing repo', error);
|
82
|
+
// create folder if doesn't exist
|
83
|
+
if (!fs.existsSync(outputDirectory)) {
|
84
|
+
mkdirp.sync(outputDirectory);
|
109
85
|
}
|
110
|
-
addRemote();
|
111
|
-
});
|
112
|
-
}
|
113
86
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
homepage : release.homepage
|
120
|
-
}, function() {
|
121
|
-
setupRepo();
|
122
|
-
});
|
123
|
-
}
|
124
|
-
|
125
|
-
function addRemote() {
|
126
|
-
console.info('Adding remote origin as ' + gitURL);
|
127
|
-
git.addRemote('origin', gitURL, gitOptions, function(){
|
128
|
-
pullFiles();
|
129
|
-
});
|
130
|
-
}
|
87
|
+
// clean folder
|
88
|
+
if (release.outputRoot.search('../repos') == 0) {
|
89
|
+
console.info('Cleaning dir', outputDirectory);
|
90
|
+
del.sync([outputDirectory + '**/*'], { silent: true, force: true });
|
91
|
+
}
|
131
92
|
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
93
|
+
// set-up local repo
|
94
|
+
function setupRepo() {
|
95
|
+
if (localRepoSetup) {
|
96
|
+
addRemote();
|
97
|
+
} else {
|
98
|
+
initRepo();
|
99
|
+
}
|
100
|
+
}
|
138
101
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
102
|
+
function initRepo() {
|
103
|
+
console.info('Initializing repository for ' + component);
|
104
|
+
git.init(gitOptions, function (error) {
|
105
|
+
if (error) {
|
106
|
+
console.error('Error initializing repo', error);
|
107
|
+
}
|
108
|
+
addRemote();
|
109
|
+
});
|
110
|
+
}
|
145
111
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
112
|
+
function createRepo() {
|
113
|
+
console.info('Creating GitHub repo ' + repoURL);
|
114
|
+
github.repos.createFromOrg({
|
115
|
+
org: release.org,
|
116
|
+
name: repoName,
|
117
|
+
homepage: release.homepage,
|
118
|
+
}, function () {
|
119
|
+
setupRepo();
|
120
|
+
});
|
121
|
+
}
|
154
122
|
|
123
|
+
function addRemote() {
|
124
|
+
console.info('Adding remote origin as ' + gitURL);
|
125
|
+
git.addRemote('origin', gitURL, gitOptions, function () {
|
126
|
+
pullFiles();
|
127
|
+
});
|
128
|
+
}
|
155
129
|
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
}
|
130
|
+
function pullFiles() {
|
131
|
+
console.info('Pulling ' + component + ' files');
|
132
|
+
git.pull('origin', 'master', pullOptions, function (error) {
|
133
|
+
resetFiles();
|
134
|
+
});
|
135
|
+
}
|
163
136
|
|
164
|
-
|
137
|
+
function resetFiles() {
|
138
|
+
console.info('Resetting files to head');
|
139
|
+
git.reset('HEAD', resetOptions, function (error) {
|
140
|
+
nextRepo();
|
141
|
+
});
|
142
|
+
}
|
165
143
|
|
166
|
-
|
144
|
+
function nextRepo() {
|
145
|
+
// console.log('Sleeping for 1 second...');
|
146
|
+
// avoid rate throttling
|
147
|
+
global.clearTimeout(timer);
|
148
|
+
timer = global.setTimeout(function () {
|
149
|
+
stepRepo();
|
150
|
+
}, 0);
|
151
|
+
}
|
167
152
|
|
153
|
+
if (localRepoSetup) {
|
154
|
+
pullFiles();
|
155
|
+
} else {
|
156
|
+
setupRepo();
|
157
|
+
// createRepo() only use to create remote repo (easier to do manually)
|
158
|
+
}
|
159
|
+
};
|
168
160
|
|
161
|
+
stepRepo();
|
169
162
|
};
|
@@ -13,170 +13,162 @@
|
|
13
13
|
*/
|
14
14
|
|
15
15
|
var
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
: false,
|
16
|
+
gulp = require('gulp'),
|
17
|
+
|
18
|
+
// node dependencies
|
19
|
+
console = require('better-console'),
|
20
|
+
fs = require('fs'),
|
21
|
+
path = require('path'),
|
22
|
+
git = require('gulp-git'),
|
23
|
+
|
24
|
+
// admin files
|
25
|
+
github = require('../../config/admin/github.js'),
|
26
|
+
release = require('../../config/admin/release'),
|
27
|
+
project = require('../../config/project/release'),
|
28
|
+
|
29
|
+
// oAuth configuration for GitHub
|
30
|
+
oAuth = fs.existsSync(__dirname + '/../../config/admin/oauth.js')
|
31
|
+
? require('../../config/admin/oauth')
|
32
|
+
: false,
|
34
33
|
|
35
|
-
|
36
|
-
|
34
|
+
// shorthand
|
35
|
+
version = project.version
|
37
36
|
;
|
38
37
|
|
39
|
-
module.exports = function(callback) {
|
40
|
-
|
41
|
-
var
|
42
|
-
index = -1,
|
43
|
-
total = release.components.length,
|
44
|
-
timer,
|
45
|
-
stream,
|
46
|
-
stepRepo
|
47
|
-
;
|
48
|
-
|
49
|
-
if(!oAuth) {
|
50
|
-
console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js');
|
51
|
-
return;
|
52
|
-
}
|
53
|
-
|
54
|
-
// Do Git commands synchronously per component, to avoid issues
|
55
|
-
stepRepo = function() {
|
56
|
-
|
57
|
-
index = index + 1;
|
58
|
-
if(index >= total) {
|
59
|
-
callback();
|
60
|
-
return;
|
61
|
-
}
|
62
|
-
|
38
|
+
module.exports = function (callback) {
|
63
39
|
var
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git',
|
70
|
-
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
|
71
|
-
|
72
|
-
commitArgs = (oAuth.name !== undefined && oAuth.email !== undefined)
|
73
|
-
? '--author "' + oAuth.name + ' <' + oAuth.email + '>"'
|
74
|
-
: '',
|
75
|
-
|
76
|
-
componentPackage = fs.existsSync(outputDirectory + 'package.json' )
|
77
|
-
? require(outputDirectory + 'package.json')
|
78
|
-
: false,
|
79
|
-
|
80
|
-
isNewVersion = (version && componentPackage.version != version),
|
81
|
-
|
82
|
-
commitMessage = (isNewVersion)
|
83
|
-
? 'Updated component to version ' + version
|
84
|
-
: 'Updated files from main repo',
|
85
|
-
|
86
|
-
gitOptions = { cwd: outputDirectory },
|
87
|
-
commitOptions = { args: commitArgs, cwd: outputDirectory },
|
88
|
-
releaseOptions = { tag_name: version, owner: release.org, repo: repoName },
|
89
|
-
|
90
|
-
fileModeOptions = { args : 'config core.fileMode false', cwd: outputDirectory },
|
91
|
-
usernameOptions = { args : 'config user.name "' + oAuth.name + '"', cwd: outputDirectory },
|
92
|
-
emailOptions = { args : 'config user.email "' + oAuth.email + '"', cwd: outputDirectory },
|
93
|
-
versionOptions = { args : 'rev-parse --verify HEAD', cwd: outputDirectory },
|
94
|
-
|
95
|
-
localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git')),
|
96
|
-
canProceed = true
|
40
|
+
index = -1,
|
41
|
+
total = release.components.length,
|
42
|
+
timer,
|
43
|
+
stream,
|
44
|
+
stepRepo
|
97
45
|
;
|
98
46
|
|
47
|
+
if (!oAuth) {
|
48
|
+
console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js');
|
99
49
|
|
100
|
-
|
101
|
-
|
102
|
-
function setConfig() {
|
103
|
-
git.exec(fileModeOptions, function() {
|
104
|
-
git.exec(usernameOptions, function () {
|
105
|
-
git.exec(emailOptions, function () {
|
106
|
-
commitFiles();
|
107
|
-
});
|
108
|
-
});
|
109
|
-
});
|
110
|
-
}
|
111
|
-
|
112
|
-
|
113
|
-
// standard path
|
114
|
-
function commitFiles() {
|
115
|
-
// commit files
|
116
|
-
console.info('Committing ' + component + ' files', commitArgs);
|
117
|
-
gulp.src('./', gitOptions)
|
118
|
-
.pipe(git.add(gitOptions))
|
119
|
-
.pipe(git.commit(commitMessage, commitOptions))
|
120
|
-
.on('error', function(error) {
|
121
|
-
// canProceed = false; bug in git commit <https://github.com/stevelacy/gulp-git/issues/49>
|
122
|
-
})
|
123
|
-
.on('finish', function(callback) {
|
124
|
-
if(canProceed) {
|
125
|
-
pushFiles();
|
126
|
-
}
|
127
|
-
else {
|
128
|
-
console.info('Nothing new to commit');
|
129
|
-
nextRepo();
|
130
|
-
}
|
131
|
-
})
|
132
|
-
;
|
50
|
+
return;
|
133
51
|
}
|
134
52
|
|
135
|
-
//
|
136
|
-
function
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
}
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
53
|
+
// Do Git commands synchronously per component, to avoid issues
|
54
|
+
stepRepo = function () {
|
55
|
+
index += 1;
|
56
|
+
if (index >= total) {
|
57
|
+
callback();
|
58
|
+
|
59
|
+
return;
|
60
|
+
}
|
61
|
+
|
62
|
+
var
|
63
|
+
component = release.components[index],
|
64
|
+
outputDirectory = path.resolve(path.join(release.outputRoot, component)),
|
65
|
+
capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
|
66
|
+
repoName = release.componentRepoRoot + capitalizedComponent,
|
67
|
+
|
68
|
+
gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git',
|
69
|
+
repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
|
70
|
+
|
71
|
+
commitArgs = (oAuth.name !== undefined && oAuth.email !== undefined)
|
72
|
+
? '--author "' + oAuth.name + ' <' + oAuth.email + '>"'
|
73
|
+
: '',
|
74
|
+
|
75
|
+
componentPackage = fs.existsSync(outputDirectory + 'package.json')
|
76
|
+
? require(outputDirectory + 'package.json')
|
77
|
+
: false,
|
78
|
+
|
79
|
+
isNewVersion = (version && componentPackage.version != version),
|
80
|
+
|
81
|
+
commitMessage = (isNewVersion)
|
82
|
+
? 'Updated component to version ' + version
|
83
|
+
: 'Updated files from main repo',
|
84
|
+
|
85
|
+
gitOptions = { cwd: outputDirectory },
|
86
|
+
commitOptions = { args: commitArgs, cwd: outputDirectory },
|
87
|
+
releaseOptions = { tag_name: version, owner: release.org, repo: repoName },
|
88
|
+
|
89
|
+
fileModeOptions = { args: 'config core.fileMode false', cwd: outputDirectory },
|
90
|
+
usernameOptions = { args: 'config user.name "' + oAuth.name + '"', cwd: outputDirectory },
|
91
|
+
emailOptions = { args: 'config user.email "' + oAuth.email + '"', cwd: outputDirectory },
|
92
|
+
versionOptions = { args: 'rev-parse --verify HEAD', cwd: outputDirectory },
|
93
|
+
|
94
|
+
localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git')),
|
95
|
+
canProceed = true
|
96
|
+
;
|
97
|
+
|
98
|
+
console.info('Processing repository:' + outputDirectory);
|
99
|
+
|
100
|
+
function setConfig() {
|
101
|
+
git.exec(fileModeOptions, function () {
|
102
|
+
git.exec(usernameOptions, function () {
|
103
|
+
git.exec(emailOptions, function () {
|
104
|
+
commitFiles();
|
105
|
+
});
|
106
|
+
});
|
107
|
+
});
|
108
|
+
}
|
109
|
+
|
110
|
+
// standard path
|
111
|
+
function commitFiles() {
|
112
|
+
// commit files
|
113
|
+
console.info('Committing ' + component + ' files', commitArgs);
|
114
|
+
gulp.src('./', gitOptions)
|
115
|
+
.pipe(git.add(gitOptions))
|
116
|
+
.pipe(git.commit(commitMessage, commitOptions))
|
117
|
+
.on('error', function (error) {
|
118
|
+
// canProceed = false; bug in git commit <https://github.com/stevelacy/gulp-git/issues/49>
|
119
|
+
})
|
120
|
+
.on('finish', function (callback) {
|
121
|
+
if (canProceed) {
|
122
|
+
pushFiles();
|
123
|
+
} else {
|
124
|
+
console.info('Nothing new to commit');
|
125
|
+
nextRepo();
|
126
|
+
}
|
127
|
+
})
|
128
|
+
;
|
129
|
+
}
|
130
|
+
|
131
|
+
// push changes to remote
|
132
|
+
function pushFiles() {
|
133
|
+
console.info('Pushing files for ' + component);
|
134
|
+
git.push('origin', 'master', { args: '', cwd: outputDirectory }, function (error) {
|
135
|
+
console.info('Push completed successfully');
|
136
|
+
getSHA();
|
137
|
+
});
|
138
|
+
}
|
139
|
+
|
140
|
+
// gets SHA of last commit
|
141
|
+
function getSHA() {
|
142
|
+
git.exec(versionOptions, function (error, version) {
|
143
|
+
version = version.trim();
|
144
|
+
createRelease(version);
|
145
|
+
});
|
146
|
+
}
|
147
|
+
|
148
|
+
// create release on GitHub.com
|
149
|
+
function createRelease(version) {
|
150
|
+
if (version) {
|
151
|
+
releaseOptions.target_commitish = version;
|
152
|
+
}
|
153
|
+
github.repos.createRelease(releaseOptions, function () {
|
154
|
+
nextRepo();
|
155
|
+
});
|
156
|
+
}
|
157
|
+
|
158
|
+
// Steps to next repository
|
159
|
+
function nextRepo() {
|
160
|
+
console.log('Sleeping for 1 second...');
|
161
|
+
// avoid rate throttling
|
162
|
+
global.clearTimeout(timer);
|
163
|
+
timer = global.setTimeout(stepRepo, 100);
|
164
|
+
}
|
165
|
+
|
166
|
+
if (localRepoSetup) {
|
167
|
+
setConfig();
|
168
|
+
} else {
|
169
|
+
console.error('Repository must be setup before running update components');
|
170
|
+
}
|
171
|
+
};
|
172
|
+
|
173
|
+
stepRepo();
|
182
174
|
};
|