Change: drop less, switch to less-bundle (#542)

* Change: drop less, switch to less-bundle

* fixup! Change: drop less, switch to less-bundle
This commit is contained in:
eight 2018-11-11 14:06:25 +08:00 committed by GitHub
parent 5646b8a0d9
commit deeba1b900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 186 additions and 212 deletions

View File

@ -108,7 +108,7 @@ function getUsercssCompiler(preprocessor) {
useFileCache: false, useFileCache: false,
}; };
} }
loadScript('/vendor/less/less.min.js'); loadScript('/vendor/less-bundle/less.min.js');
const varDefs = Object.keys(vars).map(key => `@${key}:${vars[key].value};\n`).join(''); const varDefs = Object.keys(vars).map(key => `@${key}:${vars[key].value};\n`).join('');
return self.less.render(varDefs + source) return self.less.render(varDefs + source)
.then(({css}) => css); .then(({css}) => css);

View File

@ -12,7 +12,7 @@
"eslint": "^5.8.0", "eslint": "^5.8.0",
"fs-extra": "^7.0.0", "fs-extra": "^7.0.0",
"jsonlint": "^1.6.3", "jsonlint": "^1.6.3",
"less": "^3.8.1", "less-bundle": "github:openstyles/less-bundle#v0.1.0",
"lz-string-unsafe": "^1.4.4-fork-1", "lz-string-unsafe": "^1.4.4-fork-1",
"rimraf": "^2.6.2", "rimraf": "^2.6.2",
"semver-bundle": "^0.1.1", "semver-bundle": "^0.1.1",

View File

