Removed GopherJS, basic frontend completed, need backend changes for

torrent storage
This commit is contained in:
2017-11-30 18:12:11 -05:00
parent 67fdef16b1
commit e98ad2cc88
69321 changed files with 5498914 additions and 337 deletions

View File

@@ -0,0 +1,63 @@
# 5.3.1 - 2016-08-22
- Fixed: avoid security issue related to ``reduce-css-calc@< 1.2.4``.
# 5.3.0 - 2016-07-11
- Added: support for selector transformation via `selectors` option.
([#29](https://github.com/postcss/postcss-calc/pull/29) - @uniquegestaltung)
# 5.2.1 - 2016-04-10
- Fixed: support for multiline value
([#27](https://github.com/postcss/postcss-calc/pull/27))
# 5.2.0 - 2016-01-08
- Added: "mediaQueries" option for `@media` support
([#22](https://github.com/postcss/postcss-calc/pull/22))
# 5.1.0 - 2016-01-07
- Added: "warnWhenCannotResolve" option to warn when calc() are not reduced to a single value
([#20](https://github.com/postcss/postcss-calc/pull/20))
# 5.0.0 - 2015-08-25
- Removed: compatibility with postcss v4.x
- Added: compatibility with postcss v5.x
# 4.1.0 - 2015-04-09
- Added: compatibility with postcss v4.1.x ([#12](https://github.com/postcss/postcss-calc/pull/12))
# 4.0.1 - 2015-04-09
- Fixed: `preserve` option does not create duplicated values ([#7](https://github.com/postcss/postcss-calc/issues/7))
# 4.0.0 - 2015-01-26
- Added: compatibility with postcss v4.x
- Changed: partial compatiblity with postcss v3.x (stack traces have lost filename)
# 3.0.0 - 2014-11-24
- Added: GNU like exceptions ([#4](https://github.com/postcss/postcss-calc/issues/4))
- Added: `precision` option ([#5](https://github.com/postcss/postcss-calc/issues/5))
- Added: `preserve` option ([#6](https://github.com/postcss/postcss-calc/issues/6))
# 2.1.0 - 2014-10-15
- Added: source of the error (gnu like message) (fix [#3](https://github.com/postcss/postcss-calc/issues/3))
# 2.0.1 - 2014-08-10
- Fixed: correctly ignore unrecognized values (fix [#2](https://github.com/postcss/postcss-calc/issues/2))
# 2.0.0 - 2014-08-06
- Changed: Plugin now return a function to have a consistent api. ([ref 1](https://github.com/ianstormtaylor/rework-color-function/issues/6), [ref 2](https://twitter.com/jongleberry/status/496552790416576513))
# 1.0.0 - 2014-08-04
✨ First release based on [rework-calc](https://github.com/reworkcss/rework-calc) v1.1.0 (code mainly exported to [`reduce-css-calc`](https://github.com/MoOx/reduce-css-calc))

View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2014 Maxime Thirouin
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.

View File

@@ -0,0 +1,171 @@
# postcss-calc [![Build Status](https://travis-ci.org/postcss/postcss-calc.png)](https://travis-ci.org/postcss/postcss-calc)
> [PostCSS](https://github.com/postcss/postcss) plugin to reduce `calc()`.
This plugin reduce `calc()` references whenever it's possible.
This can be particularly useful with the [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) plugin.
**Note:** When multiple units are mixed together in the same expression, the `calc()` statement is left as is, to fallback to the [w3c calc() feature](http://www.w3.org/TR/css3-values/#calc).
## Installation
```console
$ npm install postcss-calc
```
## Usage
```js
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var calc = require("postcss-calc")
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
// process css
var output = postcss()
.use(calc())
.process(css)
.css
```
**Example** (with [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) enabled as well):
```js
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var customProperties = require("postcss-custom-properties")
var calc = require("postcss-calc")
// css to be processed
var css = fs.readFileSync("input.css", "utf8")
// process css
var output = postcss()
.use(customProperties())
.use(calc())
.process(css)
.css
```
Using this `input.css`:
```css
:root {
--main-font-size: 16px;
}
body {
font-size: var(--main-font-size);
}
h1 {
font-size: calc(var(--main-font-size) * 2);
height: calc(100px - 2em);
margin-bottom: calc(
var(--main-font-size)
* 1.5
)
}
```
you will get:
```css
body {
font-size: 16px
}
h1 {
font-size: 32px;
height: calc(100px - 2em);
margin-bottom: 24px
}
```
Checkout [tests](test) for more examples.
### Options
#### `precision` (default: `5`)
Allow you to definine the precision for decimal numbers.
```js
var out = postcss()
.use(calc({precision: 10}))
.process(css)
.css
```
#### `preserve` (default: `false`)
Allow you to preserve calc() usage in output so browsers will handle decimal precision themselves.
```js
var out = postcss()
.use(calc({preserve: true}))
.process(css)
.css
```
#### `warnWhenCannotResolve` (default: `false`)
Adds warnings when calc() are not reduced to a single value.
```js
var out = postcss()
.use(calc({warnWhenCannotResolve: true}))
.process(css)
.css
```
#### `mediaQueries` (default: `false`)
Allows calc() usage as part of media query declarations.
```js
var out = postcss()
.use(calc({mediaQueries: true}))
.process(css)
.css
```
#### `selectors` (default: `false`)
Allows calc() usage as part of selectors.
```js
var out = postcss()
.use(calc({selectors: true}))
.process(css)
.css
```
Example:
```css
div[data-size="calc(3*3)"] {
width: 100px;
}
```
---
## Contributing
Work on a branch, install dev-dependencies, respect coding style & run tests before submitting a bug fix or a feature.
```console
$ git clone https://github.com/postcss/postcss-calc.git
$ git checkout -b patch-1
$ npm install
$ npm test
```
## [Changelog](CHANGELOG.md)
## [License](LICENSE)

View File

@@ -0,0 +1,62 @@
/**
* Module dependencies.
*/
var reduceCSSCalc = require("reduce-css-calc")
var helpers = require("postcss-message-helpers")
var postcss = require("postcss")
var CONTAINS_CALC = /\bcalc\([\s\S]*?\)/
/**
* PostCSS plugin to reduce calc() function calls.
*/
module.exports = postcss.plugin("postcss-calc", function(options) {
options = options || {}
var precision = options.precision
var preserve = options.preserve
var warnWhenCannotResolve = options.warnWhenCannotResolve
var mediaQueries = options.mediaQueries
var selectors = options.selectors
return function(style, result) {
function transformValue(node, property) {
var value = node[property]
if (!value || !CONTAINS_CALC.test(value)) {
return
}
helpers.try(function transformCSSCalc() {
var reducedValue = reduceCSSCalc(value, precision)
if (warnWhenCannotResolve && CONTAINS_CALC.test(reducedValue)) {
result.warn("Could not reduce expression: " + value,
{plugin: "postcss-calc", node: node})
}
if (!preserve) {
node[property] = reducedValue
return
}
if (reducedValue != value) {
var clone = node.clone()
clone[property] = reducedValue
node.parent.insertBefore(node, clone)
}
}, node.source)
}
style.walk(function(rule) {
if (mediaQueries && rule.type === "atrule") {
return transformValue(rule, "params")
}
else if (rule.type === "decl") {
return transformValue(rule, "value")
}
else if (selectors && rule.type === "rule") {
return transformValue(rule, "selector")
}
})
}
})

View File

@@ -0,0 +1,70 @@
{
"_args": [
[
"postcss-calc@5.3.1",
"C:\\Users\\deranjer\\GoglandProjects\\torrent-project\\torrent-project"
]
],
"_from": "postcss-calc@5.3.1",
"_id": "postcss-calc@5.3.1",
"_inBundle": false,
"_integrity": "sha1-d7rnypKK2FcW4v2kLyYb98HWW14=",
"_location": "/css-loader/postcss-calc",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "postcss-calc@5.3.1",
"name": "postcss-calc",
"escapedName": "postcss-calc",
"rawSpec": "5.3.1",
"saveSpec": null,
"fetchSpec": "5.3.1"
},
"_requiredBy": [
"/css-loader/cssnano"
],
"_resolved": "https://registry.npmjs.org/postcss-calc/-/postcss-calc-5.3.1.tgz",
"_spec": "5.3.1",
"_where": "C:\\Users\\deranjer\\GoglandProjects\\torrent-project\\torrent-project",
"author": {
"name": "Maxime Thirouin"
},
"bugs": {
"url": "https://github.com/postcss/postcss-calc/issues"
},
"dependencies": {
"postcss": "^5.0.2",
"postcss-message-helpers": "^2.0.0",
"reduce-css-calc": "^1.2.6"
},
"description": "PostCSS plugin to reduce calc()",
"devDependencies": {
"eslint": "^1.0.0",
"npmpub": "^3.1.0",
"postcss-custom-properties": "^5.0.0",
"tape": "^3.0.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/postcss/postcss-calc#readme",
"keywords": [
"css",
"postcss",
"postcss-plugin",
"calculation",
"calc"
],
"license": "MIT",
"name": "postcss-calc",
"repository": {
"type": "git",
"url": "git+https://github.com/postcss/postcss-calc.git"
},
"scripts": {
"release": "npmpub",
"test": "eslint . && tape test"
},
"version": "5.3.1"
}