Bug 1388013 - Vendor jsmin via |mach vendor python|; r=ahal

MozReview-Commit-ID: 197reaD9GdL

--HG--
extra : rebase_source : b55f1dd13c7256da9a5c3d85502e03148f238961
This commit is contained in:
Dave Hunt 2018-05-30 13:07:32 +01:00
parent 0195b3129a
commit cf0af6d22f
10 changed files with 258 additions and 3 deletions

View File

@ -11,6 +11,7 @@ virtualenv = "==15.2.0"
six = "==1.10.0"
attrs = "==18.1.0"
pytest = "==3.2.5"
jsmin = "==2.1.0"
[requires]
python_version = "2.7"

9
Pipfile.lock generated
View File

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "cfd63f783e0107d8c5ebc5f17ee5c6644825657a4504e5529ceaabb293837659"
"sha256": "706dd858cb4e07dbccf7f3e6f129ac5b50c9906bcd6083e4fb09e9869b379d5e"
},
"pipfile-spec": 6,
"requires": {
@ -31,6 +31,13 @@
],
"version": "==2018.4.16"
},
"jsmin": {
"hashes": [
"sha256:5d07bf0251a4128e5e8e8eef603849b6b5741c337bff087731a248f9cc774f56"
],
"index": "pypi",
"version": "==2.1.0"
},
"pipenv": {
"hashes": [
"sha256:04b9a8b02a3ff12a5502b335850cfdb192adcfd1d6bbdb7a7c47cae9ab9ddece",

11
third_party/python/jsmin/CHANGELOG.txt vendored Normal file
View File

@ -0,0 +1,11 @@
Changelog
=========
v2.1.0 (2014-12-24) Tikitu de Jager
-----------------------------------
* First changelog entries; see README.rst for prior contributors.
* Expose quote_chars parameter to provide just enough unofficial Harmony
support to be useful.

23
third_party/python/jsmin/LICENSE.txt vendored Normal file
View File

@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) 2013 Dave St.Germain
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.

1
third_party/python/jsmin/MANIFEST.in vendored Normal file
View File

@ -0,0 +1 @@
include *.txt

117
third_party/python/jsmin/PKG-INFO vendored Normal file
View File

@ -0,0 +1,117 @@
Metadata-Version: 1.1
Name: jsmin
Version: 2.1.0
Summary: JavaScript minifier.
PLEASE UPDATE TO VERSION >= 2.0.6. Older versions have a serious bug related to comments.
Home-page: https://bitbucket.org/dcs/jsmin/
Author: Tikitu de Jager
Author-email: tikitu+jsmin@logophile.org
License: MIT License
Description: =====
jsmin
=====
JavaScript minifier.
Usage
=====
.. code:: python
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read())
You can run it as a commandline tool also::
python -m jsmin myfile.js
As yet, ``jsmin`` makes no attempt to be compatible with
`ECMAScript 6 / ES.next / Harmony <http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts>`_.
If you're using it on Harmony code, though, you might find the ``quote_chars``
parameter useful:
.. code:: python
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read(), quote_chars="'\"`")
Where to get it
===============
* install the package `from pypi <https://pypi.python.org/pypi/jsmin/>`_
* get the latest release `from the stable branch on bitbucket <https://bitbucket.org/dcs/jsmin/branch/stable>`_
* get the development version `from the default branch on bitbucket <https://bitbucket.org/dcs/jsmin/branch/default>`_
Contributing
============
`Issues <https://bitbucket.org/dcs/jsmin/issues>`_ and `Pull requests <https://bitbucket.org/dcs/jsmin/pull-requests>`_
will be gratefully received on Bitbucket. Pull requests on github are great too, but the issue tracker lives on
bitbucket.
If possible, please make separate pull requests for tests and for code: tests will be committed on the stable branch
(which tracks the latest released version) while code will go to default by, erm, default.
Unless you request otherwise, your Bitbucket identity will be added to the contributor's list below; if you prefer a
different name feel free to add it in your pull request instead. (If you prefer not to be mentioned you'll have to let
the maintainer know somehow.)
Build/test status
=================
Both default and stable branches are tested with Travis: https://travis-ci.org/tikitu/jsmin
Stable (latest released version plus any new tests) is tested against CPython 2.6, 2.7, 3.2, and 3.3.
Currently:
.. image:: https://travis-ci.org/tikitu/jsmin.png?branch=ghstable
If stable is failing that means there's a new test that fails on *the latest released version on pypi*, with no fix yet
released.
Default (development version, might be ahead of latest released version) is tested against CPython 2.6, 2.7, 3.2, and
3.3. Currently:
.. image:: https://travis-ci.org/tikitu/jsmin.png?branch=master
If default is failing don't use it, but as long as stable is passing the pypi release should be ok.
Contributors (chronological commit order)
=========================================
* `Dave St.Germain <https://bitbucket.org/dcs>`_ (original author)
* `Hans weltar <https://bitbucket.org/hansweltar>`_
* `Tikitu de Jager <mailto:tikitu+jsmin@logophile.org>`_ (current maintainer)
* https://bitbucket.org/rennat
* `Nick Alexander <https://bitbucket.org/ncalexan>`_
Changelog
=========
v2.1.0 (2014-12-24) Tikitu de Jager
-----------------------------------
* First changelog entries; see README.rst for prior contributors.
* Expose quote_chars parameter to provide just enough unofficial Harmony
support to be useful.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Pre-processors
Classifier: Topic :: Text Processing :: Filters

