From 1ae45f6cbb2e34bbdd18b2d7ee0e9828f0e3541e Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sat, 24 Oct 2015 19:20:31 +0200 Subject: [PATCH] Breaking changes. --- .editorconfig | 14 +- .eslintignore | 3 + .eslintrc | 210 +++++++++++++ .jscsrc | 144 --------- .jshintrc | 26 -- README.md | 17 +- mkrfile.js | 280 +++++++++++------- package.json | 40 +-- src/_h5ai/public/css/{inc => lib}/colors.less | 0 .../css/{inc => lib}/ext/contextmenu.less | 0 .../public/css/{inc => lib}/ext/crumb.less | 0 .../public/css/{inc => lib}/ext/custom.less | 0 .../public/css/{inc => lib}/ext/filter.less | 0 .../public/css/{inc => lib}/ext/info.less | 0 .../css/{inc => lib}/ext/preview-aud.less | 0 .../css/{inc => lib}/ext/preview-img.less | 0 .../css/{inc => lib}/ext/preview-txt.less | 0 .../css/{inc => lib}/ext/preview-vid.less | 0 .../public/css/{inc => lib}/ext/preview.less | 0 .../public/css/{inc => lib}/ext/search.less | 0 .../public/css/{inc => lib}/ext/select.less | 0 .../public/css/{inc => lib}/ext/tree.less | 0 src/_h5ai/public/css/{inc => lib}/fonts.less | 0 .../public/css/{inc => lib}/main/info.less | 0 src/_h5ai/public/css/{inc => lib}/misc.less | 0 src/_h5ai/public/css/{inc => lib}/mixins.less | 0 .../public/css/{inc => lib}/responsive.less | 0 .../public/css/{inc => lib}/view/content.less | 0 .../css/{inc => lib}/view/fallback.less | 0 .../public/css/{inc => lib}/view/mainrow.less | 0 .../css/{inc => lib}/view/notification.less | 0 .../public/css/{inc => lib}/view/root.less | 0 .../public/css/{inc => lib}/view/sidebar.less | 0 .../public/css/{inc => lib}/view/topbar.less | 0 .../css/{inc => lib}/view/view-details.less | 0 .../css/{inc => lib}/view/view-grid.less | 0 .../css/{inc => lib}/view/view-icons.less | 0 .../public/css/{inc => lib}/view/view.less | 0 src/_h5ai/public/css/styles.less | 18 +- .../h5bp-post.less} | 7 +- .../h5bp-pre.less} | 14 +- .../normalize.less} | 0 src/_h5ai/public/js/inc/boot.js | 13 +- src/_h5ai/public/js/scripts.js | 12 +- .../js/{lib => vendor}/jquery-2.1.3.min.js | 0 .../jquery.qrcode-0.11.0.min.js | 0 .../js/{lib => vendor}/lodash-3.9.3.min.js | 0 .../js/{lib => vendor}/marked-0.3.2.min.js | 0 .../js/{lib => vendor}/modulejs-1.5.0.min.js | 0 .../{lib => vendor}/prism-2015-04-05.min.js | 0 test/.jshintrc | 36 --- test/scripts.js | 2 +- test/{lib => vendor}/chai.js | 0 test/{lib => vendor}/mocha.js | 0 test/{lib => vendor}/sinon.js | 0 test/{lib => vendor}/uniq.js | 0 56 files changed, 457 insertions(+), 379 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc delete mode 100644 .jscsrc delete mode 100644 .jshintrc rename src/_h5ai/public/css/{inc => lib}/colors.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/contextmenu.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/crumb.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/custom.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/filter.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/info.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/preview-aud.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/preview-img.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/preview-txt.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/preview-vid.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/preview.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/search.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/select.less (100%) rename src/_h5ai/public/css/{inc => lib}/ext/tree.less (100%) rename src/_h5ai/public/css/{inc => lib}/fonts.less (100%) rename src/_h5ai/public/css/{inc => lib}/main/info.less (100%) rename src/_h5ai/public/css/{inc => lib}/misc.less (100%) rename src/_h5ai/public/css/{inc => lib}/mixins.less (100%) rename src/_h5ai/public/css/{inc => lib}/responsive.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/content.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/fallback.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/mainrow.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/notification.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/root.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/sidebar.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/topbar.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/view-details.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/view-grid.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/view-icons.less (100%) rename src/_h5ai/public/css/{inc => lib}/view/view.less (100%) rename src/_h5ai/public/css/{lib/h5bp-main-footer.less => vendor/h5bp-post.less} (96%) rename src/_h5ai/public/css/{lib/h5bp-main-header.less => vendor/h5bp-pre.less} (90%) rename src/_h5ai/public/css/{lib/h5bp-normalize.less => vendor/normalize.less} (100%) rename src/_h5ai/public/js/{lib => vendor}/jquery-2.1.3.min.js (100%) rename src/_h5ai/public/js/{lib => vendor}/jquery.qrcode-0.11.0.min.js (100%) rename src/_h5ai/public/js/{lib => vendor}/lodash-3.9.3.min.js (100%) rename src/_h5ai/public/js/{lib => vendor}/marked-0.3.2.min.js (100%) rename src/_h5ai/public/js/{lib => vendor}/modulejs-1.5.0.min.js (100%) rename src/_h5ai/public/js/{lib => vendor}/prism-2015-04-05.min.js (100%) delete mode 100644 test/.jshintrc rename test/{lib => vendor}/chai.js (100%) rename test/{lib => vendor}/mocha.js (100%) rename test/{lib => vendor}/sinon.js (100%) rename test/{lib => vendor}/uniq.js (100%) diff --git a/.editorconfig b/.editorconfig index 874a73b4..55cb6631 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,21 +12,11 @@ insert_final_newline = true trim_trailing_whitespace = true -[package.json] -indent_style = space +[{package.json,.travis.yml,.eslintrc}] indent_size = 2 -[.travis.yml] -indent_style = space -indent_size = 2 - - -[*.md] -trim_trailing_whitespace = false - - -[*.jade] +[{*.md,*.jade}] trim_trailing_whitespace = false diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 00000000..c62b7ed1 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +build/* +node_modules/* +**/vendor/* diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 00000000..29933dee --- /dev/null +++ b/.eslintrc @@ -0,0 +1,210 @@ +--- + root: true + + parser: babel-eslint + + env: + es6: true + node: true + + globals: + modulejs: false + + ecmaFeatures: + arrowFunctions: true + binaryLiterals: true + blockBindings: true + classes: false + defaultParams: true + destructuring: true + forOf: true + generators: true + globalReturn: true + jsx: false + modules: true + objectLiteralComputedProperties: true + objectLiteralDuplicateProperties: true + objectLiteralShorthandMethods: true + objectLiteralShorthandProperties: true + octalLiterals: true + regexUFlag: true + regexYFlag: true + spread: true + superInFunctions: false + templateStrings: true + unicodeCodePointEscapes: true + + rules: + array-bracket-spacing: [2, never] + arrow-parens: [2, as-needed] + arrow-spacing: 2 + block-scoped-var: 2 + brace-style: [2, 1tbs, {allowSingleLine: true}] + camelcase: 0 + comma-dangle: [2, never] + comma-spacing: [2, {before: false, after: true}] + comma-style: [2, last] + complexity: [1, 25] ### + computed-property-spacing: [2, never] + consistent-return: 2 + consistent-this: [2, self] + constructor-super: 2 + curly: [2, multi-line] + default-case: 2 + dot-location: [2, property] + dot-notation: [2, {allowKeywords: true}] + eol-last: 2 + eqeqeq: 2 + func-names: 2 + func-style: [2, declaration, {allowArrowFunctions: true}] + generator-star-spacing: [2, after] + guard-for-in: 2 + handle-callback-err: 2 + indent: [2, 4] + key-spacing: [2, {beforeColon: false, afterColon: true}] + linebreak-style: [2, unix] + max-depth: [1, 4] + max-len: [0, 80, 4] + max-nested-callbacks: [1, 3] + max-params: [1, 5] ### + max-statements: [1, 80] ### + new-cap: 1 + new-parens: 2 + newline-after-var: 0 + no-alert: 2 + no-array-constructor: 2 + no-bitwise: 2 + no-caller: 2 + no-catch-shadow: 2 + no-class-assign: 2 + no-cond-assign: 2 + no-console: 0 ### + no-const-assign: 2 + no-constant-condition: 1 + no-continue: 0 + no-control-regex: 2 + no-debugger: 2 + no-delete-var: 2 + no-div-regex: 2 + no-dupe-args: 2 + no-dupe-class-members: 2 + no-dupe-keys: 2 + no-duplicate-case: 2 + no-else-return: 1 + no-empty: 2 + no-empty-character-class: 2 + no-empty-label: 2 + no-empty-pattern: 2 + no-eq-null: 2 + no-eval: 2 + no-ex-assign: 2 + no-extend-native: 1 + no-extra-bind: 2 + no-extra-boolean-cast: 2 + no-extra-parens: 1 + no-extra-semi: 2 + no-fallthrough: 2 + no-floating-decimal: 2 + no-func-assign: 2 + no-implicit-coercion: [2, {boolean: false, number: true, string: true}] + no-implied-eval: 2 + no-inline-comments: 0 + no-inner-declarations: [2, functions] + no-invalid-regexp: 2 + no-invalid-this: 2 + no-irregular-whitespace: 2 + no-iterator: 2 + no-label-var: 2 + no-labels: 2 + no-lone-blocks: 2 + no-lonely-if: 2 + no-loop-func: 1 + no-magic-numbers: 0 + no-mixed-requires: [2, false] + no-mixed-spaces-and-tabs: [2, false] + no-multi-spaces: 2 + no-multi-str: 2 + no-multiple-empty-lines: [2, {max: 4}] + no-native-reassign: 1 + no-negated-in-lhs: 2 + no-nested-ternary: 0 + no-new: 2 + no-new-func: 2 + no-new-object: 2 + no-new-require: 2 + no-new-wrappers: 2 + no-obj-calls: 2 + no-octal: 2 + no-octal-escape: 2 + no-param-reassign: 0 + no-path-concat: 2 + no-plusplus: 2 + no-process-env: 2 + no-process-exit: 2 + no-proto: 2 + no-redeclare: 2 + no-regex-spaces: 2 + no-restricted-modules: 2 + no-return-assign: 2 + no-script-url: 2 + no-self-compare: 2 + no-sequences: 2 + no-shadow: 2 + no-shadow-restricted-names: 2 + no-spaced-func: 2 + no-sparse-arrays: 2 + no-sync: 0 + no-ternary: 0 + no-this-before-super: 2 + no-throw-literal: 1 + no-trailing-spaces: 2 + no-undef: 2 + no-undef-init: 2 + no-undefined: 0 + no-underscore-dangle: 0 + no-unexpected-multiline: 2 + no-unneeded-ternary: 2 + no-unreachable: 2 + no-useless-call: 2 + no-useless-concat: 2 + no-unused-expressions: 2 + no-unused-vars: [1, {vars: all, args: after-used}] + no-use-before-define: 2 + no-var: 2 + no-void: 2 + no-warning-comments: [1, {terms: [todo, fixme, xxx], location: start}] + no-with: 2 + object-curly-spacing: [2, never] + object-shorthand: [2, always] + one-var: [2, never] + operator-assignment: [2, always] + operator-linebreak: [2, after] + padded-blocks: [2, never] + prefer-arrow-callback: 2 + prefer-const: 1 + prefer-reflect: 1 + prefer-spread: 2 + prefer-template: 0 ### + quote-props: [2, as-needed] + quotes: [2, single, avoid-escape] + radix: 2 + require-yield: 2 + semi: 2 + semi-spacing: [2, {before: false, after: true}] + sort-vars: 0 + space-after-keywords: [2, always] + space-before-blocks: [2, always] + space-before-function-paren: [2, {anonymous: always, named: never}] + space-in-parens: [2, never] + space-infix-ops: 2 + space-return-throw-case: 2 + space-unary-ops: [2, {words: true, nonwords: false}] + spaced-comment: [2, always] + strict: [2, never] + use-isnan: 2 + valid-jsdoc: 2 + valid-typeof: 2 + vars-on-top: 0 + wrap-iife: [2, outside] + wrap-regex: 2 + yoda: [2, never, {exceptRange: true}] diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index 23bca019..00000000 --- a/.jscsrc +++ /dev/null @@ -1,144 +0,0 @@ -{ - "disallowEmptyBlocks": true, - "disallowImplicitTypeConversion": [ - "binary", - //"boolean", - "numeric", - "string" - ], - "disallowKeywords": [ - "with" - ], - "disallowKeywordsOnNewLine": [ - "else" - ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineStrings": true, - "disallowMultipleSpaces": true, - "disallowMultipleVarDecl": true, - "disallowNewlineBeforeBlockStatements": true, - "disallowQuotedKeysInObjects": true, - "disallowSpaceAfterObjectKeys": true, - "disallowSpaceAfterPrefixUnaryOperators": [ - "++", - "--", - "+", - "-", - "~", - "!" - ], - "disallowSpaceBeforePostfixUnaryOperators": [ - "++", - "--" - ], - "disallowSpacesInCallExpression": true, - "disallowSpacesInsideArrayBrackets": "all", - "disallowSpacesInsideObjectBrackets": true, - "disallowSpacesInsideParentheses": true, - "disallowTrailingComma": true, - "disallowTrailingWhitespace": true, - "disallowYodaConditions": true, - "requireCapitalizedConstructors": true, - "requireCommaBeforeLineBreak": true, - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch", - "case", - "default" - ], - "requireDollarBeforejQueryAssignment": true, - "requireDotNotation": true, - "requireLineBreakAfterVariableAssignment": true, - "requireLineFeedAtFileEnd": true, - "requireOperatorBeforeLineBreak": [ - "?", - "=", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==", - ">", - ">=", - "<", - "<=" - ], - "requireParenthesesAroundIIFE": true, - "requireSemicolons": true, - "requireSpaceAfterBinaryOperators": [ - "=", - ",", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==" - ], - "requireSpaceAfterKeywords": [ - "do", - "for", - "if", - "else", - "switch", - "case", - "try", - "catch", - "void", - "while", - "with", - "return", - "typeof", - "function" - ], - "requireSpaceAfterLineComment": true, - "requireSpaceBeforeBinaryOperators": [ - "=", - "+", - "-", - "/", - "*", - "==", - "===", - "!=", - "!==" - ], - "requireSpaceBeforeBlockStatements": true, - "requireSpaceBeforeKeywords": [ - "else", - "while", - "catch" - ], - "requireSpaceBeforeObjectValues": true, - "requireSpaceBetweenArguments": true, - "requireSpacesInAnonymousFunctionExpression": { - "beforeOpeningRoundBrace": true, - "beforeOpeningCurlyBrace": true - }, - "requireSpacesInConditionalExpression": { - "afterTest": true, - "beforeConsequent": true, - "afterConsequent": true, - "beforeAlternate": true - }, - "requireSpacesInForStatement": true, - "validateIndentation": 4, - "validateJSDoc": { - "checkParamNames": true, - "checkRedundantParams": true, - "requireParamTypes": true - }, - "validateLineBreaks": "LF", - "validateParameterSeparator": ", ", - "validateQuoteMarks": "'" -} diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index f18bebec..00000000 --- a/.jshintrc +++ /dev/null @@ -1,26 +0,0 @@ -{ - "bitwise": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "futurehostile": true, - "latedef": true, - "maxdepth": 3, - "noarg": true, - "nocomma": true, - "nonbsp": true, - "nonew": true, - "plusplus": true, - "strict": false, - "supernew": true, - "trailing": true, - "undef": true, - "unused": true, - - "browser": true, - - "globals": { - "modulejs": false - } -} diff --git a/README.md b/README.md index 0c0e9f21..3cfec0af 100644 --- a/README.md +++ b/README.md @@ -23,25 +23,16 @@ In short you have to take the following two steps: There are installation ready packages for the latest [releases][release] and [dev builds][develop]. But to clone and build **h5ai** yourself run the following commands to find a fresh zipball in folder `build` (tested on linux -only, requires [`git`][git] and [`node 0.12+`][node] to be installed). +only, requires [`git`][git] and [`node 4.x`][node] to be installed). - -First install the global command line trigger for the [`mkr`][mkr] build tool: - -~~~ -> npm install -g mkr-global -~~~ - -Then run: - -~~~ +~~~sh > git clone git://github.com/lrsjng/h5ai.git > cd h5ai > npm install -> mkr release +> npm run build ~~~ -To build the frontend test suite run `mkr build-test`. This will output a +To build the frontend test suite run `npm run build-test`. This will output a `file://`-URL you can look up in your browser to run the tests. diff --git a/mkrfile.js b/mkrfile.js index 7603fc07..40e8611e 100644 --- a/mkrfile.js +++ b/mkrfile.js @@ -1,167 +1,243 @@ -/*jshint node: true */ -'use strict'; +import fq from 'fquery'; +import dateformat from 'dateformat'; +import {join, resolve} from 'path'; +import webpack from 'webpack'; +import {spawnSync} from 'child_process'; +const loadPlugins = () => { + const pkg = require('./package.json'); + const deps = [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {})]; + const plugs = deps.filter(name => name.startsWith('fquery-')); + plugs.forEach(plug => fq.plugin(plug)); +}; +loadPlugins(); -var path = require('path'); -var $ = require('fquery'); +const root = resolve(__dirname); +const src = join(root, 'src'); +const build = join(root, 'build'); -var pkg = require('./package.json'); - -var root = path.resolve(__dirname); -var src = path.join(root, 'src'); -var build = path.join(root, 'build'); - - -function getBuildSuffixSync() { - - try { - var out = require('child_process').execSync('git rev-list v' + pkg.version + '..HEAD', {cwd: root, encoding: 'utf8'}); - var lines = out.trim().split(/\r?\n/); - return '+' + ('000' + lines.length).substr(-3) + '~' + lines[0].substring(0, 7); - } catch (e) {} - return '+X'; +function once(fn) { + let getter = () => { + const value = fn(); + getter = () => value; + return value; + }; + return () => getter(); } +function run(cmd, {info = true, stdout = true, stderr = true, liberal = false, local = true} = {}) { + const stdio = ['ignore', stdout ? 1 : 'pipe', stderr ? 2 : 'pipe']; + if (info) { + fq.report({type: 'info', method: 'run', message: cmd}); + } + const precmd = local ? 'PATH=./node_modules/.bin:$PATH;' : ''; + const res = spawnSync('sh', ['-c', precmd + cmd], { + cwd: root, + stdio, + encoding: 'utf-8' + }); + if (res.status !== 0 && !liberal) { + fq.report({type: 'err', method: 'run', message: `${cmd} [${res.status}] ${String(res.error)}`}); + } + return res; +} -$.plugin('fquery-autoprefixer'); -$.plugin('fquery-cssmin'); -$.plugin('fquery-handlebars'); -$.plugin('fquery-includeit'); -$.plugin('fquery-jade'); -$.plugin('fquery-jshint'); -$.plugin('fquery-jszip'); -$.plugin('fquery-less'); -$.plugin('fquery-uglifyjs'); +const getStamp = once(() => { + const stamp = new Date(); + stamp.human = dateformat(stamp, 'yyyy-mm-dd HH:MM:ss'); + stamp.id = stamp.human.replace(/\D/g, '-'); + stamp.sha1 = fq.getHash(stamp.id); + return stamp; +}); +const getPackage = once(() => { + const pkg = require('./package.json'); + const res = run(`git rev-list v${pkg.version}..HEAD`, {info: false, stdout: false, stderr: false, liberal: true}); + if (res.status === 0) { + const hashes = fq._.compact(res.stdout.split(/\r?\n/)); + if (hashes.length) { + pkg.version += `+${hashes.length}~${hashes[0].substr(0, 7)}`; + } + } + return pkg; +}); -module.exports = function (suite) { +const getComment = once(() => { + const pkg = getPackage(); + return `${pkg.name} v${pkg.version} - ${getStamp().human}`; +}); +const getHeader = once(() => `/* ${getComment()} */\n`); +function formatWebpackStats(stats, len) { + const json = stats.toJson(); + const align = (s, i) => ` ${s}`.substr(-i); + const cmp = (a, b) => a < b ? -1 : a > b ? 1 : 0; + const sortBy = (arr, selector = x => x) => Array.from(arr).sort((a, b) => cmp(selector(a), selector(b))); + let res = sortBy(json.modules, x => x.size); + if (len) { + res = 'stats\n' + res.slice(-len).map(r => { + return `${align(`[${r.id}]`, 7)}${align(r.size, 10)} ${r.name}`; + }).join('\n'); + res += `\n\n${align(json.modules.length, 7)}${align(json.assets[0].size, 10)} ${json.assets[0].name}`; + } else { + res = `modules: ${json.modules.length}, bytes: ${json.assets[0].size}, bundle: ${json.assets[0].name}`; + } + return res; +} + +module.exports = suite => { suite.defaults('release'); + suite.target('clean', [], 'delete build folder').task(() => { + fq(build, {dirs: true}).delete(); + }); - suite.target('check-version', [], 'add git info to dev builds').task(function () { + suite.target('lint', [], 'lint all JavaScript files with eslint').task(() => { + run(`eslint ${src}/_h5ai/public/js`); + }); - if (pkg.develop) { - pkg.version += getBuildSuffixSync(); - $.report({type: 'info', method: 'check-version', message: 'version set to ' + pkg.version}); + suite.target('build:scripts').task(done => { + const mapSrc = fq.map.p(src, build); + const scriptsChanged = fq(`${src}: _h5ai/public/js/scripts.js`) + .newerThan(mapSrc, fq(`${src}: _h5ai/public/js/**`)).length > 0; + + if (!scriptsChanged) { + done(); + return; } + + const webpackConfig = { + context: src, + entry: './_h5ai/public/js/scripts.js', + output: { + path: build, + filename: '_h5ai/public/js/scripts.js' + }, + module: { + loaders: [ + { + include: [src], + loader: 'babel', + query: { + cacheDirectory: true + } + } + ] + } + }; + + if (!suite.args.production) { + webpackConfig.output.pathinfo = true; + webpackConfig.devtool = '#inline-source-map'; + } + + webpack(webpackConfig, (err, stats) => { + if (err) { + fq.report({type: 'err', method: 'scripts', message: err}); + } + console.log(stats.toString({colors: true})); + // fq.report({type: 'info', method: 'webpack', message: formatWebpackStats(stats, 10)}); + + fq(`${build}: _h5ai/public/js/scripts.js`) + .if(suite.args.production, function applyuglifyjs() { + this.uglifyjs(); // eslint-disable-line no-invalid-this + }) + .wrap(getHeader()) + .write(mapSrc, true); + done(); + }); }); + suite.target('build', [], 'build all updated files, optionally use :uncompressed (e.g. mkr -b build :uncompressed)').task(() => { + const env = {pkg: getPackage()}; + const mapSrc = fq.map.p(src, build).s('.less', '.css').s('.jade', ''); + const mapRoot = fq.map.p(root, join(build, '_h5ai')); - suite.target('clean', [], 'delete build folder').task(function () { - - $(build, {dirs: true}).delete(); - }); - - - suite.target('lint', [], 'lint all JavaScript files with JSHint').task(function () { - - var fs = require('fs'); - var jshint = JSON.parse(fs.readFileSync('.jshintrc', 'utf8')); - - $(src + '/_h5ai/public/js: **/*.js, ! lib/**') - .jshint(jshint, jshint.globals); - }); - - - suite.target('build', ['check-version', 'lint'], 'build all updated files, optionally use :uncompressed (e.g. mkr build :uncompressed)').task(function () { - - var header = '/* ' + pkg.name + ' ' + pkg.version + ' - ' + pkg.homepage + ' */\n'; - var env = {pkg: pkg}; - var mapSrc = $.map.p(src, build).s('.less', '.css').s('.jade', ''); - var mapRoot = $.map.p(root, path.join(build, '_h5ai')); - - $(src + ': _h5ai/public/js/*.js') - .newerThan(mapSrc, $(src + ': _h5ai/public/js/**')) + fq(`${src}: _h5ai/public/js/*.js`) + .newerThan(mapSrc, fq(`${src}: _h5ai/public/js/**`)) .includeit() - .if(!suite.args.uncompressed, function () { this.uglifyjs(); }) - .wrap(header) + .if(!suite.args.uncompressed, function applyuglifyjs() { + this.uglifyjs(); // eslint-disable-line no-invalid-this + }) + .wrap(getHeader()) .write(mapSrc, true); - $(src + ': _h5ai/public/css/*.less') - .newerThan(mapSrc, $(src + ': _h5ai/public/css/**')) + fq(`${src}: _h5ai/public/css/*.less`) + .newerThan(mapSrc, fq(`${src}: _h5ai/public/css/**`)) .includeit() .less() .autoprefixer() - .if(!suite.args.uncompressed, function () { this.cssmin(); }) - .wrap(header) + .if(!suite.args.uncompressed, function applycssmin() { + this.cssmin(); // eslint-disable-line no-invalid-this + }) + .wrap(getHeader()) .write(mapSrc, true); - $(src + ': **/*.jade, ! **/*.tpl.jade') + fq(`${src}: **/*.jade, ! **/*.tpl.jade`) .newerThan(mapSrc) .jade(env) .write(mapSrc, true); - $(src + ': **, ! _h5ai/public/js/**, ! _h5ai/public/css/**, ! **/*.jade') + fq(`${src}: **, ! _h5ai/public/js/**, ! _h5ai/public/css/**, ! **/*.jade`) .newerThan(mapSrc) .handlebars(env) .write(mapSrc, true); - $(root + ': *.md') + fq(`${root}: *.md`) .newerThan(mapRoot) .write(mapRoot, true); + + fq.report({type: 'info', message: getComment()}); }); - - suite.target('deploy', ['build'], 'deploy to a specified path (e.g. mkr deploy :dest=/some/path)').task(function () { - - if (!$._.isString(suite.args.dest)) { - $.report({ - type: 'err', - message: 'no destination path (e.g. mkr deploy :dest=/some/path)' - }); + suite.target('deploy', ['build'], 'deploy to a specified path (e.g. mkr -b deploy :dest=/some/path)').task(() => { + if (!fq._.isString(suite.args.dest)) { + fq.report({type: 'err', message: 'no destination path (e.g. mkr -b deploy :dest=/some/path)'}); } - var mapper = $.map.p(build, path.resolve(suite.args.dest)); + const mapper = fq.map.p(build, resolve(suite.args.dest)); - $(build + ': _h5ai/**') + fq(`${build}: _h5ai/**`) .newerThan(mapper) .write(mapper, true); }); + // suite.target('release', ['clean', 'lint', 'build'], 'create a zipball').task(() => { + suite.target('release', ['clean', 'build'], 'create a zipball').task(() => { + const pkg = getPackage(); + const target = join(build, `${pkg.name}-${pkg.version}.zip`); - suite.target('release', ['clean', 'build'], 'create a zipball').task(function () { - - var target = path.join(build, pkg.name + '-' + pkg.version + '.zip'); - - $(build + ': **') + fq(`${build}: **`) .jszip({dir: build, level: 9}) .write(target, true); }); - - suite.target('build-test', ['check-version'], 'build a test suite').task(function () { - - var env = {pkg: pkg}; - - $(src + '/_h5ai/public/css/styles.less') + suite.target('build-test', [], 'build a test suite').task(() => { + fq(`${src}/_h5ai/public/css/styles.less`) .includeit() .less() .autoprefixer() - .write(build + '/test/h5ai-styles.css', true); + .write(`${build}/test/h5ai-styles.css`, true); - $(src + '/_h5ai/public/js/scripts.js') + fq(`${src}/_h5ai/public/js/scripts.js`) .includeit() - .write(build + '/test/h5ai-scripts.js', true); + .write(`${build}/test/h5ai-scripts.js`, true); - $(root + '/test/styles.less') + fq(`${root}/test/styles.less`) .includeit() .less() .autoprefixer() - .write(build + '/test/styles.css', true); + .write(`${build}/test/styles.css`, true); - $(root + '/test/scripts.js') + fq(`${root}/test/scripts.js`) .includeit() - .write(build + '/test/scripts.js', true); + .write(`${build}/test/scripts.js`, true); - $(root + '/test/index.html.jade') - .jade(env) - .write(build + '/test/index.html', true); + fq(`${root}/test/index.html.jade`) + .jade({pkg: getPackage()}) + .write(`${build}/test/index.html`, true); - $.report({ - type: 'info', - message: 'browse to file://' + build + '/test/index.html' - }); + fq.report({type: 'info', message: `browse to file://${build}/test/index.html`}); }); }; diff --git a/package.json b/package.json index cb0990a2..b3ccacb1 100644 --- a/package.json +++ b/package.json @@ -2,33 +2,39 @@ "name": "h5ai", "version": "0.27.0", "develop": true, - "description": "a modern HTTP web server index", - "homepage": "http://larsjung.de/h5ai/", + "description": "A modern HTTP web server index.", + "homepage": "https://larsjung.de/h5ai/", "bugs": "https://github.com/lrsjng/h5ai/issues", - "author": "Lars Jung (http://larsjung.de)", + "author": "Lars Jung (https://larsjung.de)", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/lrsjng/h5ai.git" }, "scripts": { - "build": "mkr release", - "build-test": "mkr build-test" + "build": "mkr -b release", + "build-test": "mkr -b build-test" }, "devDependencies": { - "fquery": "~0.16.4", - "fquery-autoprefixer": "~0.2.0", - "fquery-cssmin": "~0.3.1", - "fquery-handlebars": "~0.3.0", - "fquery-includeit": "~0.3.0", - "fquery-jade": "~0.5.0", - "fquery-jshint": "~0.3.0", - "fquery-jszip": "~0.5.1", - "fquery-less": "~0.3.0", - "fquery-uglifyjs": "~0.3.0", - "mkr": "~0.8.5" + "babel": "^5.8.23", + "babel-eslint": "^4.1.3", + "babel-loader": "^5.3.2", + "dateformat": "^1.0.11", + "eslint": "^1.7.3", + "fquery": "^0.16.4", + "fquery-autoprefixer": "^0.3.0", + "fquery-cssmin": "^0.3.1", + "fquery-gethash": "^0.3.0", + "fquery-handlebars": "^0.3.0", + "fquery-includeit": "^0.3.0", + "fquery-jade": "^0.6.0", + "fquery-jszip": "^0.5.1", + "fquery-less": "^0.3.0", + "fquery-uglifyjs": "^0.3.0", + "mkr": "^0.10.0", + "webpack": "^1.12.2" }, "engines": { - "node": "0.12.x" + "node": "4.x" } } diff --git a/src/_h5ai/public/css/inc/colors.less b/src/_h5ai/public/css/lib/colors.less similarity index 100% rename from src/_h5ai/public/css/inc/colors.less rename to src/_h5ai/public/css/lib/colors.less diff --git a/src/_h5ai/public/css/inc/ext/contextmenu.less b/src/_h5ai/public/css/lib/ext/contextmenu.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/contextmenu.less rename to src/_h5ai/public/css/lib/ext/contextmenu.less diff --git a/src/_h5ai/public/css/inc/ext/crumb.less b/src/_h5ai/public/css/lib/ext/crumb.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/crumb.less rename to src/_h5ai/public/css/lib/ext/crumb.less diff --git a/src/_h5ai/public/css/inc/ext/custom.less b/src/_h5ai/public/css/lib/ext/custom.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/custom.less rename to src/_h5ai/public/css/lib/ext/custom.less diff --git a/src/_h5ai/public/css/inc/ext/filter.less b/src/_h5ai/public/css/lib/ext/filter.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/filter.less rename to src/_h5ai/public/css/lib/ext/filter.less diff --git a/src/_h5ai/public/css/inc/ext/info.less b/src/_h5ai/public/css/lib/ext/info.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/info.less rename to src/_h5ai/public/css/lib/ext/info.less diff --git a/src/_h5ai/public/css/inc/ext/preview-aud.less b/src/_h5ai/public/css/lib/ext/preview-aud.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/preview-aud.less rename to src/_h5ai/public/css/lib/ext/preview-aud.less diff --git a/src/_h5ai/public/css/inc/ext/preview-img.less b/src/_h5ai/public/css/lib/ext/preview-img.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/preview-img.less rename to src/_h5ai/public/css/lib/ext/preview-img.less diff --git a/src/_h5ai/public/css/inc/ext/preview-txt.less b/src/_h5ai/public/css/lib/ext/preview-txt.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/preview-txt.less rename to src/_h5ai/public/css/lib/ext/preview-txt.less diff --git a/src/_h5ai/public/css/inc/ext/preview-vid.less b/src/_h5ai/public/css/lib/ext/preview-vid.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/preview-vid.less rename to src/_h5ai/public/css/lib/ext/preview-vid.less diff --git a/src/_h5ai/public/css/inc/ext/preview.less b/src/_h5ai/public/css/lib/ext/preview.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/preview.less rename to src/_h5ai/public/css/lib/ext/preview.less diff --git a/src/_h5ai/public/css/inc/ext/search.less b/src/_h5ai/public/css/lib/ext/search.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/search.less rename to src/_h5ai/public/css/lib/ext/search.less diff --git a/src/_h5ai/public/css/inc/ext/select.less b/src/_h5ai/public/css/lib/ext/select.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/select.less rename to src/_h5ai/public/css/lib/ext/select.less diff --git a/src/_h5ai/public/css/inc/ext/tree.less b/src/_h5ai/public/css/lib/ext/tree.less similarity index 100% rename from src/_h5ai/public/css/inc/ext/tree.less rename to src/_h5ai/public/css/lib/ext/tree.less diff --git a/src/_h5ai/public/css/inc/fonts.less b/src/_h5ai/public/css/lib/fonts.less similarity index 100% rename from src/_h5ai/public/css/inc/fonts.less rename to src/_h5ai/public/css/lib/fonts.less diff --git a/src/_h5ai/public/css/inc/main/info.less b/src/_h5ai/public/css/lib/main/info.less similarity index 100% rename from src/_h5ai/public/css/inc/main/info.less rename to src/_h5ai/public/css/lib/main/info.less diff --git a/src/_h5ai/public/css/inc/misc.less b/src/_h5ai/public/css/lib/misc.less similarity index 100% rename from src/_h5ai/public/css/inc/misc.less rename to src/_h5ai/public/css/lib/misc.less diff --git a/src/_h5ai/public/css/inc/mixins.less b/src/_h5ai/public/css/lib/mixins.less similarity index 100% rename from src/_h5ai/public/css/inc/mixins.less rename to src/_h5ai/public/css/lib/mixins.less diff --git a/src/_h5ai/public/css/inc/responsive.less b/src/_h5ai/public/css/lib/responsive.less similarity index 100% rename from src/_h5ai/public/css/inc/responsive.less rename to src/_h5ai/public/css/lib/responsive.less diff --git a/src/_h5ai/public/css/inc/view/content.less b/src/_h5ai/public/css/lib/view/content.less similarity index 100% rename from src/_h5ai/public/css/inc/view/content.less rename to src/_h5ai/public/css/lib/view/content.less diff --git a/src/_h5ai/public/css/inc/view/fallback.less b/src/_h5ai/public/css/lib/view/fallback.less similarity index 100% rename from src/_h5ai/public/css/inc/view/fallback.less rename to src/_h5ai/public/css/lib/view/fallback.less diff --git a/src/_h5ai/public/css/inc/view/mainrow.less b/src/_h5ai/public/css/lib/view/mainrow.less similarity index 100% rename from src/_h5ai/public/css/inc/view/mainrow.less rename to src/_h5ai/public/css/lib/view/mainrow.less diff --git a/src/_h5ai/public/css/inc/view/notification.less b/src/_h5ai/public/css/lib/view/notification.less similarity index 100% rename from src/_h5ai/public/css/inc/view/notification.less rename to src/_h5ai/public/css/lib/view/notification.less diff --git a/src/_h5ai/public/css/inc/view/root.less b/src/_h5ai/public/css/lib/view/root.less similarity index 100% rename from src/_h5ai/public/css/inc/view/root.less rename to src/_h5ai/public/css/lib/view/root.less diff --git a/src/_h5ai/public/css/inc/view/sidebar.less b/src/_h5ai/public/css/lib/view/sidebar.less similarity index 100% rename from src/_h5ai/public/css/inc/view/sidebar.less rename to src/_h5ai/public/css/lib/view/sidebar.less diff --git a/src/_h5ai/public/css/inc/view/topbar.less b/src/_h5ai/public/css/lib/view/topbar.less similarity index 100% rename from src/_h5ai/public/css/inc/view/topbar.less rename to src/_h5ai/public/css/lib/view/topbar.less diff --git a/src/_h5ai/public/css/inc/view/view-details.less b/src/_h5ai/public/css/lib/view/view-details.less similarity index 100% rename from src/_h5ai/public/css/inc/view/view-details.less rename to src/_h5ai/public/css/lib/view/view-details.less diff --git a/src/_h5ai/public/css/inc/view/view-grid.less b/src/_h5ai/public/css/lib/view/view-grid.less similarity index 100% rename from src/_h5ai/public/css/inc/view/view-grid.less rename to src/_h5ai/public/css/lib/view/view-grid.less diff --git a/src/_h5ai/public/css/inc/view/view-icons.less b/src/_h5ai/public/css/lib/view/view-icons.less similarity index 100% rename from src/_h5ai/public/css/inc/view/view-icons.less rename to src/_h5ai/public/css/lib/view/view-icons.less diff --git a/src/_h5ai/public/css/inc/view/view.less b/src/_h5ai/public/css/lib/view/view.less similarity index 100% rename from src/_h5ai/public/css/inc/view/view.less rename to src/_h5ai/public/css/lib/view/view.less diff --git a/src/_h5ai/public/css/styles.less b/src/_h5ai/public/css/styles.less index 57d4d0a5..01a1162c 100644 --- a/src/_h5ai/public/css/styles.less +++ b/src/_h5ai/public/css/styles.less @@ -1,15 +1,15 @@ @charset "utf-8"; -// @include "lib/h5bp-normalize.less" -// @include "lib/h5bp-main-header.less" +// @include "vendor/normalize.less" +// @include "vendor/h5bp-pre.less" -// @include "inc/colors.less" -// @include "inc/fonts.less" -// @include "inc/misc.less" -// @include "inc/mixins.less" +// @include "lib/colors.less" +// @include "lib/fonts.less" +// @include "lib/misc.less" +// @include "lib/mixins.less" -// @include "inc/*/*.less" +// @include "lib/*/*.less" -// @include "inc/responsive.less" +// @include "lib/responsive.less" -// @include "lib/h5bp-main-footer.less" +// @include "vendor/h5bp-post.less" diff --git a/src/_h5ai/public/css/lib/h5bp-main-footer.less b/src/_h5ai/public/css/vendor/h5bp-post.less similarity index 96% rename from src/_h5ai/public/css/lib/h5bp-main-footer.less rename to src/_h5ai/public/css/vendor/h5bp-post.less index 994b56de..25cd21d2 100644 --- a/src/_h5ai/public/css/lib/h5bp-main-footer.less +++ b/src/_h5ai/public/css/vendor/h5bp-post.less @@ -3,7 +3,7 @@ ========================================================================== */ /* - * Hide visually and from screen readers: + * Hide visually and from screen readers */ .hidden { @@ -84,6 +84,7 @@ // @media print, // (-webkit-min-device-pixel-ratio: 1.25), +// (min-resolution: 1.25dppx), // (min-resolution: 120dpi) { // /* Style adjustments for high resolution devices */ // } @@ -97,7 +98,9 @@ @media print { *, *:before, - *:after { + *:after, + *:first-letter, + *:first-line { background: transparent !important; color: #000 !important; /* Black prints faster: http://www.sanbeiji.com/archives/953 */ diff --git a/src/_h5ai/public/css/lib/h5bp-main-header.less b/src/_h5ai/public/css/vendor/h5bp-pre.less similarity index 90% rename from src/_h5ai/public/css/lib/h5bp-main-header.less rename to src/_h5ai/public/css/vendor/h5bp-pre.less index 00261852..7a435d40 100644 --- a/src/_h5ai/public/css/lib/h5bp-main-header.less +++ b/src/_h5ai/public/css/vendor/h5bp-pre.less @@ -1,4 +1,4 @@ -/*! HTML5 Boilerplate v5.1.0 | MIT License | https://html5boilerplate.com/ */ +/*! HTML5 Boilerplate v5.2.0 | MIT License | https://html5boilerplate.com/ */ /* * What follows is the result of much research on cross-browser styling. @@ -84,12 +84,12 @@ textarea { Browser Upgrade Prompt ========================================================================== */ -.browserupgrade { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; -} +// .browserupgrade { +// margin: 0.2em 0; +// background: #ccc; +// color: #000; +// padding: 0.2em 0; +// } /* ========================================================================== Author's custom styles diff --git a/src/_h5ai/public/css/lib/h5bp-normalize.less b/src/_h5ai/public/css/vendor/normalize.less similarity index 100% rename from src/_h5ai/public/css/lib/h5bp-normalize.less rename to src/_h5ai/public/css/vendor/normalize.less diff --git a/src/_h5ai/public/js/inc/boot.js b/src/_h5ai/public/js/inc/boot.js index ce53e972..d82a3cf6 100644 --- a/src/_h5ai/public/js/inc/boot.js +++ b/src/_h5ai/public/js/inc/boot.js @@ -1,7 +1,11 @@ modulejs.define('boot', ['$', 'core/server'], function ($, server) { - var module = $('script[data-module]').data('module'); - var data = {action: 'get', setup: true, options: true, types: true}; + var data = { + action: 'get', + setup: true, + options: true, + types: true + }; if (module === 'index') { data.theme = true; @@ -13,8 +17,9 @@ modulejs.define('boot', ['$', 'core/server'], function ($, server) { } server.request(data, function (config) { - modulejs.define('config', config); - $(function () { modulejs.require('main/' + module); }); + $(function () { + modulejs.require('main/' + module); + }); }); }); diff --git a/src/_h5ai/public/js/scripts.js b/src/_h5ai/public/js/scripts.js index c599c49e..87fc159a 100644 --- a/src/_h5ai/public/js/scripts.js +++ b/src/_h5ai/public/js/scripts.js @@ -9,12 +9,12 @@ } }()); -// @include 'lib/jquery-*.js' -// @include 'lib/jquery.*.js' -// @include 'lib/lodash-*.js' -// @include 'lib/marked-*.js' -// @include 'lib/modulejs-*.js' -// @include 'lib/prism-*.js' +// @include 'vendor/jquery-*.js' +// @include 'vendor/jquery.*.js' +// @include 'vendor/lodash-*.js' +// @include 'vendor/marked-*.js' +// @include 'vendor/modulejs-*.js' +// @include 'vendor/prism-*.js' (function () { 'use strict'; diff --git a/src/_h5ai/public/js/lib/jquery-2.1.3.min.js b/src/_h5ai/public/js/vendor/jquery-2.1.3.min.js similarity index 100% rename from src/_h5ai/public/js/lib/jquery-2.1.3.min.js rename to src/_h5ai/public/js/vendor/jquery-2.1.3.min.js diff --git a/src/_h5ai/public/js/lib/jquery.qrcode-0.11.0.min.js b/src/_h5ai/public/js/vendor/jquery.qrcode-0.11.0.min.js similarity index 100% rename from src/_h5ai/public/js/lib/jquery.qrcode-0.11.0.min.js rename to src/_h5ai/public/js/vendor/jquery.qrcode-0.11.0.min.js diff --git a/src/_h5ai/public/js/lib/lodash-3.9.3.min.js b/src/_h5ai/public/js/vendor/lodash-3.9.3.min.js similarity index 100% rename from src/_h5ai/public/js/lib/lodash-3.9.3.min.js rename to src/_h5ai/public/js/vendor/lodash-3.9.3.min.js diff --git a/src/_h5ai/public/js/lib/marked-0.3.2.min.js b/src/_h5ai/public/js/vendor/marked-0.3.2.min.js similarity index 100% rename from src/_h5ai/public/js/lib/marked-0.3.2.min.js rename to src/_h5ai/public/js/vendor/marked-0.3.2.min.js diff --git a/src/_h5ai/public/js/lib/modulejs-1.5.0.min.js b/src/_h5ai/public/js/vendor/modulejs-1.5.0.min.js similarity index 100% rename from src/_h5ai/public/js/lib/modulejs-1.5.0.min.js rename to src/_h5ai/public/js/vendor/modulejs-1.5.0.min.js diff --git a/src/_h5ai/public/js/lib/prism-2015-04-05.min.js b/src/_h5ai/public/js/vendor/prism-2015-04-05.min.js similarity index 100% rename from src/_h5ai/public/js/lib/prism-2015-04-05.min.js rename to src/_h5ai/public/js/vendor/prism-2015-04-05.min.js diff --git a/test/.jshintrc b/test/.jshintrc deleted file mode 100644 index 0ba73d10..00000000 --- a/test/.jshintrc +++ /dev/null @@ -1,36 +0,0 @@ -{ - "bitwise": true, - "curly": true, - "eqeqeq": true, - "forin": true, - "freeze": true, - "futurehostile": true, - "latedef": true, - "maxdepth": 3, - "noarg": true, - "nocomma": true, - "nonbsp": true, - "nonew": true, - "plusplus": true, - "strict": true, - "supernew": true, - "trailing": true, - "undef": true, - "unused": true, - - "browser": true, - "mocha": true, - - "globals": { - "_": false, - "$": false, - "assert": false, - "chai": false, - "jQuery": false, - "mocha": false, - "modulejs": false, - "sinon": false, - "uniq": false, - "util": false - } -} diff --git a/test/scripts.js b/test/scripts.js index 5fb586f9..3f7c2227 100644 --- a/test/scripts.js +++ b/test/scripts.js @@ -1,4 +1,4 @@ -// @include "lib/*.js" +// @include "vendor/*.js" // @include "util/*.js" $(function () { diff --git a/test/lib/chai.js b/test/vendor/chai.js similarity index 100% rename from test/lib/chai.js rename to test/vendor/chai.js diff --git a/test/lib/mocha.js b/test/vendor/mocha.js similarity index 100% rename from test/lib/mocha.js rename to test/vendor/mocha.js diff --git a/test/lib/sinon.js b/test/vendor/sinon.js similarity index 100% rename from test/lib/sinon.js rename to test/vendor/sinon.js diff --git a/test/lib/uniq.js b/test/vendor/uniq.js similarity index 100% rename from test/lib/uniq.js rename to test/vendor/uniq.js