Skip to content

Commit

Permalink
chore: remove node-sass and kendo-theme-tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
Juveniel authored and epetrow committed Nov 4, 2024
1 parent 90857ae commit 2b1a557
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 108 deletions.
53 changes: 8 additions & 45 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ const path = require("path");
const { globSync } = require("glob");
const gulp = require("gulp");

const { embedFileBase64 } = require('@progress/kendo-theme-tasks/src/embedFile');
const { getArg, getEnvArg } = require("@progress/kendo-theme-tasks/src/utils");
const { createComponent } = require('@progress/kendo-theme-tasks/src/create');


// Settings
const paths = {
sass: {
Expand All @@ -22,6 +17,14 @@ const paths = {
}
};

function getArg(key, argsArr) {
const args = argsArr || process.argv;
const index = args.indexOf(key);
const next = args[index + 1];

return (index < 0) ? null : (!next || next[0] === '-') ? true : next; // eslint-disable-line no-nested-ternary
}

// #region helpers
function flattenAll( cwds, options ) {

Expand Down Expand Up @@ -165,27 +168,6 @@ function swatchJsonTransformer( json ) {
// #endregion


// #region assets
gulp.task("assets", function() {
let files = globSync(paths.sass.assets);
let template = fs.readFileSync('lib/data-uri.template', 'utf8');

files.forEach( file => {
embedFileBase64({
file: file,
output: {
filename: '[name].scss',
path: path.dirname( file )
},
template: template
});
});

return Promise.resolve();
});
// #endregion


// #region dist
function distSwatches() {
let output = { path: getArg('--output-path') || paths.sass.dist };
Expand All @@ -198,22 +180,3 @@ function distSwatches() {
}
gulp.task("dist:swatches", distSwatches);
// #endregion

// #region Components

/**
* A task that creates all the needed files for a new component.
*
* @example npm run create-component --name=accordion
* @example gulp create-component --name accordion
*
* @param {string} [name] - The name of the new component.
*/
gulp.task("create-component", function( done ) {
const name = getArg('--name') || getEnvArg('name') || null;

createComponent({ name });
done();
});

// #endregion
Loading

0 comments on commit 2b1a557

Please sign in to comment.