80
third_party/python/jsmin/README.rst vendored Normal file
View File

@ -0,0 +1,80 @@
=====
jsmin
=====
JavaScript minifier.
Usage
=====
.. code:: python
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read())
You can run it as a commandline tool also::
python -m jsmin myfile.js
As yet, ``jsmin`` makes no attempt to be compatible with
`ECMAScript 6 / ES.next / Harmony <http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts>`_.
If you're using it on Harmony code, though, you might find the ``quote_chars``
parameter useful:
.. code:: python
from jsmin import jsmin
with open('myfile.js') as js_file:
minified = jsmin(js_file.read(), quote_chars="'\"`")
Where to get it
===============
* install the package `from pypi <https://pypi.python.org/pypi/jsmin/>`_
* get the latest release `from the stable branch on bitbucket <https://bitbucket.org/dcs/jsmin/branch/stable>`_
* get the development version `from the default branch on bitbucket <https://bitbucket.org/dcs/jsmin/branch/default>`_
Contributing
============
`Issues <https://bitbucket.org/dcs/jsmin/issues>`_ and `Pull requests <https://bitbucket.org/dcs/jsmin/pull-requests>`_
will be gratefully received on Bitbucket. Pull requests on github are great too, but the issue tracker lives on
bitbucket.
If possible, please make separate pull requests for tests and for code: tests will be committed on the stable branch
(which tracks the latest released version) while code will go to default by, erm, default.
Unless you request otherwise, your Bitbucket identity will be added to the contributor's list below; if you prefer a
different name feel free to add it in your pull request instead. (If you prefer not to be mentioned you'll have to let
the maintainer know somehow.)
Build/test status
=================
Both default and stable branches are tested with Travis: https://travis-ci.org/tikitu/jsmin
Stable (latest released version plus any new tests) is tested against CPython 2.6, 2.7, 3.2, and 3.3.
Currently:
.. image:: https://travis-ci.org/tikitu/jsmin.png?branch=ghstable
If stable is failing that means there's a new test that fails on *the latest released version on pypi*, with no fix yet
released.
Default (development version, might be ahead of latest released version) is tested against CPython 2.6, 2.7, 3.2, and
3.3. Currently:
.. image:: https://travis-ci.org/tikitu/jsmin.png?branch=master
If default is failing don't use it, but as long as stable is passing the pypi release should be ok.
Contributors (chronological commit order)
=========================================
* `Dave St.Germain <https://bitbucket.org/dcs>`_ (original author)
* `Hans weltar <https://bitbucket.org/hansweltar>`_
* `Tikitu de Jager <mailto:tikitu+jsmin@logophile.org>`_ (current maintainer)
* https://bitbucket.org/rennat
* `Nick Alexander <https://bitbucket.org/ncalexan>`_

View File

@ -37,7 +37,7 @@ else:
__all__ = ['jsmin', 'JavascriptMinify']
__version__ = '2.0.11'
__version__ = '2.1.0'
def jsmin(js, **kwargs):

View File

@ -0,0 +1,10 @@
import sys, os, glob
from jsmin import JavascriptMinify
for f in sys.argv[1:]:
with open(f, 'r') as js:
minifier = JavascriptMinify(js, sys.stdout)
minifier.minify()
sys.stdout.write('\n')

View File

@ -9,12 +9,17 @@ extra = {}
if sys.version_info >= (3,0):
extra['use_2to3'] = True
def long_description():
return open('README.rst').read() + '\n' + open('CHANGELOG.txt').read()
setup(
name="jsmin",
version=re.search(r'__version__ = ["\']([^"\']+)', open('jsmin/__init__.py').read()).group(1),
packages=['jsmin'],
description='JavaScript minifier.\nPLEASE UPDATE TO VERSION >= 2.0.6. Older versions have a serious bug related to comments.',
long_description=open('README.rst').read(),
long_description=long_description(),
author='Dave St.Germain',
author_email='dave@st.germa.in',
maintainer='Tikitu de Jager',