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
package/tasks/install.js
CHANGED
@@ -11,430 +11,422 @@
|
|
11
11
|
* (NPM) Install - Will ask for where to put semantic (outside pm folder)
|
12
12
|
* (NPM) Upgrade - Will look for semantic install, copy over files and update if new version
|
13
13
|
* Standard installer runs asking for paths to site files etc
|
14
|
-
|
15
14
|
*/
|
16
15
|
|
17
16
|
var
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
17
|
+
gulp = require('gulp'),
|
18
|
+
|
19
|
+
// node dependencies
|
20
|
+
console = require('better-console'),
|
21
|
+
extend = require('extend'),
|
22
|
+
fs = require('fs'),
|
23
|
+
mkdirp = require('mkdirp'),
|
24
|
+
path = require('path'),
|
25
|
+
|
26
|
+
// gulp dependencies
|
27
|
+
chmod = require('gulp-chmod'),
|
28
|
+
del = require('del'),
|
29
|
+
jsonEditor = require('gulp-json-editor'),
|
30
|
+
plumber = require('gulp-plumber'),
|
31
|
+
inquirer = require('inquirer'),
|
32
|
+
rename = require('gulp-rename'),
|
33
|
+
replace = require('gulp-replace'),
|
34
|
+
requireDotFile = require('require-dot-file'),
|
35
|
+
wrench = require('wrench-sui'),
|
36
|
+
|
37
|
+
// install config
|
38
|
+
install = require('./config/project/install'),
|
39
|
+
|
40
|
+
// user config
|
41
|
+
config = require('./config/user'),
|
42
|
+
|
43
|
+
// release config (name/title/etc)
|
44
|
+
release = require('./config/project/release'),
|
45
|
+
|
46
|
+
// shorthand
|
47
|
+
questions = install.questions,
|
48
|
+
files = install.files,
|
49
|
+
folders = install.folders,
|
50
|
+
regExp = install.regExp,
|
51
|
+
settings = install.settings,
|
52
|
+
source = install.source
|
54
53
|
;
|
55
54
|
|
56
55
|
// Export install task
|
57
56
|
module.exports = function (callback) {
|
58
|
-
|
59
|
-
var
|
60
|
-
currentConfig = requireDotFile('semantic.json', process.cwd()),
|
61
|
-
manager = install.getPackageManager(),
|
62
|
-
rootQuestions = questions.root,
|
63
|
-
installFolder = false,
|
64
|
-
answers
|
65
|
-
;
|
66
|
-
|
67
|
-
console.clear();
|
68
|
-
|
69
|
-
/* Test NPM install
|
70
|
-
manager = {
|
71
|
-
name : 'NPM',
|
72
|
-
root : path.normalize(__dirname + '/../')
|
73
|
-
};
|
74
|
-
*/
|
75
|
-
|
76
|
-
|
77
|
-
/* Don't do end user config if SUI is a sub-module */
|
78
|
-
if (install.isSubModule()) {
|
79
|
-
console.info('SUI is a sub-module, skipping end-user install');
|
80
|
-
callback();
|
81
|
-
return;
|
82
|
-
}
|
83
|
-
|
84
|
-
/*-----------------
|
85
|
-
Update SUI
|
86
|
-
-----------------*/
|
87
|
-
|
88
|
-
// run update scripts if semantic.json exists
|
89
|
-
if (currentConfig && manager.name === 'NPM') {
|
90
|
-
|
91
57
|
var
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
definition : path.join(currentConfig.paths.source.definitions),
|
98
|
-
site : path.join(currentConfig.paths.source.site),
|
99
|
-
theme : path.join(currentConfig.paths.source.themes),
|
100
|
-
defaultTheme: path.join(currentConfig.paths.source.themes, folders.defaultTheme)
|
101
|
-
}
|
58
|
+
currentConfig = requireDotFile('semantic.json', process.cwd()),
|
59
|
+
manager = install.getPackageManager(),
|
60
|
+
rootQuestions = questions.root,
|
61
|
+
installFolder = false,
|
62
|
+
answers
|
102
63
|
;
|
103
64
|
|
104
|
-
|
105
|
-
if (fs.existsSync(updatePaths.definition)) {
|
106
|
-
|
107
|
-
// perform update if new version
|
108
|
-
if (currentConfig.version !== release.version) {
|
109
|
-
console.log('Updating Fomantic UI from ' + currentConfig.version + ' to ' + release.version);
|
65
|
+
console.clear();
|
110
66
|
|
111
|
-
|
112
|
-
|
67
|
+
/* Test NPM install
|
68
|
+
manager = {
|
69
|
+
name: 'NPM',
|
70
|
+
root: path.normalize(__dirname + '/../'),
|
71
|
+
}; */
|
113
72
|
|
114
|
-
|
115
|
-
|
116
|
-
|
73
|
+
/* Don't do end user config if SUI is a sub-module */
|
74
|
+
if (install.isSubModule()) {
|
75
|
+
console.info('SUI is a sub-module, skipping end-user install');
|
76
|
+
callback();
|
117
77
|
|
118
|
-
|
119
|
-
|
78
|
+
return;
|
79
|
+
}
|
120
80
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
81
|
+
/* -----------------
|
82
|
+
Update SUI
|
83
|
+
----------------- */
|
84
|
+
|
85
|
+
// run update scripts if semantic.json exists
|
86
|
+
if (currentConfig && manager.name === 'NPM') {
|
87
|
+
var
|
88
|
+
updateFolder = path.join(manager.root, currentConfig.base),
|
89
|
+
updatePaths = {
|
90
|
+
config: path.join(manager.root, files.config),
|
91
|
+
tasks: path.join(updateFolder, folders.tasks),
|
92
|
+
themeImport: path.join(updateFolder, folders.themeImport),
|
93
|
+
definition: path.join(currentConfig.paths.source.definitions),
|
94
|
+
site: path.join(currentConfig.paths.source.site),
|
95
|
+
theme: path.join(currentConfig.paths.source.themes),
|
96
|
+
defaultTheme: path.join(currentConfig.paths.source.themes, folders.defaultTheme),
|
97
|
+
}
|
125
98
|
;
|
126
99
|
|
127
|
-
//
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
;
|
100
|
+
// duck-type if there is a project installed
|
101
|
+
if (fs.existsSync(updatePaths.definition)) {
|
102
|
+
// perform update if new version
|
103
|
+
if (currentConfig.version !== release.version) {
|
104
|
+
console.log('Updating Fomantic UI from ' + currentConfig.version + ' to ' + release.version);
|
133
105
|
|
134
|
-
|
135
|
-
|
106
|
+
console.info('Updating ui definitions...');
|
107
|
+
wrench.copyDirSyncRecursive(source.definitions, updatePaths.definition, settings.wrench.overwrite);
|
136
108
|
|
137
|
-
|
109
|
+
console.info('Updating default theme...');
|
110
|
+
wrench.copyDirSyncRecursive(source.themes, updatePaths.theme, settings.wrench.merge);
|
111
|
+
wrench.copyDirSyncRecursive(source.defaultTheme, updatePaths.defaultTheme, settings.wrench.overwrite);
|
138
112
|
|
139
|
-
|
140
|
-
|
141
|
-
.pipe(plumber())
|
142
|
-
.pipe(rename(settings.rename.json)) // preserve file extension
|
143
|
-
.pipe(jsonEditor({
|
144
|
-
version: release.version
|
145
|
-
}))
|
146
|
-
.pipe(gulp.dest(manager.root))
|
147
|
-
;
|
113
|
+
console.info('Updating tasks...');
|
114
|
+
wrench.copyDirSyncRecursive(source.tasks, updatePaths.tasks, settings.wrench.overwrite);
|
148
115
|
|
149
|
-
|
116
|
+
console.info('Updating gulpfile.js');
|
117
|
+
gulp.src(source.userGulpFile)
|
118
|
+
.pipe(plumber())
|
119
|
+
.pipe(gulp.dest(updateFolder))
|
120
|
+
;
|
150
121
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
}
|
122
|
+
// copy theme import
|
123
|
+
console.info('Updating theme import file');
|
124
|
+
gulp.src(source.themeImport)
|
125
|
+
.pipe(plumber())
|
126
|
+
.pipe(gulp.dest(updatePaths.themeImport))
|
127
|
+
;
|
158
128
|
|
159
|
-
|
160
|
-
|
161
|
-
console.log('Running installer');
|
162
|
-
}
|
129
|
+
console.info('Adding new site theme files...');
|
130
|
+
wrench.copyDirSyncRecursive(source.site, updatePaths.site, settings.wrench.merge);
|
163
131
|
|
164
|
-
|
132
|
+
console.info('Updating version...');
|
165
133
|
|
166
|
-
|
167
|
-
|
168
|
-
|
134
|
+
// update version number in semantic.json
|
135
|
+
gulp.src(updatePaths.config)
|
136
|
+
.pipe(plumber())
|
137
|
+
.pipe(rename(settings.rename.json)) // preserve file extension
|
138
|
+
.pipe(jsonEditor({
|
139
|
+
version: release.version,
|
140
|
+
}))
|
141
|
+
.pipe(gulp.dest(manager.root))
|
142
|
+
;
|
169
143
|
|
170
|
-
|
171
|
-
if (manager.name === 'NPM') {
|
172
|
-
rootQuestions[0].message = rootQuestions[0].message
|
173
|
-
.replace('{packageMessage}', 'We detected you are using ' + manager.name + ' Nice!')
|
174
|
-
.replace('{root}', manager.root)
|
175
|
-
;
|
176
|
-
// set default path to detected PM root
|
177
|
-
rootQuestions[0].default = manager.root;
|
178
|
-
rootQuestions[1].default = manager.root;
|
179
|
-
|
180
|
-
// insert PM questions after "Install Type" question
|
181
|
-
Array.prototype.splice.apply(questions.setup, [2, 0].concat(rootQuestions));
|
182
|
-
|
183
|
-
// omit cleanup questions for managed install
|
184
|
-
questions.cleanup = [];
|
185
|
-
}
|
186
|
-
|
187
|
-
|
188
|
-
/*--------------
|
189
|
-
Create SUI
|
190
|
-
---------------*/
|
191
|
-
|
192
|
-
gulp.task('run setup', function (callback) {
|
193
|
-
|
194
|
-
// If auto-install is switched on, we skip the configuration section and simply reuse the configuration from semantic.json
|
195
|
-
if (install.shouldAutoInstall()) {
|
196
|
-
answers = {
|
197
|
-
overwrite : 'yes',
|
198
|
-
install : 'auto',
|
199
|
-
useRoot : true,
|
200
|
-
semanticRoot: currentConfig.base
|
201
|
-
};
|
202
|
-
callback();
|
203
|
-
} else {
|
204
|
-
return inquirer.prompt(questions.setup)
|
205
|
-
.then((setupAnswers) => {
|
206
|
-
// hoist
|
207
|
-
answers = setupAnswers;
|
208
|
-
});
|
209
|
-
}
|
210
|
-
});
|
144
|
+
console.info('Update complete! Run "\x1b[92mgulp build\x1b[0m" to rebuild dist/ files.');
|
211
145
|
|
212
|
-
|
146
|
+
callback();
|
213
147
|
|
214
|
-
|
215
|
-
|
216
|
-
|
148
|
+
return;
|
149
|
+
} else {
|
150
|
+
console.log('Current version of Fomantic UI already installed');
|
151
|
+
callback();
|
217
152
|
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
if (install.shouldAutoInstall()) {
|
225
|
-
console.log('Auto-Installing (Without User Interaction)');
|
226
|
-
} else {
|
227
|
-
console.log('Installing');
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
} else {
|
156
|
+
console.error('Cannot locate files to update at path: ', updatePaths.definition);
|
157
|
+
console.log('Running installer');
|
158
|
+
}
|
228
159
|
}
|
229
|
-
console.log('------------------------------');
|
230
160
|
|
161
|
+
/* --------------
|
162
|
+
Determine Root
|
163
|
+
--------------- */
|
231
164
|
|
232
|
-
|
233
|
-
|
234
|
-
|
165
|
+
// PM that supports Build Tools (NPM Only Now)
|
166
|
+
if (manager.name === 'NPM') {
|
167
|
+
rootQuestions[0].message = rootQuestions[0].message
|
168
|
+
.replace('{packageMessage}', 'We detected you are using ' + manager.name + ' Nice!')
|
169
|
+
.replace('{root}', manager.root)
|
170
|
+
;
|
171
|
+
// set default path to detected PM root
|
172
|
+
rootQuestions[0].default = manager.root;
|
173
|
+
rootQuestions[1].default = manager.root;
|
235
174
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
175
|
+
// insert PM questions after "Install Type" question
|
176
|
+
Array.prototype.splice.apply(questions.setup, [2, 0].concat(rootQuestions));
|
177
|
+
|
178
|
+
// omit cleanup questions for managed install
|
179
|
+
questions.cleanup = [];
|
180
|
+
}
|
181
|
+
|
182
|
+
/* --------------
|
183
|
+
Create SUI
|
184
|
+
--------------- */
|
185
|
+
|
186
|
+
gulp.task('run setup', function (callback) {
|
187
|
+
// If auto-install is switched on, we skip the configuration section and simply reuse the configuration from semantic.json
|
188
|
+
if (install.shouldAutoInstall()) {
|
189
|
+
answers = {
|
190
|
+
overwrite: 'yes',
|
191
|
+
install: 'auto',
|
192
|
+
useRoot: true,
|
193
|
+
semanticRoot: currentConfig.base,
|
194
|
+
};
|
195
|
+
callback();
|
196
|
+
} else {
|
197
|
+
return inquirer.prompt(questions.setup)
|
198
|
+
.then((setupAnswers) => {
|
199
|
+
// hoist
|
200
|
+
answers = setupAnswers;
|
201
|
+
})
|
202
|
+
;
|
203
|
+
}
|
204
|
+
});
|
245
205
|
|
246
|
-
|
247
|
-
|
248
|
-
|
206
|
+
gulp.task('create install files', function (callback) {
|
207
|
+
/* --------------
|
208
|
+
Exit Conditions
|
209
|
+
--------------- */
|
249
210
|
|
250
|
-
|
251
|
-
|
211
|
+
// if config exists and user specifies not to proceed
|
212
|
+
if (answers.overwrite !== undefined && answers.overwrite == 'no') {
|
213
|
+
callback();
|
252
214
|
|
253
|
-
|
254
|
-
if (answers.customRoot) {
|
255
|
-
if (answers.customRoot === '') {
|
256
|
-
console.log('Unable to proceed, invalid project root');
|
257
|
-
callback();
|
258
|
-
return;
|
215
|
+
return;
|
259
216
|
}
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
definition : folders.definitions,
|
266
|
-
lessImport : folders.lessImport,
|
267
|
-
tasks : folders.tasks,
|
268
|
-
theme : folders.themes,
|
269
|
-
defaultTheme: path.join(folders.themes, folders.defaultTheme),
|
270
|
-
themeImport : folders.themeImport
|
271
|
-
});
|
272
|
-
|
273
|
-
// add project root to semantic root
|
274
|
-
installFolder = path.join(manager.root, answers.semanticRoot);
|
275
|
-
|
276
|
-
// add install folder to all output paths
|
277
|
-
for (var destination in installPaths) {
|
278
|
-
if (installPaths.hasOwnProperty(destination)) {
|
279
|
-
// config goes in project root, rest in install folder
|
280
|
-
installPaths[destination] = (destination == 'config' || destination == 'configFolder')
|
281
|
-
? path.normalize(path.join(manager.root, installPaths[destination]))
|
282
|
-
: path.normalize(path.join(installFolder, installPaths[destination]))
|
283
|
-
;
|
217
|
+
console.clear();
|
218
|
+
if (install.shouldAutoInstall()) {
|
219
|
+
console.log('Auto-Installing (Without User Interaction)');
|
220
|
+
} else {
|
221
|
+
console.log('Installing');
|
284
222
|
}
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
wrench.copyDirSyncRecursive(source.definitions, installPaths.definition, settings.wrench.overwrite);
|
301
|
-
|
302
|
-
console.info('Copying UI themes');
|
303
|
-
wrench.copyDirSyncRecursive(source.themes, installPaths.theme, settings.wrench.merge);
|
304
|
-
wrench.copyDirSyncRecursive(source.defaultTheme, installPaths.defaultTheme, settings.wrench.overwrite);
|
305
|
-
|
306
|
-
console.info('Copying gulp tasks');
|
307
|
-
wrench.copyDirSyncRecursive(source.tasks, installPaths.tasks, settings.wrench.overwrite);
|
308
|
-
|
309
|
-
// copy theme import
|
310
|
-
console.info('Adding theme files');
|
311
|
-
gulp.src(source.themeImport)
|
312
|
-
.pipe(plumber())
|
313
|
-
.pipe(gulp.dest(installPaths.themeImport))
|
314
|
-
;
|
315
|
-
gulp.src(source.lessImport)
|
316
|
-
.pipe(plumber())
|
317
|
-
.pipe(gulp.dest(installPaths.lessImport))
|
318
|
-
;
|
319
|
-
|
320
|
-
// create gulp file
|
321
|
-
console.info('Creating gulpfile.js');
|
322
|
-
gulp.src(source.userGulpFile)
|
323
|
-
.pipe(plumber())
|
324
|
-
.pipe(gulp.dest(installFolder))
|
325
|
-
;
|
223
|
+
console.log('------------------------------');
|
224
|
+
|
225
|
+
/* --------------
|
226
|
+
Paths
|
227
|
+
--------------- */
|
228
|
+
|
229
|
+
var
|
230
|
+
installPaths = {
|
231
|
+
config: files.config,
|
232
|
+
configFolder: folders.config,
|
233
|
+
site: answers.site || folders.site,
|
234
|
+
themeConfig: files.themeConfig,
|
235
|
+
themeConfigFolder: folders.themeConfig,
|
236
|
+
}
|
237
|
+
;
|
326
238
|
|
327
|
-
|
239
|
+
/* --------------
|
240
|
+
NPM Install
|
241
|
+
--------------- */
|
242
|
+
|
243
|
+
// Check if PM install
|
244
|
+
if (manager && (answers.useRoot || answers.customRoot)) {
|
245
|
+
// Set root to custom root path if set
|
246
|
+
if (answers.customRoot) {
|
247
|
+
if (answers.customRoot === '') {
|
248
|
+
console.log('Unable to proceed, invalid project root');
|
249
|
+
callback();
|
250
|
+
|
251
|
+
return;
|
252
|
+
}
|
253
|
+
manager.root = answers.customRoot;
|
254
|
+
}
|
328
255
|
|
256
|
+
// special install paths only for PM install
|
257
|
+
installPaths = extend(false, {}, installPaths, {
|
258
|
+
definition: folders.definitions,
|
259
|
+
lessImport: folders.lessImport,
|
260
|
+
tasks: folders.tasks,
|
261
|
+
theme: folders.themes,
|
262
|
+
defaultTheme: path.join(folders.themes, folders.defaultTheme),
|
263
|
+
themeImport: folders.themeImport,
|
264
|
+
});
|
265
|
+
|
266
|
+
// add project root to semantic root
|
267
|
+
installFolder = path.join(manager.root, answers.semanticRoot);
|
268
|
+
|
269
|
+
// add install folder to all output paths
|
270
|
+
for (var destination in installPaths) {
|
271
|
+
if (installPaths.hasOwnProperty(destination)) {
|
272
|
+
// config goes in project root, rest in install folder
|
273
|
+
installPaths[destination] = (destination == 'config' || destination == 'configFolder')
|
274
|
+
? path.normalize(path.join(manager.root, installPaths[destination]))
|
275
|
+
: path.normalize(path.join(installFolder, installPaths[destination]));
|
276
|
+
}
|
277
|
+
}
|
329
278
|
|
330
|
-
|
331
|
-
|
332
|
-
|
279
|
+
// create project folders
|
280
|
+
try {
|
281
|
+
mkdirp.sync(installFolder);
|
282
|
+
mkdirp.sync(installPaths.definition);
|
283
|
+
mkdirp.sync(installPaths.theme);
|
284
|
+
mkdirp.sync(installPaths.tasks);
|
285
|
+
} catch (error) {
|
286
|
+
console.error('NPM does not have permissions to create folders at your specified path. Adjust your folders permissions and run "npm install" again');
|
287
|
+
}
|
333
288
|
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
} else {
|
365
|
-
console.info('Creating src/theme.config (LESS config)', installPaths.themeConfig);
|
366
|
-
return gulp.src(source.themeConfig)
|
367
|
-
.pipe(plumber())
|
368
|
-
.pipe(rename({extname: ''}))
|
369
|
-
.pipe(replace(regExp.siteVariable, siteVariable))
|
370
|
-
.pipe(gulp.dest(installPaths.themeConfigFolder))
|
371
|
-
;
|
372
|
-
}
|
373
|
-
});
|
289
|
+
console.log('Installing to \x1b[92m' + answers.semanticRoot + '\x1b[0m');
|
290
|
+
|
291
|
+
console.info('Copying UI definitions');
|
292
|
+
wrench.copyDirSyncRecursive(source.definitions, installPaths.definition, settings.wrench.overwrite);
|
293
|
+
|
294
|
+
console.info('Copying UI themes');
|
295
|
+
wrench.copyDirSyncRecursive(source.themes, installPaths.theme, settings.wrench.merge);
|
296
|
+
wrench.copyDirSyncRecursive(source.defaultTheme, installPaths.defaultTheme, settings.wrench.overwrite);
|
297
|
+
|
298
|
+
console.info('Copying gulp tasks');
|
299
|
+
wrench.copyDirSyncRecursive(source.tasks, installPaths.tasks, settings.wrench.overwrite);
|
300
|
+
|
301
|
+
// copy theme import
|
302
|
+
console.info('Adding theme files');
|
303
|
+
gulp.src(source.themeImport)
|
304
|
+
.pipe(plumber())
|
305
|
+
.pipe(gulp.dest(installPaths.themeImport))
|
306
|
+
;
|
307
|
+
gulp.src(source.lessImport)
|
308
|
+
.pipe(plumber())
|
309
|
+
.pipe(gulp.dest(installPaths.lessImport))
|
310
|
+
;
|
311
|
+
|
312
|
+
// create gulp file
|
313
|
+
console.info('Creating gulpfile.js');
|
314
|
+
gulp.src(source.userGulpFile)
|
315
|
+
.pipe(plumber())
|
316
|
+
.pipe(gulp.dest(installFolder))
|
317
|
+
;
|
318
|
+
}
|
374
319
|
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
gulp.task('create semantic.json', function () {
|
380
|
-
|
381
|
-
var
|
382
|
-
jsonConfig = install.createJSON(answers)
|
383
|
-
;
|
384
|
-
|
385
|
-
// adjust variables in theme.less
|
386
|
-
if (fs.existsSync(installPaths.config)) {
|
387
|
-
console.info('Extending config file (semantic.json)', installPaths.config);
|
388
|
-
return gulp.src(installPaths.config)
|
389
|
-
.pipe(plumber())
|
390
|
-
.pipe(rename(settings.rename.json)) // preserve file extension
|
391
|
-
.pipe(jsonEditor(jsonConfig))
|
392
|
-
.pipe(gulp.dest(installPaths.configFolder))
|
393
|
-
;
|
394
|
-
} else {
|
395
|
-
console.info('Creating config file (semantic.json)', installPaths.config);
|
396
|
-
return gulp.src(source.config)
|
397
|
-
.pipe(plumber())
|
398
|
-
.pipe(rename({extname: ''})) // remove .template from ext
|
399
|
-
.pipe(jsonEditor(jsonConfig, {end_with_newline: true}))
|
400
|
-
.pipe(gulp.dest(installPaths.configFolder))
|
401
|
-
;
|
402
|
-
}
|
320
|
+
/* --------------
|
321
|
+
Site Theme
|
322
|
+
--------------- */
|
403
323
|
|
404
|
-
|
324
|
+
// Copy _site templates folder to destination
|
325
|
+
if (fs.existsSync(installPaths.site)) {
|
326
|
+
console.info('Site folder exists, merging files (no overwrite)', installPaths.site);
|
327
|
+
} else {
|
328
|
+
console.info('Creating site theme folder', installPaths.site);
|
329
|
+
}
|
330
|
+
wrench.copyDirSyncRecursive(source.site, installPaths.site, settings.wrench.merge);
|
331
|
+
|
332
|
+
/* --------------
|
333
|
+
Theme Config
|
334
|
+
--------------- */
|
335
|
+
|
336
|
+
gulp.task('create theme.config', function () {
|
337
|
+
var
|
338
|
+
// determine path to site theme folder from theme config
|
339
|
+
// force CSS path variable to use forward slashes for paths
|
340
|
+
pathToSite = path.relative(path.resolve(installPaths.themeConfigFolder), path.resolve(installPaths.site)).replace(/\\/g, '/'),
|
341
|
+
siteVariable = "@siteFolder : '" + pathToSite + "/';"
|
342
|
+
;
|
343
|
+
|
344
|
+
// rewrite site variable in theme.less
|
345
|
+
console.info('Adjusting @siteFolder to: ', pathToSite + '/');
|
346
|
+
|
347
|
+
if (fs.existsSync(installPaths.themeConfig)) {
|
348
|
+
console.info('Modifying src/theme.config (LESS config)', installPaths.themeConfig);
|
349
|
+
|
350
|
+
return gulp.src(installPaths.themeConfig)
|
351
|
+
.pipe(plumber())
|
352
|
+
.pipe(replace(regExp.siteVariable, siteVariable))
|
353
|
+
.pipe(gulp.dest(installPaths.themeConfigFolder))
|
354
|
+
;
|
355
|
+
} else {
|
356
|
+
console.info('Creating src/theme.config (LESS config)', installPaths.themeConfig);
|
357
|
+
|
358
|
+
return gulp.src(source.themeConfig)
|
359
|
+
.pipe(plumber())
|
360
|
+
.pipe(rename({ extname: '' }))
|
361
|
+
.pipe(replace(regExp.siteVariable, siteVariable))
|
362
|
+
.pipe(gulp.dest(installPaths.themeConfigFolder))
|
363
|
+
;
|
364
|
+
}
|
365
|
+
});
|
405
366
|
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
367
|
+
/* --------------
|
368
|
+
Semantic.json
|
369
|
+
--------------- */
|
370
|
+
|
371
|
+
gulp.task('create semantic.json', function () {
|
372
|
+
var
|
373
|
+
jsonConfig = install.createJSON(answers)
|
374
|
+
;
|
375
|
+
|
376
|
+
// adjust variables in theme.less
|
377
|
+
if (fs.existsSync(installPaths.config)) {
|
378
|
+
console.info('Extending config file (semantic.json)', installPaths.config);
|
379
|
+
|
380
|
+
return gulp.src(installPaths.config)
|
381
|
+
.pipe(plumber())
|
382
|
+
.pipe(rename(settings.rename.json)) // preserve file extension
|
383
|
+
.pipe(jsonEditor(jsonConfig))
|
384
|
+
.pipe(gulp.dest(installPaths.configFolder))
|
385
|
+
;
|
386
|
+
} else {
|
387
|
+
console.info('Creating config file (semantic.json)', installPaths.config);
|
388
|
+
|
389
|
+
return gulp.src(source.config)
|
390
|
+
.pipe(plumber())
|
391
|
+
.pipe(rename({ extname: '' })) // remove .template from ext
|
392
|
+
.pipe(jsonEditor(jsonConfig, { end_with_newline: true }))
|
393
|
+
.pipe(gulp.dest(installPaths.configFolder))
|
394
|
+
;
|
428
395
|
}
|
429
|
-
|
430
|
-
|
396
|
+
});
|
397
|
+
|
398
|
+
gulp.series('create theme.config', 'create semantic.json')(callback);
|
399
|
+
});
|
400
|
+
|
401
|
+
gulp.task('clean up install', function (callback) {
|
402
|
+
// Completion Message
|
403
|
+
if (installFolder && !install.shouldAutoInstall()) {
|
404
|
+
console.log('\n Setup Complete! \n Installing Peer Dependencies. \x1b[0;31mPlease refrain from ctrl + c\x1b[0m... \n After completion navigate to \x1b[92m' + answers.semanticRoot + '\x1b[0m and run "\x1b[92mgulp build\x1b[0m" to build');
|
405
|
+
callback();
|
406
|
+
} else {
|
407
|
+
console.log('');
|
408
|
+
console.log('');
|
409
|
+
|
410
|
+
// If auto-install is switched on, we skip the configuration section and simply build the dependencies
|
411
|
+
if (install.shouldAutoInstall()) {
|
412
|
+
gulp.series('build')(callback);
|
431
413
|
} else {
|
432
|
-
|
414
|
+
// We don't return the inquirer promise on purpose because we handle the callback ourselves
|
415
|
+
inquirer.prompt(questions.cleanup)
|
416
|
+
.then((answers) => {
|
417
|
+
if (answers.cleanup === 'yes') {
|
418
|
+
del(install.setupFiles);
|
419
|
+
}
|
420
|
+
if (answers.build === 'yes') {
|
421
|
+
gulp.series('build')(callback);
|
422
|
+
} else {
|
423
|
+
callback();
|
424
|
+
}
|
425
|
+
})
|
426
|
+
;
|
433
427
|
}
|
434
|
-
|
435
|
-
|
436
|
-
}
|
437
|
-
});
|
428
|
+
}
|
429
|
+
});
|
438
430
|
|
439
|
-
|
431
|
+
gulp.series('run setup', 'create install files', 'clean up install')(callback);
|
440
432
|
};
|