Comparing version 1.7.0 to 1.8.0
@@ -1,1 +0,1 @@ | ||
{"token":{"access_token":"ea5311c07eb9582f091a4473f93bbd6f189ce06e","scope":"public_repo","token_type":"bearer"}} | ||
"38b8c0414318ea474e4014a1f2371e242523833d" |
@@ -5,3 +5,3 @@ { | ||
"description": "Jade template runtime", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"keywords": [ | ||
@@ -8,0 +8,0 @@ "template" |
@@ -38,2 +38,5 @@ 'use strict'; | ||
this.pp = options.pretty || false; | ||
if (this.pp === true) { | ||
this.pp = ' '; | ||
} | ||
this.debug = false !== options.compileDebug; | ||
@@ -180,3 +183,3 @@ this.indents = 0; | ||
newline = newline ? '\n' : ''; | ||
this.buffer(newline + Array(this.indents + offset).join(' ')); | ||
this.buffer(newline + Array(this.indents + offset).join(this.pp)); | ||
if (this.parentIndents) | ||
@@ -309,3 +312,3 @@ this.buf.push("buf.push.apply(buf, jade_indent);"); | ||
visitMixinBlock: function(block){ | ||
if (this.pp) this.buf.push("jade_indent.push('" + Array(this.indents + 1).join(' ') + "');"); | ||
if (this.pp) this.buf.push("jade_indent.push('" + Array(this.indents + 1).join(this.pp) + "');"); | ||
this.buf.push('block && block();'); | ||
@@ -356,3 +359,3 @@ if (this.pp) this.buf.push("jade_indent.pop();"); | ||
this.mixins[key].used = true; | ||
if (pp) this.buf.push("jade_indent.push('" + Array(this.indents + 1).join(' ') + "');") | ||
if (pp) this.buf.push("jade_indent.push('" + Array(this.indents + 1).join(pp) + "');") | ||
if (block || attrs.length || attrsBlocks.length) { | ||
@@ -676,2 +679,3 @@ | ||
var val = toConstant(attr.val); | ||
if (key === 'style') val = runtime.style(val); | ||
if (escaped && !(key.indexOf('data') === 0 && typeof val !== 'string')) { | ||
@@ -687,2 +691,5 @@ val = runtime.escape(val); | ||
var val = attr.val; | ||
if (key === 'style') { | ||
val = 'jade.style(' + val + ')'; | ||
} | ||
if (escaped && !(key.indexOf('data') === 0)) { | ||
@@ -689,0 +696,0 @@ val = 'jade.escape(' + val + ')'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
372
lib/index.js
@@ -1,1 +0,371 @@ | ||
jade.js | ||
'use strict'; | ||
/*! | ||
* Jade | ||
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca> | ||
* MIT Licensed | ||
*/ | ||
/** | ||
* Module dependencies. | ||
*/ | ||
var Parser = require('./parser') | ||
, Lexer = require('./lexer') | ||
, Compiler = require('./compiler') | ||
, runtime = require('./runtime') | ||
, addWith = require('with') | ||
, fs = require('fs') | ||
, utils = require('./utils'); | ||
/** | ||
* Expose self closing tags. | ||
*/ | ||
exports.selfClosing = require('void-elements'); | ||
/** | ||
* Default supported doctypes. | ||
*/ | ||
exports.doctypes = require('./doctypes'); | ||
/** | ||
* Text filters. | ||
*/ | ||
exports.filters = require('./filters'); | ||
/** | ||
* Utilities. | ||
*/ | ||
exports.utils = require('./utils'); | ||
/** | ||
* Expose `Compiler`. | ||
*/ | ||
exports.Compiler = Compiler; | ||
/** | ||
* Expose `Parser`. | ||
*/ | ||
exports.Parser = Parser; | ||
/** | ||
* Expose `Lexer`. | ||
*/ | ||
exports.Lexer = Lexer; | ||
/** | ||
* Nodes. | ||
*/ | ||
exports.nodes = require('./nodes'); | ||
/** | ||
* Jade runtime helpers. | ||
*/ | ||
exports.runtime = runtime; | ||
/** | ||
* Template function cache. | ||
*/ | ||
exports.cache = {}; | ||
/** | ||
* Parse the given `str` of jade and return a function body. | ||
* | ||
* @param {String} str | ||
* @param {Object} options | ||
* @return {Object} | ||
* @api private | ||
*/ | ||
function parse(str, options){ | ||
// Parse | ||
var parser = new (options.parser || Parser)(str, options.filename, options); | ||
var tokens; | ||
try { | ||
// Parse | ||
tokens = parser.parse(); | ||
} catch (err) { | ||
parser = parser.context(); | ||
runtime.rethrow(err, parser.filename, parser.lexer.lineno, parser.input); | ||
} | ||
// Compile | ||
var compiler = new (options.compiler || Compiler)(tokens, options); | ||
var js; | ||
try { | ||
js = compiler.compile(); | ||
} catch (err) { | ||
if (err.line && (err.filename || !options.filename)) { | ||
runtime.rethrow(err, err.filename, err.line, parser.input); | ||
} | ||
} | ||
// Debug compiler | ||
if (options.debug) { | ||
console.error('\nCompiled Function:\n\n\u001b[90m%s\u001b[0m', js.replace(/^/gm, ' ')); | ||
} | ||
var globals = []; | ||
if (options.globals) { | ||
globals = options.globals.slice(); | ||
} | ||
globals.push('jade'); | ||
globals.push('jade_mixins'); | ||
globals.push('jade_interp'); | ||
globals.push('jade_debug'); | ||
globals.push('buf'); | ||
var body = '' | ||
+ 'var buf = [];\n' | ||
+ 'var jade_mixins = {};\n' | ||
+ 'var jade_interp;\n' | ||
+ (options.self | ||
? 'var self = locals || {};\n' + js | ||
: addWith('locals || {}', '\n' + js, globals)) + ';' | ||
+ 'return buf.join("");'; | ||
return {body: body, dependencies: parser.dependencies}; | ||
} | ||
/** | ||
* Compile a `Function` representation of the given jade `str`. | ||
* | ||
* Options: | ||
* | ||
* - `compileDebug` when `false` debugging code is stripped from the compiled | ||
template, when it is explicitly `true`, the source code is included in | ||
the compiled template for better accuracy. | ||
* - `filename` used to improve errors when `compileDebug` is not `false` and to resolve imports/extends | ||
* | ||
* @param {String} str | ||
* @param {Options} options | ||
* @return {Function} | ||
* @api public | ||
*/ | ||
exports.compile = function(str, options){ | ||
var options = options || {} | ||
, filename = options.filename | ||
? utils.stringify(options.filename) | ||
: 'undefined' | ||
, fn; | ||
str = String(str); | ||
var parsed = parse(str, options); | ||
if (options.compileDebug !== false) { | ||
fn = [ | ||
'var jade_debug = [{ lineno: 1, filename: ' + filename + ' }];' | ||
, 'try {' | ||
, parsed.body | ||
, '} catch (err) {' | ||
, ' jade.rethrow(err, jade_debug[0].filename, jade_debug[0].lineno' + (options.compileDebug === true ? ',' + utils.stringify(str) : '') + ');' | ||
, '}' | ||
].join('\n'); | ||
} else { | ||
fn = parsed.body; | ||
} | ||
fn = new Function('locals, jade', fn) | ||
var res = function(locals){ return fn(locals, Object.create(runtime)) }; | ||
if (options.client) { | ||
res.toString = function () { | ||
var err = new Error('The `client` option is deprecated, use the `jade.compileClient` method instead'); | ||
err.name = 'Warning'; | ||
console.error(err.stack || err.message); | ||
return exports.compileClient(str, options); | ||
}; | ||
} | ||
res.dependencies = parsed.dependencies; | ||
return res; | ||
}; | ||
/** | ||
* Compile a JavaScript source representation of the given jade `str`. | ||
* | ||
* Options: | ||
* | ||
* - `compileDebug` When it is `true`, the source code is included in | ||
* the compiled template for better error messages. | ||
* - `filename` used to improve errors when `compileDebug` is not `true` and to resolve imports/extends | ||
* - `name` the name of the resulting function (defaults to "template") | ||
* | ||
* @param {String} str | ||
* @param {Options} options | ||
* @return {String} | ||
* @api public | ||
*/ | ||
exports.compileClient = function(str, options){ | ||
var options = options || {}; | ||
var name = options.name || 'template'; | ||
var filename = options.filename ? utils.stringify(options.filename) : 'undefined'; | ||
var fn; | ||
str = String(str); | ||
if (options.compileDebug) { | ||
options.compileDebug = true; | ||
fn = [ | ||
'var jade_debug = [{ lineno: 1, filename: ' + filename + ' }];' | ||
, 'try {' | ||
, parse(str, options).body | ||
, '} catch (err) {' | ||
, ' jade.rethrow(err, jade_debug[0].filename, jade_debug[0].lineno, ' + utils.stringify(str) + ');' | ||
, '}' | ||
].join('\n'); | ||
} else { | ||
options.compileDebug = false; | ||
fn = parse(str, options).body; | ||
} | ||
return 'function ' + name + '(locals) {\n' + fn + '\n}'; | ||
}; | ||
/** | ||
* Compile a `Function` representation of the given jade file. | ||
* | ||
* Options: | ||
* | ||
* - `compileDebug` when `false` debugging code is stripped from the compiled | ||
template, when it is explicitly `true`, the source code is included in | ||
the compiled template for better accuracy. | ||
* | ||
* @param {String} path | ||
* @param {Options} options | ||
* @return {Function} | ||
* @api public | ||
*/ | ||
exports.compileFile = function (path, options) { | ||
options = options || {}; | ||
var key = path + ':string'; | ||
options.filename = path; | ||
var str = options.cache | ||
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) | ||
: fs.readFileSync(path, 'utf8'); | ||
return options.cache | ||
? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) | ||
: exports.compile(str, options); | ||
}; | ||
/** | ||
* Render the given `str` of jade. | ||
* | ||
* Options: | ||
* | ||
* - `cache` enable template caching | ||
* - `filename` filename required for `include` / `extends` and caching | ||
* | ||
* @param {String} str | ||
* @param {Object|Function} options or fn | ||
* @param {Function|undefined} fn | ||
* @returns {String} | ||
* @api public | ||
*/ | ||
exports.render = function(str, options, fn){ | ||
// support callback API | ||
if ('function' == typeof options) { | ||
fn = options, options = undefined; | ||
} | ||
if (typeof fn === 'function') { | ||
var res | ||
try { | ||
res = exports.render(str, options); | ||
} catch (ex) { | ||
return fn(ex); | ||
} | ||
return fn(null, res); | ||
} | ||
options = options || {}; | ||
// cache requires .filename | ||
if (options.cache && !options.filename) { | ||
throw new Error('the "filename" option is required for caching'); | ||
} | ||
var path = options.filename; | ||
var tmpl = options.cache | ||
? exports.cache[path] || (exports.cache[path] = exports.compile(str, options)) | ||
: exports.compile(str, options); | ||
return tmpl(options); | ||
}; | ||
/** | ||
* Render a Jade file at the given `path`. | ||
* | ||
* @param {String} path | ||
* @param {Object|Function} options or callback | ||
* @param {Function|undefined} fn | ||
* @returns {String} | ||
* @api public | ||
*/ | ||
exports.renderFile = function(path, options, fn){ | ||
// support callback API | ||
if ('function' == typeof options) { | ||
fn = options, options = undefined; | ||
} | ||
if (typeof fn === 'function') { | ||
var res | ||
try { | ||
res = exports.renderFile(path, options); | ||
} catch (ex) { | ||
return fn(ex); | ||
} | ||
return fn(null, res); | ||
} | ||
options = options || {}; | ||
var key = path + ':string'; | ||
options.filename = path; | ||
var str = options.cache | ||
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) | ||
: fs.readFileSync(path, 'utf8'); | ||
return exports.render(str, options); | ||
}; | ||
/** | ||
* Compile a Jade file at the given `path` for use on the client. | ||
* | ||
* @param {String} path | ||
* @param {Object} options | ||
* @returns {String} | ||
* @api public | ||
*/ | ||
exports.compileFileClient = function(path, options){ | ||
options = options || {}; | ||
var key = path + ':string'; | ||
options.filename = path; | ||
var str = options.cache | ||
? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8')) | ||
: fs.readFileSync(path, 'utf8'); | ||
return exports.compileClient(str, options); | ||
}; | ||
/** | ||
* Express support. | ||
*/ | ||
exports.__express = exports.renderFile; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -481,2 +481,5 @@ 'use strict'; | ||
} | ||
if (tok.args) { | ||
assertExpression('[' + tok.args + ']'); | ||
} | ||
} | ||
@@ -648,3 +651,3 @@ | ||
try { | ||
Function('', 'return (' + val + ');'); | ||
assertExpression(val); | ||
if (str[i] === ' ' || str[i] === '\n') { | ||
@@ -651,0 +654,0 @@ for (var x = i; x < str.length; x++) { |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -814,3 +814,3 @@ 'use strict'; | ||
if (tag.textOnly) { | ||
tag.block = this.parseTextBlock(); | ||
tag.block = this.parseTextBlock() || new nodes.Block(); | ||
} else if ('indent' == this.peek().type) { | ||
@@ -817,0 +817,0 @@ var block = this.block(); |
@@ -63,3 +63,5 @@ 'use strict'; | ||
function joinClasses(val) { | ||
return Array.isArray(val) ? val.map(joinClasses).filter(nulls).join(' ') : val; | ||
return (Array.isArray(val) ? val.map(joinClasses) : | ||
(val && typeof val === 'object') ? Object.keys(val).filter(function (key) { return val[key]; }) : | ||
[val]).filter(nulls).join(' '); | ||
} | ||
@@ -91,2 +93,12 @@ | ||
exports.style = function (val) { | ||
if (val && typeof val === 'object') { | ||
return Object.keys(val).map(function (style) { | ||
return style + ':' + val[style]; | ||
}).join(';'); | ||
} else { | ||
return val; | ||
} | ||
}; | ||
/** | ||
@@ -102,2 +114,5 @@ * Render the given attribute. | ||
exports.attr = function attr(key, val, escaped, terse) { | ||
if (key === 'style') { | ||
val = exports.style(val); | ||
} | ||
if ('boolean' == typeof val || null == val) { | ||
@@ -110,6 +125,20 @@ if (val) { | ||
} else if (0 == key.indexOf('data') && 'string' != typeof val) { | ||
if (JSON.stringify(val).indexOf('&') !== -1) { | ||
console.warn('Since Jade 2.0.0, ampersands (`&`) in data attributes ' + | ||
'will be escaped to `&`'); | ||
}; | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will eliminate the double quotes around dates in ' + | ||
'ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + "='" + JSON.stringify(val).replace(/'/g, ''') + "'"; | ||
} else if (escaped) { | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will stringify dates in ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + '="' + exports.escape(val) + '"'; | ||
} else { | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will stringify dates in ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + '="' + val + '"'; | ||
@@ -116,0 +145,0 @@ } |
@@ -0,0 +0,0 @@ 'use strict'; |
{ | ||
"name": "jade", | ||
"description": "Jade template engine", | ||
"version": "1.7.0", | ||
"description": "A clean, whitespace-sensitive template language for writing HTML", | ||
"version": "1.8.0", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -14,5 +14,5 @@ "maintainers": [ | ||
"type": "git", | ||
"url": "git://github.com/visionmedia/jade" | ||
"url": "git://github.com/tj/jade" | ||
}, | ||
"main": "./index.js", | ||
"main": "lib", | ||
"bin": { | ||
@@ -22,5 +22,5 @@ "jade": "./bin/jade.js" | ||
"dependencies": { | ||
"character-parser": "1.2.0", | ||
"commander": "2.1.0", | ||
"constantinople": "~2.0.0", | ||
"character-parser": "1.2.1", | ||
"commander": "2.3.0", | ||
"constantinople": "~3.0.1", | ||
"mkdirp": "~0.5.0", | ||
@@ -30,3 +30,3 @@ "monocle": "1.1.51", | ||
"void-elements": "~1.0.0", | ||
"with": "~3.0.0" | ||
"with": "~4.0.0" | ||
}, | ||
@@ -40,11 +40,11 @@ "devDependencies": { | ||
"should": "*", | ||
"less": "*", | ||
"less": "<2.0.0", | ||
"uglify-js": "*", | ||
"browserify": "*", | ||
"linify": "*", | ||
"less-file": "0.0.8", | ||
"express": "~3.4.8", | ||
"browserify-middleware": "~2.4.0", | ||
"less-file": "0.0.9", | ||
"express": "~4.9.5", | ||
"browserify-middleware": "~4.1.0", | ||
"twbs": "0.0.6", | ||
"highlight-codemirror": "~3.20.0", | ||
"highlight-codemirror": "~4.1.0", | ||
"inconsolata": "0.0.2", | ||
@@ -58,3 +58,3 @@ "jade-code-mirror": "~1.0.5", | ||
"opener": "^1.3.0", | ||
"github-basic": "^3.0.0", | ||
"github-basic": "^4.1.2", | ||
"pull-request": "^3.0.0", | ||
@@ -75,8 +75,10 @@ "lsr": "^1.0.0", | ||
"compile": "npm run compile-full && npm run compile-runtime", | ||
"compile-full": "browserify ./lib/jade.js --standalone jade -x ./node_modules/transformers > jade.js", | ||
"compile-full": "browserify ./lib/index.js --standalone jade -x ./node_modules/transformers > jade.js", | ||
"compile-runtime": "browserify ./lib/runtime.js --standalone jade > runtime.js" | ||
}, | ||
"browser": { | ||
"fs": false, | ||
"./lib/filters.js": "./lib/filters-client.js" | ||
} | ||
}, | ||
"homepage": "http://jade-lang.com" | ||
} |
@@ -342,3 +342,3 @@ # Jade - 模板引擎 | ||
```jade | ||
</p>foo\bar</p> | ||
<p>foo\bar</p> | ||
``` | ||
@@ -345,0 +345,0 @@ |
@@ -10,4 +10,4 @@ # [![Jade - template engine ](http://i.imgur.com/5zf2aVt.png)](http://jade-lang.com/) | ||
[![Build Status](https://img.shields.io/travis/visionmedia/jade/master.svg)](https://travis-ci.org/visionmedia/jade) | ||
[![Dependency Status](https://img.shields.io/gemnasium/visionmedia/jade.svg)](https://gemnasium.com/visionmedia/jade) | ||
[![Build Status](https://img.shields.io/travis/jadejs/jade/master.svg)](https://travis-ci.org/jadejs/jade) | ||
[![Dependency Status](https://img.shields.io/gemnasium/jadejs/jade.svg)](https://gemnasium.com/jadejs/jade) | ||
[![NPM version](https://img.shields.io/npm/v/jade.svg)](http://badge.fury.io/js/jade) | ||
@@ -68,3 +68,3 @@ | ||
The official [jade tutorial](http://jade-lang.com/tutorial/) is a great place to start. While that (and the syntax documentation) is being finished, you can view some of the old documentation [here](https://github.com/visionmedia/jade/blob/master/jade.md) and [here](https://github.com/visionmedia/jade/blob/master/jade-language.md) | ||
The official [jade tutorial](http://jade-lang.com/tutorial/) is a great place to start. While that (and the syntax documentation) is being finished, you can view some of the old documentation [here](https://github.com/jadejs/jade/blob/master/jade.md) and [here](https://github.com/jadejs/jade/blob/master/jade-language.md) | ||
@@ -97,3 +97,3 @@ ## API | ||
The latest version of jade can be download for the browser in standalone form from [here](https://github.com/visionmedia/jade/raw/master/jade.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your jade templates to JavaScript and then just use the [runtime.js](https://github.com/visionmedia/jade/raw/master/runtime.js) library on the client. | ||
The latest version of jade can be download for the browser in standalone form from [here](https://github.com/jadejs/jade/raw/master/jade.js). It only supports the very latest browsers though, and is a large file. It is recommended that you pre-compile your jade templates to JavaScript and then just use the [runtime.js](https://github.com/jadejs/jade/raw/master/runtime.js) library on the client. | ||
@@ -129,3 +129,3 @@ To compile a template for use on the client using the command line, do: | ||
- [Jade について。](https://gist.github.com/japboy/5402844) (A Japanese Tutorial) | ||
- [Jade - 模板引擎](https://github.com/visionmedia/jade/blob/master/Readme_zh-cn.md) | ||
- [Jade - 模板引擎](https://github.com/jadejs/jade/blob/master/Readme_zh-cn.md) | ||
@@ -132,0 +132,0 @@ Implementations in other languages: |
'use strict'; | ||
var GITHUB_CLIENT_ID = '2031dbe958e741775201'; | ||
var GITHUB_CLIENT_SECRET = 'd509a1e5e89248ce5d4211cb06995edcd979667d'; | ||
var SCOPE = 'public_repo'; | ||
var fs = require('fs'); | ||
var qs = require('querystring'); | ||
var crypto = require('crypto'); | ||
var express = require('express'); | ||
var opener = require('opener'); | ||
var github = require('github-basic'); | ||
var pr = require('pull-request'); | ||
var readdirp = require('lsr').sync; | ||
var TOKEN = JSON.parse(fs.readFileSync(__dirname + '/.release.json', 'utf8')); | ||
@@ -25,65 +17,20 @@ // todo: check that the version is a new un-released version | ||
function getToken(gotToken) { | ||
try { | ||
var settings = JSON.parse(fs.readFileSync(__dirname + '/.release.json', 'utf8')); | ||
return gotToken(settings.token); | ||
} catch (ex) { | ||
// use server to initialize config | ||
} | ||
var app = express(); | ||
var state = crypto.randomBytes(8).toString('hex'); | ||
var server = null; | ||
app.get('/', function (req, res, next) { | ||
if (req.query.code) return next(); | ||
res.redirect('https://github.com/login/oauth/authorize?client_id=' + GITHUB_CLIENT_ID | ||
+ '&scope=' + SCOPE | ||
+ '&redirect_uri=http://localhost:1337/' | ||
+ '&state=' + state); | ||
compiledWebsite.then(function () { | ||
var fileUpdates = readdirp(__dirname + '/docs/out').filter(function (info) { | ||
return info.isFile(); | ||
}).map(function (info) { | ||
return { | ||
path: info.path.replace(/^\.\//, ''), | ||
content: fs.readFileSync(info.fullPath) | ||
}; | ||
}); | ||
app.get('/', function (req, res, next) { | ||
var code = req.query.code; | ||
var u = 'https://github.com/login/oauth/access_token' | ||
+ '?client_id=' + GITHUB_CLIENT_ID | ||
+ '&client_secret=' + GITHUB_CLIENT_SECRET | ||
+ '&code=' + code | ||
+ '&state=' + state; | ||
github.buffer('GET', u, {}, {}, function (err, response) { | ||
if (err) return next(err); | ||
req.token = qs.parse(response.body); | ||
next(); | ||
}); | ||
}); | ||
app.get('/', function (req, res, next) { | ||
res.send('got token, return to terminal'); | ||
server.close(); | ||
fs.writeFileSync(__dirname + '/.release.json', JSON.stringify({token: req.token})); | ||
gotToken(req.token); | ||
}); | ||
server = app.listen(1337); | ||
server.setTimeout(3000); | ||
opener('http://localhost:1337'); | ||
} | ||
getToken(function (token) { | ||
compiledWebsite.then(function () { | ||
var fileUpdates = readdirp(__dirname + '/docs/out').filter(function (info) { | ||
return info.isFile(); | ||
}).map(function (info) { | ||
return { | ||
path: info.path.replace(/^\.\//, ''), | ||
content: fs.readFileSync(info.fullPath) | ||
}; | ||
}); | ||
return pr.commit('visionmedia', 'jade', { | ||
branch: 'gh-pages', | ||
message: 'Update website for ' + version, | ||
updates: fileUpdates | ||
}, {auth: {type: 'oauth', token: token.access_token}}); | ||
}).then(function () { | ||
// todo: release the new npm package, set the tag and commit etc. | ||
}).done(); | ||
return pr.commit('jadejs', 'jade', { | ||
branch: 'gh-pages', | ||
message: 'Update website for ' + version, | ||
updates: fileUpdates | ||
}, {auth: {type: 'oauth', token: TOKEN}}); | ||
}).then(function () { | ||
// todo: release the new npm package, set the tag and commit etc. | ||
}).done(function () { | ||
console.log('website published'); | ||
}); |
@@ -1,2 +0,2 @@ | ||
!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jade=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.jade=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
'use strict'; | ||
@@ -64,3 +64,5 @@ | ||
function joinClasses(val) { | ||
return Array.isArray(val) ? val.map(joinClasses).filter(nulls).join(' ') : val; | ||
return (Array.isArray(val) ? val.map(joinClasses) : | ||
(val && typeof val === 'object') ? Object.keys(val).filter(function (key) { return val[key]; }) : | ||
[val]).filter(nulls).join(' '); | ||
} | ||
@@ -92,2 +94,12 @@ | ||
exports.style = function (val) { | ||
if (val && typeof val === 'object') { | ||
return Object.keys(val).map(function (style) { | ||
return style + ':' + val[style]; | ||
}).join(';'); | ||
} else { | ||
return val; | ||
} | ||
}; | ||
/** | ||
@@ -103,2 +115,5 @@ * Render the given attribute. | ||
exports.attr = function attr(key, val, escaped, terse) { | ||
if (key === 'style') { | ||
val = exports.style(val); | ||
} | ||
if ('boolean' == typeof val || null == val) { | ||
@@ -111,6 +126,20 @@ if (val) { | ||
} else if (0 == key.indexOf('data') && 'string' != typeof val) { | ||
if (JSON.stringify(val).indexOf('&') !== -1) { | ||
console.warn('Since Jade 2.0.0, ampersands (`&`) in data attributes ' + | ||
'will be escaped to `&`'); | ||
}; | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will eliminate the double quotes around dates in ' + | ||
'ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + "='" + JSON.stringify(val).replace(/'/g, ''') + "'"; | ||
} else if (escaped) { | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will stringify dates in ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + '="' + exports.escape(val) + '"'; | ||
} else { | ||
if (val && typeof val.toISOString === 'function') { | ||
console.warn('Jade will stringify dates in ISO form after 2.0.0'); | ||
} | ||
return ' ' + key + '="' + val + '"'; | ||
@@ -185,3 +214,3 @@ } | ||
try { | ||
str = str || _dereq_('fs').readFileSync(filename, 'utf8') | ||
str = str || require('fs').readFileSync(filename, 'utf8') | ||
} catch (ex) { | ||
@@ -211,6 +240,5 @@ rethrow(err, null, lineno) | ||
},{"fs":2}],2:[function(_dereq_,module,exports){ | ||
},{"fs":2}],2:[function(require,module,exports){ | ||
},{}]},{},[1]) | ||
(1) | ||
},{}]},{},[1])(1) | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
10
363628
37
10240
17
+ Addedacorn@1.2.22.7.0(transitive)
+ Addedacorn-globals@1.0.9(transitive)
+ Addedcharacter-parser@1.2.1(transitive)
+ Addedcommander@2.3.0(transitive)
+ Addedconstantinople@3.0.2(transitive)
+ Addedwith@4.0.3(transitive)
- Removedasync@0.2.10(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcharacter-parser@1.2.0(transitive)
- Removedcommander@2.1.0(transitive)
- Removedconstantinople@2.0.1(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removedsource-map@0.1.34(transitive)
- Removeduglify-js@2.4.24(transitive)
- Removeduglify-to-browserify@1.0.2(transitive)
- Removedwindow-size@0.1.0(transitive)
- Removedwith@3.0.1(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedyargs@3.5.4(transitive)
Updatedcharacter-parser@1.2.1
Updatedcommander@2.3.0
Updatedconstantinople@~3.0.1
Updatedwith@~4.0.0