Skip to content

Commit

Permalink
fix(install): copy overrides.less file on install/update
Browse files Browse the repository at this point in the history
The new file overrides.less was missing at install/update. Without that any install would miss the overrides files which in turn breaks components which rely on them like transition
  • Loading branch information
lubber-de authored Apr 7, 2023
1 parent 7986b3f commit edee12d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
11 changes: 8 additions & 3 deletions tasks/admin/distributions/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*******************************/

/*
This will create individual distribution repositories for each SUI distribution
This will create individual distribution repositories for each FUI distribution
* copy distribution files to release
* update package.json file
Expand Down Expand Up @@ -153,6 +153,8 @@ module.exports = function (callback) {
tasks.push(function () {
let
definitions,
overridesImport,
lessImport,
themeImport,
themeConfig,
siteTheme,
Expand All @@ -161,7 +163,10 @@ module.exports = function (callback) {
definitions = gulp.src('src/definitions/**/*', { base: 'src/' })
.pipe(gulp.dest(outputDirectory))
;
themeImport = gulp.src('src/semantic.less', { base: 'src/' })
overridesImport = gulp.src('src/overrides.less', { base: 'src/' })
.pipe(gulp.dest(outputDirectory))
;
lessImport = gulp.src('src/semantic.less', { base: 'src/' })
.pipe(gulp.dest(outputDirectory))
;
themeImport = gulp.src('src/theme.less', { base: 'src/' })
Expand All @@ -177,7 +182,7 @@ module.exports = function (callback) {
.pipe(gulp.dest(outputDirectory))
;

return mergeStream(definitions, themeImport, themeConfig, siteTheme, themes);
return mergeStream(definitions, overridesImport, lessImport, themeImport, themeConfig, siteTheme, themes);
});
}

Expand Down
3 changes: 3 additions & 0 deletions tasks/config/project/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ module.exports = {
config: './semantic.json.example',
definitions: './src/definitions',
gulpFile: './gulpfile.js',
overridesImport: './src/overrides.less',
lessImport: './src/semantic.less',
site: './src/_site',
tasks: './tasks',
Expand All @@ -253,6 +254,7 @@ module.exports = {
// expected final filenames
files: {
config: 'semantic.json',
overridesImport: 'src/overrides.less',
lessImport: 'src/semantic.less',
site: 'src/site',
themeConfig: 'src/theme.config',
Expand All @@ -263,6 +265,7 @@ module.exports = {
folders: {
config: './',
definitions: 'src/definitions/',
overridesImport: 'src/',
lessImport: 'src/',
modules: 'node_modules/',
site: 'src/site/',
Expand Down
20 changes: 15 additions & 5 deletions tasks/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ module.exports = function (callback) {
root: path.normalize(__dirname + '/../'),
}; */

/* Don't do end user config if SUI is a sub-module */
/* Don't do end user config if FUI is a sub-module */
if (install.isSubModule()) {
console.info('SUI is a sub-module, skipping end-user install');
console.info('FUI is a sub-module, skipping end-user install');
callback();

return;
Expand All @@ -86,7 +86,7 @@ module.exports = function (callback) {
}

/* -----------------
Update SUI
Update FUI
----------------- */

// run update scripts if semantic.json exists
Expand All @@ -96,6 +96,7 @@ module.exports = function (callback) {
updatePaths = {
config: path.join(manager.root, files.config),
tasks: path.join(updateFolder, folders.tasks),
overridesImport: path.join(updateFolder, folders.overridesImport),
themeImport: path.join(updateFolder, folders.themeImport),
definition: path.join(currentConfig.paths.source.definitions),
site: path.join(currentConfig.paths.source.site),
Expand Down Expand Up @@ -132,7 +133,11 @@ module.exports = function (callback) {
.pipe(plumber())
.pipe(gulp.dest(updatePaths.themeImport))
;

console.info('Updating overrides import file');
gulp.src(source.overridesImport)
.pipe(plumber())
.pipe(gulp.dest(updatePaths.overridesImport))
;
console.info('Adding new site theme files...');
wrench.copyDirSyncRecursive(source.site, updatePaths.site, settings.wrench.merge);

Expand Down Expand Up @@ -187,7 +192,7 @@ module.exports = function (callback) {
}

/* --------------
Create SUI
Create FUI
--------------- */

gulp.task('run setup', function (callback) {
Expand Down Expand Up @@ -263,6 +268,7 @@ module.exports = function (callback) {
// special install paths only for PM install
installPaths = extend(false, {}, installPaths, {
definition: folders.definitions,
overridesImport: folders.overridesImport,
lessImport: folders.lessImport,
tasks: folders.tasks,
theme: folders.themes,
Expand Down Expand Up @@ -311,6 +317,10 @@ module.exports = function (callback) {
.pipe(plumber())
.pipe(gulp.dest(installPaths.themeImport))
;
gulp.src(source.overridesImport)
.pipe(plumber())
.pipe(gulp.dest(installPaths.overridesImport))
;
gulp.src(source.lessImport)
.pipe(plumber())
.pipe(gulp.dest(installPaths.lessImport))
Expand Down

0 comments on commit edee12d

Please sign in to comment.