diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..2f8826912 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +/docs diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index f1b5b3c4f..000000000 --- a/.eslintrc +++ /dev/null @@ -1,90 +0,0 @@ -{ - "env": { - "browser": true, - "node": true, - "amd": true - }, - "globals": { - "attachEvent": false, - "detachEvent": false - }, - "rules": { - "array-bracket-spacing": 2, - "block-scoped-var": 2, - "brace-style": [1, "1tbs", {"allowSingleLine": true}], - "camelcase": 2, - "comma-dangle": [2, "never"], - "comma-spacing": 2, - "computed-property-spacing": [2, "never"], - "dot-notation": [2, { "allowKeywords": false }], - "eol-last": 2, - "eqeqeq": [2, "smart"], - "indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": 2}], - "key-spacing": 1, - "keyword-spacing": [2, { "after": true }], - "linebreak-style": 2, - "max-depth": [1, 4], - "max-params": [1, 5], - "new-cap": [2, {"newIsCapExceptions": ["model"]}], - "no-alert": 2, - "no-caller": 2, - "no-catch-shadow": 2, - "no-console": 2, - "no-debugger": 2, - "no-delete-var": 2, - "no-div-regex": 1, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-else-return": 1, - "no-empty-character-class": 2, - "no-eval": 2, - "no-ex-assign": 2, - "no-extend-native": 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-implied-eval": 2, - "no-inner-declarations": 2, - "no-irregular-whitespace": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-lonely-if": 2, - "no-multi-str": 2, - "no-native-reassign": 2, - "no-negated-in-lhs": 1, - "no-new-object": 2, - "no-new-wrappers": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-proto": 2, - "no-redeclare": 2, - "no-shadow": 2, - "no-spaced-func": 2, - "no-throw-literal": 2, - "no-trailing-spaces": 2, - "no-undef": 2, - "no-undef-init": 2, - "no-undefined": 2, - "no-unneeded-ternary": 2, - "no-unreachable": 2, - "no-unused-expressions": [2, {"allowTernary": true, "allowShortCircuit": true}], - "no-with": 2, - "object-curly-spacing": [2, "never"], - "quote-props": [1, "consistent-as-needed"], - "quotes": [2, "single", "avoid-escape"], - "radix": 2, - "semi": 2, - "space-before-function-paren": [2, {"anonymous": "never", "named": "never"}], - "space-infix-ops": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "use-isnan": 2, - "valid-typeof": 2, - "wrap-iife": [2, "inside"] - } -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..88e2ae2b8 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,76 @@ +{ + "extends": ["prettier", "plugin:prettier/recommended"], + "plugins": ["prettier"], + "parser": "babel-eslint", + "parserOptions": { + "ecmaVersion": 2015, + "sourceType": "module" + }, + "env": { + "browser": true, + "node": true + }, + "globals": { + "Promise": false + }, + "rules": { + "prettier/prettier": "error", + + "block-scoped-var": "error", + "camelcase": "error", + "dot-notation": ["error", { "allowKeywords": false }], + "eqeqeq": ["error", "smart"], + "max-depth": ["warn", 4], + "max-params": ["warn", 5], + "new-cap": ["error", {"newIsCapExceptions": ["model"]}], + "no-alert": "error", + "no-caller": "error", + "no-catch-shadow": "error", + "no-console": "error", + "no-debugger": "error", + "no-delete-var": "error", + "no-div-regex": "warn", + "no-dupe-args": "error", + "no-dupe-keys": "error", + "no-duplicate-case": "error", + "no-else-return": "warn", + "no-empty-character-class": "error", + "no-eval": "error", + "no-ex-assign": "error", + "no-extend-native": "error", + "no-extra-boolean-cast": "error", + "no-fallthrough": "error", + "no-func-assign": "error", + "no-implied-eval": "error", + "no-inner-declarations": "error", + "no-irregular-whitespace": "error", + "no-label-var": "error", + "no-labels": "error", + "no-lone-blocks": "error", + "no-lonely-if": "error", + "no-multi-str": "error", + "no-native-reassign": "error", + "no-negated-in-lhs": "warn", + "no-new-object": "error", + "no-new-wrappers": "error", + "no-obj-calls": "error", + "no-octal": "error", + "no-octal-escape": "error", + "no-proto": "error", + "no-redeclare": "error", + "no-shadow": "error", + "no-spaced-func": "error", + "no-throw-literal": "error", + "no-undef": "error", + "no-undef-init": "error", + "no-unneeded-ternary": "error", + "no-unreachable": "error", + "no-unused-expressions": ["error", {"allowTernary": true, "allowShortCircuit": true}], + "no-var": "error", + "no-with": "error", + "prefer-const": "error", + "radix": "error", + "use-isnan": "error", + "valid-typeof": "error" + } +} diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..503a33a6d --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +"@mixmaxhq/prettier-config" diff --git a/.travis.yml b/.travis.yml index 5615d5d1e..520c46f53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,3 @@ script: notifications: email: false sudo: false -env: - global: - - NPM_CONFIG_PROGRESS="false" - - secure: G9oDQUXytNHni0wasGDXO3lQE/xuP9gd6VZ20kuh5FzVlqfY5L7JfYWki435nZ1z2yPD1QVAZi+1BCmCwnkTLVO9gB7cmDJDt1VzeHdCSOqCXGDAbOcq67/OO4FUa77sCQSDnqOOGVbiUPldaDl8G6uylk72Ll8b0pPwUWdRCM8= - - secure: dniSzTSxXzaSGYjW3+LiNesx/BtTWo6RHuMKm19MwNo/YJYJJ/1YSEH/9vCmlVzc00CqvJ5Khwu9XPzcDV4gkuNQFN1+QcgGI2heVUqac/jqlGF39VEH8Xc+H40MsRLkwgSIkadIPWj4wBbbzqyC9M+J/KjUPOhBXGtp+FARu0I= diff --git a/CNAME b/CNAME deleted file mode 100644 index 706ffc0a0..000000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -backbonejs.org \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 55403616b..3920f7d51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,22 +1,13 @@ ## How to Open a Backbone.js Ticket -* Do not use tickets to ask for help with (debugging) your application. Ask on -the [mailing list](https://groups.google.com/forum/#!forum/backbonejs), -in the IRC channel (`#documentcloud` on Freenode), or if you understand your -specific problem, on [StackOverflow](http://stackoverflow.com/questions/tagged/backbone.js). +- Before you open a ticket or send a pull request, + [search](https://github.com/mixmaxhq/boddle/issues) for previous discussions + about the same feature or issue. Add to the earlier ticket if you find one. -* Before you open a ticket or send a pull request, -[search](https://github.com/jashkenas/backbone/issues) for previous -discussions about the same feature or issue. Add to the earlier ticket if you -find one. +- Before sending a pull request for a feature or bug fix, be sure to have + [tests](http://backbonejs.org/test/). -* Before sending a pull request for a feature or bug fix, be sure to have -[tests](http://backbonejs.org/test/). +- Use the same coding style as the rest of the + [codebase](https://github.com/mixmaxhq/boddle/blob/master/backbone.js). -* Use the same coding style as the rest of the -[codebase](https://github.com/jashkenas/backbone/blob/master/backbone.js). - -* In your pull request, do not add documentation or rebuild the minified -`backbone-min.js` file. We'll do that before cutting a new release. - -* All pull requests should be made to the `master` branch. +- All pull requests should be made to the `master` branch. diff --git a/LICENSE b/LICENSE index 911822491..9bc9c5dbf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,7 @@ Copyright (c) 2010-2019 Jeremy Ashkenas, DocumentCloud +Copyright (C) 2020 Mixmax, Inc + 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 diff --git a/README.md b/README.md index 276b7fc3e..0bc01ac34 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,20 @@ - ____ __ __ - /\ _`\ /\ \ /\ \ __ - \ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____ - \ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\ - \ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\ - \ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/ - \/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/ - \ \____/ - \/___/ - (_'_______________________________________________________________________________'_) - (_.———————————————————————————————————————————————————————————————————————————————._) +# boddle - -Backbone supplies structure to JavaScript-heavy applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface. - -For Docs, License, Tests, pre-packed downloads, and everything else, really, see: -http://backbonejs.org +Backbone-inspired data layer, aiming at majority API compatibility with modern promises and no +underscore/jquery dependency. To suggest a feature or report a bug: -https://github.com/jashkenas/backbone/issues - -For questions on working with Backbone or general discussions: -https://groups.google.com/forum/#!forum/backbonejs, -http://stackoverflow.com/questions/tagged/backbone.js, or -https://gitter.im/jashkenas/backbone +https://github.com/mixmaxh/boddle/issues -Backbone is an open-sourced component of DocumentCloud: -https://github.com/documentcloud - -Many thanks to our contributors: +Many thanks to Backbone's contributors: https://github.com/jashkenas/backbone/graphs/contributors -Special thanks to Robert Kieffer for the original philosophy behind Backbone. +Special thanks to Robert Kieffer for the original philosophy behind Backbone (and, indirectly, +boddle). https://github.com/broofa + +## install + +```sh +$ npm i -P boddle +``` diff --git a/bower.json b/bower.json deleted file mode 100644 index 89e688695..000000000 --- a/bower.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name" : "backbone", - "main" : "backbone.js", - "dependencies" : { - "underscore" : ">=1.8.3" - }, - "ignore" : ["docs", "examples", "test", "*.yml", "*.html", "*.ico", "*.md", "CNAME", ".*", "karma.*", "package.json"] -} diff --git a/package.json b/package.json index 638241cd7..f43e3fcee 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,11 @@ { - "name": "backbone", - "description": "Give your JS App some Backbone with Models, Views, Collections, and Events.", - "url": "http://backbonejs.org", + "name": "boddle", + "description": "Backbone-inspired data layer, aiming at majority API compatibility with modern promises and no underscore/jquery dependency.", + "url": "https://github.com/mixmaxhq/boddle", "keywords": [ + "backbone", "model", - "view", - "controller", - "router", - "server", + "collection", "client", "browser" ], @@ -30,14 +28,14 @@ "test": "karma start && coffee test/model.coffee && npm run lint", "build": "uglifyjs backbone.js --mangle --source-map backbone-min.map -o backbone-min.js", "doc": "docco backbone.js && docco examples/todos/todos.js examples/backbone.localStorage.js", - "lint": "eslint backbone.js test/*.js" + "lint": "eslint ." }, "main": "backbone.js", - "version": "1.4.0", + "version": "2.0.0", "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/jashkenas/backbone.git" + "url": "https://github.com/mixmaxhq/boddle.git" }, "files": [ "backbone.js",