mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-16 21:11:52 +00:00
0.2.0 - Mid migration
This commit is contained in:
parent
139e6a915e
commit
7e38fdbd7d
42393 changed files with 5358157 additions and 62 deletions
307
web/node_modules/@svgr/core/CHANGELOG.md
generated
vendored
Normal file
307
web/node_modules/@svgr/core/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,307 @@
|
|||
# Change Log
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [5.5.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.4.0...v5.5.0) (2020-11-15)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **typescript:** fix react-native support [#465](https://github.com/gregberge/svgr/tree/master/packages/core/issues/465) ([#488](https://github.com/gregberge/svgr/tree/master/packages/core/issues/488)) ([d61e0cf](https://github.com/gregberge/svgr/tree/master/packages/core/commit/d61e0cface065afc1478fdb44d87ca8177041eab))
|
||||
* prevent removing the namespace by svgr ([[#475](https://github.com/gregberge/svgr/tree/master/packages/core/issues/475)](https://github.com/gregberge/svgr/issues/475) ([#498](https://github.com/gregberge/svgr/tree/master/packages/core/issues/498)) ([00e84ea](https://github.com/gregberge/svgr/tree/master/packages/core/commit/00e84ead96d89bcbd072b9585b4db1365e392d33))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow custom name for named export ([#493](https://github.com/gregberge/svgr/tree/master/packages/core/issues/493)) ([16a58d6](https://github.com/gregberge/svgr/tree/master/packages/core/commit/16a58d6e817c065f72a68be91600a1a360205f44))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.4.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.3.1...v5.4.0) (2020-04-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* wrap svg component directly with memo/forwardRef ([#440](https://github.com/gregberge/svgr/tree/master/packages/core/issues/440)) ([#441](https://github.com/gregberge/svgr/tree/master/packages/core/issues/441)) ([a6de2da](https://github.com/gregberge/svgr/tree/master/packages/core/commit/a6de2dacb63e36572a2167b928418bdc39f3a9c2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **cli:** make all CLI options available in config ([a23a186](https://github.com/gregberge/svgr/tree/master/packages/core/commit/a23a18675c0dd4a461d2fcbdc72a305cabd32a13)), closes [#431](https://github.com/gregberge/svgr/tree/master/packages/core/issues/431) [#437](https://github.com/gregberge/svgr/tree/master/packages/core/issues/437)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.3.1](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.3.0...v5.3.1) (2020-04-05)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.3.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.2.0...v5.3.0) (2020-03-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add typescript option ([4596d7b](https://github.com/gregberge/svgr/tree/master/packages/core/commit/4596d7bb470babb5ec4b87f5281174fb182bd9c7)), closes [#373](https://github.com/gregberge/svgr/tree/master/packages/core/issues/373)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [5.2.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.1.0...v5.2.0) (2020-02-23)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [5.0.1](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v5.0.0...v5.0.1) (2019-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix engines in package.json ([a45d6fc](https://github.com/gregberge/svgr/tree/master/packages/core/commit/a45d6fc8b43402bec60ed4e9273f90fdc65a23a7))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.3.3](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v4.3.2...v4.3.3) (2019-09-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **babel-plugin-svg-dynamic-title:** dont render empty title ([#341](https://github.com/gregberge/svgr/tree/master/packages/core/issues/341)) ([88b24c5](https://github.com/gregberge/svgr/tree/master/packages/core/commit/88b24c5)), closes [#333](https://github.com/gregberge/svgr/tree/master/packages/core/issues/333)
|
||||
* invalid characters in component name ([#332](https://github.com/gregberge/svgr/tree/master/packages/core/issues/332)) ([4b4bd2c](https://github.com/gregberge/svgr/tree/master/packages/core/commit/4b4bd2c)), closes [#331](https://github.com/gregberge/svgr/tree/master/packages/core/issues/331)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.3.2](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v4.3.1...v4.3.2) (2019-07-15)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.3.1](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v4.3.0...v4.3.1) (2019-07-01)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.3.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v4.2.0...v4.3.0) (2019-05-28)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.2.0](https://github.com/gregberge/svgr/tree/master/packages/core/compare/v4.1.0...v4.2.0) (2019-04-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* keep viewBox when dimensions are removed ([#281](https://github.com/gregberge/svgr/tree/master/packages/core/issues/281)) ([f476c8e](https://github.com/gregberge/svgr/tree/master/packages/core/commit/f476c8e))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add expo option ([#289](https://github.com/gregberge/svgr/tree/master/packages/core/issues/289)) ([978db3e](https://github.com/gregberge/svgr/tree/master/packages/core/commit/978db3e))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.1.0](https://github.com/gregberge/svgr/compare/v4.0.4...v4.1.0) (2018-11-24)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.3](https://github.com/gregberge/svgr/compare/v4.0.2...v4.0.3) (2018-11-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* upgrade dependencies ([7e2195f](https://github.com/gregberge/svgr/commit/7e2195f))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.2](https://github.com/gregberge/svgr/compare/v4.0.1...v4.0.2) (2018-11-08)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [4.0.1](https://github.com/gregberge/svgr/compare/v4.0.0...v4.0.1) (2018-11-08)
|
||||
|
||||
**Note:** Version bump only for package @svgr/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [4.0.0](https://github.com/gregberge/svgr/compare/v3.1.0...v4.0.0) (2018-11-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **svgo:** prefix ids by default ([06c338d](https://github.com/gregberge/svgr/commit/06c338d)), closes [#210](https://github.com/gregberge/svgr/issues/210)
|
||||
* **v4:** new architecture ([ac8b8ca](https://github.com/gregberge/svgr/commit/ac8b8ca))
|
||||
* allow dynamic properties in replaceAttrValues option ([15f55fe](https://github.com/gregberge/svgr/commit/15f55fe)), closes [#205](https://github.com/gregberge/svgr/issues/205)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* **v4:** - `template` option must now returns a Babel AST
|
||||
- `@svgr/core` does not include svgo & prettier by default
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.1.0](https://github.com/gregberge/svgr/compare/v3.0.0...v3.1.0) (2018-10-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* style & custom SVG properties ([#203](https://github.com/gregberge/svgr/issues/203)) ([f8b2212](https://github.com/gregberge/svgr/commit/f8b2212)), closes [#199](https://github.com/gregberge/svgr/issues/199) [#201](https://github.com/gregberge/svgr/issues/201)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow Mask & Image on React Native ([#202](https://github.com/gregberge/svgr/issues/202)) ([0256bc0](https://github.com/gregberge/svgr/commit/0256bc0))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="3.0.0"></a>
|
||||
# [3.0.0](https://github.com/gregberge/svgr/compare/v2.4.1...v3.0.0) (2018-10-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix --icon + --no-dimensions ([7535693](https://github.com/gregberge/svgr/commit/7535693)), closes [#141](https://github.com/gregberge/svgr/issues/141)
|
||||
* fix expandProps when position is not allowed ([45522fc](https://github.com/gregberge/svgr/commit/45522fc))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **config:** improve runtime config ([e52cdce](https://github.com/gregberge/svgr/commit/e52cdce)), closes [#192](https://github.com/gregberge/svgr/issues/192)
|
||||
* **template:** expose `getProps` util for template ([5cb238e](https://github.com/gregberge/svgr/commit/5cb238e)), closes [#187](https://github.com/gregberge/svgr/issues/187)
|
||||
* add synchronous API ([169eb2f](https://github.com/gregberge/svgr/commit/169eb2f)), closes [#185](https://github.com/gregberge/svgr/issues/185)
|
||||
* always prefix component name with "Svg" ([f71aa7a](https://github.com/gregberge/svgr/commit/f71aa7a)), closes [#190](https://github.com/gregberge/svgr/issues/190)
|
||||
* do not remove style tag ([a4ce09a](https://github.com/gregberge/svgr/commit/a4ce09a)), closes [#191](https://github.com/gregberge/svgr/issues/191)
|
||||
* new "expandProps" option ([bb95828](https://github.com/gregberge/svgr/commit/bb95828)), closes [#170](https://github.com/gregberge/svgr/issues/170)
|
||||
* remove "svgAttributes" option ([4e46a5d](https://github.com/gregberge/svgr/commit/4e46a5d)), closes [#173](https://github.com/gregberge/svgr/issues/173)
|
||||
* use forwardRef on React Native ([4bdd989](https://github.com/gregberge/svgr/commit/4bdd989)), closes [#184](https://github.com/gregberge/svgr/issues/184)
|
||||
* use React.forwardRef ([cbee51c](https://github.com/gregberge/svgr/commit/cbee51c)), closes [#184](https://github.com/gregberge/svgr/issues/184)
|
||||
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
* "--no-expand-props" is now replaced by "--expand-props none". You can now specify a position "start" or "end" for "expandProps"
|
||||
property.
|
||||
* `svgAttributes` has been removed, please use `svgProps` instead.
|
||||
* "ref" option now uses `React.forwardRef`. You don't have to use "svgRef"
|
||||
prop, just use "ref" and it will work. `React.forwardRef` requires React
|
||||
> 16.3.
|
||||
* Style tag will no longer be automatically removed. SVGO should handle it
|
||||
correctly using "inlineStyles" plugin. If you want to remove them,
|
||||
enable "removeStyleElement" plugin in your SVGO config.
|
||||
* **config:** - Runtime configuration is always loaded (even with Node API `convert`)
|
||||
- In CLI, "--config" is now "--config-file"; this new option can be used
|
||||
everywhere
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.4.1"></a>
|
||||
## [2.4.1](https://github.com/gregberge/svgr/compare/v2.4.0...v2.4.1) (2018-09-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **config:** fix custom config & default options ([#176](https://github.com/gregberge/svgr/issues/176)) ([9a6c40b](https://github.com/gregberge/svgr/commit/9a6c40b))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.4.0"></a>
|
||||
# [2.4.0](https://github.com/gregberge/svgr/compare/v2.3.0...v2.4.0) (2018-09-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* use literal instead of litteral ([7849fd4](https://github.com/gregberge/svgr/commit/7849fd4))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* allow to spread props at the start ([#166](https://github.com/gregberge/svgr/issues/166)) ([cd659dc](https://github.com/gregberge/svgr/commit/cd659dc))
|
||||
* **upgrade:** h2x@1.1.0 (jsdom@12.0.0) & others ([2d9b7bd](https://github.com/gregberge/svgr/commit/2d9b7bd))
|
||||
* new option "svgProps" ([#172](https://github.com/gregberge/svgr/issues/172)) ([9657110](https://github.com/gregberge/svgr/commit/9657110))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.2.0"></a>
|
||||
# [2.2.0](https://github.com/gregberge/svgr/compare/v2.1.1...v2.2.0) (2018-08-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove null-byte characters ([#154](https://github.com/gregberge/svgr/issues/154)) ([de7f8a7](https://github.com/gregberge/svgr/commit/de7f8a7)), closes [#153](https://github.com/gregberge/svgr/issues/153)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **core:** pass info to SVGO ([2b2353b](https://github.com/gregberge/svgr/commit/2b2353b)), closes [#152](https://github.com/gregberge/svgr/issues/152)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.1.1"></a>
|
||||
## [2.1.1](https://github.com/gregberge/svgr/compare/v2.1.0...v2.1.1) (2018-07-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **core:** config conflict with icon option ([#137](https://github.com/gregberge/svgr/issues/137)) ([e13a99a](https://github.com/gregberge/svgr/commit/e13a99a))
|
||||
|
||||
|
||||
|
||||
|
||||
<a name="2.1.0"></a>
|
||||
# [2.1.0](https://github.com/gregberge/svgr/compare/v2.0.0...v2.1.0) (2018-07-08)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add .editorconfig support ([#129](https://github.com/gregberge/svgr/issues/129)) ([968fd82](https://github.com/gregberge/svgr/commit/968fd82))
|
||||
* **cli:** support custom filename cases ([#136](https://github.com/gregberge/svgr/issues/136)) ([4922f7a](https://github.com/gregberge/svgr/commit/4922f7a)), closes [#118](https://github.com/gregberge/svgr/issues/118)
|
7
web/node_modules/@svgr/core/LICENSE
generated
vendored
Normal file
7
web/node_modules/@svgr/core/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
Copyright 2017 Smooth Code
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
60
web/node_modules/@svgr/core/README.md
generated
vendored
Normal file
60
web/node_modules/@svgr/core/README.md
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
# @svgr/core
|
||||
|
||||
[![Build Status][build-badge]][build]
|
||||
[![version][version-badge]][package]
|
||||
[![MIT License][license-badge]][license]
|
||||
|
||||
Node API of SVGR.
|
||||
|
||||
```
|
||||
npm install @svgr/core
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import svgr from '@svgr/core'
|
||||
|
||||
const svgCode = `
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<rect x="10" y="10" height="100" width="100"
|
||||
style="stroke:#ff0000; fill: #0000ff"/>
|
||||
</svg>
|
||||
`
|
||||
|
||||
svgr(svgCode, { icon: true }, { componentName: 'MyComponent' }).then(
|
||||
(jsCode) => {
|
||||
console.log(jsCode)
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
Use `svgr.sync(code, config, state)` if you would like to use sync version.
|
||||
|
||||
### Plugins
|
||||
|
||||
By default `@svgr/core` doesn't include `svgo` and `prettier` plugins, if you want them, you have to install them and include them in config.
|
||||
|
||||
```js
|
||||
svgr(svgCode, {
|
||||
plugins: ['@svgr/plugin-svgo', '@svgr/plugin-jsx', '@svgr/plugin-prettier'],
|
||||
}).then((jsCode) => {
|
||||
console.log(jsCode)
|
||||
})
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
[build-badge]: https://img.shields.io/travis/smooth-code/svgr.svg?style=flat-square
|
||||
[build]: https://travis-ci.org/smooth-code/svgr
|
||||
[version-badge]: https://img.shields.io/npm/v/@svgr/core.svg?style=flat-square
|
||||
[package]: https://www.npmjs.com/package/@svgr/core
|
||||
[license-badge]: https://img.shields.io/npm/l/@svgr/core.svg?style=flat-square
|
||||
[license]: https://github.com/smooth-code/svgr/blob/master/LICENSE
|
||||
|
||||
```
|
||||
|
||||
```
|
93
web/node_modules/@svgr/core/lib/config.js
generated
vendored
Normal file
93
web/node_modules/@svgr/core/lib/config.js
generated
vendored
Normal file
|
@ -0,0 +1,93 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.resolveConfig = resolveConfig;
|
||||
exports.resolveConfigFile = resolveConfigFile;
|
||||
exports.loadConfig = loadConfig;
|
||||
exports.DEFAULT_CONFIG = void 0;
|
||||
|
||||
var _cosmiconfig = require("cosmiconfig");
|
||||
|
||||
const DEFAULT_CONFIG = {
|
||||
dimensions: true,
|
||||
expandProps: 'end',
|
||||
icon: false,
|
||||
native: false,
|
||||
typescript: false,
|
||||
prettier: true,
|
||||
prettierConfig: null,
|
||||
memo: false,
|
||||
ref: false,
|
||||
replaceAttrValues: null,
|
||||
svgProps: null,
|
||||
svgo: true,
|
||||
svgoConfig: null,
|
||||
template: null,
|
||||
titleProp: false,
|
||||
runtimeConfig: true,
|
||||
plugins: null,
|
||||
namedExport: 'ReactComponent'
|
||||
};
|
||||
exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
|
||||
const explorer = (0, _cosmiconfig.cosmiconfig)('svgr', {
|
||||
sync: true,
|
||||
cache: true,
|
||||
rcExtensions: true
|
||||
});
|
||||
const explorerSync = (0, _cosmiconfig.cosmiconfigSync)('svgr', {
|
||||
sync: true,
|
||||
cache: true,
|
||||
rcExtensions: true
|
||||
});
|
||||
|
||||
async function resolveConfig(searchFrom, configFile) {
|
||||
if (configFile == null) {
|
||||
const result = await explorer.search(searchFrom);
|
||||
return result ? result.config : null;
|
||||
}
|
||||
|
||||
const result = await explorer.load(configFile);
|
||||
return result ? result.config : null;
|
||||
}
|
||||
|
||||
resolveConfig.sync = (searchFrom, configFile) => {
|
||||
if (configFile == null) {
|
||||
const result = explorerSync.search(searchFrom);
|
||||
return result ? result.config : null;
|
||||
}
|
||||
|
||||
const result = explorerSync.load(configFile);
|
||||
return result ? result.config : null;
|
||||
};
|
||||
|
||||
async function resolveConfigFile(filePath) {
|
||||
const result = await explorer.search(filePath);
|
||||
return result ? result.filepath : null;
|
||||
}
|
||||
|
||||
resolveConfigFile.sync = filePath => {
|
||||
const result = explorerSync.search(filePath);
|
||||
return result ? result.filepath : null;
|
||||
};
|
||||
|
||||
async function loadConfig({
|
||||
configFile,
|
||||
...baseConfig
|
||||
}, state = {}) {
|
||||
const rcConfig = state.filePath && baseConfig.runtimeConfig !== false ? await resolveConfig(state.filePath, configFile) : {};
|
||||
return { ...DEFAULT_CONFIG,
|
||||
...rcConfig,
|
||||
...baseConfig
|
||||
};
|
||||
}
|
||||
|
||||
loadConfig.sync = ({
|
||||
configFile,
|
||||
...baseConfig
|
||||
}, state = {}) => {
|
||||
const rcConfig = state.filePath && baseConfig.runtimeConfig !== false ? resolveConfig.sync(state.filePath, configFile) : {};
|
||||
return { ...DEFAULT_CONFIG,
|
||||
...rcConfig,
|
||||
...baseConfig
|
||||
};
|
||||
};
|
35
web/node_modules/@svgr/core/lib/convert.js
generated
vendored
Normal file
35
web/node_modules/@svgr/core/lib/convert.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.default = void 0;
|
||||
|
||||
var _state = require("./state");
|
||||
|
||||
var _config = require("./config");
|
||||
|
||||
var _plugins = require("./plugins");
|
||||
|
||||
function run(code, config, state) {
|
||||
const expandedState = (0, _state.expandState)(state);
|
||||
const plugins = (0, _plugins.getPlugins)(config, state).map(_plugins.resolvePlugin);
|
||||
let nextCode = String(code).replace('\0', ''); // eslint-disable-next-line no-restricted-syntax
|
||||
|
||||
for (const plugin of plugins) {
|
||||
nextCode = plugin(nextCode, config, expandedState);
|
||||
}
|
||||
|
||||
return nextCode;
|
||||
}
|
||||
|
||||
async function convert(code, config = {}, state = {}) {
|
||||
config = await (0, _config.loadConfig)(config, state);
|
||||
return run(code, config, state);
|
||||
}
|
||||
|
||||
convert.sync = (code, config = {}, state = {}) => {
|
||||
config = _config.loadConfig.sync(config, state);
|
||||
return run(code, config, state);
|
||||
};
|
||||
|
||||
var _default = convert;
|
||||
exports.default = _default;
|
20
web/node_modules/@svgr/core/lib/index.js
generated
vendored
Normal file
20
web/node_modules/@svgr/core/lib/index.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
var _exportNames = {};
|
||||
exports.default = void 0;
|
||||
|
||||
var _convert = _interopRequireDefault(require("./convert"));
|
||||
|
||||
exports.default = _convert.default;
|
||||
|
||||
var _config = require("./config");
|
||||
|
||||
Object.keys(_config).forEach(function (key) {
|
||||
if (key === "default" || key === "__esModule") return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _config[key]) return;
|
||||
exports[key] = _config[key];
|
||||
});
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
58
web/node_modules/@svgr/core/lib/plugins.js
generated
vendored
Normal file
58
web/node_modules/@svgr/core/lib/plugins.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.getPlugins = getPlugins;
|
||||
exports.resolvePlugin = resolvePlugin;
|
||||
exports.loadPlugin = loadPlugin;
|
||||
|
||||
var _pluginJsx = _interopRequireDefault(require("@svgr/plugin-jsx"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const DEFAULT_PLUGINS = [_pluginJsx.default];
|
||||
|
||||
function getPlugins(config, state) {
|
||||
if (config.plugins) {
|
||||
return config.plugins;
|
||||
}
|
||||
|
||||
if (state.caller && state.caller.defaultPlugins) {
|
||||
return state.caller.defaultPlugins;
|
||||
}
|
||||
|
||||
return DEFAULT_PLUGINS;
|
||||
}
|
||||
|
||||
function resolvePlugin(plugin) {
|
||||
if (typeof plugin === 'function') {
|
||||
return plugin;
|
||||
}
|
||||
|
||||
if (typeof plugin === 'string') {
|
||||
return loadPlugin(plugin);
|
||||
}
|
||||
|
||||
throw new Error(`Invalid plugin "${plugin}"`);
|
||||
}
|
||||
|
||||
const pluginCache = {};
|
||||
|
||||
function loadPlugin(moduleName) {
|
||||
if (pluginCache[moduleName]) {
|
||||
return pluginCache[moduleName];
|
||||
}
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line
|
||||
const plugin = require(moduleName);
|
||||
|
||||
if (!plugin.default || !plugin) {
|
||||
throw new Error(`Invalid plugin "${moduleName}"`);
|
||||
}
|
||||
|
||||
pluginCache[moduleName] = plugin.default || plugin;
|
||||
return pluginCache[moduleName];
|
||||
} catch (error) {
|
||||
throw new Error(`Module "${moduleName}" missing. Maybe \`npm install ${moduleName}\` could help!`);
|
||||
}
|
||||
}
|
27
web/node_modules/@svgr/core/lib/state.js
generated
vendored
Normal file
27
web/node_modules/@svgr/core/lib/state.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
"use strict";
|
||||
|
||||
exports.__esModule = true;
|
||||
exports.expandState = expandState;
|
||||
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
|
||||
var _camelcase = _interopRequireDefault(require("camelcase"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const validCharacters = /[^a-zA-Z0-9_-]/g;
|
||||
|
||||
function getComponentName(state) {
|
||||
if (!state.filePath) return 'SvgComponent';
|
||||
const pascalCaseFileName = (0, _camelcase.default)(_path.default.parse(state.filePath).name.replace(validCharacters, ''), {
|
||||
pascalCase: true
|
||||
});
|
||||
return `Svg${pascalCaseFileName}`;
|
||||
}
|
||||
|
||||
function expandState(state) {
|
||||
return {
|
||||
componentName: state.componentName || getComponentName(state),
|
||||
...state
|
||||
};
|
||||
}
|
38
web/node_modules/@svgr/core/package.json
generated
vendored
Normal file
38
web/node_modules/@svgr/core/package.json
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"name": "@svgr/core",
|
||||
"description": "Transform SVG into React Components.",
|
||||
"version": "5.5.0",
|
||||
"main": "lib/index.js",
|
||||
"repository": "https://github.com/gregberge/svgr/tree/master/packages/core",
|
||||
"author": "Greg Bergé <berge.greg@gmail.com>",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"svgr",
|
||||
"svg",
|
||||
"react",
|
||||
"core",
|
||||
"api"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"homepage": "https://react-svgr.com",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/gregberge"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"prebuild": "rm -rf lib/",
|
||||
"build": "babel --config-file ../../babel.config.js -d lib --ignore \"**/*.test.js\" src",
|
||||
"prepublishOnly": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@svgr/plugin-jsx": "^5.5.0",
|
||||
"camelcase": "^6.2.0",
|
||||
"cosmiconfig": "^7.0.0"
|
||||
},
|
||||
"gitHead": "b5920550bd966f876cb65c5e23af180461e5aa23"
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue