-
Notifications
You must be signed in to change notification settings - Fork 86
chore: update gulpfile.js scripts to use ESM, bump plugin versions #9420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d02d6d9
chore: update icons gulpfile.js to use ESM
web-padawan 1552ae1
chore: update rich-text-editor gulpfile.js to use ESM
web-padawan d0eec39
chore: update vaadin-lumo-styles gulpfile.js to use ESM
web-padawan 399f63d
chore: remove separate eslint.config.js entry for .cjs
web-padawan 3b36f2f
chore: align version of gulp and gulp-cli
web-padawan 8fa833c
chore: deduplicate yarn.lock
web-padawan 26b544c
chore: revert not needed resoluton for now
web-padawan f4341d4
chore: get file name to make script work on Windows
web-padawan 9728db8
chore: try reverting some changes to svg2ttf
web-padawan eb89bf9
chore: use imagemin-svgo directly to reduce dependencies
web-padawan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import * as cheerio from 'cheerio'; | ||
import { dest, src, task } from 'gulp'; | ||
import concat from 'gulp-concat'; | ||
import { gulpPlugin } from 'gulp-plugin-extras'; | ||
import { basename } from 'path'; | ||
|
||
function createCopyright() { | ||
return `/** | ||
* @license | ||
vursen marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* Copyright (c) 2015 - ${new Date().getFullYear()} Vaadin Ltd. | ||
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ | ||
*/`; | ||
} | ||
|
||
function transformIcon() { | ||
return gulpPlugin('gulp-transform-icon', (file) => { | ||
const id = basename(file.path, '.svg'); | ||
const svg = cheerio.load(file.contents, { xmlMode: true })('svg'); | ||
// Remove fill attributes. | ||
svg.children('[fill]').removeAttr('fill'); | ||
// Add closing tags instead of self-closing. | ||
const content = svg.children().toString().replace(/"\/>/gu, '"></path>'); | ||
console.warn(id, content); | ||
// Output the "meat" of the SVG as group element. | ||
file.contents = Buffer.from(`<g id="vaadin:${id}">${content}</g>`); | ||
return file; | ||
}); | ||
} | ||
|
||
function createIconset() { | ||
return gulpPlugin('gulp-create-iconset', (file) => { | ||
// Enclose all icons in a vaadin-iconset | ||
const contents = `${createCopyright()} | ||
import { Iconset } from '@vaadin/icon/vaadin-iconset.js'; | ||
|
||
const template = document.createElement('template'); | ||
|
||
template.innerHTML = \`<svg><defs>\n${file.contents}\n</defs></svg>\`; | ||
|
||
Iconset.register('vaadin', 16, template);\n`; | ||
file.contents = Buffer.from(contents); | ||
return file; | ||
}); | ||
} | ||
|
||
task('icons', () => { | ||
return src(['assets/svg/*.svg'], { base: '.' }) | ||
.pipe(transformIcon()) | ||
.pipe(concat('vaadin-iconset.js')) | ||
.pipe(createIconset()) | ||
.pipe(dest('.')); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 15 additions & 21 deletions
36
packages/rich-text-editor/gulpfile.cjs → packages/rich-text-editor/gulpfile.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced usage of
gulp-modify
which pulls in deprecatedgulp-util
in this file with custom plugins.