@ -14,7 +14,7 @@ const files = {
'jsonlint': [ 'jsonlint': [
'lib/jsonlint.js → jsonlint.js' 'lib/jsonlint.js → jsonlint.js'
], ],
'less': [ 'less-bundle': [
'dist/less.min.js → less.min.js' 'dist/less.min.js → less.min.js'
], ],
'lz-string-unsafe': [ 'lz-string-unsafe': [

View File

@ -1,181 +1,177 @@
https://github.com/less/less.js
Apache License
https://github.com/less/less.js/blob/master/LICENSE Version 2.0, January 2004
http://www.apache.org/licenses/
Apache License TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Version 2.0, January 2004
http://www.apache.org/licenses/ 1. Definitions.
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION "License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
1. Definitions.
"Licensor" shall mean the copyright owner or entity authorized by
"License" shall mean the terms and conditions for use, reproduction, the copyright owner that is granting the License.
and distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
"Licensor" shall mean the copyright owner or entity authorized by other entities that control, are controlled by, or are under common
the copyright owner that is granting the License. control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
"Legal Entity" shall mean the union of the acting entity and all direction or management of such entity, whether by contract or
other entities that control, are controlled by, or are under common otherwise, or (ii) ownership of fifty percent (50%) or more of the
control with that entity. For the purposes of this definition, outstanding shares, or (iii) beneficial ownership of such entity.
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or "You" (or "Your") shall mean an individual or Legal Entity
otherwise, or (ii) ownership of fifty percent (50%) or more of the exercising permissions granted by this License.
outstanding shares, or (iii) beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
"You" (or "Your") shall mean an individual or Legal Entity including but not limited to software source code, documentation
exercising permissions granted by this License. source, and configuration files.
"Source" form shall mean the preferred form for making modifications, "Object" form shall mean any form resulting from mechanical
including but not limited to software source code, documentation transformation or translation of a Source form, including but
source, and configuration files. not limited to compiled object code, generated documentation,
and conversions to other media types.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but "Work" shall mean the work of authorship, whether in Source or
not limited to compiled object code, generated documentation, Object form, made available under the License, as indicated by a
and conversions to other media types. copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a "Derivative Works" shall mean any work, whether in Source or Object
copyright notice that is included in or attached to the work form, that is based on (or derived from) the Work and for which the
(an example is provided in the Appendix below). editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
"Derivative Works" shall mean any work, whether in Source or Object of this License, Derivative Works shall not include works that remain
form, that is based on (or derived from) the Work and for which the separable from, or merely link (or bind by name) to the interfaces of,
editorial revisions, annotations, elaborations, or other modifications the Work and Derivative Works thereof.
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain "Contribution" shall mean any work of authorship, including
separable from, or merely link (or bind by name) to the interfaces of, the original version of the Work and any modifications or additions
the Work and Derivative Works thereof. to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
"Contribution" shall mean any work of authorship, including or by an individual or Legal Entity authorized to submit on behalf of
the original version of the Work and any modifications or additions the copyright owner. For the purposes of this definition, "submitted"
to that Work or Derivative Works thereof, that is intentionally means any form of electronic, verbal, or written communication sent
submitted to Licensor for inclusion in the Work by the copyright owner to the Licensor or its representatives, including but not limited to
or by an individual or Legal Entity authorized to submit on behalf of communication on electronic mailing lists, source code control systems,
the copyright owner. For the purposes of this definition, "submitted" and issue tracking systems that are managed by, or on behalf of, the
means any form of electronic, verbal, or written communication sent Licensor for the purpose of discussing and improving the Work, but
to the Licensor or its representatives, including but not limited to excluding communication that is conspicuously marked or otherwise
communication on electronic mailing lists, source code control systems, designated in writing by the copyright owner as "Not a Contribution."
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but "Contributor" shall mean Licensor and any individual or Legal Entity
excluding communication that is conspicuously marked or otherwise on behalf of whom a Contribution has been received by Licensor and
designated in writing by the copyright owner as "Not a Contribution." subsequently incorporated within the Work.
"Contributor" shall mean Licensor and any individual or Legal Entity 2. Grant of Copyright License. Subject to the terms and conditions of
on behalf of whom a Contribution has been received by Licensor and this License, each Contributor hereby grants to You a perpetual,
subsequently incorporated within the Work. worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
2. Grant of Copyright License. Subject to the terms and conditions of publicly display, publicly perform, sublicense, and distribute the
this License, each Contributor hereby grants to You a perpetual, Work and such Derivative Works in Source or Object form.
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of, 3. Grant of Patent License. Subject to the terms and conditions of
publicly display, publicly perform, sublicense, and distribute the this License, each Contributor hereby grants to You a perpetual,
Work and such Derivative Works in Source or Object form. worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
3. Grant of Patent License. Subject to the terms and conditions of use, offer to sell, sell, import, and otherwise transfer the Work,
this License, each Contributor hereby grants to You a perpetual, where such license applies only to those patent claims licensable
worldwide, non-exclusive, no-charge, royalty-free, irrevocable by such Contributor that are necessarily infringed by their
(except as stated in this section) patent license to make, have made, Contribution(s) alone or by combination of their Contribution(s)
use, offer to sell, sell, import, and otherwise transfer the Work, with the Work to which such Contribution(s) was submitted. If You
where such license applies only to those patent claims licensable institute patent litigation against any entity (including a
by such Contributor that are necessarily infringed by their cross-claim or counterclaim in a lawsuit) alleging that the Work
Contribution(s) alone or by combination of their Contribution(s) or a Contribution incorporated within the Work constitutes direct
with the Work to which such Contribution(s) was submitted. If You or contributory patent infringement, then any patent licenses
institute patent litigation against any entity (including a granted to You under this License for that Work shall terminate
cross-claim or counterclaim in a lawsuit) alleging that the Work as of the date such litigation is filed.
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses 4. Redistribution. You may reproduce and distribute copies of the
granted to You under this License for that Work shall terminate Work or Derivative Works thereof in any medium, with or without
as of the date such litigation is filed. modifications, and in Source or Object form, provided that You
meet the following conditions:
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without (a) You must give any other recipients of the Work or
modifications, and in Source or Object form, provided that You Derivative Works a copy of this License; and
meet the following conditions:
(b) You must cause any modified files to carry prominent notices
(a) You must give any other recipients of the Work or stating that You changed the files; and
Derivative Works a copy of this License; and
(c) You must retain, in the Source form of any Derivative Works
(b) You must cause any modified files to carry prominent notices that You distribute, all copyright, patent, trademark, and
stating that You changed the files; and attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
(c) You must retain, in the Source form of any Derivative Works the Derivative Works; and
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work, (d) If the Work includes a "NOTICE" text file as part of its
excluding those notices that do not pertain to any part of distribution, then any Derivative Works that You distribute must
the Derivative Works; and include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
(d) If the Work includes a "NOTICE" text file as part of its pertain to any part of the Derivative Works, in at least one
distribution, then any Derivative Works that You distribute must of the following places: within a NOTICE text file distributed
include a readable copy of the attribution notices contained as part of the Derivative Works; within the Source form or
within such NOTICE file, excluding those notices that do not documentation, if provided along with the Derivative Works; or,
pertain to any part of the Derivative Works, in at least one within a display generated by the Derivative Works, if and
of the following places: within a NOTICE text file distributed wherever such third-party notices normally appear. The contents
as part of the Derivative Works; within the Source form or of the NOTICE file are for informational purposes only and
documentation, if provided along with the Derivative Works; or, do not modify the License. You may add Your own attribution
within a display generated by the Derivative Works, if and notices within Derivative Works that You distribute, alongside
wherever such third-party notices normally appear. The contents or as an addendum to the NOTICE text from the Work, provided
of the NOTICE file are for informational purposes only and that such additional attribution notices cannot be construed
do not modify the License. You may add Your own attribution as modifying the License.
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided You may add Your own copyright statement to Your modifications and
that such additional attribution notices cannot be construed may provide additional or different license terms and conditions
as modifying the License. for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
You may add Your own copyright statement to Your modifications and reproduction, and distribution of the Work otherwise complies with
may provide additional or different license terms and conditions the conditions stated in this License.
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use, 5. Submission of Contributions. Unless You explicitly state otherwise,
reproduction, and distribution of the Work otherwise complies with any Contribution intentionally submitted for inclusion in the Work
the conditions stated in this License. by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
5. Submission of Contributions. Unless You explicitly state otherwise, Notwithstanding the above, nothing herein shall supersede or modify
any Contribution intentionally submitted for inclusion in the Work the terms of any separate license agreement you may have executed
by You to the Licensor shall be under the terms and conditions of with Licensor regarding such Contributions.
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify 6. Trademarks. This License does not grant permission to use the trade
the terms of any separate license agreement you may have executed names, trademarks, service marks, or product names of the Licensor,
with Licensor regarding such Contributions. except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor, 7. Disclaimer of Warranty. Unless required by applicable law or
except as required for reasonable and customary use in describing the agreed to in writing, Licensor provides the Work (and each
origin of the Work and reproducing the content of the NOTICE file. Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
7. Disclaimer of Warranty. Unless required by applicable law or implied, including, without limitation, any warranties or conditions
agreed to in writing, Licensor provides the Work (and each of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
Contributor provides its Contributions) on an "AS IS" BASIS, PARTICULAR PURPOSE. You are solely responsible for determining the
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or appropriateness of using or redistributing the Work and assume any
implied, including, without limitation, any warranties or conditions risks associated with Your exercise of permissions under this License.
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the 8. Limitation of Liability. In no event and under no legal theory,
appropriateness of using or redistributing the Work and assume any whether in tort (including negligence), contract, or otherwise,
risks associated with Your exercise of permissions under this License. unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
8. Limitation of Liability. In no event and under no legal theory, liable to You for damages, including any direct, indirect, special,
whether in tort (including negligence), contract, or otherwise, incidental, or consequential damages of any character arising as a
unless required by applicable law (such as deliberate and grossly result of this License or out of the use or inability to use the
negligent acts) or agreed to in writing, shall any Contributor be Work (including but not limited to damages for loss of goodwill,
liable to You for damages, including any direct, indirect, special, work stoppage, computer failure or malfunction, or any and all
incidental, or consequential damages of any character arising as a other commercial damages or losses), even if such Contributor
result of this License or out of the use or inability to use the has been advised of the possibility of such damages.
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all 9. Accepting Warranty or Additional Liability. While redistributing
other commercial damages or losses), even if such Contributor the Work or Derivative Works thereof, You may choose to offer,
has been advised of the possibility of such damages. and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
9. Accepting Warranty or Additional Liability. While redistributing License. However, in accepting such obligations, You may act only
the Work or Derivative Works thereof, You may choose to offer, on Your own behalf and on Your sole responsibility, not on behalf
and charge a fee for, acceptance of support, warranty, indemnity, of any other Contributor, and only if You agree to indemnify,
or other liability obligations and/or rights consistent with this defend, and hold each Contributor harmless for any liability
License. However, in accepting such obligations, You may act only incurred by, or claims asserted against, such Contributor by reason
on Your own behalf and on Your sole responsibility, not on behalf of your accepting any such warranty or additional liability.
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability END OF TERMS AND CONDITIONS
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

5
vendor/less-bundle/README.md vendored Normal file
View File

@ -0,0 +1,5 @@
## less-bundle v0.1.0
less-bundle installed via npm - source repo:
https://github.com/openstyles/less-bundle/raw/v0.1.0/dist/less.min.js

1
vendor/less-bundle/less.min.js vendored Normal file

File diff suppressed because one or more lines are too long

10
vendor/less/README.md vendored
View File

@ -1,10 +0,0 @@
## LESS v3.8.1
less.js installed via npm - source repo:
https://github.com/less/less.js/blob/v3.8.1/dist/less.min.js
If the link doesn't work, it is likely that the npm version and the release versions don't match:
- https://www.npmjs.com/package/less
- https://github.com/less/less.js/releases

File diff suppressed because one or more lines are too long