svg-sprite-generation-loader 2.2.8 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +10 -8
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -1
- package/.github/dependabot.yml +7 -0
- package/.github/workflows/close-state-issues.yml +1 -1
- package/.github/workflows/codeql-analysis.yml +30 -31
- package/.github/workflows/dependency-review.yml +2 -2
- package/.github/workflows/npm-publish.yml +8 -3
- package/.github/workflows/quality-check.yml +31 -0
- package/.husky/pre-commit +0 -3
- package/.prettierignore +4 -0
- package/CODE_OF_CONDUCT.md +11 -11
- package/CONTRIBUTING.md +1 -0
- package/README.md +6 -6
- package/eslint.config.js +19 -0
- package/index.js +1 -11
- package/package.json +11 -7
- package/plugin.js +0 -1
- package/utils/transformSvg.js +0 -1
- package/.eslintrc.json +0 -12
|
@@ -4,7 +4,6 @@ about: Create a report to help us improve
|
|
|
4
4
|
title: ''
|
|
5
5
|
labels: ''
|
|
6
6
|
assignees: ''
|
|
7
|
-
|
|
8
7
|
---
|
|
9
8
|
|
|
10
9
|
**Describe the bug**
|
|
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
|
|
|
12
11
|
|
|
13
12
|
**To Reproduce**
|
|
14
13
|
Steps to reproduce the behavior:
|
|
14
|
+
|
|
15
15
|
1. Go to '...'
|
|
16
16
|
2. Click on '....'
|
|
17
17
|
3. Scroll down to '....'
|
|
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
|
|
|
24
24
|
If applicable, add screenshots to help explain your problem.
|
|
25
25
|
|
|
26
26
|
**Desktop (please complete the following information):**
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
- OS: [e.g. iOS]
|
|
29
|
+
- Browser [e.g. chrome, safari]
|
|
30
|
+
- Version [e.g. 22]
|
|
30
31
|
|
|
31
32
|
**Smartphone (please complete the following information):**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
- Device: [e.g. iPhone6]
|
|
35
|
+
- OS: [e.g. iOS8.1]
|
|
36
|
+
- Browser [e.g. stock browser, safari]
|
|
37
|
+
- Version [e.g. 22]
|
|
36
38
|
|
|
37
39
|
**Additional context**
|
|
38
40
|
Add any other context about the problem here.
|
package/.github/dependabot.yml
CHANGED
|
@@ -5,7 +5,14 @@
|
|
|
5
5
|
|
|
6
6
|
version: 2
|
|
7
7
|
updates:
|
|
8
|
+
# npm packages
|
|
8
9
|
- package-ecosystem: 'npm' # See documentation for possible values
|
|
9
10
|
directory: '/' # Location of package manifests
|
|
10
11
|
schedule:
|
|
11
12
|
interval: 'monthly'
|
|
13
|
+
|
|
14
|
+
# GitHub Actions used in workflows
|
|
15
|
+
- package-ecosystem: 'github-actions'
|
|
16
|
+
directory: '/'
|
|
17
|
+
schedule:
|
|
18
|
+
interval: 'monthly'
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
# the `language` matrix defined below to confirm you have the correct set of
|
|
10
10
|
# supported CodeQL languages.
|
|
11
11
|
#
|
|
12
|
-
name:
|
|
12
|
+
name: 'CodeQL'
|
|
13
13
|
|
|
14
14
|
on:
|
|
15
15
|
push:
|
|
16
|
-
branches: [
|
|
16
|
+
branches: ['main']
|
|
17
17
|
pull_request:
|
|
18
18
|
# The branches below must be a subset of the branches above
|
|
19
|
-
branches: [
|
|
19
|
+
branches: ['main']
|
|
20
20
|
schedule:
|
|
21
21
|
- cron: '41 5 * * 1'
|
|
22
22
|
|
|
@@ -32,41 +32,40 @@ jobs:
|
|
|
32
32
|
strategy:
|
|
33
33
|
fail-fast: false
|
|
34
34
|
matrix:
|
|
35
|
-
language: [
|
|
35
|
+
language: ['javascript']
|
|
36
36
|
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
37
37
|
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
38
38
|
|
|
39
39
|
steps:
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
- name: Checkout repository
|
|
41
|
+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
53
|
-
# queries: security-extended,security-and-quality
|
|
43
|
+
# Initializes the CodeQL tools for scanning.
|
|
44
|
+
- name: Initialize CodeQL
|
|
45
|
+
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
|
46
|
+
with:
|
|
47
|
+
languages: ${{ matrix.language }}
|
|
48
|
+
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
49
|
+
# By default, queries listed here will override any specified in a config file.
|
|
50
|
+
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
# If this step fails, then you should remove it and run the build manually (see below)
|
|
58
|
-
- name: Autobuild
|
|
59
|
-
uses: github/codeql-action/autobuild@v2
|
|
52
|
+
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
53
|
+
# queries: security-extended,security-and-quality
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
|
56
|
+
# If this step fails, then you should remove it and run the build manually (see below)
|
|
57
|
+
- name: Autobuild
|
|
58
|
+
uses: github/codeql-action/autobuild@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
|
63
59
|
|
|
64
|
-
|
|
65
|
-
|
|
60
|
+
# ℹ️ Command-line programs to run using the OS shell.
|
|
61
|
+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
# ./location_of_script_within_repo/buildscript.sh
|
|
63
|
+
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
|
64
|
+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
# - run: |
|
|
67
|
+
# echo "Run, Build Application using script"
|
|
68
|
+
# ./location_of_script_within_repo/buildscript.sh
|
|
69
|
+
|
|
70
|
+
- name: Perform CodeQL Analysis
|
|
71
|
+
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
|
|
@@ -15,6 +15,6 @@ jobs:
|
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
steps:
|
|
17
17
|
- name: 'Checkout Repository'
|
|
18
|
-
uses: actions/checkout@
|
|
18
|
+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
19
19
|
- name: 'Dependency Review'
|
|
20
|
-
uses: actions/dependency-review-action@
|
|
20
|
+
uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
|
|
@@ -8,19 +8,24 @@ on:
|
|
|
8
8
|
types: [created]
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
|
+
quality-check:
|
|
12
|
+
uses: ./.github/workflows/quality-check.yml
|
|
13
|
+
secrets: inherit
|
|
14
|
+
|
|
11
15
|
publish:
|
|
16
|
+
needs: quality-check
|
|
12
17
|
runs-on: ubuntu-latest
|
|
13
18
|
permissions:
|
|
14
19
|
contents: read
|
|
15
20
|
id-token: write
|
|
16
21
|
steps:
|
|
17
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
18
23
|
|
|
19
24
|
- name: Install pnpm
|
|
20
|
-
uses: pnpm/action-setup@
|
|
25
|
+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
|
21
26
|
|
|
22
27
|
- name: Set Node.js
|
|
23
|
-
uses: actions/setup-node@v6
|
|
28
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
24
29
|
with:
|
|
25
30
|
node-version: 24
|
|
26
31
|
cache: 'pnpm'
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Quality Check
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
workflow_call:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
checks:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
14
|
+
|
|
15
|
+
- name: Install pnpm
|
|
16
|
+
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
|
|
17
|
+
|
|
18
|
+
- name: Set Node.js
|
|
19
|
+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
|
20
|
+
with:
|
|
21
|
+
node-version: 24
|
|
22
|
+
cache: 'pnpm'
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: pnpm i --frozen-lockfile
|
|
26
|
+
|
|
27
|
+
- name: Lint
|
|
28
|
+
run: pnpm lint
|
|
29
|
+
|
|
30
|
+
- name: Format check
|
|
31
|
+
run: pnpm format:check
|
package/.husky/pre-commit
CHANGED
package/.prettierignore
ADDED
package/CODE_OF_CONDUCT.md
CHANGED
|
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
|
|
|
17
17
|
Examples of behavior that contributes to a positive environment for our
|
|
18
18
|
community include:
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
- Demonstrating empathy and kindness toward other people
|
|
21
|
+
- Being respectful of differing opinions, viewpoints, and experiences
|
|
22
|
+
- Giving and gracefully accepting constructive feedback
|
|
23
|
+
- Accepting responsibility and apologizing to those affected by our mistakes,
|
|
24
24
|
and learning from the experience
|
|
25
|
-
|
|
25
|
+
- Focusing on what is best not just for us as individuals, but for the
|
|
26
26
|
overall community
|
|
27
27
|
|
|
28
28
|
Examples of unacceptable behavior include:
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
- The use of sexualized language or imagery, and sexual attention or
|
|
31
31
|
advances of any kind
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
- Trolling, insulting or derogatory comments, and personal or political attacks
|
|
33
|
+
- Public or private harassment
|
|
34
|
+
- Publishing others' private information, such as a physical or email
|
|
35
35
|
address, without their explicit permission
|
|
36
|
-
|
|
36
|
+
- Other conduct which could reasonably be considered inappropriate in a
|
|
37
37
|
professional setting
|
|
38
38
|
|
|
39
39
|
## Enforcement Responsibilities
|
|
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
|
|
|
106
106
|
### 4. Permanent Ban
|
|
107
107
|
|
|
108
108
|
**Community Impact**: Demonstrating a pattern of violation of community
|
|
109
|
-
standards, including sustained inappropriate behavior,
|
|
109
|
+
standards, including sustained inappropriate behavior, harassment of an
|
|
110
110
|
individual, or aggression toward or disparagement of classes of individuals.
|
|
111
111
|
|
|
112
112
|
**Consequence**: A permanent ban from any sort of public interaction within
|
package/CONTRIBUTING.md
CHANGED
package/README.md
CHANGED
|
@@ -108,9 +108,9 @@ import iconData from 'path/to/some/icon-file-name.svg';
|
|
|
108
108
|
|
|
109
109
|
## Options
|
|
110
110
|
|
|
111
|
-
| Name | Type | Default value | Description
|
|
112
|
-
| -------------- | -------------------------------- | ------------- |
|
|
113
|
-
| symbolId | `string` \| `function` | `"[name]"` | Sprite item (single icon) `<symbol>` `id` attribute value.<br />`string` or `function` that takes the file path of the original icon as an argument and returns `string`.<br /><br />You can use [interpolateName](https://github.com/webpack/loader-utils#interpolatename) patterns.<br /> Default value (`"[name]"`) is equal to icon filename (without extension). For example, by default symbolId for `file1.svg` file will be `file1`
|
|
114
|
-
| spriteFilePath | `string` | `sprite.svg` | Path to sprite file.<br /> `webpack.output.path` is included. You can use [interpolateName](https://github.com/webpack/loader-utils#interpolatename) patterns.
|
|
115
|
-
| svgoOptimize | `boolean` \| `object` | `true` | Enable/Disable/Customize source svg file optimization with [svgo.optimize](https://github.com/svg/svgo#optimize). The following options are used by default: <br /><pre>`{`<br /> `plugins: [
|
|
116
|
-
| **addContent** | `boolean` | `false` | Add svg content as property to transformed svg object (may increase bundle size when enabled)
|
|
111
|
+
| Name | Type | Default value | Description |
|
|
112
|
+
| -------------- | -------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
113
|
+
| symbolId | `string` \| `function` | `"[name]"` | Sprite item (single icon) `<symbol>` `id` attribute value.<br />`string` or `function` that takes the file path of the original icon as an argument and returns `string`.<br /><br />You can use [interpolateName](https://github.com/webpack/loader-utils#interpolatename) patterns.<br /> Default value (`"[name]"`) is equal to icon filename (without extension). For example, by default symbolId for `file1.svg` file will be `file1` |
|
|
114
|
+
| spriteFilePath | `string` | `sprite.svg` | Path to sprite file.<br /> `webpack.output.path` is included. You can use [interpolateName](https://github.com/webpack/loader-utils#interpolatename) patterns. |
|
|
115
|
+
| svgoOptimize | `boolean` \| `object` | `true` | Enable/Disable/Customize source svg file optimization with [svgo.optimize](https://github.com/svg/svgo#optimize). The following options are used by default: <br /><pre>`{`<br /> `plugins: ['preset-default', 'removeXMLNS'],`<br />`}`</pre> You can disable it completely (by passing `false`) or use your own configuration (see [svgo docs](https://github.com/svg/svgo#optimize)) |
|
|
116
|
+
| **addContent** | `boolean` | `false` | Add svg content as property to transformed svg object (may increase bundle size when enabled) |
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const js = require('@eslint/js');
|
|
2
|
+
const globals = require('globals');
|
|
3
|
+
const importPlugin = require('eslint-plugin-import');
|
|
4
|
+
const prettier = require('eslint-config-prettier');
|
|
5
|
+
|
|
6
|
+
module.exports = [
|
|
7
|
+
js.configs.recommended,
|
|
8
|
+
importPlugin.flatConfigs.recommended,
|
|
9
|
+
{
|
|
10
|
+
languageOptions: {
|
|
11
|
+
ecmaVersion: 'latest',
|
|
12
|
+
sourceType: 'commonjs',
|
|
13
|
+
globals: {
|
|
14
|
+
...globals.node,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
prettier,
|
|
19
|
+
];
|
package/index.js
CHANGED
|
@@ -94,17 +94,7 @@ function svgSpriteGenerationLoader(source) {
|
|
|
94
94
|
const svgoOptimizeConfig =
|
|
95
95
|
options.svgoOptimize === true
|
|
96
96
|
? {
|
|
97
|
-
plugins: [
|
|
98
|
-
{
|
|
99
|
-
name: 'preset-default',
|
|
100
|
-
params: {
|
|
101
|
-
overrides: {
|
|
102
|
-
removeViewBox: false,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
'removeXMLNS',
|
|
107
|
-
],
|
|
97
|
+
plugins: ['preset-default', 'removeXMLNS'],
|
|
108
98
|
}
|
|
109
99
|
: options.svgoOptimize;
|
|
110
100
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svg-sprite-generation-loader",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Webpack loader for generating external svg symbol sprite files",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -33,15 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"loader-utils": "^3.2.1",
|
|
35
35
|
"schema-utils": "^4.2.0",
|
|
36
|
-
"svgo": "^
|
|
36
|
+
"svgo": "^4.0.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"eslint": "^
|
|
40
|
-
"eslint
|
|
41
|
-
"eslint-config-prettier": "^10.1.
|
|
42
|
-
"eslint-plugin-import": "^2.
|
|
39
|
+
"@eslint/js": "^10.0.1",
|
|
40
|
+
"eslint": "^10.4.1",
|
|
41
|
+
"eslint-config-prettier": "^10.1.8",
|
|
42
|
+
"eslint-plugin-import": "^2.32.0",
|
|
43
|
+
"globals": "^17.6.0",
|
|
43
44
|
"husky": ">=6",
|
|
44
|
-
"lint-staged": "
|
|
45
|
+
"lint-staged": "^17.0.7",
|
|
45
46
|
"prettier": "^3.8.3"
|
|
46
47
|
},
|
|
47
48
|
"lint-staged": {
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
"*.{js,css,md}": "prettier --write"
|
|
50
51
|
},
|
|
51
52
|
"scripts": {
|
|
53
|
+
"lint": "eslint .",
|
|
54
|
+
"format": "prettier --write .",
|
|
55
|
+
"format:check": "prettier --check .",
|
|
52
56
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
53
57
|
}
|
|
54
58
|
}
|
package/plugin.js
CHANGED
|
@@ -6,7 +6,6 @@ class SvgSpriteGeneratorPlugin {
|
|
|
6
6
|
this.params = params;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
// eslint-disable-next-line class-methods-use-this
|
|
10
9
|
apply(compiler) {
|
|
11
10
|
// webpack module instance can be accessed from the compiler object,
|
|
12
11
|
// this ensures that correct version of the module is used
|
package/utils/transformSvg.js
CHANGED