-
Notifications
You must be signed in to change notification settings - Fork 32
chore: update deps version #173
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
Open
liweijie0812
wants to merge
27
commits into
develop
Choose a base branch
from
chore/deps
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
6d14cd6
chore: update deps version
liweijie0812 29033d4
feat: upgrade svgo to v4
liweijie0812 4e8b767
chore: upgrade husky to v9
liweijie0812 aa5846d
chore: upgrade fs-extra to v11
liweijie0812 d938cc3
chore: upgrade cross-env to v11
liweijie0812 1fd31de
chore: upgrade cross-env to v11
liweijie0812 d2b4325
chore: upgrade lint-staged to v16
liweijie0812 6f062a9
chore: upgrade del to v8
liweijie0812 fe29c13
chore: upgrade del to v8
liweijie0812 8aef4c1
chore: fix
liweijie0812 1d9cc3d
chore: upgrade gulp-rename
liweijie0812 5385e42
chore: upgrade ts-node to v10
liweijie0812 adc270d
chore: upgrade camelcase to v10, remove uppercamelcase
liweijie0812 0e7a825
chore: remove merge2 merge-stream
liweijie0812 da20ab6
chore: upgrade rimraf to v6
liweijie0812 f56985c
chore: upgrade decamelize to v6
liweijie0812 e6c8a1d
chore: upgrade gulp to v5
liweijie0812 892d478
chore: update pnpm-workspace.yaml
liweijie0812 b25288a
chore: fix lock
liweijie0812 8114dbe
chore: update deps
liweijie0812 bb5c9d5
chore: upgrade gulp-iconfont to v11
liweijie0812 6e031d1
chore: remove .npmrc
liweijie0812 8116002
chore: fix ts warning
liweijie0812 69120af
chore: rollup-plugin-terser is Deprecated, use @rollup/plugin-terser
liweijie0812 e642a80
chore: fix build
liweijie0812 94159b9
chore: pin gulp-iconfont 11.0.1
liweijie0812 d736cdb
Merge branch 'develop' into chore/deps
liweijie0812 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1 @@ | ||
| #!/bin/sh | ||
| . "$(dirname "$0")/_/husky.sh" | ||
|
|
||
| pnpm lint-staged | ||
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 |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| import del from 'del'; | ||
| import { deleteAsync } from 'del'; | ||
|
|
||
| export const clearDir = (paths: string[]) => () => del(paths); | ||
| export const clearDir = (paths: string[]) => () => deleteAsync(paths); |
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 |
|---|---|---|
| @@ -1,87 +1,79 @@ | ||
| import SVGO from 'svgo'; | ||
| import type { PluginConfig, Config } from 'svgo'; | ||
| import { optimize } from 'svgo'; | ||
| import { createTransformStreamAsync } from './transform'; | ||
|
|
||
| export interface SVGOConfig { | ||
| removeXMLNS?: boolean; | ||
| cleanupAttrs?: boolean ; | ||
| removeDoctype?: boolean ; | ||
| removeXMLProcInst?: boolean ; | ||
| removeComments?: boolean ; | ||
| removeMetadata?: boolean ; | ||
| removeTitle?: boolean ; | ||
| removeDesc?: boolean ; | ||
| removeUselessDefs?: boolean ; | ||
| removeEditorsNSData?: boolean ; | ||
| removeEmptyAttrs?: boolean ; | ||
| removeHiddenElems?: boolean ; | ||
| removeEmptyText?: boolean ; | ||
| removeEmptyContainers?: boolean ; | ||
| removeViewBox?: boolean ; | ||
| cleanupEnableBackground?: boolean ; | ||
| convertStyleToAttrs?: boolean ; | ||
| convertPathData?: boolean ; | ||
| convertTransform?: boolean ; | ||
| removeUnknownsAndDefaults?: boolean ; | ||
| removeNonInheritableGroupAttrs?: boolean ; | ||
| removeUselessStrokeAndFill?: boolean ; | ||
| removeUnusedNS?: boolean ; | ||
| cleanupIDs?: boolean ; | ||
| cleanupNumericValues?: boolean ; | ||
| moveElemsAttrsToGroup?: boolean ; | ||
| moveGroupAttrsToElems?: boolean ; | ||
| collapseGroups?: boolean ; | ||
| removeRasterImages?: boolean ; | ||
| mergePaths?: boolean ; | ||
| convertShapeToPath?: boolean ; | ||
| sortAttrs?: boolean ; | ||
| removeDimensions?: boolean ; | ||
| removeXMLNS?: boolean; | ||
| cleanupAttrs?: boolean; | ||
| removeDoctype?: boolean; | ||
| removeXMLProcInst?: boolean; | ||
| removeComments?: boolean; | ||
| removeMetadata?: boolean; | ||
| removeTitle?: boolean; | ||
| removeDesc?: boolean; | ||
| removeUselessDefs?: boolean; | ||
| removeEditorsNSData?: boolean; | ||
| removeEmptyAttrs?: boolean; | ||
| removeHiddenElems?: boolean; | ||
| removeEmptyText?: boolean; | ||
| removeEmptyContainers?: boolean; | ||
| removeViewBox?: boolean; | ||
| cleanupEnableBackground?: boolean; | ||
| convertStyleToAttrs?: boolean; | ||
| convertPathData?: boolean; | ||
| convertTransform?: boolean; | ||
| removeUnknownsAndDefaults?: boolean; | ||
| removeNonInheritableGroupAttrs?: boolean; | ||
| removeUselessStrokeAndFill?: boolean; | ||
| removeUnusedNS?: boolean; | ||
| cleanupIDs?: boolean; | ||
| cleanupNumericValues?: boolean; | ||
| moveElemsAttrsToGroup?: boolean; | ||
| moveGroupAttrsToElems?: boolean; | ||
| collapseGroups?: boolean; | ||
| removeRasterImages?: boolean; | ||
| mergePaths?: boolean; | ||
| convertShapeToPath?: boolean; | ||
| sortAttrs?: boolean; | ||
| removeDimensions?: boolean; | ||
| } | ||
|
|
||
| function getSVGOOption(config: SVGOConfig = {}) { | ||
| function getSVGOOption(config: SVGOConfig = {}): Config { | ||
| const { removeXMLNS = true } = config; | ||
| const plugins: PluginConfig[] = [ | ||
| { | ||
| // https://svgo.dev/docs/preset-default/ | ||
| name: 'preset-default', | ||
| params: { | ||
| overrides: { | ||
| cleanupAttrs: false, | ||
| convertPathData: false, | ||
| removeUselessStrokeAndFill: false, | ||
| cleanupIds: false, | ||
| cleanupNumericValues: false, | ||
| moveElemsAttrsToGroup: false, | ||
| mergePaths: false, | ||
| }, | ||
| }, | ||
| }, | ||
| 'convertStyleToAttrs', | ||
| 'removeRasterImages', | ||
| 'removeDimensions', | ||
| { name: 'removeAttrs', params: { attrs: ['class'] } }, | ||
| ]; | ||
| if (removeXMLNS) { | ||
| plugins.push('removeXMLNS'); | ||
| } | ||
|
|
||
| return { | ||
| floatPrecision: 2, | ||
| plugins: [ | ||
| { cleanupAttrs: false }, | ||
| { removeDoctype: true }, | ||
| { removeXMLProcInst: true }, | ||
| { removeXMLNS }, | ||
| { removeComments: true }, | ||
| { removeMetadata: true }, | ||
| { removeTitle: true }, | ||
| { removeDesc: true }, | ||
| { removeUselessDefs: true }, | ||
| { removeEditorsNSData: true }, | ||
| { removeEmptyAttrs: true }, | ||
| { removeHiddenElems: true }, | ||
| { removeEmptyText: true }, | ||
| { removeEmptyContainers: true }, | ||
| { removeViewBox: false }, | ||
| { cleanupEnableBackground: true }, | ||
| { convertStyleToAttrs: true }, | ||
| { convertPathData: false }, | ||
| { convertTransform: true }, | ||
| { removeUnknownsAndDefaults: true }, | ||
| { removeNonInheritableGroupAttrs: true }, | ||
| { removeUselessStrokeAndFill: false }, | ||
| { removeUnusedNS: true }, | ||
| { cleanupIDs: false }, // remain id to identify different paths | ||
| { cleanupNumericValues: false }, // avoid path destroyed | ||
| { moveElemsAttrsToGroup: false }, // remain each path attrs | ||
| { moveGroupAttrsToElems: true }, | ||
| { collapseGroups: true }, | ||
| { removeRasterImages: false }, | ||
| { mergePaths: false }, | ||
| { convertShapeToPath: true }, | ||
| { sortAttrs: true }, | ||
| { removeDimensions: true }, | ||
| { removeAttrs: { attrs: ['class'] } }, | ||
| ], | ||
| plugins, | ||
| }; | ||
| } | ||
|
|
||
| export const svgo = (config?: SVGOConfig) => { | ||
| const optimizer = new SVGO(getSVGOOption(config)); | ||
| return createTransformStreamAsync(async (raw: string) => (await optimizer.optimize(raw)).data); | ||
| const options = getSVGOOption(config); | ||
| return createTransformStreamAsync( | ||
| async (raw: string) => optimize(raw, options).data, | ||
| ); | ||
| }; |
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
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
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
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
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.
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.
这个是?
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.
husky 9以后不需要