Skip to content

Commit abd49eb

Browse files
authored
chore: update gulp config to fix icons scripts (#4126)
1 parent d6a6d21 commit abd49eb

8 files changed

Lines changed: 26 additions & 7 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ function createCopyright() {
1414
*/`;
1515
}
1616

17+
function addWarning() {
18+
return `console.warn(
19+
\`WARNING: Since Vaadin 23.1, using <iron-icon> is deprecated. Please use <vaadin-icon> and '@vaadin/icons/vaadin-iconset.js' instead.\`,
20+
);`;
21+
}
22+
1723
function iconFileModifier(prefix) {
1824
return function (file, contents) {
1925
const id = file.path.replace(/.*\/(.*).svg/, '$1');
@@ -43,6 +49,8 @@ gulp.task('iron-icons', () => {
4349
return `${createCopyright()}
4450
import '@polymer/iron-iconset-svg/iron-iconset-svg.js';
4551
52+
${addWarning()}
53+
4654
const template = document.createElement('template');
4755
4856
template.innerHTML = \`<iron-iconset-svg name="vaadin" size="16">

‎packages/icons/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"module": "vaadin-iconset.js",
2121
"type": "module",
2222
"scripts": {
23-
"icons": "gulp icons"
23+
"icons": "gulp icons --gulpfile gulpfile.cjs"
2424
},
2525
"files": [
2626
"iconset.js",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ gulp.task('icons', (done) => {
3535

3636
let output = `/**
3737
* @license
38-
* Copyright (c) 2021 Vaadin Ltd
38+
* Copyright (c) 2018 - 2022 Vaadin Ltd.
3939
* This program is available under Commercial Vaadin Developer License 4.0, available at https://vaadin.com/license/cvdl-4.0.
4040
*/
4141
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';

‎packages/rich-text-editor/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"module": "vaadin-rich-text-editor.js",
2222
"type": "module",
2323
"scripts": {
24-
"icons": "gulp icons"
24+
"icons": "gulp icons --gulpfile gulpfile.cjs"
2525
},
2626
"files": [
2727
"src",
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ function createCopyright() {
3232
*/`;
3333
}
3434

35+
function addWarning() {
36+
return `console.warn(
37+
\`WARNING: Since Vaadin 23.1, using <iron-icon> is deprecated. Please use <vaadin-icon> and '@vaadin/vaadin-lumo-styles/vaadin-iconset.js' instead.\`,
38+
);`;
39+
}
40+
3541
function createIconset(folder, filenames, idPrefix = '') {
3642
let output = `<svg xmlns="http://www.w3.org/2000/svg">\n<defs>\n`;
3743
filenames.forEach((filename) => {
@@ -59,7 +65,7 @@ function createIconset(folder, filenames, idPrefix = '') {
5965
return output;
6066
}
6167

62-
gulp.task('icons', () => {
68+
gulp.task('icons', (done) => {
6369
const folder = 'icons/svg/';
6470
let glyphs;
6571

@@ -103,6 +109,8 @@ gulp.task('icons', () => {
103109
import '@polymer/iron-iconset-svg/iron-iconset-svg.js';
104110
import './version.js';
105111
112+
${addWarning()}
113+
106114
const template = document.createElement('template');
107115
108116
template.innerHTML = \`<iron-iconset-svg size="1000" name="lumo">
@@ -210,6 +218,8 @@ document.head.appendChild(template.content);
210218
if (err) {
211219
return console.error(err);
212220
}
221+
222+
done();
213223
});
214224
});
215225
});

‎packages/vaadin-lumo-styles/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"module": "all-imports.js",
2121
"type": "module",
2222
"scripts": {
23-
"icons": "gulp icons"
23+
"icons": "gulp icons --gulpfile gulpfile.cjs"
2424
},
2525
"files": [
2626
"*.d.ts",

packages/vaadin-material-styles/gulpfile.js renamed to packages/vaadin-material-styles/gulpfile.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function sortIconFilesNormalized(file1, file2) {
2323
return file1.replace(/-/g, '~').localeCompare(file2.replace(/-/g, '~'), 'en-US');
2424
}
2525

26-
gulp.task('icons', () => {
26+
gulp.task('icons', (done) => {
2727
const folder = 'icons/svg/';
2828
let glyphs;
2929

@@ -132,6 +132,7 @@ document.head.appendChild(template.content);
132132
if (err) {
133133
return console.error(err);
134134
}
135+
done();
135136
});
136137
});
137138
});

‎packages/vaadin-material-styles/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"module": "all-imports.js",
2121
"type": "module",
2222
"scripts": {
23-
"icons": "gulp icons"
23+
"icons": "gulp icons --gulpfile gulpfile.cjs"
2424
},
2525
"files": [
2626
"*.d.ts",

0 commit comments

Comments
 (0)