Skip to content

Commit

Permalink
Fix broken npm package.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericelliott committed Aug 25, 2015
1 parent 7053c6b commit c7f456d
Show file tree
Hide file tree
Showing 24 changed files with 10,360 additions and 2,121 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bundle.js
node_modules
build
50 changes: 24 additions & 26 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,26 +34,25 @@

"rules": {
"block-scoped-var": [0],
"brace-style": [2, "1tbs", { "allowSingleLine": true }],
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
"camelcase": [0],
"comma-dangle": [2, "never"],
"comma-dangle": [0],
"comma-spacing": [2],
"comma-style": [2, "last"],
"complexity": [0, 11],
"consistent-return": [2],
"consistent-this": [0, "that"],
"curly": [2, "multi-line"],
"default-case": [2],
"dot-notation": [2, { "allowKeywords": true }],
"dot-notation": [2, {"allowKeywords": true}],
"eol-last": [2],
"eqeqeq": [2],
"func-names": [0],
"func-style": [0, "declaration"],
"generator-star-spacing": [2, "after"],
"strict": 0,
"guard-for-in": [0],
"handle-callback-err": [0],
"key-spacing": [2, { "beforeColon": false, "afterColon": true }],
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"quotes": [2, "single", "avoid-escape"],
"max-depth": [0, 4],
"max-len": [0, 80, 4],
Expand Down Expand Up @@ -81,17 +80,15 @@
"no-duplicate-case": [2],
"no-else-return": [0],
"no-empty": [2],
"no-empty-class": [2],
"no-empty-character-class": [2],
"no-empty-label": [2],
"no-eq-null": [0],
"no-eval": [2],
"no-ex-assign": [2],
"no-extend-native": [1],
"no-extra-bind": [2],
"no-extra-boolean-cast": [2],
"no-extra-parens": [0],
"no-extra-semi": [1],
"no-extra-strict": [2],
"no-fallthrough": [2],
"no-floating-decimal": [2],
"no-func-assign": [2],
Expand All @@ -110,7 +107,7 @@
"no-mixed-spaces-and-tabs": [2, false],
"no-multi-spaces": [2],
"no-multi-str": [2],
"no-multiple-empty-lines": [2, { "max": 2 }],
"no-multiple-empty-lines": [2, {"max": 2}],
"no-native-reassign": [1],
"no-negated-in-lhs": [2],
"no-nested-ternary": [0],
Expand Down Expand Up @@ -138,7 +135,6 @@
"no-sequences": [2],
"no-shadow": [2],
"no-shadow-restricted-names": [2],
"no-space-before-semi": [2],
"no-spaced-func": [2],
"no-sparse-arrays": [2],
"no-sync": [0],
Expand All @@ -151,44 +147,46 @@
"no-underscore-dangle": [2],
"no-unreachable": [2],
"no-unused-expressions": [2],
"no-unused-vars": [1, { "vars": "all", "args": "after-used" }],
"no-unused-vars": [1, {"vars": "all", "args": "after-used"}],
"no-use-before-define": [2],
"no-void": [0],
"no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
"no-warning-comments": [0, {"terms": ["todo", "fixme", "xxx"], "location": "start"}],
"no-with": [2],
"no-wrap-func": [2],
"no-extra-parens": [2],
"one-var": [0],
"operator-assignment": [0, "always"],
"operator-linebreak": [2, "after"],
"padded-blocks": [0],
"quote-props": [0],
"radix": [0],
"semi": [2],
"semi-spacing": [2, { "before": false, "after": true }],
"semi-spacing": [2, {"before": false, "after": true}],
"sort-vars": [0],
"space-after-keywords": [2, "always"],
"space-before-function-paren": [2, { "anonymous": "always", "named": "always" }],
"space-before-function-paren": [2, {"anonymous": "always", "named": "always"}],
"space-before-blocks": [0, "always"],
"space-in-brackets": [0, "never", {
"singleValue": true,
"arraysInArrays": false,
"arraysInObjects": false,
"objectsInArrays": true,
"objectsInObjects": true,
"propertyName": false
}],
"space-in-brackets": [
0, "never", {
"singleValue": true,
"arraysInArrays": false,
"arraysInObjects": false,
"objectsInArrays": true,
"objectsInObjects": true,
"propertyName": false
}
],
"space-in-parens": [2, "never"],
"space-infix-ops": [2],
"space-return-throw-case": [2],
"space-unary-ops": [2, { "words": true, "nonwords": false }],
"space-unary-ops": [2, {"words": true, "nonwords": false}],
"spaced-line-comment": [0, "always"],
"strict": [1],
"strict": [2, "never"],
"use-isnan": [2],
"valid-jsdoc": [0],
"valid-typeof": [2],
"vars-on-top": [0],
"wrap-iife": [2],
"wrap-regex": [2],
"yoda": [2, "never", { "exceptRange": true }]
"yoda": [2, "never", {"exceptRange": true}]
}
}
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ install:
- npm install
script:
- npm run validate
env:
global:
- secure: ZaVxQhRv9HYXTCqeS9T4XXGO1cGayL11os8jDZ6wqNkQAwkOw3QSL70iloN5DMzg4WXv8Pwp5I4EUDIcUwiu4UCbDgfn1vYoTfVEmDMBDni4xw3CRG7IT8gEijJItCaOdEzC+IBmpAFuVI8xcuic7WBYPKRnShWkZ1xwmHDSenc=
- secure: lh7gaH4G4RUvdjrocupakeFbx4JtF7AyLGXGfsJl+/PJFjvrB+Ahatb8sTcb5hDHTr+Ucunzawx1HBNE+k+7CyykKBQpsQNWT/q6vlL/PAjRpt501O46NEdfTm/RSTqHgIo9WINYIa/ZpCh2L0vAevduaT0GGFCaP9W7fpJaVhM=
10 changes: 10 additions & 0 deletions .zuul.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ui: tape
browsers:
- name: chrome
version: latest
- name: firefox
version: latest
- name: ie
version: 9..latest
- name: iphone
version: 6.1..latest
1 change: 1 addition & 0 deletions bin/env.sh.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export SAUCE_USERNAME=[Your Saucelabs Username]
export SAUCE_ACCESS_KEY=[Your Access Key]
export TEST_PORT=2000
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cuid",
"repo": "dilvie/cuid",
"description": "Collision-resistant ids optimized for horizontal scaling and performance",
"version": "1.2.2",
"version": "1.3.0",
"keywords": [
"uid",
"unique id",
Expand Down
52 changes: 27 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"version": "1.3.0",
"description": "Collision-resistant ids optimized for horizontal scaling and performance. For node and browsers.",
"author": {
"email": "eric@ericleads.com",
"name": "Eric Elliott",
"url": "http://ericleads.com"
"url": "https://ericelliottjs.com"
},
"main": "./build/server/cuid.js",
"browserify": "./build/client/cuid.js",
"browser": "./build/client/cuid.js",
"keywords": [
"id",
"guid",
"uid",
"unique id",
Expand All @@ -20,34 +20,36 @@
"url": "https://github.com/ericelliott/cuid.git"
},
"license": "MIT",
"directories": {
"dist": "./dist",
"lib": "./lib",
"src": "./src",
"test": "./test"
},
"devDependencies": {
"babel": "^5.6.14",
"babel-eslint": "^3.1.20",
"babel-loader": "^5.3.0",
"blue-tape": "^0.1.9",
"eslint": "^0.24.0",
"babel": "5.6.14",
"babel-eslint": "3.1.20",
"babel-loader": "5.3.0",
"ecstatic": "^0.8.0",
"eslint": "0.24.0",
"faucet": "0.0.1",
"node-libs-browser": "^0.5.2",
"rimraf": "^2.4.1",
"saucelabs": "^0.1.1",
"webpack": "^1.10.1"
"node-libs-browser": "0.5.2",
"rimraf": "2.4.1",
"sauce-connect-launcher": "^0.12.0",
"saucelabs": "0.1.1",
"tape": "4.2.0",
"wd": "^0.3.12",
"webpack": "1.10.1",
"zuul": "^3.3.0"
},
"scripts": {
"build": "NODE_ENV=production webpack && npm run build:min",
"build:min": "NODE_ENV=production webpack -p",
"clean": "rimraf build",
"lint": "eslint source/**/*.js",
"clean": "rimraf build && rimraf test/client/test-cuid.js",
"prebuild": "npm run clean",
"test": "npm run test:server",
"test:client": "source bin/env.sh && babel-node test/client",
"build": "npm run build:server && npm run build:client && npm run build:test",
"build:server": "NODE_ENV=production WEBPACK_TARGET=server webpack",
"build:client": "NODE_ENV=production WEBPACK_TARGET=client webpack -p",
"build:test": "browserify ./test/client/index.js -s testcuid -t babelify --outfile test/client/test-cuid.js",
"comment:build:test": "NODE_ENV=production WEBPACK_TARGET=test webpack -p",
"lint": "eslint source test",
"test": "npm run test:server && npm run test:client",
"test:client": "zuul -- test/client/test-cuid",
"test:server": "babel-node test/server",
"validate": "npm run lint && npm run test",
"prevalidate": "npm run clean",
"validate": "npm run lint && npm run build && npm run test",
"validate-dev": "npm run lint && npm run build && npm run test | faucet"
},
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions source/client/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import createCuid from '../index.js';
const fingerprint = require('browser-fingerprint')();

const { cuid, slug } = createCuid(fingerprint);
export { cuid, slug };
cuid.slug = slug;

export default cuid;
4 changes: 1 addition & 3 deletions source/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* MIT License
*/

'use strict';

let c = 0;
const blockSize = 4;
const base = 36;
Expand All @@ -24,7 +22,7 @@ const randomBlock = function randomBlock () {
};

const safeCounter = function () {
c = (c < discreteValues) ? c : 0;
c = c < discreteValues ? c : 0;
return c++;
};

Expand Down
6 changes: 3 additions & 3 deletions source/server/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import createCuid from '../index.js';
const fingerprint = require('node-fingerprint')();

const { cuid, slug } = createCuid(fingerprint);
export { cuid, slug };
cuid.slug = slug;

export default cuid;
22 changes: 0 additions & 22 deletions test/applitude-cuid-test.html

This file was deleted.

33 changes: 0 additions & 33 deletions test/applitude-cuid-test.js

This file was deleted.

21 changes: 0 additions & 21 deletions test/browser-cuid-test.html

This file was deleted.

32 changes: 0 additions & 32 deletions test/browser-cuid-test.js

This file was deleted.

0 comments on commit c7f456d

Please sign in to comment.