webpack_rails 0.3.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webpack_rails/ErrorMessagePlugin.js +37 -0
- data/lib/webpack_rails/engine.rb +6 -5
- data/lib/webpack_rails/node_modules/cors/CONTRIBUTING.md +35 -0
- data/lib/webpack_rails/node_modules/cors/LICENSE +9 -0
- data/lib/webpack_rails/node_modules/cors/README.md +192 -0
- data/lib/webpack_rails/node_modules/cors/lib/index.js +242 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/HISTORY.md +29 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/index.js +124 -0
- data/lib/webpack_rails/node_modules/cors/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/cors/package.json +79 -0
- data/lib/webpack_rails/node_modules/cors/test/basic-auth.js +40 -0
- data/lib/webpack_rails/node_modules/cors/test/body-events.js +81 -0
- data/lib/webpack_rails/node_modules/cors/test/cors.js +652 -0
- data/lib/webpack_rails/node_modules/cors/test/error-response.js +77 -0
- data/lib/webpack_rails/node_modules/cors/test/example-app.js +98 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-2.js +56 -0
- data/lib/webpack_rails/node_modules/cors/test/issue-31.js +58 -0
- data/lib/webpack_rails/node_modules/cors/test/mocha.opts +3 -0
- data/lib/webpack_rails/node_modules/express/History.md +3025 -0
- data/lib/webpack_rails/node_modules/express/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/Readme.md +138 -0
- data/lib/webpack_rails/node_modules/express/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/lib/application.js +643 -0
- data/lib/webpack_rails/node_modules/express/lib/express.js +103 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/init.js +36 -0
- data/lib/webpack_rails/node_modules/express/lib/middleware/query.js +51 -0
- data/lib/webpack_rails/node_modules/express/lib/request.js +489 -0
- data/lib/webpack_rails/node_modules/express/lib/response.js +1053 -0
- data/lib/webpack_rails/node_modules/express/lib/router/index.js +645 -0
- data/lib/webpack_rails/node_modules/express/lib/router/layer.js +176 -0
- data/lib/webpack_rails/node_modules/express/lib/router/route.js +210 -0
- data/lib/webpack_rails/node_modules/express/lib/utils.js +300 -0
- data/lib/webpack_rails/node_modules/express/lib/view.js +173 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/HISTORY.md +170 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/README.md +135 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/index.js +231 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/README.md +203 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/charset.js +102 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/encoding.js +118 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/language.js +112 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js +179 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/package.json +86 -0
- data/lib/webpack_rails/node_modules/express/node_modules/accepts/package.json +98 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/array-flatten.js +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/package.json +62 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/HISTORY.md +40 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/README.md +141 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/index.js +443 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/HISTORY.md +9 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/README.md +92 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/index.js +214 -0
- data/lib/webpack_rails/node_modules/express/node_modules/content-type/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/README.md +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/index.js +116 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie/package.json +68 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/History.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/Readme.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/index.js +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/History.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Makefile +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/Readme.md +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/bower.json +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/browser.js +168 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/component.json +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/debug.js +197 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node.js +209 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/debug/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/History.md +75 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/Readme.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/index.js +529 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js +33 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js +101 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/depd/package.json +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/index.js +29 -0
- data/lib/webpack_rails/node_modules/express/node_modules/escape-html/package.json +51 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/HISTORY.md +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/README.md +165 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/index.js +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/etag/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/HISTORY.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/README.md +133 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/index.js +151 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/README.md +43 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/index.js +69 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/package.json +59 -0
- data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/package.json +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/HISTORY.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/README.md +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/fresh/package.json +87 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/index.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/package.json +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/HISTORY.md +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/README.md +41 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/index.js +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/methods/package.json +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/HISTORY.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/README.md +154 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/index.js +196 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/README.md +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/index.js +95 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/package.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/on-finished/package.json +71 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/HISTORY.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/LICENSE +24 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/README.md +107 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/index.js +136 -0
- data/lib/webpack_rails/node_modules/express/node_modules/parseurl/package.json +80 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/History.md +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/Readme.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/index.js +129 -0
- data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/package.json +184 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/HISTORY.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/README.md +137 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/index.js +345 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/HISTORY.md +4 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md +53 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/index.js +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/package.json +65 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/Cakefile +18 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/README.md +161 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +439 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/package.json +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/src/ipaddr.coffee +374 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/test/ipaddr.test.coffee +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/package.json +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CHANGELOG.md +88 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/CONTRIBUTING.md +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/LICENSE +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/README.md +317 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/bower.json +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/index.js +15 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/parse.js +186 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/stringify.js +121 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/utils.js +190 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/package.json +56 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/parse.js +478 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/stringify.js +259 -0
- data/lib/webpack_rails/node_modules/express/node_modules/qs/test/utils.js +28 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/HISTORY.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/README.md +48 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/index.js +49 -0
- data/lib/webpack_rails/node_modules/express/node_modules/range-parser/package.json +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/HISTORY.md +295 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/README.md +195 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/index.js +820 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/README.md +38 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/index.js +36 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/package.json +67 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/HISTORY.md +76 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/README.md +63 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/index.js +120 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/LICENSE +16 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/README.md +42 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits_browser.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/package.json +50 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/package.json +85 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/README.md +90 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/build.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/test.js +57 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/cli.js +8 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/mime.js +108 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/package.json +73 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/types.json +1 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/History.md +66 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/README.md +35 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/index.js +125 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/package.json +47 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/README.md +114 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/codes.json +64 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/index.js +60 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/send/package.json +89 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/HISTORY.md +284 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/LICENSE +25 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/README.md +235 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/index.js +187 -0
- data/lib/webpack_rails/node_modules/express/node_modules/serve-static/package.json +83 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/HISTORY.md +180 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/README.md +132 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/index.js +262 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/HISTORY.md +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/README.md +81 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/index.js +270 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/HISTORY.md +171 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/LICENSE +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/README.md +103 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/index.js +188 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/package.json +84 -0
- data/lib/webpack_rails/node_modules/express/node_modules/type-is/package.json +93 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/LICENSE +20 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/README.md +34 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/index.js +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/package.json +58 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/HISTORY.md +23 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/README.md +91 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/index.js +117 -0
- data/lib/webpack_rails/node_modules/express/node_modules/vary/package.json +72 -0
- data/lib/webpack_rails/node_modules/express/package.json +167 -0
- data/lib/webpack_rails/node_modules/is-array/History.md +11 -0
- data/lib/webpack_rails/node_modules/is-array/Makefile +11 -0
- data/lib/webpack_rails/node_modules/is-array/Readme.md +27 -0
- data/lib/webpack_rails/node_modules/is-array/component.json +13 -0
- data/lib/webpack_rails/node_modules/is-array/index.js +33 -0
- data/lib/webpack_rails/node_modules/is-array/package.json +41 -0
- data/lib/webpack_rails/node_modules/is-array/test/test.html +46 -0
- data/lib/webpack_rails/node_modules/is-object/LICENSE +19 -0
- data/lib/webpack_rails/node_modules/is-object/README.md +55 -0
- data/lib/webpack_rails/node_modules/is-object/index.js +5 -0
- data/lib/webpack_rails/node_modules/is-object/package.json +91 -0
- data/lib/webpack_rails/node_modules/is-object/test/index.js +23 -0
- data/lib/webpack_rails/node_modules/is-string/CHANGELOG.md +19 -0
- data/lib/webpack_rails/node_modules/is-string/LICENSE +22 -0
- data/lib/webpack_rails/node_modules/is-string/Makefile +61 -0
- data/lib/webpack_rails/node_modules/is-string/README.md +57 -0
- data/lib/webpack_rails/node_modules/is-string/index.js +20 -0
- data/lib/webpack_rails/node_modules/is-string/package.json +93 -0
- data/lib/webpack_rails/node_modules/is-string/test.js +36 -0
- data/lib/webpack_rails/node_modules/js-string-escape/CHANGELOG.md +9 -0
- data/lib/webpack_rails/node_modules/js-string-escape/LICENSE +21 -0
- data/lib/webpack_rails/node_modules/js-string-escape/README.md +44 -0
- data/lib/webpack_rails/node_modules/js-string-escape/index.js +22 -0
- data/lib/webpack_rails/node_modules/js-string-escape/package.json +63 -0
- data/lib/webpack_rails/node_modules/js-string-escape/test/test.js +43 -0
- data/lib/webpack_rails/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/strip-ansi/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +31 -0
- data/lib/webpack_rails/node_modules/strip-ansi/package.json +85 -0
- data/lib/webpack_rails/node_modules/strip-ansi/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/README.md +109 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client-overlay.js +35 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/client.js +131 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/README.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/client.js +30 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/index.html +18 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/package.json +14 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/server.js +41 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/webpack.config.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/helpers.js +8 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/middleware.js +83 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/History.md +20 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/License.md +19 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/Readme.md +15 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/decode.js +80 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/encode.js +64 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/package.json +96 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/common-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/index.js +210 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/tap-index.js +3 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/cli.js +47 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js +6 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +33 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/package.json +89 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/readme.md +43 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/package.json +58 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/process-update.js +105 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/client-test.js +81 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/helpers-test.js +22 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/middleware-test.js +188 -0
- data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/mocha.opts +1 -0
- data/lib/webpack_rails/node_modules/xtend/LICENCE +19 -0
- data/lib/webpack_rails/node_modules/xtend/Makefile +4 -0
- data/lib/webpack_rails/node_modules/xtend/README.md +32 -0
- data/lib/webpack_rails/node_modules/xtend/immutable.js +17 -0
- data/lib/webpack_rails/node_modules/xtend/mutable.js +15 -0
- data/lib/webpack_rails/node_modules/xtend/package.json +88 -0
- data/lib/webpack_rails/node_modules/xtend/test.js +63 -0
- data/lib/webpack_rails/package.json +22 -0
- data/lib/webpack_rails/processor.rb +28 -9
- data/lib/webpack_rails/require_directive_processor.rb +51 -0
- data/lib/webpack_rails/sprockets_environment.rb +45 -0
- data/lib/webpack_rails/task.rb +51 -22
- data/lib/webpack_rails/webpack-task-dev-server.js +122 -0
- data/lib/webpack_rails/{webpack-task.js → webpack-task-watch.js} +0 -0
- data/lib/webpack_rails/webpack.rake +5 -5
- data/lib/webpack_rails.rb +1 -3
- metadata +346 -5
- data/lib/webpack_rails/sprockets_base_webpack.rb +0 -14
- data/lib/webpack_rails/sprockets_index_webpack.rb +0 -15
@@ -0,0 +1,529 @@
|
|
1
|
+
/*!
|
2
|
+
* depd
|
3
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Module dependencies.
|
9
|
+
*/
|
10
|
+
|
11
|
+
var callSiteToString = require('./lib/compat').callSiteToString
|
12
|
+
var EventEmitter = require('events').EventEmitter
|
13
|
+
var relative = require('path').relative
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Module exports.
|
17
|
+
*/
|
18
|
+
|
19
|
+
module.exports = depd
|
20
|
+
|
21
|
+
/**
|
22
|
+
* Get the path to base files on.
|
23
|
+
*/
|
24
|
+
|
25
|
+
var basePath = process.cwd()
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Get listener count on event emitter.
|
29
|
+
*/
|
30
|
+
|
31
|
+
/*istanbul ignore next*/
|
32
|
+
var eventListenerCount = EventEmitter.listenerCount
|
33
|
+
|| function (emitter, type) { return emitter.listeners(type).length }
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Determine if namespace is contained in the string.
|
37
|
+
*/
|
38
|
+
|
39
|
+
function containsNamespace(str, namespace) {
|
40
|
+
var val = str.split(/[ ,]+/)
|
41
|
+
|
42
|
+
namespace = String(namespace).toLowerCase()
|
43
|
+
|
44
|
+
for (var i = 0 ; i < val.length; i++) {
|
45
|
+
if (!(str = val[i])) continue;
|
46
|
+
|
47
|
+
// namespace contained
|
48
|
+
if (str === '*' || str.toLowerCase() === namespace) {
|
49
|
+
return true
|
50
|
+
}
|
51
|
+
}
|
52
|
+
|
53
|
+
return false
|
54
|
+
}
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Convert a data descriptor to accessor descriptor.
|
58
|
+
*/
|
59
|
+
|
60
|
+
function convertDataDescriptorToAccessor(obj, prop, message) {
|
61
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
62
|
+
var value = descriptor.value
|
63
|
+
|
64
|
+
descriptor.get = function getter() { return value }
|
65
|
+
|
66
|
+
if (descriptor.writable) {
|
67
|
+
descriptor.set = function setter(val) { return value = val }
|
68
|
+
}
|
69
|
+
|
70
|
+
delete descriptor.value
|
71
|
+
delete descriptor.writable
|
72
|
+
|
73
|
+
Object.defineProperty(obj, prop, descriptor)
|
74
|
+
|
75
|
+
return descriptor
|
76
|
+
}
|
77
|
+
|
78
|
+
/**
|
79
|
+
* Create arguments string to keep arity.
|
80
|
+
*/
|
81
|
+
|
82
|
+
function createArgumentsString(arity) {
|
83
|
+
var str = ''
|
84
|
+
|
85
|
+
for (var i = 0; i < arity; i++) {
|
86
|
+
str += ', arg' + i
|
87
|
+
}
|
88
|
+
|
89
|
+
return str.substr(2)
|
90
|
+
}
|
91
|
+
|
92
|
+
/**
|
93
|
+
* Create stack string from stack.
|
94
|
+
*/
|
95
|
+
|
96
|
+
function createStackString(stack) {
|
97
|
+
var str = this.name + ': ' + this.namespace
|
98
|
+
|
99
|
+
if (this.message) {
|
100
|
+
str += ' deprecated ' + this.message
|
101
|
+
}
|
102
|
+
|
103
|
+
for (var i = 0; i < stack.length; i++) {
|
104
|
+
str += '\n at ' + callSiteToString(stack[i])
|
105
|
+
}
|
106
|
+
|
107
|
+
return str
|
108
|
+
}
|
109
|
+
|
110
|
+
/**
|
111
|
+
* Create deprecate for namespace in caller.
|
112
|
+
*/
|
113
|
+
|
114
|
+
function depd(namespace) {
|
115
|
+
if (!namespace) {
|
116
|
+
throw new TypeError('argument namespace is required')
|
117
|
+
}
|
118
|
+
|
119
|
+
var stack = getStack()
|
120
|
+
var site = callSiteLocation(stack[1])
|
121
|
+
var file = site[0]
|
122
|
+
|
123
|
+
function deprecate(message) {
|
124
|
+
// call to self as log
|
125
|
+
log.call(deprecate, message)
|
126
|
+
}
|
127
|
+
|
128
|
+
deprecate._file = file
|
129
|
+
deprecate._ignored = isignored(namespace)
|
130
|
+
deprecate._namespace = namespace
|
131
|
+
deprecate._traced = istraced(namespace)
|
132
|
+
deprecate._warned = Object.create(null)
|
133
|
+
|
134
|
+
deprecate.function = wrapfunction
|
135
|
+
deprecate.property = wrapproperty
|
136
|
+
|
137
|
+
return deprecate
|
138
|
+
}
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Determine if namespace is ignored.
|
142
|
+
*/
|
143
|
+
|
144
|
+
function isignored(namespace) {
|
145
|
+
/* istanbul ignore next: tested in a child processs */
|
146
|
+
if (process.noDeprecation) {
|
147
|
+
// --no-deprecation support
|
148
|
+
return true
|
149
|
+
}
|
150
|
+
|
151
|
+
var str = process.env.NO_DEPRECATION || ''
|
152
|
+
|
153
|
+
// namespace ignored
|
154
|
+
return containsNamespace(str, namespace)
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Determine if namespace is traced.
|
159
|
+
*/
|
160
|
+
|
161
|
+
function istraced(namespace) {
|
162
|
+
/* istanbul ignore next: tested in a child processs */
|
163
|
+
if (process.traceDeprecation) {
|
164
|
+
// --trace-deprecation support
|
165
|
+
return true
|
166
|
+
}
|
167
|
+
|
168
|
+
var str = process.env.TRACE_DEPRECATION || ''
|
169
|
+
|
170
|
+
// namespace traced
|
171
|
+
return containsNamespace(str, namespace)
|
172
|
+
}
|
173
|
+
|
174
|
+
/**
|
175
|
+
* Display deprecation message.
|
176
|
+
*/
|
177
|
+
|
178
|
+
function log(message, site) {
|
179
|
+
var haslisteners = eventListenerCount(process, 'deprecation') !== 0
|
180
|
+
|
181
|
+
// abort early if no destination
|
182
|
+
if (!haslisteners && this._ignored) {
|
183
|
+
return
|
184
|
+
}
|
185
|
+
|
186
|
+
var caller
|
187
|
+
var callFile
|
188
|
+
var callSite
|
189
|
+
var i = 0
|
190
|
+
var seen = false
|
191
|
+
var stack = getStack()
|
192
|
+
var file = this._file
|
193
|
+
|
194
|
+
if (site) {
|
195
|
+
// provided site
|
196
|
+
callSite = callSiteLocation(stack[1])
|
197
|
+
callSite.name = site.name
|
198
|
+
file = callSite[0]
|
199
|
+
} else {
|
200
|
+
// get call site
|
201
|
+
i = 2
|
202
|
+
site = callSiteLocation(stack[i])
|
203
|
+
callSite = site
|
204
|
+
}
|
205
|
+
|
206
|
+
// get caller of deprecated thing in relation to file
|
207
|
+
for (; i < stack.length; i++) {
|
208
|
+
caller = callSiteLocation(stack[i])
|
209
|
+
callFile = caller[0]
|
210
|
+
|
211
|
+
if (callFile === file) {
|
212
|
+
seen = true
|
213
|
+
} else if (callFile === this._file) {
|
214
|
+
file = this._file
|
215
|
+
} else if (seen) {
|
216
|
+
break
|
217
|
+
}
|
218
|
+
}
|
219
|
+
|
220
|
+
var key = caller
|
221
|
+
? site.join(':') + '__' + caller.join(':')
|
222
|
+
: undefined
|
223
|
+
|
224
|
+
if (key !== undefined && key in this._warned) {
|
225
|
+
// already warned
|
226
|
+
return
|
227
|
+
}
|
228
|
+
|
229
|
+
this._warned[key] = true
|
230
|
+
|
231
|
+
// generate automatic message from call site
|
232
|
+
if (!message) {
|
233
|
+
message = callSite === site || !callSite.name
|
234
|
+
? defaultMessage(site)
|
235
|
+
: defaultMessage(callSite)
|
236
|
+
}
|
237
|
+
|
238
|
+
// emit deprecation if listeners exist
|
239
|
+
if (haslisteners) {
|
240
|
+
var err = DeprecationError(this._namespace, message, stack.slice(i))
|
241
|
+
process.emit('deprecation', err)
|
242
|
+
return
|
243
|
+
}
|
244
|
+
|
245
|
+
// format and write message
|
246
|
+
var format = process.stderr.isTTY
|
247
|
+
? formatColor
|
248
|
+
: formatPlain
|
249
|
+
var msg = format.call(this, message, caller, stack.slice(i))
|
250
|
+
process.stderr.write(msg + '\n', 'utf8')
|
251
|
+
|
252
|
+
return
|
253
|
+
}
|
254
|
+
|
255
|
+
/**
|
256
|
+
* Get call site location as array.
|
257
|
+
*/
|
258
|
+
|
259
|
+
function callSiteLocation(callSite) {
|
260
|
+
var file = callSite.getFileName() || '<anonymous>'
|
261
|
+
var line = callSite.getLineNumber()
|
262
|
+
var colm = callSite.getColumnNumber()
|
263
|
+
|
264
|
+
if (callSite.isEval()) {
|
265
|
+
file = callSite.getEvalOrigin() + ', ' + file
|
266
|
+
}
|
267
|
+
|
268
|
+
var site = [file, line, colm]
|
269
|
+
|
270
|
+
site.callSite = callSite
|
271
|
+
site.name = callSite.getFunctionName()
|
272
|
+
|
273
|
+
return site
|
274
|
+
}
|
275
|
+
|
276
|
+
/**
|
277
|
+
* Generate a default message from the site.
|
278
|
+
*/
|
279
|
+
|
280
|
+
function defaultMessage(site) {
|
281
|
+
var callSite = site.callSite
|
282
|
+
var funcName = site.name
|
283
|
+
|
284
|
+
// make useful anonymous name
|
285
|
+
if (!funcName) {
|
286
|
+
funcName = '<anonymous@' + formatLocation(site) + '>'
|
287
|
+
}
|
288
|
+
|
289
|
+
var context = callSite.getThis()
|
290
|
+
var typeName = context && callSite.getTypeName()
|
291
|
+
|
292
|
+
// ignore useless type name
|
293
|
+
if (typeName === 'Object') {
|
294
|
+
typeName = undefined
|
295
|
+
}
|
296
|
+
|
297
|
+
// make useful type name
|
298
|
+
if (typeName === 'Function') {
|
299
|
+
typeName = context.name || typeName
|
300
|
+
}
|
301
|
+
|
302
|
+
return typeName && callSite.getMethodName()
|
303
|
+
? typeName + '.' + funcName
|
304
|
+
: funcName
|
305
|
+
}
|
306
|
+
|
307
|
+
/**
|
308
|
+
* Format deprecation message without color.
|
309
|
+
*/
|
310
|
+
|
311
|
+
function formatPlain(msg, caller, stack) {
|
312
|
+
var timestamp = new Date().toUTCString()
|
313
|
+
|
314
|
+
var formatted = timestamp
|
315
|
+
+ ' ' + this._namespace
|
316
|
+
+ ' deprecated ' + msg
|
317
|
+
|
318
|
+
// add stack trace
|
319
|
+
if (this._traced) {
|
320
|
+
for (var i = 0; i < stack.length; i++) {
|
321
|
+
formatted += '\n at ' + callSiteToString(stack[i])
|
322
|
+
}
|
323
|
+
|
324
|
+
return formatted
|
325
|
+
}
|
326
|
+
|
327
|
+
if (caller) {
|
328
|
+
formatted += ' at ' + formatLocation(caller)
|
329
|
+
}
|
330
|
+
|
331
|
+
return formatted
|
332
|
+
}
|
333
|
+
|
334
|
+
/**
|
335
|
+
* Format deprecation message with color.
|
336
|
+
*/
|
337
|
+
|
338
|
+
function formatColor(msg, caller, stack) {
|
339
|
+
var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' // bold cyan
|
340
|
+
+ ' \x1b[33;1mdeprecated\x1b[22;39m' // bold yellow
|
341
|
+
+ ' \x1b[0m' + msg + '\x1b[39m' // reset
|
342
|
+
|
343
|
+
// add stack trace
|
344
|
+
if (this._traced) {
|
345
|
+
for (var i = 0; i < stack.length; i++) {
|
346
|
+
formatted += '\n \x1b[36mat ' + callSiteToString(stack[i]) + '\x1b[39m' // cyan
|
347
|
+
}
|
348
|
+
|
349
|
+
return formatted
|
350
|
+
}
|
351
|
+
|
352
|
+
if (caller) {
|
353
|
+
formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m' // cyan
|
354
|
+
}
|
355
|
+
|
356
|
+
return formatted
|
357
|
+
}
|
358
|
+
|
359
|
+
/**
|
360
|
+
* Format call site location.
|
361
|
+
*/
|
362
|
+
|
363
|
+
function formatLocation(callSite) {
|
364
|
+
return relative(basePath, callSite[0])
|
365
|
+
+ ':' + callSite[1]
|
366
|
+
+ ':' + callSite[2]
|
367
|
+
}
|
368
|
+
|
369
|
+
/**
|
370
|
+
* Get the stack as array of call sites.
|
371
|
+
*/
|
372
|
+
|
373
|
+
function getStack() {
|
374
|
+
var limit = Error.stackTraceLimit
|
375
|
+
var obj = {}
|
376
|
+
var prep = Error.prepareStackTrace
|
377
|
+
|
378
|
+
Error.prepareStackTrace = prepareObjectStackTrace
|
379
|
+
Error.stackTraceLimit = Math.max(10, limit)
|
380
|
+
|
381
|
+
// capture the stack
|
382
|
+
Error.captureStackTrace(obj)
|
383
|
+
|
384
|
+
// slice this function off the top
|
385
|
+
var stack = obj.stack.slice(1)
|
386
|
+
|
387
|
+
Error.prepareStackTrace = prep
|
388
|
+
Error.stackTraceLimit = limit
|
389
|
+
|
390
|
+
return stack
|
391
|
+
}
|
392
|
+
|
393
|
+
/**
|
394
|
+
* Capture call site stack from v8.
|
395
|
+
*/
|
396
|
+
|
397
|
+
function prepareObjectStackTrace(obj, stack) {
|
398
|
+
return stack
|
399
|
+
}
|
400
|
+
|
401
|
+
/**
|
402
|
+
* Return a wrapped function in a deprecation message.
|
403
|
+
*/
|
404
|
+
|
405
|
+
function wrapfunction(fn, message) {
|
406
|
+
if (typeof fn !== 'function') {
|
407
|
+
throw new TypeError('argument fn must be a function')
|
408
|
+
}
|
409
|
+
|
410
|
+
var args = createArgumentsString(fn.length)
|
411
|
+
var deprecate = this
|
412
|
+
var stack = getStack()
|
413
|
+
var site = callSiteLocation(stack[1])
|
414
|
+
|
415
|
+
site.name = fn.name
|
416
|
+
|
417
|
+
var deprecatedfn = eval('(function (' + args + ') {\n'
|
418
|
+
+ '"use strict"\n'
|
419
|
+
+ 'log.call(deprecate, message, site)\n'
|
420
|
+
+ 'return fn.apply(this, arguments)\n'
|
421
|
+
+ '})')
|
422
|
+
|
423
|
+
return deprecatedfn
|
424
|
+
}
|
425
|
+
|
426
|
+
/**
|
427
|
+
* Wrap property in a deprecation message.
|
428
|
+
*/
|
429
|
+
|
430
|
+
function wrapproperty(obj, prop, message) {
|
431
|
+
if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
|
432
|
+
throw new TypeError('argument obj must be object')
|
433
|
+
}
|
434
|
+
|
435
|
+
var descriptor = Object.getOwnPropertyDescriptor(obj, prop)
|
436
|
+
|
437
|
+
if (!descriptor) {
|
438
|
+
throw new TypeError('must call property on owner object')
|
439
|
+
}
|
440
|
+
|
441
|
+
if (!descriptor.configurable) {
|
442
|
+
throw new TypeError('property must be configurable')
|
443
|
+
}
|
444
|
+
|
445
|
+
var deprecate = this
|
446
|
+
var stack = getStack()
|
447
|
+
var site = callSiteLocation(stack[1])
|
448
|
+
|
449
|
+
// set site name
|
450
|
+
site.name = prop
|
451
|
+
|
452
|
+
// convert data descriptor
|
453
|
+
if ('value' in descriptor) {
|
454
|
+
descriptor = convertDataDescriptorToAccessor(obj, prop, message)
|
455
|
+
}
|
456
|
+
|
457
|
+
var get = descriptor.get
|
458
|
+
var set = descriptor.set
|
459
|
+
|
460
|
+
// wrap getter
|
461
|
+
if (typeof get === 'function') {
|
462
|
+
descriptor.get = function getter() {
|
463
|
+
log.call(deprecate, message, site)
|
464
|
+
return get.apply(this, arguments)
|
465
|
+
}
|
466
|
+
}
|
467
|
+
|
468
|
+
// wrap setter
|
469
|
+
if (typeof set === 'function') {
|
470
|
+
descriptor.set = function setter() {
|
471
|
+
log.call(deprecate, message, site)
|
472
|
+
return set.apply(this, arguments)
|
473
|
+
}
|
474
|
+
}
|
475
|
+
|
476
|
+
Object.defineProperty(obj, prop, descriptor)
|
477
|
+
}
|
478
|
+
|
479
|
+
/**
|
480
|
+
* Create DeprecationError for deprecation
|
481
|
+
*/
|
482
|
+
|
483
|
+
function DeprecationError(namespace, message, stack) {
|
484
|
+
var error = new Error()
|
485
|
+
var stackString
|
486
|
+
|
487
|
+
Object.defineProperty(error, 'constructor', {
|
488
|
+
value: DeprecationError
|
489
|
+
})
|
490
|
+
|
491
|
+
Object.defineProperty(error, 'message', {
|
492
|
+
configurable: true,
|
493
|
+
enumerable: false,
|
494
|
+
value: message,
|
495
|
+
writable: true
|
496
|
+
})
|
497
|
+
|
498
|
+
Object.defineProperty(error, 'name', {
|
499
|
+
enumerable: false,
|
500
|
+
configurable: true,
|
501
|
+
value: 'DeprecationError',
|
502
|
+
writable: true
|
503
|
+
})
|
504
|
+
|
505
|
+
Object.defineProperty(error, 'namespace', {
|
506
|
+
configurable: true,
|
507
|
+
enumerable: false,
|
508
|
+
value: namespace,
|
509
|
+
writable: true
|
510
|
+
})
|
511
|
+
|
512
|
+
Object.defineProperty(error, 'stack', {
|
513
|
+
configurable: true,
|
514
|
+
enumerable: false,
|
515
|
+
get: function () {
|
516
|
+
if (stackString !== undefined) {
|
517
|
+
return stackString
|
518
|
+
}
|
519
|
+
|
520
|
+
// prepare stack trace
|
521
|
+
return stackString = createStackString.call(this, stack)
|
522
|
+
},
|
523
|
+
set: function setter(val) {
|
524
|
+
stackString = val
|
525
|
+
}
|
526
|
+
})
|
527
|
+
|
528
|
+
return error
|
529
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
/*!
|
2
|
+
* depd
|
3
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Module exports.
|
9
|
+
*/
|
10
|
+
|
11
|
+
module.exports = bufferConcat
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Concatenate an array of Buffers.
|
15
|
+
*/
|
16
|
+
|
17
|
+
function bufferConcat(bufs) {
|
18
|
+
var length = 0
|
19
|
+
|
20
|
+
for (var i = 0, len = bufs.length; i < len; i++) {
|
21
|
+
length += bufs[i].length
|
22
|
+
}
|
23
|
+
|
24
|
+
var buf = new Buffer(length)
|
25
|
+
var pos = 0
|
26
|
+
|
27
|
+
for (var i = 0, len = bufs.length; i < len; i++) {
|
28
|
+
bufs[i].copy(buf, pos)
|
29
|
+
pos += bufs[i].length
|
30
|
+
}
|
31
|
+
|
32
|
+
return buf
|
33
|
+
}
|
@@ -0,0 +1,101 @@
|
|
1
|
+
/*!
|
2
|
+
* depd
|
3
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Module exports.
|
9
|
+
*/
|
10
|
+
|
11
|
+
module.exports = callSiteToString
|
12
|
+
|
13
|
+
/**
|
14
|
+
* Format a CallSite file location to a string.
|
15
|
+
*/
|
16
|
+
|
17
|
+
function callSiteFileLocation(callSite) {
|
18
|
+
var fileName
|
19
|
+
var fileLocation = ''
|
20
|
+
|
21
|
+
if (callSite.isNative()) {
|
22
|
+
fileLocation = 'native'
|
23
|
+
} else if (callSite.isEval()) {
|
24
|
+
fileName = callSite.getScriptNameOrSourceURL()
|
25
|
+
if (!fileName) {
|
26
|
+
fileLocation = callSite.getEvalOrigin()
|
27
|
+
}
|
28
|
+
} else {
|
29
|
+
fileName = callSite.getFileName()
|
30
|
+
}
|
31
|
+
|
32
|
+
if (fileName) {
|
33
|
+
fileLocation += fileName
|
34
|
+
|
35
|
+
var lineNumber = callSite.getLineNumber()
|
36
|
+
if (lineNumber != null) {
|
37
|
+
fileLocation += ':' + lineNumber
|
38
|
+
|
39
|
+
var columnNumber = callSite.getColumnNumber()
|
40
|
+
if (columnNumber) {
|
41
|
+
fileLocation += ':' + columnNumber
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
return fileLocation || 'unknown source'
|
47
|
+
}
|
48
|
+
|
49
|
+
/**
|
50
|
+
* Format a CallSite to a string.
|
51
|
+
*/
|
52
|
+
|
53
|
+
function callSiteToString(callSite) {
|
54
|
+
var addSuffix = true
|
55
|
+
var fileLocation = callSiteFileLocation(callSite)
|
56
|
+
var functionName = callSite.getFunctionName()
|
57
|
+
var isConstructor = callSite.isConstructor()
|
58
|
+
var isMethodCall = !(callSite.isToplevel() || isConstructor)
|
59
|
+
var line = ''
|
60
|
+
|
61
|
+
if (isMethodCall) {
|
62
|
+
var methodName = callSite.getMethodName()
|
63
|
+
var typeName = getConstructorName(callSite)
|
64
|
+
|
65
|
+
if (functionName) {
|
66
|
+
if (typeName && functionName.indexOf(typeName) !== 0) {
|
67
|
+
line += typeName + '.'
|
68
|
+
}
|
69
|
+
|
70
|
+
line += functionName
|
71
|
+
|
72
|
+
if (methodName && functionName.lastIndexOf('.' + methodName) !== functionName.length - methodName.length - 1) {
|
73
|
+
line += ' [as ' + methodName + ']'
|
74
|
+
}
|
75
|
+
} else {
|
76
|
+
line += typeName + '.' + (methodName || '<anonymous>')
|
77
|
+
}
|
78
|
+
} else if (isConstructor) {
|
79
|
+
line += 'new ' + (functionName || '<anonymous>')
|
80
|
+
} else if (functionName) {
|
81
|
+
line += functionName
|
82
|
+
} else {
|
83
|
+
addSuffix = false
|
84
|
+
line += fileLocation
|
85
|
+
}
|
86
|
+
|
87
|
+
if (addSuffix) {
|
88
|
+
line += ' (' + fileLocation + ')'
|
89
|
+
}
|
90
|
+
|
91
|
+
return line
|
92
|
+
}
|
93
|
+
|
94
|
+
/**
|
95
|
+
* Get constructor name of reviver.
|
96
|
+
*/
|
97
|
+
|
98
|
+
function getConstructorName(obj) {
|
99
|
+
var receiver = obj.receiver
|
100
|
+
return (receiver.constructor && receiver.constructor.name) || null
|
101
|
+
}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
/*!
|
2
|
+
* depd
|
3
|
+
* Copyright(c) 2014 Douglas Christopher Wilson
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Module exports.
|
9
|
+
*/
|
10
|
+
|
11
|
+
lazyProperty(module.exports, 'bufferConcat', function bufferConcat() {
|
12
|
+
return Buffer.concat || require('./buffer-concat')
|
13
|
+
})
|
14
|
+
|
15
|
+
lazyProperty(module.exports, 'callSiteToString', function callSiteToString() {
|
16
|
+
var limit = Error.stackTraceLimit
|
17
|
+
var obj = {}
|
18
|
+
var prep = Error.prepareStackTrace
|
19
|
+
|
20
|
+
function prepareObjectStackTrace(obj, stack) {
|
21
|
+
return stack
|
22
|
+
}
|
23
|
+
|
24
|
+
Error.prepareStackTrace = prepareObjectStackTrace
|
25
|
+
Error.stackTraceLimit = 2
|
26
|
+
|
27
|
+
// capture the stack
|
28
|
+
Error.captureStackTrace(obj)
|
29
|
+
|
30
|
+
// slice the stack
|
31
|
+
var stack = obj.stack.slice()
|
32
|
+
|
33
|
+
Error.prepareStackTrace = prep
|
34
|
+
Error.stackTraceLimit = limit
|
35
|
+
|
36
|
+
return stack[0].toString ? toString : require('./callsite-tostring')
|
37
|
+
})
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Define a lazy property.
|
41
|
+
*/
|
42
|
+
|
43
|
+
function lazyProperty(obj, prop, getter) {
|
44
|
+
function get() {
|
45
|
+
var val = getter()
|
46
|
+
|
47
|
+
Object.defineProperty(obj, prop, {
|
48
|
+
configurable: true,
|
49
|
+
enumerable: true,
|
50
|
+
value: val
|
51
|
+
})
|
52
|
+
|
53
|
+
return val
|
54
|
+
}
|
55
|
+
|
56
|
+
Object.defineProperty(obj, prop, {
|
57
|
+
configurable: true,
|
58
|
+
enumerable: true,
|
59
|
+
get: get
|
60
|
+
})
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* Call toString() on the obj
|
65
|
+
*/
|
66
|
+
|
67
|
+
function toString(obj) {
|
68
|
+
return obj.toString()
|
69
|
+
}
|