Skip to content

Commit

Permalink
chore(ui-icons,ui-scripts): move icon generation to ui-scipts (except…
Browse files Browse the repository at this point in the history
… icon fonts)
  • Loading branch information
balzss committed Oct 2, 2023
1 parent cd5e681 commit 9a8feb4
Show file tree
Hide file tree
Showing 10 changed files with 630 additions and 20 deletions.
250 changes: 250 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 2 additions & 17 deletions packages/ui-icons/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@
*/

const gulp = require('gulp')
const { buildFonts } = require('@instructure/ui-icons-build')

const {
optimizeSVGs,
buildSVGs,
buildFonts,
buildReact,
buildAll,
clean
} = require('@instructure/ui-icons-build')

gulp.task('clean', clean)
gulp.task('optimize', optimizeSVGs)
gulp.task('build:svgs', buildSVGs)
gulp.task('build:fonts', buildFonts)
gulp.task('build:react', buildReact)
gulp.task('build', buildAll)

gulp.task('default', buildAll)
gulp.task('default', buildFonts)
5 changes: 3 additions & 2 deletions packages/ui-icons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
"bugs": "https://github.com/instructure/instructure-ui/issues",
"scripts": {
"clean": "gulp clean && ui-scripts clean",
"prepare-build": "gulp",
"prepare-build": "npm run build-icons",
"build-icons": "ui-scripts build-icons --svgoConfig svgo.config.js --config icons.config.js && gulp",
"build": "ui-scripts build __build__ --copy-files --modules es,cjs",
"export": "gulp clean && gulp && npm run build:types",
"export": "npm run build-icons && npm run build:types",
"build:types": "tsc -p tsconfig.build.json",
"ts:check": "tsc -p tsconfig.build.json --noEmit --emitDeclarationOnly false"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/ui-icons/svgo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ module.exports = {
name: 'convertPathData',
active: false
},
{
name: 'removeAttrs',
params: {
attrs: '(fill)'
}
},
{
// Custom plugin for wrapping multiple path svg-s into a `<g>` tag.
// This is needed because all svg files are supposed to have
Expand Down
4 changes: 3 additions & 1 deletion packages/ui-scripts/lib/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import bundle from '../build/webpack.js'
import clean from '../build/clean.js'
import build from '../build/babel.js'
import generateAllTokens from '../build/generate-all-tokens.js'
import buildIcons from '../icons/build-icons.js'

export const yargCommands = [
bump,
Expand All @@ -47,5 +48,6 @@ export const yargCommands = [
bundle,
clean,
build,
generateAllTokens
generateAllTokens,
buildIcons
]
Loading

0 comments on commit 9a8feb4

Please sign in to comment.