mirror of
https://github.com/idanoo/GoScrobble
synced 2025-07-01 13:42:20 +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
649
web/node_modules/cssnano/CHANGELOG.md
generated
vendored
Normal file
649
web/node_modules/cssnano/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,649 @@
|
|||
# 4.1.11
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* fix [CVE-2021-28092](https://nvd.nist.gov/vuln/detail/CVE-2021-28092)
|
||||
|
||||
# 4.1.10
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `stylehacks` does not throw error on `[attr]` selector
|
||||
|
||||
# 4.1.9
|
||||
|
||||
## Performance Improvements
|
||||
|
||||
* `postcss-colormin`: increase performance
|
||||
* `postcss-discard-comments`: increase performance
|
||||
* `postcss-merge-rules` increase performance
|
||||
* `postcss-minify-params` increase performance
|
||||
* `postcss-minify-selectors`: increase performance
|
||||
* `postcss-normalize-display-values`: increase performance
|
||||
* `postcss-normalize-positions`: increase performance
|
||||
* `postcss-normalize-repeat-style`: increase performance
|
||||
* `postcss-normalize-string`: increase performance
|
||||
* `postcss-normalize-timing-functions`: increase performance
|
||||
* `postcss-normalize-whitespace`: increase performance
|
||||
* `postcss-ordered-values`: increase performance
|
||||
* `postcss-reduce-transforms`: increase performance
|
||||
* `postcss-svgo`: increase performance
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` handle uppercase properties and values
|
||||
* `postcss-minify-gradients` handle uppercase properties and values
|
||||
* `postcss-minify-params` do break `@page` rules
|
||||
* `postcss-reduce-idents` handle uppercase at-rules
|
||||
* `postcss-reduce-initial` now uses `repeat` as initial value for `mask-repeat`
|
||||
* `postcss-reduce-initial` handle uppercase value when you convert to initial
|
||||
* `stylehacks` handle uppercase properties and values
|
||||
|
||||
# 4.1.8
|
||||
|
||||
## Performance Improvements
|
||||
|
||||
* initial loading time (`require('cssnano')`).
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` correctly merging border properties with custom properties.
|
||||
|
||||
# 4.1.7
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* republish `cssnano` due broken release.
|
||||
|
||||
# 4.1.6
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` doesn't throw error when merge a border property.
|
||||
|
||||
# 4.1.5
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `cssnano` now allow to toggling of plugins in presets using boolean configuration option.
|
||||
* `postcss-merge-longhand` doesn't merge properties with `unset`.
|
||||
* `postcss-merge-longhand` correctly merge borders with custom properties.
|
||||
* `postcss-merge-longhand` doesn't merge redundant values if declarations are of different importance.
|
||||
|
||||
## Other changes
|
||||
|
||||
* `postcss-calc` updated to `7.0.0` version.
|
||||
|
||||
# 4.1.4
|
||||
|
||||
## Other changes
|
||||
|
||||
* `css-declaration-sorter` now use PostCSS 7.
|
||||
* `postcss-calc` now use PostCSS 7.
|
||||
|
||||
# 4.1.3
|
||||
|
||||
## Other changes
|
||||
|
||||
* `postcss-minify-font-values` now use PostCSS 7.
|
||||
* `postcss-discard-duplicates` now use PostCSS 7.
|
||||
|
||||
# 4.1.2
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-svgo` now handle DataURI with uppercase `data` value (`DATA:image/*;...`).
|
||||
|
||||
# 4.1.1
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `css-declaration-sorter` was removed from default prevent.
|
||||
* `postcss-normalize-timing-functions` doesn't lowercased property anymore.
|
||||
* `postcss-normalize-positons` now handles uppercase properties.
|
||||
* `postcss-normalize-url` now is case-insensitive.
|
||||
* `postcss-merge-idents` now is case-insensitive.
|
||||
* `postcss-merge-rules` now is case-insensitive.
|
||||
* `postcss-minify-selectors` now is case-insensitive.
|
||||
* `postcss-minify-font-values` now is case-insensitive.
|
||||
* `postcss-normalize-unicode` now has correct dependencies.
|
||||
* `postcss-minify-params` now has correct dependencies.
|
||||
|
||||
## Other changes
|
||||
|
||||
* `cssnano-preset-advanced` use Autoprefixer 9.
|
||||
* use PostCSS 7 in all plugins.
|
||||
|
||||
# 4.1.0
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` doesn't mangle borders.
|
||||
|
||||
## Features
|
||||
|
||||
* `postcss-ordered-values` support ordering animation values.
|
||||
|
||||
# 4.0.5
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` now correctly merges borders with custom properties.
|
||||
* `postcss-merge-longhand` doesn't throw error in some `border` merge cases.
|
||||
|
||||
# 4.0.4
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` doesn't drop border-width with custom property from border shorthand.
|
||||
* `postcss-merge-longhand` doesn't convert `currentColor`.
|
||||
* `postcss-merge-longhand` doesn't merge border properties if there is a shorthand property between them.
|
||||
|
||||
# 4.0.3
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` incorrect minification of `border` (`border-*`) declarations.
|
||||
|
||||
# 4.0.2
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `postcss-merge-longhand` don't explode declarations with custom properties.
|
||||
* `postcss-colormin` now better transform to `hsl`.
|
||||
|
||||
# 4.0.1
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* `browserslist` version incompatibility with `caniuse-api`.
|
||||
|
||||
# 4.0.0
|
||||
|
||||
## Breaking changes
|
||||
|
||||
* We dropped support for Node 4, now requiring at least Node 6.9.
|
||||
|
||||
## Features
|
||||
|
||||
* postcss-merge-longhand now optimises `border-spacing` property.
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* postcss-normalize-unicode doesn't change `U` to lowercase for `IE` <= 11 and `Edge` <= 15.
|
||||
* postcss-merge-longhand works with custom properties (Example `a { border-style:dotted; border-style:var(--variable) }`) correctly.
|
||||
* postcss-ordered-values handle `border` property with invalid border width value correctly.
|
||||
* postcss-merge-rules handles `:-ms-input-placeholder` and `::-ms-input-placeholder` selectors correctly.
|
||||
* postcss-merge-rules works with `all` property correctly.
|
||||
* postcss-normalize-url don't handle empty `url` function.
|
||||
* postcss-normalize-url handles `data` and `*-extension://` URLs correctly.
|
||||
* postcss-colormin adds whitespace after minified value and before function.
|
||||
* postcss-minify-font-values better escapes font name.
|
||||
* postcss-minify-params doesn't remove `all` for IE.
|
||||
|
||||
## Other changes
|
||||
|
||||
* update all dependencies to latest.
|
||||
* better handles uppercase selectors/properties/values/units.
|
||||
|
||||
# 4.0.0-rc.2
|
||||
|
||||
## Features
|
||||
|
||||
* Includes the new release candidate for postcss-selector-parser 3.
|
||||
* Refactors comments tokenizing in postcss-discard-comments to be more
|
||||
memory efficient.
|
||||
* Adds css-declaration-sorter for improved gzip compression efficiencies
|
||||
(thanks to @Siilwyn).
|
||||
* postcss-svgo now optimises base 64 encoded SVG where possible
|
||||
(thanks to @evilebottnawi).
|
||||
* stylehacks now supports `@media \0screen\,screen\9 {}` hacks
|
||||
(thanks to @evilebottnawi).
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* Fixed handling of package.json configuration (thanks to @andyjansson).
|
||||
* Fixed `resolveConfig` for a `Root` node without a `source` property
|
||||
(thanks to @darthmaim).
|
||||
* Improved radial gradient handling (thanks to @pigcan).
|
||||
* stylehacks now properly accounts for vendor prefixes
|
||||
(thanks to @evilebottnawi).
|
||||
|
||||
# 4.0.0-rc.1
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* cssnano: Resolved an issue with external configuration which wasn't
|
||||
being loaded correctly (thanks to @andyjansson).
|
||||
* postcss-minify-params: Resolved an issue with cssnano's handling of the
|
||||
`@value` syntax from css-modules to better integrate with css-loader.
|
||||
|
||||
# 4.0.0-rc.0
|
||||
|
||||
Since version 4 has been in-development for some time, we thought it would be
|
||||
best to release an alpha version so that we could catch any issues before
|
||||
the actual release.
|
||||
|
||||
## Breaking changes
|
||||
|
||||
* cssnano & its plugins have been upgraded to PostCSS 6.x. Please ensure that
|
||||
for optimal results that you use cssnano with a PostCSS 6 compatible runner
|
||||
& that any other plugins are also using PostCSS 6.
|
||||
* cssnano is now essentially a preset loader and does not contain any built-in
|
||||
transforms (instead, it delegates to `cssnano-preset-default` by default).
|
||||
Due to the new architecture, it's not possible to exclude asynchronous
|
||||
transforms and run it synchronously, unlike in 3.x. Any transforms that
|
||||
were "core" modules have now been extracted out into separate packages.
|
||||
* Because of the new preset system, cssnano will not accept any transformation
|
||||
options; these must be set in the preset. The option names remain mostly the
|
||||
same, except some cases where "core" modules have been extracted out:
|
||||
|
||||
* `core` is now `normalizeWhitespace`.
|
||||
* `reduceBackgroundRepeat` is now `normalizeRepeatStyle`.
|
||||
* `reduceDisplayValues` is now `normalizeDisplayValues`.
|
||||
* `reducePositions` is now `normalizePositions`.
|
||||
* `reduceTimingFunctions` is now `normalizeTimingFunctions`.
|
||||
* `styleCache` is now `rawCache`.
|
||||
|
||||
When excluding transforms, we now have an `exclude` option (in 3.x this was
|
||||
named `disable`). Similarly, the `safe` option was removed; the defaults
|
||||
are now much less aggressive.
|
||||
* By default, the following transforms are no longer applied to any input CSS.
|
||||
You may see an increased output file size as a result:
|
||||
|
||||
* `autoprefixer`
|
||||
* `postcss-discard-unused`
|
||||
* `postcss-merge-idents`
|
||||
* `postcss-reduce-idents`
|
||||
* `postcss-zindex`
|
||||
|
||||
Note that you can load `cssnano-preset-advanced` instead which *does* contain
|
||||
these transforms.
|
||||
* We no longer detect previous plugins to silently exclude our own, and now
|
||||
consider this to be an anti-pattern. So `postcss-filter-plugins` was removed.
|
||||
* We also changed some options to make the default transforms safer:
|
||||
|
||||
* `postcss-minify-font-values`: `removeAfterKeyword` set to `false` from `true`.
|
||||
* `postcss-normalize-url`: `stripWWW` set to `false` from `true`.
|
||||
|
||||
* cssnano now does not accept the `sourcemap` shortcut option; please refer
|
||||
to the PostCSS documentation on sourcemaps. The `quickstart.js` file included
|
||||
with this module will give you a good starting point.
|
||||
* `cssnano.process` is no longer a custom method; we use the built-in `process`
|
||||
method exposed on each PostCSS plugin. The new signature is
|
||||
`cssnano.process(css, postcssOpts, cssnanoOpts)`, in 3.x it was
|
||||
`cssnano.process(css, cssnanoOpts)`.
|
||||
* We dropped support for Node 0.12, now requiring at least Node 4.
|
||||
* Finally, cssnano is now developed as a monorepo, due to the fact that some
|
||||
transforms have a lot of grey area/overlap. Due to this, some modules have
|
||||
been refactored to delegate responsibility to others, such that duplication
|
||||
of functionality is minimized. For instance, `postcss-colormin` will no
|
||||
longer compress whitespace or compress numbers, as those are handled by
|
||||
`postcss-normalize-whitespace` & `postcss-convert-values` respectively.
|
||||
|
||||
## Other changes
|
||||
|
||||
* Due to the PostCSS 6 upgrade, we have been able to reduce usage of custom
|
||||
methods, such as node `clone` behaviour. In cases where some utility
|
||||
has been used by several plugins it is now a separate package, reducing
|
||||
cssnano's footprint.
|
||||
* cssnano now makes much better use of Browserslist. `postcss-colormin` &
|
||||
`postcss-reduce-initial` were enhanced with different behaviour depending
|
||||
on which browsers are passed. And now, the footprint for the `caniuse-db`
|
||||
dependency is much smaller thanks to `caniuse-lite` - 7 times smaller as
|
||||
of this writing. This makes cssnano much faster to download from npm!
|
||||
|
||||
# 3.10.0
|
||||
|
||||
* cssnano will no longer `console.warn` any messages when using deprecated
|
||||
options; these are now sent to PostCSS. You will be able to see them if you
|
||||
use a PostCSS runner with built-in messages support, or alternately by
|
||||
loading `postcss-reporter` or `postcss-browser-reporter` in your plugins list.
|
||||
* Prepares support for `grid` identifier reduction by adding it to the list
|
||||
of optimisations turned off when `options.safe` is set to `true`.
|
||||
* Adds support for normalizing `unicode-range` descriptors. Values will
|
||||
be converted when the code matches `0` & `f` in the same place on both sides
|
||||
of the range. So, `u+2000-2fff` can be converted to `u+2???`, but
|
||||
`u+2100-2fff` will be left as it is.
|
||||
|
||||
# 3.9.1
|
||||
|
||||
* Resolves an integration issue with `v3.9.0`, where `undefined` values
|
||||
would attempt to be parsed.
|
||||
|
||||
# 3.9.0
|
||||
|
||||
* Adds a new option to normalize wrapping quotes for strings & joining
|
||||
multiple-line strings into a single line. This optimisation can potentially
|
||||
reduce the final gzipped size of your CSS file.
|
||||
|
||||
# 3.8.2
|
||||
|
||||
* Resolves an issue where `display: list-item inline flow` would be normalized
|
||||
to `inline list-item` rather than `inline-list-item` (thanks to @mattbasta).
|
||||
|
||||
# 3.8.1
|
||||
|
||||
* Adds a quick start file for easy integration with Runkit. Try cssnano online
|
||||
at https://runkit.com/npm/cssnano.
|
||||
|
||||
# 3.8.0
|
||||
|
||||
* Adds support for normalizing multiple values for the `display` property. For
|
||||
example `block flow` can be simplified to `block`.
|
||||
|
||||
# 3.7.7
|
||||
|
||||
* Further improves CSS mixin handling; semicolons will no longer be stripped
|
||||
from *rules* as well as declarations.
|
||||
|
||||
# 3.7.6
|
||||
|
||||
* Resolves an issue where the semicolon was being incorrectly stripped
|
||||
from CSS mixins.
|
||||
|
||||
# 3.7.5
|
||||
|
||||
* Resolves an issue where the `safe` flag was not being persisted across
|
||||
multiple files (thanks to @techmatt101).
|
||||
|
||||
# 3.7.4
|
||||
|
||||
* Improves performance of the reducePositions transform by testing
|
||||
against `hasOwnProperty` instead of using an array of object keys.
|
||||
* Removes the redundant `indexes-of` dependency.
|
||||
|
||||
# 3.7.3
|
||||
|
||||
* Unpins postcss-filter-plugins from `2.0.0` as a fix has landed in the new
|
||||
version of uniqid.
|
||||
|
||||
# 3.7.2
|
||||
|
||||
* Temporarily pins postcss-filter-plugins to version `2.0.0` in order to
|
||||
mitigate an issue with uniqid `3.0.0`.
|
||||
|
||||
# 3.7.1
|
||||
|
||||
* Enabling safe mode now turns off both postcss-merge-idents &
|
||||
postcss-normalize-url's `stripWWW` option.
|
||||
|
||||
# 3.7.0
|
||||
|
||||
* Added: Reduce `background-repeat` definitions; works with both this property
|
||||
& the `background` shorthand, and aims to compress the extended two value
|
||||
syntax into the single value syntax.
|
||||
* Added: Reduce `initial` values for properties when the *actual* initial value
|
||||
is shorter; for example, `min-width: initial` becomes `min-width: 0`.
|
||||
|
||||
# 3.6.2
|
||||
|
||||
* Fixed an issue where cssnano would crash on `steps(1)`.
|
||||
|
||||
# 3.6.1
|
||||
|
||||
* Fixed an issue where cssnano would crash on `steps` functions with a
|
||||
single argument.
|
||||
|
||||
# 3.6.0
|
||||
|
||||
* Added `postcss-discard-overridden` to safely discard overridden rules with
|
||||
the same identifier (thanks to @Justineo).
|
||||
* Added: Reduce animation/transition timing functions. Detects `cubic-bezier`
|
||||
functions that are equivalent to the timing keywords and compresses, as well
|
||||
as normalizing the `steps` timing function.
|
||||
* Added the `perspective-origin` property to the list of supported properties
|
||||
transformed by the `reduce-positions` transform.
|
||||
|
||||
# 3.5.2
|
||||
|
||||
* Resolves an issue where the 3 or 4 value syntax for `background-position`
|
||||
were being incorrectly converted.
|
||||
|
||||
# 3.5.1
|
||||
|
||||
* Improves checking for `background-position` values in the `background`
|
||||
shorthand property.
|
||||
|
||||
# 3.5.0
|
||||
|
||||
* Adds a new optimisation path which can minimise keyword values for
|
||||
`background-position` and the `background` shorthand.
|
||||
* Tweaks to performance in the `core` module, now performs less AST passes.
|
||||
* Now compiled with Babel 6.
|
||||
|
||||
# 3.4.0
|
||||
|
||||
* Adds a new optimisation path which can minimise gradient parameters
|
||||
automatically.
|
||||
|
||||
# 3.3.2
|
||||
|
||||
* Fixes an issue where using `options.safe` threw an error when cssnano was
|
||||
not used as part of a PostCSS instance, but standalone (such as in modules
|
||||
like gulp-cssnano). cssnano now renames `safe` internally to `isSafe`.
|
||||
|
||||
# 3.3.1
|
||||
|
||||
* Unpins postcss-colormin from `2.1.2`, as the `2.1.3` & `2.1.4` patches had
|
||||
optimization regressions that are now resolved in `2.1.5`.
|
||||
|
||||
# 3.3.0
|
||||
|
||||
* Updated modules to use postcss-value-parser version 3 (thanks to @TrySound).
|
||||
* Now converts between transform functions with postcss-reduce-transforms.
|
||||
e.g. `translate3d(0, 0, 0)` becomes `translateZ(0)`.
|
||||
|
||||
# 3.2.0
|
||||
|
||||
* cssnano no longer converts `outline: none` to `outline: 0`, as there are
|
||||
some cases where the values are not equivalent (thanks to @TrySound).
|
||||
* cssnano no longer converts for example `16px` to `1pc` *by default*. Length
|
||||
optimisations can be turned on via `{convertValues: {length: true}}`.
|
||||
* Improved minimization of css functions (thanks to @TrySound).
|
||||
|
||||
# 3.1.0
|
||||
|
||||
* This release swaps postcss-single-charset for postcss-normalize-charset,
|
||||
which can detect encoding to determine whether a charset is necessary.
|
||||
Optionally, you can set the `add` option to `true` to prepend a UTF-8
|
||||
charset to the output automatically (thanks to @TrySound).
|
||||
* A `safe` option was added, which disables more aggressive optimisations, as
|
||||
a convenient preset configuration (thanks to @TrySound).
|
||||
* Added an option to convert from `deg` to `turn` & vice versa, & improved
|
||||
minification performance in functions (thanks to @TrySound).
|
||||
|
||||
# 3.0.3
|
||||
|
||||
* Fixes an issue where cssnano was removing spaces around forward slashes in
|
||||
string literals (thanks to @TrySound).
|
||||
|
||||
# 3.0.2
|
||||
|
||||
* Fixes an issue where cssnano was removing spaces around forward slashes in
|
||||
calc functions.
|
||||
|
||||
# 3.0.1
|
||||
|
||||
* Replaced css-list & balanced-match with postcss-value-parser, reducing the
|
||||
module's overall size (thanks to @TrySound).
|
||||
|
||||
# 3.0.0
|
||||
|
||||
* All cssnano plugins and cssnano itself have migrated to PostCSS 5.x. Please
|
||||
make sure that when using the 3.x releases that you use a 5.x compatible
|
||||
PostCSS runner.
|
||||
* cssnano will now compress inline SVG through SVGO. Because of this change,
|
||||
interfacing with cssnano must now be done through an asynchronous API. The
|
||||
main `process` method has the same signature as a PostCSS processor instance.
|
||||
* The old options such as `merge` & `fonts` that were deprecated in
|
||||
release `2.5.0` were removed. The new architecture allows you to specify any
|
||||
module name to disable it.
|
||||
* postcss-minify-selectors' at-rule compression was extracted out into
|
||||
postcss-minify-params (thanks to @TrySound).
|
||||
* Overall performance of the module has improved dramatically, thanks to work
|
||||
by @TrySound and input from the community.
|
||||
* Improved selector merging/deduplication in certain use cases.
|
||||
* cssnano no longer compresses hex colours in filter properties, to better
|
||||
support old versions of Internet Explorer (thanks to @faddee).
|
||||
* cssnano will not merge properties together that have an `inherit` keyword.
|
||||
* postcss-minify-font-weight & postcss-font-family were consolidated into
|
||||
postcss-minify-font-values. Using the old options will print deprecation
|
||||
warnings (thanks to @TrySound).
|
||||
* The cssnano CLI was extracted into a separate module, so that dependent
|
||||
modules such as gulp-cssnano don't download unnecessary extras.
|
||||
|
||||
# 2.6.1
|
||||
|
||||
* Improved performance of the core module `functionOptimiser`.
|
||||
|
||||
# 2.6.0
|
||||
|
||||
* Adds a new optimisation which re-orders properties that accept values in
|
||||
an arbitrary order. This can lead to improved merging behaviour in certain
|
||||
cases.
|
||||
|
||||
# 2.5.0
|
||||
|
||||
* Adds support for disabling modules of the user's choosing, with new option
|
||||
names. The old options (such as `merge` & `fonts`) will be removed in `3.0`.
|
||||
|
||||
# 2.4.0
|
||||
|
||||
* postcss-minify-selectors was extended to add support for conversion of
|
||||
`::before` to `:before`; this release removes the dedicated
|
||||
postcss-pseudoelements module.
|
||||
|
||||
# 2.3.0
|
||||
|
||||
* Consolidated postcss-minify-trbl & two integrated modules into
|
||||
postcss-merge-longhand.
|
||||
|
||||
# 2.2.0
|
||||
|
||||
* Replaced integrated plugin filter with postcss-filter-plugins.
|
||||
* Improved rule merging logic.
|
||||
* Improved performance across the board by reducing AST iterations where it
|
||||
was possible to do so.
|
||||
* cssnano will now perform better whitespace compression when used with other
|
||||
PostCSS plugins.
|
||||
|
||||
# 2.1.1
|
||||
|
||||
* Fixes an issue where options were not passed to normalize-url.
|
||||
|
||||
# 2.1.0
|
||||
|
||||
* Allow `postcss-font-family` to be disabled.
|
||||
|
||||
# 2.0.3
|
||||
|
||||
* cssnano can now be consumed with the parentheses-less method in PostCSS; e.g.
|
||||
`postcss([ cssnano ])`.
|
||||
* Fixes an issue where 'Din' was being picked up by the logic as a numeric
|
||||
value, causing the full font name to be incorrectly rearranged.
|
||||
|
||||
# 2.0.2
|
||||
|
||||
* Extract trbl value reducing into a separate module.
|
||||
* Refactor core longhand optimiser to not rely on trbl cache.
|
||||
* Adds support for `ch` units; previously they were removed.
|
||||
* Fixes parsing of some selector hacks.
|
||||
* Fixes an issue where embedded base 64 data was being converted as if it were
|
||||
a URL.
|
||||
|
||||
# 2.0.1
|
||||
|
||||
* Add `postcss-plugin` keyword to package.json.
|
||||
* Wraps all core processors with the PostCSS 4.1 plugin API.
|
||||
|
||||
# 2.0.0
|
||||
|
||||
* Adds removal of outdated vendor prefixes based on browser support.
|
||||
* Addresses an issue where relative path separators were converted to
|
||||
backslashes on Windows.
|
||||
* cssnano will now detect previous plugins and silently disable them when the
|
||||
functionality overlaps. This is to enable faster interoperation with cssnext.
|
||||
* cssnano now exports as a PostCSS plugin. The simple interface is exposed
|
||||
at `cssnano.process(css, opts)` instead of `cssnano(css, opts)`.
|
||||
* Improved URL detection when using two or more in the same declaration.
|
||||
* node 0.10 is no longer officially supported.
|
||||
|
||||
# 1.4.3
|
||||
|
||||
* Fixes incorrect minification of `background:none` to `background:0 0`.
|
||||
|
||||
# 1.4.2
|
||||
|
||||
* Fixes an issue with nested URLs inside `url()` functions.
|
||||
|
||||
# 1.4.1
|
||||
|
||||
* Addresses an issue where whitespace removal after a CSS function would cause
|
||||
rendering issues in Internet Explorer.
|
||||
|
||||
# 1.4.0
|
||||
|
||||
* Adds support for removal of unused `@keyframes` and `@counter-style` at-rules.
|
||||
* comments: adds support for user-directed removal of comments, with the
|
||||
`remove` option (thanks to @dmitrykiselyov).
|
||||
* comments: `removeAllButFirst` now operates on each CSS tree, rather than the
|
||||
first one passed to cssnano.
|
||||
|
||||
# 1.3.3
|
||||
|
||||
* Fixes incorrect minification of `border:none` to `border:0 0`.
|
||||
|
||||
# 1.3.2
|
||||
|
||||
* Improved selector minifying logic, leading to better compression of attribute
|
||||
selectors.
|
||||
* Improved comment discarding logic.
|
||||
|
||||
# 1.3.1
|
||||
|
||||
* Fixes crash on undefined `decl.before` from prior AST.
|
||||
|
||||
# 1.3.0
|
||||
|
||||
* Added support for bundling cssnano using webpack (thanks to @MoOx).
|
||||
|
||||
# 1.2.1
|
||||
|
||||
* Fixed a bug where a CSS function keyword inside its value would throw
|
||||
an error.
|
||||
|
||||
# 1.2.0
|
||||
|
||||
* Better support for merging properties without the existance of a shorthand
|
||||
override.
|
||||
* Can now 'merge forward' adjacent rules as well as the previous 'merge behind'
|
||||
behaviour, leading to better compression.
|
||||
* Selector re-ordering now happens last in the chain of plugins, to help clean
|
||||
up merged selectors.
|
||||
|
||||
# 1.1.0
|
||||
|
||||
* Now can merge identifiers such as `@keyframes` and `@counter-style` if they
|
||||
have duplicated properties but are named differently.
|
||||
* Fixes an issue where duplicated keyframes with the same name would cause
|
||||
an infinite loop.
|
||||
|
||||
# 1.0.2
|
||||
|
||||
* Improve module loading logic (thanks to @tunnckoCore).
|
||||
* Improve minification of numeric values, with better support for `rem`,
|
||||
trailing zeroes and slash/comma separated values
|
||||
(thanks to @TrySound & @tunnckoCore).
|
||||
* Fixed an issue where `-webkit-tap-highlight-color` values were being
|
||||
incorrectly transformed to `transparent`. This is not supported in Safari.
|
||||
* Added support for viewport units (thanks to @TrySound).
|
||||
* Add MIT license file.
|
||||
|
||||
# 1.0.1
|
||||
|
||||
* Add repository/author links to package.json.
|
||||
|
||||
# 1.0.0
|
||||
|
||||
* Initial release.
|
22
web/node_modules/cssnano/LICENSE-MIT
generated
vendored
Normal file
22
web/node_modules/cssnano/LICENSE-MIT
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
|
||||
|
||||
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.
|
6
web/node_modules/cssnano/README.md
generated
vendored
Normal file
6
web/node_modules/cssnano/README.md
generated
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
# cssnano
|
||||
|
||||
For documentation, please see the following links:
|
||||
|
||||
* Repository: https://github.com/cssnano/cssnano
|
||||
* Website: http://cssnano.co
|
122
web/node_modules/cssnano/dist/index.js
generated
vendored
Normal file
122
web/node_modules/cssnano/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,122 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
|
||||
var _path = require('path');
|
||||
|
||||
var _path2 = _interopRequireDefault(_path);
|
||||
|
||||
var _postcss = require('postcss');
|
||||
|
||||
var _postcss2 = _interopRequireDefault(_postcss);
|
||||
|
||||
var _cosmiconfig = require('cosmiconfig');
|
||||
|
||||
var _cosmiconfig2 = _interopRequireDefault(_cosmiconfig);
|
||||
|
||||
var _isResolvable = require('is-resolvable');
|
||||
|
||||
var _isResolvable2 = _interopRequireDefault(_isResolvable);
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const cssnano = 'cssnano';
|
||||
|
||||
function initializePlugin(plugin, css, result) {
|
||||
if (Array.isArray(plugin)) {
|
||||
const [processor, opts] = plugin;
|
||||
if (typeof opts === 'undefined' || typeof opts === 'object' && !opts.exclude || typeof opts === 'boolean' && opts === true) {
|
||||
return Promise.resolve(processor(opts)(css, result));
|
||||
}
|
||||
} else {
|
||||
return Promise.resolve(plugin()(css, result));
|
||||
}
|
||||
// Handle excluded plugins
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
/*
|
||||
* preset can be one of four possibilities:
|
||||
* preset = 'default'
|
||||
* preset = ['default', {}]
|
||||
* preset = function <- to be invoked
|
||||
* preset = {plugins: []} <- already invoked function
|
||||
*/
|
||||
|
||||
function resolvePreset(preset) {
|
||||
let fn, options;
|
||||
if (Array.isArray(preset)) {
|
||||
fn = preset[0];
|
||||
options = preset[1];
|
||||
} else {
|
||||
fn = preset;
|
||||
options = {};
|
||||
}
|
||||
// For JS setups where we invoked the preset already
|
||||
if (preset.plugins) {
|
||||
return Promise.resolve(preset.plugins);
|
||||
}
|
||||
// Provide an alias for the default preset, as it is built-in.
|
||||
if (fn === 'default') {
|
||||
return Promise.resolve(require('cssnano-preset-default')(options).plugins);
|
||||
}
|
||||
// For non-JS setups; we'll need to invoke the preset ourselves.
|
||||
if (typeof fn === 'function') {
|
||||
return Promise.resolve(fn(options).plugins);
|
||||
}
|
||||
// Try loading a preset from node_modules
|
||||
if ((0, _isResolvable2.default)(fn)) {
|
||||
return Promise.resolve(require(fn)(options).plugins);
|
||||
}
|
||||
const sugar = `cssnano-preset-${fn}`;
|
||||
// Try loading a preset from node_modules (sugar)
|
||||
if ((0, _isResolvable2.default)(sugar)) {
|
||||
return Promise.resolve(require(sugar)(options).plugins);
|
||||
}
|
||||
// If all else fails, we probably have a typo in the config somewhere
|
||||
throw new Error(`Cannot load preset "${fn}". Please check your configuration for errors and try again.`);
|
||||
}
|
||||
|
||||
/*
|
||||
* cssnano will look for configuration firstly as options passed
|
||||
* directly to it, and failing this it will use cosmiconfig to
|
||||
* load an external file.
|
||||
*/
|
||||
|
||||
function resolveConfig(css, result, options) {
|
||||
if (options.preset) {
|
||||
return resolvePreset(options.preset);
|
||||
}
|
||||
|
||||
const inputFile = css.source && css.source.input && css.source.input.file;
|
||||
let searchPath = inputFile ? _path2.default.dirname(inputFile) : process.cwd();
|
||||
let configPath = null;
|
||||
|
||||
if (options.configFile) {
|
||||
searchPath = null;
|
||||
configPath = _path2.default.resolve(process.cwd(), options.configFile);
|
||||
}
|
||||
|
||||
const configExplorer = (0, _cosmiconfig2.default)(cssnano);
|
||||
const searchForConfig = configPath ? configExplorer.load(configPath) : configExplorer.search(searchPath);
|
||||
|
||||
return searchForConfig.then(config => {
|
||||
if (config === null) {
|
||||
return resolvePreset('default');
|
||||
}
|
||||
return resolvePreset(config.config.preset || config.config);
|
||||
});
|
||||
}
|
||||
|
||||
exports.default = _postcss2.default.plugin(cssnano, (options = {}) => {
|
||||
return (css, result) => {
|
||||
return resolveConfig(css, result, options).then(plugins => {
|
||||
return plugins.reduce((promise, plugin) => {
|
||||
return promise.then(initializePlugin.bind(null, plugin, css, result));
|
||||
}, Promise.resolve());
|
||||
});
|
||||
};
|
||||
});
|
||||
module.exports = exports['default'];
|
151
web/node_modules/cssnano/node_modules/cosmiconfig/CHANGELOG.md
generated
vendored
Normal file
151
web/node_modules/cssnano/node_modules/cosmiconfig/CHANGELOG.md
generated
vendored
Normal file
|
@ -0,0 +1,151 @@
|
|||
# Changelog
|
||||
|
||||
## 5.2.1
|
||||
|
||||
- Chore: Upgrade `js-yaml` to avoid npm audit warning.
|
||||
|
||||
## 5.2.0
|
||||
|
||||
- Added: `packageProp` values can be arrays of strings, to allow for property names that include periods. (This was possible before, but not documented or deliberately supported.)
|
||||
- Chore: Replaced the `lodash.get` dependency with a locally defined function.
|
||||
- Chore: Upgrade `js-yaml` to avoid npm audit warning.
|
||||
|
||||
## 5.1.0
|
||||
|
||||
- Added: `packageProp` values can include periods to describe paths to nested objects within `package.json`.
|
||||
|
||||
## 5.0.7
|
||||
|
||||
- Fixed: JS loader bypasses Node's `require` cache, fixing a bug where updates to `.js` config files would not load even when Cosmiconfig was told not to cache.
|
||||
|
||||
## 5.0.6
|
||||
|
||||
- Fixed: Better error message if the end user tries an extension Cosmiconfig is not configured to understand.
|
||||
|
||||
## 5.0.5
|
||||
|
||||
- Fixed: `load` and `loadSync` work with paths relative to `process.cwd()`.
|
||||
|
||||
## 5.0.4
|
||||
|
||||
- Fixed: `rc` files with `.js` extensions included in default `searchPlaces`.
|
||||
|
||||
## 5.0.3
|
||||
|
||||
- Docs: Minor corrections to documentation. *Released to update package documentation on npm*.
|
||||
|
||||
## 5.0.2
|
||||
|
||||
- Fixed: Allow `searchSync` and `loadSync` to load JS configuration files whose export is a Promise.
|
||||
|
||||
## 5.0.1
|
||||
|
||||
The API has been completely revamped to increase clarity and enable a very wide range of new usage. **Please read the readme for all the details.**
|
||||
|
||||
While the defaults remain just as useful as before — and you can still pass no options at all — now you can also do all kinds of wild and crazy things.
|
||||
|
||||
- The `loaders` option allows you specify custom functions to derive config objects from files. Your loader functions could parse ES2015 modules or TypeScript, JSON5, even INI or XML. Whatever suits you.
|
||||
- The `searchPlaces` option allows you to specify exactly where cosmiconfig looks within each directory it searches.
|
||||
- The combination of `loaders` and `searchPlaces` means that you should be able to load pretty much any kind of configuration file you want, from wherever you want it to look.
|
||||
|
||||
Additionally, the overloaded `load()` function has been split up into several clear and focused functions:
|
||||
|
||||
- `search()` now searches up the directory tree, and `load()` loads a configuration file that you don't need to search for.
|
||||
- The `sync` option has been replaced with separate synchronous functions: `searchSync()` and `loadSync()`.
|
||||
- `clearFileCache()` and `clearDirectoryCache()` have been renamed to `clearLoadCache()` and `clearSearchPath()` respectively.
|
||||
|
||||
More details:
|
||||
|
||||
- The default JS loader uses `require`, instead of `require-from-string`. So you *could* use `require` hooks to control the loading of JS files (e.g. pass them through esm or Babel). In most cases it is probably preferable to use a custom loader.
|
||||
- The options `rc`, `js`, and `rcExtensions` have all been removed. You can accomplish the same and more with `searchPlaces`.
|
||||
- The default `searchPlaces` include `rc` files with extensions, e.g. `.thingrc.json`, `.thingrc.yaml`, `.thingrc.yml`. This is the equivalent of switching the default value of the old `rcExtensions` option to `true`.
|
||||
- The option `rcStrictJson` has been removed. To get the same effect, you can specify `noExt: cosmiconfig.loadJson` in your `loaders` object.
|
||||
- `packageProp` no longer accepts `false`. If you don't want to look in `package.json`, write a `searchPlaces` array that does not include it.
|
||||
- By default, empty files are ignored by `search()`. The new option `ignoreEmptySearchPlaces` allows you to load them, instead, in case you want to do something with empty files.
|
||||
- The option `configPath` has been removed. Just pass your filepaths directory to `load()`.
|
||||
- Removed the `format` option. Formats are now all handled via the file extensions specified in `loaders`.
|
||||
|
||||
(If you're wondering with happened to 5.0.0 ... it was a silly publishing mistake.)
|
||||
|
||||
## 4.0.0
|
||||
|
||||
- Licensing improvement: updated `parse-json` from `3.0.0` to `4.0.0`(see [sindresorhus/parse-json#12][parse-json-pr-12]).
|
||||
- Changed: error message format for `JSON` parse errors(see [#101][pr-101]). If you were relying on the format of JSON-parsing error messages, this will be a breaking change for you.
|
||||
- Changed: set default for `searchPath` as `process.cwd()` in `explorer.load`.
|
||||
|
||||
## 3.1.0
|
||||
|
||||
- Added: infer format based on filePath
|
||||
|
||||
## 3.0.1
|
||||
|
||||
- Fixed: memory leak due to bug in `require-from-string`.
|
||||
- Added: for JSON files, append position to end of error message.
|
||||
|
||||
## 3.0.0
|
||||
|
||||
- Removed: support for loading config path using the `--config` flag. cosmiconfig will not parse command line arguments. Your application can parse command line arguments and pass them to cosmiconfig.
|
||||
- Removed: `argv` config option.
|
||||
- Removed: support for Node versions < 4.
|
||||
- Added: `sync` option.
|
||||
- Fixed: Throw a clear error on getting empty config file.
|
||||
- Fixed: when a `options.configPath` is `package.json`, return the package prop, not the entire JSON file.
|
||||
|
||||
## 2.2.2
|
||||
|
||||
- Fixed: `options.configPath` and `--config` flag are respected.
|
||||
|
||||
## 2.2.0, 2.2.1
|
||||
|
||||
- 2.2.0 included a number of improvements but somehow broke stylelint. The changes were reverted in 2.2.1, to be restored later.
|
||||
|
||||
## 2.1.3
|
||||
|
||||
- Licensing improvement: switched from `json-parse-helpfulerror` to `parse-json`.
|
||||
|
||||
## 2.1.2
|
||||
|
||||
- Fixed: bug where an `ENOENT` error would be thrown is `searchPath` referenced a non-existent file.
|
||||
- Fixed: JSON parsing errors in Node v7.
|
||||
|
||||
## 2.1.1
|
||||
|
||||
- Fixed: swapped `graceful-fs` for regular `fs`, fixing a garbage collection problem.
|
||||
|
||||
## 2.1.0
|
||||
|
||||
- Added: Node 0.12 support.
|
||||
|
||||
## 2.0.2
|
||||
|
||||
- Fixed: Node version specified in `package.json`.
|
||||
|
||||
## 2.0.1
|
||||
|
||||
- Fixed: no more infinite loop in Windows.
|
||||
|
||||
## 2.0.0
|
||||
|
||||
- Changed: module now creates cosmiconfig instances with `load` methods (see README).
|
||||
- Added: caching (enabled by the change above).
|
||||
- Removed: support for Node versions <4.
|
||||
|
||||
## 1.1.0
|
||||
|
||||
- Add `rcExtensions` option.
|
||||
|
||||
## 1.0.2
|
||||
|
||||
- Fix handling of `require()`'s within JS module configs.
|
||||
|
||||
## 1.0.1
|
||||
|
||||
- Switch Promise implementation to pinkie-promise.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
- Initial release.
|
||||
|
||||
[parse-json-pr-12]: https://github.com/sindresorhus/parse-json/pull/12
|
||||
|
||||
[pr-101]: https://github.com/davidtheclark/cosmiconfig/pull/101
|
22
web/node_modules/cssnano/node_modules/cosmiconfig/LICENSE
generated
vendored
Normal file
22
web/node_modules/cssnano/node_modules/cosmiconfig/LICENSE
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 David Clark
|
||||
|
||||
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.
|
||||
|
537
web/node_modules/cssnano/node_modules/cosmiconfig/README.md
generated
vendored
Normal file
537
web/node_modules/cssnano/node_modules/cosmiconfig/README.md
generated
vendored
Normal file
|
@ -0,0 +1,537 @@
|
|||
# cosmiconfig
|
||||
|
||||
[](https://travis-ci.org/davidtheclark/cosmiconfig) [](https://ci.appveyor.com/project/davidtheclark/cosmiconfig/branch/master)
|
||||
[](https://codecov.io/gh/davidtheclark/cosmiconfig)
|
||||
|
||||
Cosmiconfig searches for and loads configuration for your program.
|
||||
|
||||
It features smart defaults based on conventional expectations in the JavaScript ecosystem.
|
||||
But it's also flexible enough to search wherever you'd like to search, and load whatever you'd like to load.
|
||||
|
||||
By default, Cosmiconfig will start where you tell it to start and search up the directory tree for the following:
|
||||
|
||||
- a `package.json` property
|
||||
- a JSON or YAML, extensionless "rc file"
|
||||
- an "rc file" with the extensions `.json`, `.yaml`, `.yml`, or `.js`.
|
||||
- a `.config.js` CommonJS module
|
||||
|
||||
For example, if your module's name is "soursocks", cosmiconfig will search up the directory tree for configuration in the following places:
|
||||
|
||||
- a `soursocks` property in `package.json`
|
||||
- a `.soursocksrc` file in JSON or YAML format
|
||||
- a `.soursocksrc.json` file
|
||||
- a `.soursocksrc.yaml`, `.soursocksrc.yml`, or `.soursocksrc.js` file
|
||||
- a `soursocks.config.js` file exporting a JS object
|
||||
|
||||
Cosmiconfig continues to search up the directory tree, checking each of these places in each directory, until it finds some acceptable configuration (or hits the home directory).
|
||||
|
||||
👀 **Looking for the v4 docs?**
|
||||
v5 involves significant revisions to Cosmiconfig's API, allowing for much greater flexibility and clarifying some things.
|
||||
If you have trouble switching from v4 to v5, please file an issue.
|
||||
If you are still using v4, those v4 docs are available [in the `4.0.0` tag](https://github.com/davidtheclark/cosmiconfig/tree/4.0.0).
|
||||
|
||||
## Table of contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Usage](#usage)
|
||||
- [Result](#result)
|
||||
- [cosmiconfig()](#cosmiconfig-1)
|
||||
- [moduleName](#modulename)
|
||||
- [explorer.search()](#explorersearch)
|
||||
- [searchFrom](#searchfrom)
|
||||
- [explorer.searchSync()](#explorersearchsync)
|
||||
- [explorer.load()](#explorerload)
|
||||
- [explorer.loadSync()](#explorerloadsync)
|
||||
- [explorer.clearLoadCache()](#explorerclearloadcache)
|
||||
- [explorer.clearSearchCache()](#explorerclearsearchcache)
|
||||
- [explorer.clearCaches()](#explorerclearcaches)
|
||||
- [cosmiconfigOptions](#cosmiconfigoptions)
|
||||
- [searchPlaces](#searchplaces)
|
||||
- [loaders](#loaders)
|
||||
- [packageProp](#packageprop)
|
||||
- [stopDir](#stopdir)
|
||||
- [cache](#cache)
|
||||
- [transform](#transform)
|
||||
- [ignoreEmptySearchPlaces](#ignoreemptysearchplaces)
|
||||
- [Caching](#caching)
|
||||
- [Differences from rc](#differences-from-rc)
|
||||
- [Contributing & Development](#contributing--development)
|
||||
|
||||
## Installation
|
||||
|
||||
```
|
||||
npm install cosmiconfig
|
||||
```
|
||||
|
||||
Tested in Node 4+.
|
||||
|
||||
## Usage
|
||||
|
||||
Create a Cosmiconfig explorer, then either `search` for or directly `load` a configuration file.
|
||||
|
||||
```js
|
||||
const cosmiconfig = require('cosmiconfig');
|
||||
// ...
|
||||
const explorer = cosmiconfig(moduleName);
|
||||
|
||||
// Search for a configuration by walking up directories.
|
||||
// See documentation for search, below.
|
||||
explorer.search()
|
||||
.then((result) => {
|
||||
// result.config is the parsed configuration object.
|
||||
// result.filepath is the path to the config file that was found.
|
||||
// result.isEmpty is true if there was nothing to parse in the config file.
|
||||
})
|
||||
.catch((error) => {
|
||||
// Do something constructive.
|
||||
});
|
||||
|
||||
// Load a configuration directly when you know where it should be.
|
||||
// The result object is the same as for search.
|
||||
// See documentation for load, below.
|
||||
explorer.load(pathToConfig).then(..);
|
||||
|
||||
// You can also search and load synchronously.
|
||||
const searchedFor = explorer.searchSync();
|
||||
const loaded = explorer.loadSync(pathToConfig);
|
||||
```
|
||||
|
||||
## Result
|
||||
|
||||
The result object you get from `search` or `load` has the following properties:
|
||||
|
||||
- **config:** The parsed configuration object. `undefined` if the file is empty.
|
||||
- **filepath:** The path to the configuration file that was found.
|
||||
- **isEmpty:** `true` if the configuration file is empty. This property will not be present if the configuration file is not empty.
|
||||
|
||||
## cosmiconfig()
|
||||
|
||||
```js
|
||||
const explorer = cosmiconfig(moduleName[, cosmiconfigOptions])
|
||||
```
|
||||
|
||||
Creates a cosmiconfig instance ("explorer") configured according to the arguments, and initializes its caches.
|
||||
|
||||
### moduleName
|
||||
|
||||
Type: `string`. **Required.**
|
||||
|
||||
Your module name. This is used to create the default [`searchPlaces`] and [`packageProp`].
|
||||
|
||||
**[`cosmiconfigOptions`] are documented below.**
|
||||
You may not need them, and should first read about the functions you'll use.
|
||||
|
||||
## explorer.search()
|
||||
|
||||
```js
|
||||
explorer.search([searchFrom]).then(result => {..})
|
||||
```
|
||||
|
||||
Searches for a configuration file. Returns a Promise that resolves with a [result] or with `null`, if no configuration file is found.
|
||||
|
||||
You can do the same thing synchronously with [`searchSync()`].
|
||||
|
||||
Let's say your module name is `goldengrahams` so you initialized with `const explorer = cosmiconfig('goldengrahams');`.
|
||||
Here's how your default [`search()`] will work:
|
||||
|
||||
- Starting from `process.cwd()` (or some other directory defined by the `searchFrom` argument to [`search()`]), look for configuration objects in the following places:
|
||||
1. A `goldengrahams` property in a `package.json` file.
|
||||
2. A `.goldengrahamsrc` file with JSON or YAML syntax.
|
||||
3. A `.goldengrahamsrc.json` file.
|
||||
4. A `.goldengrahamsrc.yaml`, `.goldengrahamsrc.yml`, or `.goldengrahamsrc.js` file.
|
||||
5. A `goldengrahams.config.js` JS file exporting the object.
|
||||
- If none of those searches reveal a configuration object, move up one directory level and try again.
|
||||
So the search continues in `./`, `../`, `../../`, `../../../`, etc., checking the same places in each directory.
|
||||
- Continue searching until arriving at your home directory (or some other directory defined by the cosmiconfig option [`stopDir`]).
|
||||
- If at any point a parseable configuration is found, the [`search()`] Promise resolves with its [result] \(or, with [`searchSync()`], the [result] is returned).
|
||||
- If no configuration object is found, the [`search()`] Promise resolves with `null` (or, with [`searchSync()`], `null` is returned).
|
||||
- If a configuration object is found *but is malformed* (causing a parsing error), the [`search()`] Promise rejects with that error (so you should `.catch()` it). (Or, with [`searchSync()`], the error is thrown.)
|
||||
|
||||
**If you know exactly where your configuration file should be, you can use [`load()`], instead.**
|
||||
|
||||
**The search process is highly customizable.**
|
||||
Use the cosmiconfig options [`searchPlaces`] and [`loaders`] to precisely define where you want to look for configurations and how you want to load them.
|
||||
|
||||
### searchFrom
|
||||
|
||||
Type: `string`.
|
||||
Default: `process.cwd()`.
|
||||
|
||||
A filename.
|
||||
[`search()`] will start its search here.
|
||||
|
||||
If the value is a directory, that's where the search starts.
|
||||
If it's a file, the search starts in that file's directory.
|
||||
|
||||
## explorer.searchSync()
|
||||
|
||||
```js
|
||||
const result = explorer.searchSync([searchFrom]);
|
||||
```
|
||||
|
||||
Synchronous version of [`search()`].
|
||||
|
||||
Returns a [result] or `null`.
|
||||
|
||||
## explorer.load()
|
||||
|
||||
```js
|
||||
explorer.load(loadPath).then(result => {..})
|
||||
```
|
||||
|
||||
Loads a configuration file. Returns a Promise that resolves with a [result] or rejects with an error (if the file does not exist or cannot be loaded).
|
||||
|
||||
Use `load` if you already know where the configuration file is and you just need to load it.
|
||||
|
||||
```js
|
||||
explorer.load('load/this/file.json'); // Tries to load load/this/file.json.
|
||||
```
|
||||
|
||||
If you load a `package.json` file, the result will be derived from whatever property is specified as your [`packageProp`].
|
||||
|
||||
## explorer.loadSync()
|
||||
|
||||
```js
|
||||
const result = explorer.loadSync(loadPath);
|
||||
```
|
||||
|
||||
Synchronous version of [`load()`].
|
||||
|
||||
Returns a [result].
|
||||
|
||||
## explorer.clearLoadCache()
|
||||
|
||||
Clears the cache used in [`load()`].
|
||||
|
||||
## explorer.clearSearchCache()
|
||||
|
||||
Clears the cache used in [`search()`].
|
||||
|
||||
## explorer.clearCaches()
|
||||
|
||||
Performs both [`clearLoadCache()`] and [`clearSearchCache()`].
|
||||
|
||||
## cosmiconfigOptions
|
||||
|
||||
Type: `Object`.
|
||||
|
||||
Possible options are documented below.
|
||||
|
||||
### searchPlaces
|
||||
|
||||
Type: `Array<string>`.
|
||||
Default: See below.
|
||||
|
||||
An array of places that [`search()`] will check in each directory as it moves up the directory tree.
|
||||
Each place is relative to the directory being searched, and the places are checked in the specified order.
|
||||
|
||||
**Default `searchPlaces`:**
|
||||
|
||||
```js
|
||||
[
|
||||
'package.json',
|
||||
`.${moduleName}rc`,
|
||||
`.${moduleName}rc.json`,
|
||||
`.${moduleName}rc.yaml`,
|
||||
`.${moduleName}rc.yml`,
|
||||
`.${moduleName}rc.js`,
|
||||
`${moduleName}.config.js`,
|
||||
]
|
||||
```
|
||||
|
||||
Create your own array to search more, fewer, or altogether different places.
|
||||
|
||||
Every item in `searchPlaces` needs to have a loader in [`loaders`] that corresponds to its extension.
|
||||
(Common extensions are covered by default loaders.)
|
||||
Read more about [`loaders`] below.
|
||||
|
||||
`package.json` is a special value: When it is included in `searchPlaces`, Cosmiconfig will always parse it as JSON and load a property within it, not the whole file.
|
||||
That property is defined with the [`packageProp`] option, and defaults to your module name.
|
||||
|
||||
Examples, with a module named `porgy`:
|
||||
|
||||
```js
|
||||
// Disallow extensions on rc files:
|
||||
[
|
||||
'package.json',
|
||||
'.porgyrc',
|
||||
'porgy.config.js'
|
||||
]
|
||||
|
||||
// ESLint searches for configuration in these places:
|
||||
[
|
||||
'.eslintrc.js',
|
||||
'.eslintrc.yaml',
|
||||
'.eslintrc.yml',
|
||||
'.eslintrc.json',
|
||||
'.eslintrc',
|
||||
'package.json'
|
||||
]
|
||||
|
||||
// Babel looks in fewer places:
|
||||
[
|
||||
'package.json',
|
||||
'.babelrc'
|
||||
]
|
||||
|
||||
// Maybe you want to look for a wide variety of JS flavors:
|
||||
[
|
||||
'porgy.config.js',
|
||||
'porgy.config.mjs',
|
||||
'porgy.config.ts',
|
||||
'porgy.config.coffee'
|
||||
]
|
||||
// ^^ You will need to designate custom loaders to tell
|
||||
// Cosmiconfig how to handle these special JS flavors.
|
||||
|
||||
// Look within a .config/ subdirectory of every searched directory:
|
||||
[
|
||||
'package.json',
|
||||
'.porgyrc',
|
||||
'.config/.porgyrc',
|
||||
'.porgyrc.json',
|
||||
'.config/.porgyrc.json'
|
||||
]
|
||||
```
|
||||
|
||||
### loaders
|
||||
|
||||
Type: `Object`.
|
||||
Default: See below.
|
||||
|
||||
An object that maps extensions to the loader functions responsible for loading and parsing files with those extensions.
|
||||
|
||||
Cosmiconfig exposes its default loaders for `.js`, `.json`, and `.yaml` as `cosmiconfig.loadJs`, `cosmiconfig.loadJson`, and `cosmiconfig.loadYaml`, respectively.
|
||||
|
||||
**Default `loaders`:**
|
||||
|
||||
```js
|
||||
{
|
||||
'.json': cosmiconfig.loadJson,
|
||||
'.yaml': cosmiconfig.loadYaml,
|
||||
'.yml': cosmiconfig.loadYaml,
|
||||
'.js': cosmiconfig.loadJs,
|
||||
noExt: cosmiconfig.loadYaml
|
||||
}
|
||||
```
|
||||
|
||||
(YAML is a superset of JSON; which means YAML parsers can parse JSON; which is how extensionless files can be either YAML *or* JSON with only one parser.)
|
||||
|
||||
**If you provide a `loaders` object, your object will be *merged* with the defaults.**
|
||||
So you can override one or two without having to override them all.
|
||||
|
||||
**Keys in `loaders`** are extensions (starting with a period), or `noExt` to specify the loader for files *without* extensions, like `.soursocksrc`.
|
||||
|
||||
**Values in `loaders`** are either a loader function (described below) or an object with `sync` and/or `async` properties, whose values are loader functions.
|
||||
|
||||
**The most common use case for custom loaders value is to load extensionless `rc` files as strict JSON**, instead of JSON *or* YAML (the default).
|
||||
To accomplish that, provide the following `loaders` value:
|
||||
|
||||
```js
|
||||
{
|
||||
noExt: cosmiconfig.loadJson
|
||||
}
|
||||
```
|
||||
|
||||
If you want to load files that are not handled by the loader functions Cosmiconfig exposes, you can write a custom loader function or use one from NPM if it exists.
|
||||
|
||||
**Third-party loaders:**
|
||||
|
||||
- [@endemolshinegroup/cosmiconfig-typescript-loader](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader)
|
||||
|
||||
**Use cases for custom loader function:**
|
||||
|
||||
- Allow configuration syntaxes that aren't handled by Cosmiconfig's defaults, like JSON5, INI, or XML.
|
||||
- Allow ES2015 modules from `.mjs` configuration files.
|
||||
- Parse JS files with Babel before deriving the configuration.
|
||||
|
||||
**Custom loader functions** have the following signature:
|
||||
|
||||
```js
|
||||
// Sync
|
||||
(filepath: string, content: string) => Object | null
|
||||
|
||||
// Async
|
||||
(filepath: string, content: string) => Object | null | Promise<Object | null>
|
||||
```
|
||||
|
||||
Cosmiconfig reads the file when it checks whether the file exists, so it will provide you with both the file's path and its content.
|
||||
Do whatever you need to, and return either a configuration object or `null` (or, for async-only loaders, a Promise that resolves with one of those).
|
||||
`null` indicates that no real configuration was found and the search should continue.
|
||||
|
||||
It's easiest if you make your custom loader function synchronous.
|
||||
Then it can be used regardless of whether you end up calling [`search()`] or [`searchSync()`], [`load()`] or [`loadSync()`].
|
||||
If you want or need to provide an async-only loader, you can do so by making the value of `loaders` an object with an `async` property whose value is the async loader.
|
||||
You can also add a `sync` property to designate a sync loader, if you want to use both async and sync search and load functions.
|
||||
|
||||
A few things to note:
|
||||
|
||||
- If you use a custom loader, be aware of whether it's sync or async and how that aligned with your usage of sync or async search and load functions.
|
||||
- **Special JS syntax can also be handled by using a `require` hook**, because `cosmiconfig.loadJs` just uses `require`.
|
||||
Whether you use custom loaders or a `require` hook is up to you.
|
||||
|
||||
Examples:
|
||||
|
||||
```js
|
||||
// Allow JSON5 syntax:
|
||||
{
|
||||
'.json': json5Loader
|
||||
}
|
||||
|
||||
// Allow XML, and treat sync and async separately:
|
||||
{
|
||||
'.xml': { async: asyncXmlLoader, sync: syncXmlLoader }
|
||||
}
|
||||
|
||||
// Allow a special configuration syntax of your own creation:
|
||||
{
|
||||
'.special': specialLoader
|
||||
}
|
||||
|
||||
// Allow many flavors of JS, using custom loaders:
|
||||
{
|
||||
'.mjs': esmLoader,
|
||||
'.ts': typeScriptLoader,
|
||||
'.coffee': coffeeScriptLoader
|
||||
}
|
||||
|
||||
// Allow many flavors of JS but rely on require hooks:
|
||||
{
|
||||
'.mjs': cosmiconfig.loadJs,
|
||||
'.ts': cosmiconfig.loadJs,
|
||||
'.coffee': cosmiconfig.loadJs
|
||||
}
|
||||
```
|
||||
|
||||
### packageProp
|
||||
|
||||
Type: `string | Array<string>`.
|
||||
Default: `` `${moduleName}` ``.
|
||||
|
||||
Name of the property in `package.json` to look for.
|
||||
|
||||
Use a period-delimited string or an array of strings to describe a path to nested properties.
|
||||
|
||||
For example, the value `'configs.myPackage'` or `['configs', 'myPackage']` will get you the `"myPackage"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"configs": {
|
||||
"myPackage": {..}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If nested property names within the path include periods, you need to use an array of strings. For example, the value `['configs', 'foo.bar', 'baz']` will get you the `"baz"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"configs": {
|
||||
"foo.bar": {
|
||||
"baz": {..}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If a string includes period but corresponds to a top-level property name, it will not be interpreted as a period-delimited path. For example, the value `'one.two'` will get you the `"three"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"one.two": "three",
|
||||
"one": {
|
||||
"two": "four"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### stopDir
|
||||
|
||||
Type: `string`.
|
||||
Default: Absolute path to your home directory.
|
||||
|
||||
Directory where the search will stop.
|
||||
|
||||
### cache
|
||||
|
||||
Type: `boolean`.
|
||||
Default: `true`.
|
||||
|
||||
If `false`, no caches will be used.
|
||||
Read more about ["Caching"](#caching) below.
|
||||
|
||||
### transform
|
||||
|
||||
Type: `(Result) => Promise<Result> | Result`.
|
||||
|
||||
A function that transforms the parsed configuration. Receives the [result].
|
||||
|
||||
If using [`search()`] or [`load()`] \(which are async), the transform function can return the transformed result or return a Promise that resolves with the transformed result.
|
||||
If using [`searchSync()`] or [`loadSync()`], the function must be synchronous and return the transformed result.
|
||||
|
||||
The reason you might use this option — instead of simply applying your transform function some other way — is that *the transformed result will be cached*. If your transformation involves additional filesystem I/O or other potentially slow processing, you can use this option to avoid repeating those steps every time a given configuration is searched or loaded.
|
||||
|
||||
### ignoreEmptySearchPlaces
|
||||
|
||||
Type: `boolean`.
|
||||
Default: `true`.
|
||||
|
||||
By default, if [`search()`] encounters an empty file (containing nothing but whitespace) in one of the [`searchPlaces`], it will ignore the empty file and move on.
|
||||
If you'd like to load empty configuration files, instead, set this option to `false`.
|
||||
|
||||
Why might you want to load empty configuration files?
|
||||
If you want to throw an error, or if an empty configuration file means something to your program.
|
||||
|
||||
## Caching
|
||||
|
||||
As of v2, cosmiconfig uses caching to reduce the need for repetitious reading of the filesystem or expensive transforms. Every new cosmiconfig instance (created with `cosmiconfig()`) has its own caches.
|
||||
|
||||
To avoid or work around caching, you can do the following:
|
||||
|
||||
- Set the `cosmiconfig` option [`cache`] to `false`.
|
||||
- Use the cache-clearing methods [`clearLoadCache()`], [`clearSearchCache()`], and [`clearCaches()`].
|
||||
- Create separate instances of cosmiconfig (separate "explorers").
|
||||
|
||||
## Differences from [rc](https://github.com/dominictarr/rc)
|
||||
|
||||
[rc](https://github.com/dominictarr/rc) serves its focused purpose well. cosmiconfig differs in a few key ways — making it more useful for some projects, less useful for others:
|
||||
|
||||
- Looks for configuration in some different places: in a `package.json` property, an rc file, a `.config.js` file, and rc files with extensions.
|
||||
- Built-in support for JSON, YAML, and CommonJS formats.
|
||||
- Stops at the first configuration found, instead of finding all that can be found up the directory tree and merging them automatically.
|
||||
- Options.
|
||||
- Asynchronous by default (though can be run synchronously).
|
||||
|
||||
## Contributing & Development
|
||||
|
||||
Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
|
||||
|
||||
And please do participate!
|
||||
|
||||
[result]: #result
|
||||
|
||||
[`load()`]: #explorerload
|
||||
|
||||
[`loadsync()`]: #explorerloadsync
|
||||
|
||||
[`search()`]: #explorersearch
|
||||
|
||||
[`searchsync()`]: #explorersearchsync
|
||||
|
||||
[`clearloadcache()`]: #explorerclearloadcache
|
||||
|
||||
[`clearsearchcache()`]: #explorerclearsearchcache
|
||||
|
||||
[`clearcaches()`]: #explorerclearcaches
|
||||
|
||||
[`packageprop`]: #packageprop
|
||||
|
||||
[`cache`]: #cache
|
||||
|
||||
[`stopdir`]: #stopdir
|
||||
|
||||
[`searchplaces`]: #searchplaces
|
||||
|
||||
[`loaders`]: #loaders
|
||||
|
||||
[`cosmiconfigoptions`]: #cosmiconfigoptions
|
19
web/node_modules/cssnano/node_modules/cosmiconfig/dist/cacheWrapper.js
generated
vendored
Normal file
19
web/node_modules/cssnano/node_modules/cosmiconfig/dist/cacheWrapper.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
function cacheWrapper (cache , key , fn ) {
|
||||
if (!cache) {
|
||||
return fn();
|
||||
}
|
||||
|
||||
const cached = cache.get(key);
|
||||
if (cached !== undefined) {
|
||||
return cached;
|
||||
}
|
||||
|
||||
const result = fn();
|
||||
cache.set(key, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = cacheWrapper;
|
322
web/node_modules/cssnano/node_modules/cosmiconfig/dist/createExplorer.js
generated
vendored
Normal file
322
web/node_modules/cssnano/node_modules/cosmiconfig/dist/createExplorer.js
generated
vendored
Normal file
|
@ -0,0 +1,322 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const loaders = require('./loaders');
|
||||
const readFile = require('./readFile');
|
||||
const cacheWrapper = require('./cacheWrapper');
|
||||
const getDirectory = require('./getDirectory');
|
||||
const getPropertyByPath = require('./getPropertyByPath');
|
||||
|
||||
const MODE_SYNC = 'sync';
|
||||
|
||||
// An object value represents a config object.
|
||||
// null represents that the loader did not find anything relevant.
|
||||
// undefined represents that the loader found something relevant
|
||||
// but it was empty.
|
||||
|
||||
|
||||
class Explorer {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
constructor(options ) {
|
||||
this.loadCache = options.cache ? new Map() : null;
|
||||
this.loadSyncCache = options.cache ? new Map() : null;
|
||||
this.searchCache = options.cache ? new Map() : null;
|
||||
this.searchSyncCache = options.cache ? new Map() : null;
|
||||
this.config = options;
|
||||
this.validateConfig();
|
||||
}
|
||||
|
||||
clearLoadCache() {
|
||||
if (this.loadCache) {
|
||||
this.loadCache.clear();
|
||||
}
|
||||
if (this.loadSyncCache) {
|
||||
this.loadSyncCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
clearSearchCache() {
|
||||
if (this.searchCache) {
|
||||
this.searchCache.clear();
|
||||
}
|
||||
if (this.searchSyncCache) {
|
||||
this.searchSyncCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
clearCaches() {
|
||||
this.clearLoadCache();
|
||||
this.clearSearchCache();
|
||||
}
|
||||
|
||||
validateConfig() {
|
||||
const config = this.config;
|
||||
|
||||
config.searchPlaces.forEach(place => {
|
||||
const loaderKey = path.extname(place) || 'noExt';
|
||||
const loader = config.loaders[loaderKey];
|
||||
if (!loader) {
|
||||
throw new Error(
|
||||
`No loader specified for ${getExtensionDescription(
|
||||
place
|
||||
)}, so searchPlaces item "${place}" is invalid`
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
search(searchFrom ) {
|
||||
searchFrom = searchFrom || process.cwd();
|
||||
return getDirectory(searchFrom).then(dir => {
|
||||
return this.searchFromDirectory(dir);
|
||||
});
|
||||
}
|
||||
|
||||
searchFromDirectory(dir ) {
|
||||
const absoluteDir = path.resolve(process.cwd(), dir);
|
||||
const run = () => {
|
||||
return this.searchDirectory(absoluteDir).then(result => {
|
||||
const nextDir = this.nextDirectoryToSearch(absoluteDir, result);
|
||||
if (nextDir) {
|
||||
return this.searchFromDirectory(nextDir);
|
||||
}
|
||||
return this.config.transform(result);
|
||||
});
|
||||
};
|
||||
|
||||
if (this.searchCache) {
|
||||
return cacheWrapper(this.searchCache, absoluteDir, run);
|
||||
}
|
||||
return run();
|
||||
}
|
||||
|
||||
searchSync(searchFrom ) {
|
||||
searchFrom = searchFrom || process.cwd();
|
||||
const dir = getDirectory.sync(searchFrom);
|
||||
return this.searchFromDirectorySync(dir);
|
||||
}
|
||||
|
||||
searchFromDirectorySync(dir ) {
|
||||
const absoluteDir = path.resolve(process.cwd(), dir);
|
||||
const run = () => {
|
||||
const result = this.searchDirectorySync(absoluteDir);
|
||||
const nextDir = this.nextDirectoryToSearch(absoluteDir, result);
|
||||
if (nextDir) {
|
||||
return this.searchFromDirectorySync(nextDir);
|
||||
}
|
||||
return this.config.transform(result);
|
||||
};
|
||||
|
||||
if (this.searchSyncCache) {
|
||||
return cacheWrapper(this.searchSyncCache, absoluteDir, run);
|
||||
}
|
||||
return run();
|
||||
}
|
||||
|
||||
searchDirectory(dir ) {
|
||||
return this.config.searchPlaces.reduce((prevResultPromise, place) => {
|
||||
return prevResultPromise.then(prevResult => {
|
||||
if (this.shouldSearchStopWithResult(prevResult)) {
|
||||
return prevResult;
|
||||
}
|
||||
return this.loadSearchPlace(dir, place);
|
||||
});
|
||||
}, Promise.resolve(null));
|
||||
}
|
||||
|
||||
searchDirectorySync(dir ) {
|
||||
let result = null;
|
||||
for (const place of this.config.searchPlaces) {
|
||||
result = this.loadSearchPlaceSync(dir, place);
|
||||
if (this.shouldSearchStopWithResult(result)) break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
shouldSearchStopWithResult(result ) {
|
||||
if (result === null) return false;
|
||||
if (result.isEmpty && this.config.ignoreEmptySearchPlaces) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
loadSearchPlace(dir , place ) {
|
||||
const filepath = path.join(dir, place);
|
||||
return readFile(filepath).then(content => {
|
||||
return this.createCosmiconfigResult(filepath, content);
|
||||
});
|
||||
}
|
||||
|
||||
loadSearchPlaceSync(dir , place ) {
|
||||
const filepath = path.join(dir, place);
|
||||
const content = readFile.sync(filepath);
|
||||
return this.createCosmiconfigResultSync(filepath, content);
|
||||
}
|
||||
|
||||
nextDirectoryToSearch(
|
||||
currentDir ,
|
||||
currentResult
|
||||
) {
|
||||
if (this.shouldSearchStopWithResult(currentResult)) {
|
||||
return null;
|
||||
}
|
||||
const nextDir = nextDirUp(currentDir);
|
||||
if (nextDir === currentDir || currentDir === this.config.stopDir) {
|
||||
return null;
|
||||
}
|
||||
return nextDir;
|
||||
}
|
||||
|
||||
loadPackageProp(filepath , content ) {
|
||||
const parsedContent = loaders.loadJson(filepath, content);
|
||||
const packagePropValue = getPropertyByPath(
|
||||
parsedContent,
|
||||
this.config.packageProp
|
||||
);
|
||||
return packagePropValue || null;
|
||||
}
|
||||
|
||||
getLoaderEntryForFile(filepath ) {
|
||||
if (path.basename(filepath) === 'package.json') {
|
||||
const loader = this.loadPackageProp.bind(this);
|
||||
return { sync: loader, async: loader };
|
||||
}
|
||||
|
||||
const loaderKey = path.extname(filepath) || 'noExt';
|
||||
return this.config.loaders[loaderKey] || {};
|
||||
}
|
||||
|
||||
getSyncLoaderForFile(filepath ) {
|
||||
const entry = this.getLoaderEntryForFile(filepath);
|
||||
if (!entry.sync) {
|
||||
throw new Error(
|
||||
`No sync loader specified for ${getExtensionDescription(filepath)}`
|
||||
);
|
||||
}
|
||||
return entry.sync;
|
||||
}
|
||||
|
||||
getAsyncLoaderForFile(filepath ) {
|
||||
const entry = this.getLoaderEntryForFile(filepath);
|
||||
const loader = entry.async || entry.sync;
|
||||
if (!loader) {
|
||||
throw new Error(
|
||||
`No async loader specified for ${getExtensionDescription(filepath)}`
|
||||
);
|
||||
}
|
||||
return loader;
|
||||
}
|
||||
|
||||
loadFileContent(
|
||||
mode ,
|
||||
filepath ,
|
||||
content
|
||||
) {
|
||||
if (content === null) {
|
||||
return null;
|
||||
}
|
||||
if (content.trim() === '') {
|
||||
return undefined;
|
||||
}
|
||||
const loader =
|
||||
mode === MODE_SYNC
|
||||
? this.getSyncLoaderForFile(filepath)
|
||||
: this.getAsyncLoaderForFile(filepath);
|
||||
return loader(filepath, content);
|
||||
}
|
||||
|
||||
loadedContentToCosmiconfigResult(
|
||||
filepath ,
|
||||
loadedContent
|
||||
) {
|
||||
if (loadedContent === null) {
|
||||
return null;
|
||||
}
|
||||
if (loadedContent === undefined) {
|
||||
return { filepath, config: undefined, isEmpty: true };
|
||||
}
|
||||
return { config: loadedContent, filepath };
|
||||
}
|
||||
|
||||
createCosmiconfigResult(
|
||||
filepath ,
|
||||
content
|
||||
) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
return this.loadFileContent('async', filepath, content);
|
||||
})
|
||||
.then(loaderResult => {
|
||||
return this.loadedContentToCosmiconfigResult(filepath, loaderResult);
|
||||
});
|
||||
}
|
||||
|
||||
createCosmiconfigResultSync(
|
||||
filepath ,
|
||||
content
|
||||
) {
|
||||
const loaderResult = this.loadFileContent('sync', filepath, content);
|
||||
return this.loadedContentToCosmiconfigResult(filepath, loaderResult);
|
||||
}
|
||||
|
||||
validateFilePath(filepath ) {
|
||||
if (!filepath) {
|
||||
throw new Error('load and loadSync must pass a non-empty string');
|
||||
}
|
||||
}
|
||||
|
||||
load(filepath ) {
|
||||
return Promise.resolve().then(() => {
|
||||
this.validateFilePath(filepath);
|
||||
const absoluteFilePath = path.resolve(process.cwd(), filepath);
|
||||
return cacheWrapper(this.loadCache, absoluteFilePath, () => {
|
||||
return readFile(absoluteFilePath, { throwNotFound: true })
|
||||
.then(content => {
|
||||
return this.createCosmiconfigResult(absoluteFilePath, content);
|
||||
})
|
||||
.then(this.config.transform);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
loadSync(filepath ) {
|
||||
this.validateFilePath(filepath);
|
||||
const absoluteFilePath = path.resolve(process.cwd(), filepath);
|
||||
return cacheWrapper(this.loadSyncCache, absoluteFilePath, () => {
|
||||
const content = readFile.sync(absoluteFilePath, { throwNotFound: true });
|
||||
const result = this.createCosmiconfigResultSync(
|
||||
absoluteFilePath,
|
||||
content
|
||||
);
|
||||
return this.config.transform(result);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function createExplorer(options ) {
|
||||
const explorer = new Explorer(options);
|
||||
|
||||
return {
|
||||
search: explorer.search.bind(explorer),
|
||||
searchSync: explorer.searchSync.bind(explorer),
|
||||
load: explorer.load.bind(explorer),
|
||||
loadSync: explorer.loadSync.bind(explorer),
|
||||
clearLoadCache: explorer.clearLoadCache.bind(explorer),
|
||||
clearSearchCache: explorer.clearSearchCache.bind(explorer),
|
||||
clearCaches: explorer.clearCaches.bind(explorer),
|
||||
};
|
||||
};
|
||||
|
||||
function nextDirUp(dir ) {
|
||||
return path.dirname(dir);
|
||||
}
|
||||
|
||||
function getExtensionDescription(filepath ) {
|
||||
const ext = path.extname(filepath);
|
||||
return ext ? `extension "${ext}"` : 'files without extensions';
|
||||
}
|
22
web/node_modules/cssnano/node_modules/cosmiconfig/dist/getDirectory.js
generated
vendored
Normal file
22
web/node_modules/cssnano/node_modules/cosmiconfig/dist/getDirectory.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const isDirectory = require('is-directory');
|
||||
|
||||
function getDirectory(filepath ) {
|
||||
return new Promise((resolve, reject) => {
|
||||
return isDirectory(filepath, (err, filepathIsDirectory) => {
|
||||
if (err) {
|
||||
return reject(err);
|
||||
}
|
||||
return resolve(filepathIsDirectory ? filepath : path.dirname(filepath));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getDirectory.sync = function getDirectorySync(filepath ) {
|
||||
return isDirectory.sync(filepath) ? filepath : path.dirname(filepath);
|
||||
};
|
||||
|
||||
module.exports = getDirectory;
|
23
web/node_modules/cssnano/node_modules/cosmiconfig/dist/getPropertyByPath.js
generated
vendored
Normal file
23
web/node_modules/cssnano/node_modules/cosmiconfig/dist/getPropertyByPath.js
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
// Resolves property names or property paths defined with period-delimited
|
||||
// strings or arrays of strings. Property names that are found on the source
|
||||
// object are used directly (even if they include a period).
|
||||
// Nested property names that include periods, within a path, are only
|
||||
// understood in array paths.
|
||||
function getPropertyByPath(source , path ) {
|
||||
if (typeof path === 'string' && source.hasOwnProperty(path)) {
|
||||
return source[path];
|
||||
}
|
||||
|
||||
const parsedPath = typeof path === 'string' ? path.split('.') : path;
|
||||
return parsedPath.reduce((previous, key) => {
|
||||
if (previous === undefined) {
|
||||
return previous;
|
||||
}
|
||||
return previous[key];
|
||||
}, source);
|
||||
}
|
||||
|
||||
module.exports = getPropertyByPath;
|
81
web/node_modules/cssnano/node_modules/cosmiconfig/dist/index.js
generated
vendored
Normal file
81
web/node_modules/cssnano/node_modules/cosmiconfig/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,81 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const os = require('os');
|
||||
const createExplorer = require('./createExplorer');
|
||||
const loaders = require('./loaders');
|
||||
|
||||
module.exports = cosmiconfig;
|
||||
|
||||
function cosmiconfig(
|
||||
moduleName ,
|
||||
options
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
) {
|
||||
options = options || {};
|
||||
const defaults = {
|
||||
packageProp: moduleName,
|
||||
searchPlaces: [
|
||||
'package.json',
|
||||
`.${moduleName}rc`,
|
||||
`.${moduleName}rc.json`,
|
||||
`.${moduleName}rc.yaml`,
|
||||
`.${moduleName}rc.yml`,
|
||||
`.${moduleName}rc.js`,
|
||||
`${moduleName}.config.js`,
|
||||
],
|
||||
ignoreEmptySearchPlaces: true,
|
||||
stopDir: os.homedir(),
|
||||
cache: true,
|
||||
transform: identity,
|
||||
};
|
||||
const normalizedOptions = Object.assign(
|
||||
{},
|
||||
defaults,
|
||||
options,
|
||||
{
|
||||
loaders: normalizeLoaders(options.loaders),
|
||||
}
|
||||
);
|
||||
|
||||
return createExplorer(normalizedOptions);
|
||||
}
|
||||
|
||||
cosmiconfig.loadJs = loaders.loadJs;
|
||||
cosmiconfig.loadJson = loaders.loadJson;
|
||||
cosmiconfig.loadYaml = loaders.loadYaml;
|
||||
|
||||
function normalizeLoaders(rawLoaders ) {
|
||||
const defaults = {
|
||||
'.js': { sync: loaders.loadJs, async: loaders.loadJs },
|
||||
'.json': { sync: loaders.loadJson, async: loaders.loadJson },
|
||||
'.yaml': { sync: loaders.loadYaml, async: loaders.loadYaml },
|
||||
'.yml': { sync: loaders.loadYaml, async: loaders.loadYaml },
|
||||
noExt: { sync: loaders.loadYaml, async: loaders.loadYaml },
|
||||
};
|
||||
|
||||
if (!rawLoaders) {
|
||||
return defaults;
|
||||
}
|
||||
|
||||
return Object.keys(rawLoaders).reduce((result, ext) => {
|
||||
const entry = rawLoaders && rawLoaders[ext];
|
||||
if (typeof entry === 'function') {
|
||||
result[ext] = { sync: entry, async: entry };
|
||||
} else {
|
||||
result[ext] = entry;
|
||||
}
|
||||
return result;
|
||||
}, defaults);
|
||||
}
|
||||
|
||||
function identity(x) {
|
||||
return x;
|
||||
}
|
30
web/node_modules/cssnano/node_modules/cosmiconfig/dist/loaders.js
generated
vendored
Normal file
30
web/node_modules/cssnano/node_modules/cosmiconfig/dist/loaders.js
generated
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const parseJson = require('parse-json');
|
||||
const yaml = require('js-yaml');
|
||||
const importFresh = require('import-fresh');
|
||||
|
||||
function loadJs(filepath ) {
|
||||
const result = importFresh(filepath);
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadJson(filepath , content ) {
|
||||
try {
|
||||
return parseJson(content);
|
||||
} catch (err) {
|
||||
err.message = `JSON Error in ${filepath}:\n${err.message}`;
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
function loadYaml(filepath , content ) {
|
||||
return yaml.safeLoad(content, { filename: filepath });
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
loadJs,
|
||||
loadJson,
|
||||
loadYaml,
|
||||
};
|
42
web/node_modules/cssnano/node_modules/cosmiconfig/dist/readFile.js
generated
vendored
Normal file
42
web/node_modules/cssnano/node_modules/cosmiconfig/dist/readFile.js
generated
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function readFile(filepath , options ) {
|
||||
options = options || {};
|
||||
const throwNotFound = options.throwNotFound || false;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.readFile(filepath, 'utf8', (err, content) => {
|
||||
if (err && err.code === 'ENOENT' && !throwNotFound) {
|
||||
return resolve(null);
|
||||
}
|
||||
if (err) return reject(err);
|
||||
resolve(content);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
readFile.sync = function readFileSync(
|
||||
filepath ,
|
||||
options
|
||||
) {
|
||||
options = options || {};
|
||||
const throwNotFound = options.throwNotFound || false;
|
||||
|
||||
try {
|
||||
return fs.readFileSync(filepath, 'utf8');
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT' && !throwNotFound) {
|
||||
return null;
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = readFile;
|
114
web/node_modules/cssnano/node_modules/cosmiconfig/package.json
generated
vendored
Normal file
114
web/node_modules/cssnano/node_modules/cosmiconfig/package.json
generated
vendored
Normal file
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"name": "cosmiconfig",
|
||||
"version": "5.2.1",
|
||||
"description": "Find and load configuration from a package.json property, rc file, or CommonJS module",
|
||||
"main": "dist/index.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"precommit": "lint-staged && jest && flow check",
|
||||
"lint:md-partial": "remark -u remark-preset-davidtheclark --frail --quiet --no-stdout --output --",
|
||||
"lint:md": "npm run lint:md-partial -- *.md",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"lint": "eslint . && npm run lint:md",
|
||||
"format": "prettier --write \"{src/*.js,test/*.js}\"",
|
||||
"pretest": "npm run lint && flow check",
|
||||
"test": "jest --coverage",
|
||||
"test:watch": "jest --watch",
|
||||
"coverage": "jest --coverage --coverageReporters=html --coverageReporters=text",
|
||||
"build": "flow-remove-types src --out-dir dist --quiet",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint --fix",
|
||||
"prettier --write",
|
||||
"git add"
|
||||
],
|
||||
"*.md": [
|
||||
"npm run lint:md-partial",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/davidtheclark/cosmiconfig.git"
|
||||
},
|
||||
"keywords": [
|
||||
"load",
|
||||
"configuration",
|
||||
"config"
|
||||
],
|
||||
"author": "David Clark <david.dave.clark@gmail.com>",
|
||||
"contributors": [
|
||||
"Bogdan Chadkin <trysound@yandex.ru>",
|
||||
"Suhas Karanth <sudo.suhas@gmail.com>"
|
||||
],
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/davidtheclark/cosmiconfig/issues"
|
||||
},
|
||||
"homepage": "https://github.com/davidtheclark/cosmiconfig#readme",
|
||||
"prettier": {
|
||||
"trailingComma": "es5",
|
||||
"singleQuote": true,
|
||||
"printWidth": 80,
|
||||
"tabWidth": 2
|
||||
},
|
||||
"jest": {
|
||||
"testEnvironment": "node",
|
||||
"collectCoverageFrom": [
|
||||
"src/*.js"
|
||||
],
|
||||
"coverageReporters": [
|
||||
"text",
|
||||
"html",
|
||||
"lcov"
|
||||
],
|
||||
"coverageThreshold": {
|
||||
"global": {
|
||||
"branches": 100,
|
||||
"functions": 100,
|
||||
"lines": 100,
|
||||
"statements": 100
|
||||
}
|
||||
},
|
||||
"resetModules": true,
|
||||
"resetMocks": true
|
||||
},
|
||||
"babel": {
|
||||
"plugins": [
|
||||
"transform-flow-strip-types"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"import-fresh": "^2.0.0",
|
||||
"is-directory": "^0.3.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"parse-json": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-eslint": "^8.0.3",
|
||||
"babel-plugin-transform-flow-strip-types": "^6.22.0",
|
||||
"del": "^3.0.0",
|
||||
"eslint": "^4.12.1",
|
||||
"eslint-config-davidtheclark-node": "^0.2.2",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-plugin-flowtype": "^2.39.1",
|
||||
"eslint-plugin-node": "^5.2.1",
|
||||
"flow-bin": "^0.68.0",
|
||||
"flow-remove-types": "^1.2.3",
|
||||
"husky": "^0.14.3",
|
||||
"jest": "^21.2.1",
|
||||
"lint-staged": "^6.0.0",
|
||||
"make-dir": "^1.2.0",
|
||||
"parent-module": "^0.1.0",
|
||||
"prettier": "^1.8.2",
|
||||
"remark-cli": "^5.0.0",
|
||||
"remark-preset-davidtheclark": "^0.7.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
}
|
29
web/node_modules/cssnano/node_modules/import-fresh/index.js
generated
vendored
Normal file
29
web/node_modules/cssnano/node_modules/import-fresh/index.js
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const resolveFrom = require('resolve-from');
|
||||
const callerPath = require('caller-path');
|
||||
|
||||
module.exports = moduleId => {
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
const filePath = resolveFrom(path.dirname(callerPath()), moduleId);
|
||||
|
||||
// Delete itself from module parent
|
||||
if (require.cache[filePath] && require.cache[filePath].parent) {
|
||||
let i = require.cache[filePath].parent.children.length;
|
||||
|
||||
while (i--) {
|
||||
if (require.cache[filePath].parent.children[i].id === filePath) {
|
||||
require.cache[filePath].parent.children.splice(i, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Delete module from cache
|
||||
delete require.cache[filePath];
|
||||
|
||||
// Return fresh module
|
||||
return require(filePath);
|
||||
};
|
21
web/node_modules/cssnano/node_modules/import-fresh/license
generated
vendored
Normal file
21
web/node_modules/cssnano/node_modules/import-fresh/license
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
48
web/node_modules/cssnano/node_modules/import-fresh/package.json
generated
vendored
Normal file
48
web/node_modules/cssnano/node_modules/import-fresh/package.json
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "import-fresh",
|
||||
"version": "2.0.0",
|
||||
"description": "Import a module while bypassing the cache",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/import-fresh",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava",
|
||||
"heapdump": "optional-dev-dependency && node heapdump.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"require",
|
||||
"cache",
|
||||
"uncache",
|
||||
"uncached",
|
||||
"module",
|
||||
"fresh",
|
||||
"bypass"
|
||||
],
|
||||
"dependencies": {
|
||||
"caller-path": "^2.0.0",
|
||||
"resolve-from": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"optional-dev-dependency": "^2.0.1",
|
||||
"xo": "^0.18.2"
|
||||
},
|
||||
"optionalDevDependencies": {
|
||||
"heapdump": "^0.3.7"
|
||||
},
|
||||
"xo": {
|
||||
"rules": {
|
||||
"import/no-extraneous-dependencies": "off"
|
||||
}
|
||||
}
|
||||
}
|
50
web/node_modules/cssnano/node_modules/import-fresh/readme.md
generated
vendored
Normal file
50
web/node_modules/cssnano/node_modules/import-fresh/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
# import-fresh [](https://travis-ci.org/sindresorhus/import-fresh)
|
||||
|
||||
> Import a module while bypassing the [cache](https://nodejs.org/api/modules.html#modules_caching)
|
||||
|
||||
Useful for testing purposes when you need to freshly import a module.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save import-fresh
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// foo.js
|
||||
let i = 0;
|
||||
module.exports = () => ++i;
|
||||
```
|
||||
|
||||
```js
|
||||
const importFresh = require('import-fresh');
|
||||
|
||||
require('./foo')();
|
||||
//=> 1
|
||||
|
||||
require('./foo')();
|
||||
//=> 2
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
|
||||
importFresh('./foo')();
|
||||
//=> 1
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [clear-module](https://github.com/sindresorhus/clear-module) - Clear a module from the import cache
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [import-cwd](https://github.com/sindresorhus/import-cwd) - Import a module from the current working directory
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
33
web/node_modules/cssnano/node_modules/parse-json/index.js
generated
vendored
Normal file
33
web/node_modules/cssnano/node_modules/parse-json/index.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
const errorEx = require('error-ex');
|
||||
const fallback = require('json-parse-better-errors');
|
||||
|
||||
const JSONError = errorEx('JSONError', {
|
||||
fileName: errorEx.append('in %s')
|
||||
});
|
||||
|
||||
module.exports = (input, reviver, filename) => {
|
||||
if (typeof reviver === 'string') {
|
||||
filename = reviver;
|
||||
reviver = null;
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
return JSON.parse(input, reviver);
|
||||
} catch (err) {
|
||||
fallback(input, reviver);
|
||||
|
||||
throw err;
|
||||
}
|
||||
} catch (err) {
|
||||
err.message = err.message.replace(/\n/g, '');
|
||||
|
||||
const jsonErr = new JSONError(err);
|
||||
if (filename) {
|
||||
jsonErr.fileName = filename;
|
||||
}
|
||||
|
||||
throw jsonErr;
|
||||
}
|
||||
};
|
9
web/node_modules/cssnano/node_modules/parse-json/license
generated
vendored
Normal file
9
web/node_modules/cssnano/node_modules/parse-json/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
43
web/node_modules/cssnano/node_modules/parse-json/package.json
generated
vendored
Normal file
43
web/node_modules/cssnano/node_modules/parse-json/package.json
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"name": "parse-json",
|
||||
"version": "4.0.0",
|
||||
"description": "Parse JSON with more helpful errors",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/parse-json",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"vendor"
|
||||
],
|
||||
"keywords": [
|
||||
"parse",
|
||||
"json",
|
||||
"graceful",
|
||||
"error",
|
||||
"message",
|
||||
"humanize",
|
||||
"friendly",
|
||||
"helpful",
|
||||
"string",
|
||||
"str"
|
||||
],
|
||||
"dependencies": {
|
||||
"error-ex": "^1.3.1",
|
||||
"json-parse-better-errors": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"nyc": "^11.2.1",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
83
web/node_modules/cssnano/node_modules/parse-json/readme.md
generated
vendored
Normal file
83
web/node_modules/cssnano/node_modules/parse-json/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
# parse-json [](https://travis-ci.org/sindresorhus/parse-json)
|
||||
|
||||
> Parse JSON with more helpful errors
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install parse-json
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const parseJson = require('parse-json');
|
||||
const json = '{\n\t"foo": true,\n}';
|
||||
|
||||
|
||||
JSON.parse(json);
|
||||
/*
|
||||
undefined:3
|
||||
}
|
||||
^
|
||||
SyntaxError: Unexpected token }
|
||||
*/
|
||||
|
||||
|
||||
parseJson(json);
|
||||
/*
|
||||
JSONError: Trailing comma in object at 3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
|
||||
|
||||
parseJson(json, 'foo.json');
|
||||
/*
|
||||
JSONError: Trailing comma in object in foo.json:3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
|
||||
|
||||
// You can also add the filename at a later point
|
||||
try {
|
||||
parseJson(json);
|
||||
} catch (err) {
|
||||
err.fileName = 'foo.json';
|
||||
throw err;
|
||||
}
|
||||
/*
|
||||
JSONError: Trailing comma in object in foo.json:3:1
|
||||
}
|
||||
^
|
||||
*/
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### parseJson(input, [reviver], [filename])
|
||||
|
||||
#### input
|
||||
|
||||
Type: `string`
|
||||
|
||||
#### reviver
|
||||
|
||||
Type: `Function`
|
||||
|
||||
Prescribes how the value originally produced by parsing is transformed, before being returned. See [`JSON.parse` docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Using_the_reviver_parameter
|
||||
) for more.
|
||||
|
||||
#### filename
|
||||
|
||||
Type: `string`
|
||||
|
||||
Filename displayed in the error message.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
35
web/node_modules/cssnano/node_modules/resolve-from/index.js
generated
vendored
Normal file
35
web/node_modules/cssnano/node_modules/resolve-from/index.js
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
const path = require('path');
|
||||
const Module = require('module');
|
||||
|
||||
const resolveFrom = (fromDir, moduleId, silent) => {
|
||||
if (typeof fromDir !== 'string') {
|
||||
throw new TypeError(`Expected \`fromDir\` to be of type \`string\`, got \`${typeof fromDir}\``);
|
||||
}
|
||||
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError(`Expected \`moduleId\` to be of type \`string\`, got \`${typeof moduleId}\``);
|
||||
}
|
||||
|
||||
fromDir = path.resolve(fromDir);
|
||||
const fromFile = path.join(fromDir, 'noop.js');
|
||||
|
||||
const resolveFileName = () => Module._resolveFilename(moduleId, {
|
||||
id: fromFile,
|
||||
filename: fromFile,
|
||||
paths: Module._nodeModulePaths(fromDir)
|
||||
});
|
||||
|
||||
if (silent) {
|
||||
try {
|
||||
return resolveFileName();
|
||||
} catch (err) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return resolveFileName();
|
||||
};
|
||||
|
||||
module.exports = (fromDir, moduleId) => resolveFrom(fromDir, moduleId);
|
||||
module.exports.silent = (fromDir, moduleId) => resolveFrom(fromDir, moduleId, true);
|
21
web/node_modules/cssnano/node_modules/resolve-from/license
generated
vendored
Normal file
21
web/node_modules/cssnano/node_modules/resolve-from/license
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
35
web/node_modules/cssnano/node_modules/resolve-from/package.json
generated
vendored
Normal file
35
web/node_modules/cssnano/node_modules/resolve-from/package.json
generated
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "resolve-from",
|
||||
"version": "3.0.0",
|
||||
"description": "Resolve the path of a module like `require.resolve()` but from a given path",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/resolve-from",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"require",
|
||||
"resolve",
|
||||
"path",
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"import",
|
||||
"path"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
71
web/node_modules/cssnano/node_modules/resolve-from/readme.md
generated
vendored
Normal file
71
web/node_modules/cssnano/node_modules/resolve-from/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,71 @@
|
|||
# resolve-from [](https://travis-ci.org/sindresorhus/resolve-from)
|
||||
|
||||
> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save resolve-from
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const resolveFrom = require('resolve-from');
|
||||
|
||||
// There is a file at `./foo/bar.js`
|
||||
|
||||
resolveFrom('foo', './bar');
|
||||
//=> '/Users/sindresorhus/dev/test/foo/bar.js'
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### resolveFrom(fromDir, moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### resolveFrom.silent(fromDir, moduleId)
|
||||
|
||||
Returns `null` instead of throwing when the module can't be found.
|
||||
|
||||
#### fromDir
|
||||
|
||||
Type: `string`
|
||||
|
||||
Directory to resolve from.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Tip
|
||||
|
||||
Create a partial using a bound function if you want to resolve from the same `fromDir` multiple times:
|
||||
|
||||
```js
|
||||
const resolveFromFoo = resolveFrom.bind(null, 'foo');
|
||||
|
||||
resolveFromFoo('./bar');
|
||||
resolveFromFoo('./baz');
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [req-from](https://github.com/sindresorhus/req-from) - Require a module from a given path
|
||||
- [req-cwd](https://github.com/sindresorhus/req-cwd) - Require a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [lazy-req](https://github.com/sindresorhus/lazy-req) - Require modules lazily
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
57
web/node_modules/cssnano/package.json
generated
vendored
Normal file
57
web/node_modules/cssnano/package.json
generated
vendored
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
"name": "cssnano",
|
||||
"version": "4.1.11",
|
||||
"description": "A modular minifier, built on top of the PostCSS ecosystem.",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"bundle-size": "webpack --json --config src/__tests__/_webpack.config.js | webpack-bundle-size-analyzer",
|
||||
"integrations": "babel-node src/__tests__/util/rebuild.js",
|
||||
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
|
||||
},
|
||||
"keywords": [
|
||||
"css",
|
||||
"compress",
|
||||
"minify",
|
||||
"optimise",
|
||||
"optimisation",
|
||||
"postcss",
|
||||
"postcss-plugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cosmiconfig": "^5.0.0",
|
||||
"cssnano-preset-default": "^4.0.8",
|
||||
"is-resolvable": "^1.0.0",
|
||||
"postcss": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-to-sentence": "^2.0.0",
|
||||
"babel-cli": "^6.0.0",
|
||||
"babel-core": "^6.0.0",
|
||||
"babel-loader": "^7.0.0",
|
||||
"cross-env": "^5.0.0",
|
||||
"cssnano-preset-advanced": "^4.0.7",
|
||||
"postcss-font-magician": "^2.0.0",
|
||||
"webpack": "^2.0.0",
|
||||
"webpack-bundle-size-analyzer": "^2.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
"author": {
|
||||
"name": "Ben Briggs",
|
||||
"email": "beneb.info@gmail.com",
|
||||
"url": "http://beneb.info"
|
||||
},
|
||||
"repository": "cssnano/cssnano",
|
||||
"files": [
|
||||
"dist",
|
||||
"LICENSE-MIT",
|
||||
"quickstart.js"
|
||||
],
|
||||
"tonicExampleFilename": "quickstart.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cssnano/cssnano/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
}
|
47
web/node_modules/cssnano/quickstart.js
generated
vendored
Normal file
47
web/node_modules/cssnano/quickstart.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* This example targets Node 4 and up.
|
||||
*/
|
||||
|
||||
const cssnano = require('cssnano');
|
||||
|
||||
/*
|
||||
* Add your CSS code here.
|
||||
*/
|
||||
|
||||
const css = `
|
||||
h1 {
|
||||
color: #ff0000;
|
||||
font-weight: bold;
|
||||
}
|
||||
`;
|
||||
|
||||
/*
|
||||
* Add any PostCSS options here. For example to enable sourcemaps, see:
|
||||
* https://github.com/postcss/postcss/blob/master/site/source-maps.md
|
||||
*
|
||||
* Or for an inline sourcemap, uncomment the options below.
|
||||
*/
|
||||
|
||||
const postcssOpts = {
|
||||
// from: 'app.css',
|
||||
// to: 'app.min.css',
|
||||
// map: {inline: true},
|
||||
};
|
||||
|
||||
/*
|
||||
* Add your choice of preset. Note that for any value other
|
||||
* than 'default', you will need to install the appropriate
|
||||
* preset separately.
|
||||
*/
|
||||
|
||||
const cssnanoOpts = {
|
||||
preset: 'default',
|
||||
};
|
||||
|
||||
/*
|
||||
* Compress the CSS asynchronously and log it to the console.
|
||||
*/
|
||||
|
||||
cssnano.process(css, postcssOpts, cssnanoOpts).then(result => {
|
||||
console.log(result.css);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue