refactor(Cypress): add nodemodules

This commit is contained in:
2021-09-02 17:18:41 +02:00
parent 1aa57bbd0a
commit bc6e1bc12e
4238 changed files with 340975 additions and 8 deletions

2
node_modules/timers-browserify/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,2 @@
.DS_Store
/node_modules

58
node_modules/timers-browserify/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,58 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## 1.4.0 - 2015-02-23
### Added
* Link to `timers-browserify-full`, which offers a larger, but much more exact,
version of Node's `timers` library
### Changed
* `setTimeout` and `setInterval` return objects with the same API as the Node
implementation, instead of just IDs
### Fixed
* `active` implementation actually has an effect, as in Node
* Replaced usages of `apply` that break in IE 8
## 1.3.0 - 2015-02-04
### Changed
* Prefer native versions of `setImmediate` and `clearImmediate` if they exist
## 1.2.0 - 2015-01-02
### Changed
* Update `process` dependency
## 1.1.0 - 2014-08-26
### Added
* `clearImmediate` available to undo `setImmediate`
## 1.0.3 - 2014-06-30
### Fixed
* Resume returning opaque IDs from `setTimeout` and `setInterval`
## 1.0.2 - 2014-06-30
### Fixed
* Pass `window` explicitly to `setTimeout` and others to resolve an error in
Chrome
## 1.0.1 - 2013-12-28
### Changed
* Replaced `setimmediate` dependency with `process` for the `nextTick` shim
## 1.0.0 - 2013-12-10
### Added
* Guard against undefined globals like `setTimeout` in some environments
## 0.0.0 - 2012-05-30
### Added
* Basic functionality for initial release

46
node_modules/timers-browserify/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,46 @@
# timers-browserify
This project uses the [MIT](http://jryans.mit-license.org/) license:
Copyright © 2012 J. Ryan Stinnett <jryans@gmail.com>
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 restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
# lib/node
The `lib/node` directory borrows files from joyent/node which uses the following license:
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
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 restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.

40
node_modules/timers-browserify/README.md generated vendored Normal file
View File

@@ -0,0 +1,40 @@
# Overview
Adds support for the `timers` module to browserify.
## Wait, isn't it already supported in the browser?
The public methods of the `timers` module are:
* `setTimeout(callback, delay, [arg], [...])`
* `clearTimeout(timeoutId)`
* `setInterval(callback, delay, [arg], [...])`
* `clearInterval(intervalId)`
and indeed, browsers support these already.
## So, why does this exist?
The `timers` module also includes some private methods used in other built-in
Node.js modules:
* `enroll(item, delay)`
* `unenroll(item)`
* `active(item)`
These are used to efficiently support a large quantity of timers with the same
timeouts by creating only a few timers under the covers.
Node.js also offers the `immediate` APIs, which aren't yet available cross-browser, so we polyfill those:
* `setImmediate(callback, [arg], [...])`
* `clearImmediate(immediateId)`
## I need lots of timers and want to use linked list timers as Node.js does.
Linked lists are efficient when you have thousands (millions?) of timers with the same delay.
Take a look at [timers-browserify-full](https://www.npmjs.com/package/timers-browserify-full) in this case.
# License
[MIT](http://jryans.mit-license.org/)

3
node_modules/timers-browserify/example/enroll/build.sh generated vendored Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
browserify --debug -o js/browserify.js js/main.js

View File

@@ -0,0 +1,8 @@
<!doctype html>
<html>
<head>
<script type="text/javascript" src="/js/browserify.js"></script>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,233 @@
var require = function (file, cwd) {
var resolved = require.resolve(file, cwd || '/');
var mod = require.modules[resolved];
if (!mod) throw new Error(
'Failed to resolve module ' + file + ', tried ' + resolved
);
var res = mod._cached ? mod._cached : mod();
return res;
}
require.paths = [];
require.modules = {};
require.extensions = [".js",".coffee"];
require._core = {
'assert': true,
'events': true,
'fs': true,
'path': true,
'vm': true
};
require.resolve = (function () {
return function (x, cwd) {
if (!cwd) cwd = '/';
if (require._core[x]) return x;
var path = require.modules.path();
cwd = path.resolve('/', cwd);
var y = cwd || '/';
if (x.match(/^(?:\.\.?\/|\/)/)) {
var m = loadAsFileSync(path.resolve(y, x))
|| loadAsDirectorySync(path.resolve(y, x));
if (m) return m;
}
var n = loadNodeModulesSync(x, y);
if (n) return n;
throw new Error("Cannot find module '" + x + "'");
function loadAsFileSync (x) {
if (require.modules[x]) {
return x;
}
for (var i = 0; i < require.extensions.length; i++) {
var ext = require.extensions[i];
if (require.modules[x + ext]) return x + ext;
}
}
function loadAsDirectorySync (x) {
x = x.replace(/\/+$/, '');
var pkgfile = x + '/package.json';
if (require.modules[pkgfile]) {
var pkg = require.modules[pkgfile]();
var b = pkg.browserify;
if (typeof b === 'object' && b.main) {
var m = loadAsFileSync(path.resolve(x, b.main));
if (m) return m;
}
else if (typeof b === 'string') {
var m = loadAsFileSync(path.resolve(x, b));
if (m) return m;
}
else if (pkg.main) {
var m = loadAsFileSync(path.resolve(x, pkg.main));
if (m) return m;
}
}
return loadAsFileSync(x + '/index');
}
function loadNodeModulesSync (x, start) {
var dirs = nodeModulesPathsSync(start);
for (var i = 0; i < dirs.length; i++) {
var dir = dirs[i];
var m = loadAsFileSync(dir + '/' + x);
if (m) return m;
var n = loadAsDirectorySync(dir + '/' + x);
if (n) return n;
}
var m = loadAsFileSync(x);
if (m) return m;
}
function nodeModulesPathsSync (start) {
var parts;
if (start === '/') parts = [ '' ];
else parts = path.normalize(start).split('/');
var dirs = [];
for (var i = parts.length - 1; i >= 0; i--) {
if (parts[i] === 'node_modules') continue;
var dir = parts.slice(0, i + 1).join('/') + '/node_modules';
dirs.push(dir);
}
return dirs;
}
};
})();
require.alias = function (from, to) {
var path = require.modules.path();
var res = null;
try {
res = require.resolve(from + '/package.json', '/');
}
catch (err) {
res = require.resolve(from, '/');
}
var basedir = path.dirname(res);
var keys = (Object.keys || function (obj) {
var res = [];
for (var key in obj) res.push(key)
return res;
})(require.modules);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key.slice(0, basedir.length + 1) === basedir + '/') {
var f = key.slice(basedir.length);
require.modules[to + f] = require.modules[basedir + f];
}
else if (key === basedir) {
require.modules[to] = require.modules[basedir];
}
}
};
require.define = function (filename, fn) {
var dirname = require._core[filename]
? ''
: require.modules.path().dirname(filename)
;
var require_ = function (file) {
return require(file, dirname)
};
require_.resolve = function (name) {
return require.resolve(name, dirname);
};
require_.modules = require.modules;
require_.define = require.define;
var module_ = { exports : {} };
require.modules[filename] = function () {
require.modules[filename]._cached = module_.exports;
fn.call(
module_.exports,
require_,
module_,
module_.exports,
dirname,
filename
);
require.modules[filename]._cached = module_.exports;
return module_.exports;
};
};
if (typeof process === 'undefined') process = {};
if (!process.nextTick) process.nextTick = (function () {
var queue = [];
var canPost = typeof window !== 'undefined'
&& window.postMessage && window.addEventListener
;
if (canPost) {
window.addEventListener('message', function (ev) {
if (ev.source === window && ev.data === 'browserify-tick') {
ev.stopPropagation();
if (queue.length > 0) {
var fn = queue.shift();
fn();
}
}
}, true);
}
return function (fn) {
if (canPost) {
queue.push(fn);
window.postMessage('browserify-tick', '*');
}
else setTimeout(fn, 0);
};
})();
if (!process.title) process.title = 'browser';
if (!process.binding) process.binding = function (name) {
if (name === 'evals') return require('vm')
else throw new Error('No such module')
};
if (!process.cwd) process.cwd = function () { return '.' };
if (!process.env) process.env = {};
if (!process.argv) process.argv = [];
require.define("path", Function(
[ 'require', 'module', 'exports', '__dirname', '__filename' ],
"function filter (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n if (fn(xs[i], i, xs)) res.push(xs[i]);\n }\n return res;\n}\n\n// resolves . and .. elements in a path array with directory names there\n// must be no slashes, empty elements, or device names (c:\\) in the array\n// (so also no leading and trailing slashes - it does not distinguish\n// relative and absolute paths)\nfunction normalizeArray(parts, allowAboveRoot) {\n // if the path tries to go above the root, `up` ends up > 0\n var up = 0;\n for (var i = parts.length; i >= 0; i--) {\n var last = parts[i];\n if (last == '.') {\n parts.splice(i, 1);\n } else if (last === '..') {\n parts.splice(i, 1);\n up++;\n } else if (up) {\n parts.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (allowAboveRoot) {\n for (; up--; up) {\n parts.unshift('..');\n }\n }\n\n return parts;\n}\n\n// Regex to split a filename into [*, dir, basename, ext]\n// posix version\nvar splitPathRe = /^(.+\\/(?!$)|\\/)?((?:.+?)?(\\.[^.]*)?)$/;\n\n// path.resolve([from ...], to)\n// posix version\nexports.resolve = function() {\nvar resolvedPath = '',\n resolvedAbsolute = false;\n\nfor (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) {\n var path = (i >= 0)\n ? arguments[i]\n : process.cwd();\n\n // Skip empty and invalid entries\n if (typeof path !== 'string' || !path) {\n continue;\n }\n\n resolvedPath = path + '/' + resolvedPath;\n resolvedAbsolute = path.charAt(0) === '/';\n}\n\n// At this point the path should be resolved to a full absolute path, but\n// handle relative paths to be safe (might happen when process.cwd() fails)\n\n// Normalize the path\nresolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {\n return !!p;\n }), !resolvedAbsolute).join('/');\n\n return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';\n};\n\n// path.normalize(path)\n// posix version\nexports.normalize = function(path) {\nvar isAbsolute = path.charAt(0) === '/',\n trailingSlash = path.slice(-1) === '/';\n\n// Normalize the path\npath = normalizeArray(filter(path.split('/'), function(p) {\n return !!p;\n }), !isAbsolute).join('/');\n\n if (!path && !isAbsolute) {\n path = '.';\n }\n if (path && trailingSlash) {\n path += '/';\n }\n \n return (isAbsolute ? '/' : '') + path;\n};\n\n\n// posix version\nexports.join = function() {\n var paths = Array.prototype.slice.call(arguments, 0);\n return exports.normalize(filter(paths, function(p, index) {\n return p && typeof p === 'string';\n }).join('/'));\n};\n\n\nexports.dirname = function(path) {\n var dir = splitPathRe.exec(path)[1] || '';\n var isWindows = false;\n if (!dir) {\n // No dirname\n return '.';\n } else if (dir.length === 1 ||\n (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) {\n // It is just a slash or a drive letter with a slash\n return dir;\n } else {\n // It is a full dirname, strip trailing slash\n return dir.substring(0, dir.length - 1);\n }\n};\n\n\nexports.basename = function(path, ext) {\n var f = splitPathRe.exec(path)[2] || '';\n // TODO: make this comparison case-insensitive on windows?\n if (ext && f.substr(-1 * ext.length) === ext) {\n f = f.substr(0, f.length - ext.length);\n }\n return f;\n};\n\n\nexports.extname = function(path) {\n return splitPathRe.exec(path)[3] || '';\n};\n\n//@ sourceURL=path"
));
require.define("timers", Function(
[ 'require', 'module', 'exports', '__dirname', '__filename' ],
"module.exports = require(\"timers-browserify\")\n//@ sourceURL=timers"
));
require.define("/node_modules/timers-browserify/package.json", Function(
[ 'require', 'module', 'exports', '__dirname', '__filename' ],
"module.exports = {\"main\":\"main.js\"}\n//@ sourceURL=/node_modules/timers-browserify/package.json"
));
require.define("/node_modules/timers-browserify/main.js", Function(
[ 'require', 'module', 'exports', '__dirname', '__filename' ],
"// DOM APIs, for completeness\n\nexports.setTimeout = setTimeout;\nexports.clearTimeout = clearTimeout;\nexports.setInterval = setInterval;\nexports.clearInterval = clearInterval;\n\n// TODO: Change to more effiecient list approach used in Node.js\n// For now, we just implement the APIs using the primitives above.\n\nexports.enroll = function(item, delay) {\n item._timeoutID = setTimeout(item._onTimeout, delay);\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._timeoutID);\n};\n\nexports.active = function(item) {\n // our naive impl doesn't care (correctness is still preserved)\n};\n\n//@ sourceURL=/node_modules/timers-browserify/main.js"
));
require.define("/main.js", Function(
[ 'require', 'module', 'exports', '__dirname', '__filename' ],
"var timers = require('timers');\n\nvar obj = {\n _onTimeout: function() {\n console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms');\n },\n start: function() {\n console.log('Timer should run for 100 ms');\n this.now = new Date().getTime();\n timers.enroll(this, 100);\n }\n};\n\nobj.start();\n\n//@ sourceURL=/main.js"
));
require("/main.js");

View File

@@ -0,0 +1,14 @@
var timers = require('timers');
var obj = {
_onTimeout: function() {
console.log('Timer ran for: ' + (new Date().getTime() - obj.now) + ' ms');
},
start: function() {
console.log('Timer should run for 100 ms');
this.now = new Date().getTime();
timers.enroll(this, 100);
}
};
obj.start();

View File

@@ -0,0 +1,11 @@
var connect = require('connect');
var server = connect.createServer();
server.use(connect.static(__dirname));
var browserify = require('browserify');
var bundle = browserify(__dirname + '/js/main.js', { mount: '/js/browserify.js' });
server.use(bundle);
var port = parseInt(process.argv[2] || 8080, 10);
server.listen(port);
console.log('Listening on :' + port);

76
node_modules/timers-browserify/main.js generated vendored Normal file
View File

@@ -0,0 +1,76 @@
var nextTick = require('process/browser.js').nextTick;
var apply = Function.prototype.apply;
var slice = Array.prototype.slice;
var immediateIds = {};
var nextImmediateId = 0;
// DOM APIs, for completeness
exports.setTimeout = function() {
return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);
};
exports.setInterval = function() {
return new Timeout(apply.call(setInterval, window, arguments), clearInterval);
};
exports.clearTimeout =
exports.clearInterval = function(timeout) { timeout.close(); };
function Timeout(id, clearFn) {
this._id = id;
this._clearFn = clearFn;
}
Timeout.prototype.unref = Timeout.prototype.ref = function() {};
Timeout.prototype.close = function() {
this._clearFn.call(window, this._id);
};
// Does not start the time, just sets up the members needed.
exports.enroll = function(item, msecs) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = msecs;
};
exports.unenroll = function(item) {
clearTimeout(item._idleTimeoutId);
item._idleTimeout = -1;
};
exports._unrefActive = exports.active = function(item) {
clearTimeout(item._idleTimeoutId);
var msecs = item._idleTimeout;
if (msecs >= 0) {
item._idleTimeoutId = setTimeout(function onTimeout() {
if (item._onTimeout)
item._onTimeout();
}, msecs);
}
};
// That's not how node.js implements it but the exposed api is the same.
exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) {
var id = nextImmediateId++;
var args = arguments.length < 2 ? false : slice.call(arguments, 1);
immediateIds[id] = true;
nextTick(function onNextTick() {
if (immediateIds[id]) {
// fn.call() is faster so we optimize for the common use-case
// @see http://jsperf.com/call-apply-segu
if (args) {
fn.apply(null, args);
} else {
fn.call(null);
}
// Prevent ids from leaking
exports.clearImmediate(id);
}
});
return id;
};
exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) {
delete immediateIds[id];
};

103
node_modules/timers-browserify/package.json generated vendored Normal file
View File

@@ -0,0 +1,103 @@
{
"_from": "timers-browserify@^1.0.1",
"_id": "timers-browserify@1.4.2",
"_inBundle": false,
"_integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=",
"_location": "/timers-browserify",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "timers-browserify@^1.0.1",
"name": "timers-browserify",
"escapedName": "timers-browserify",
"rawSpec": "^1.0.1",
"saveSpec": null,
"fetchSpec": "^1.0.1"
},
"_requiredBy": [
"/browserify"
],
"_resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz",
"_shasum": "c9c58b575be8407375cb5e2462dacee74359f41d",
"_spec": "timers-browserify@^1.0.1",
"_where": "/home/simon/Documents/lifen-autotest/node_modules/browserify",
"author": {
"name": "J. Ryan Stinnett",
"email": "jryans@gmail.com",
"url": "http://convolv.es/"
},
"bugs": {
"url": "https://github.com/jryans/timers-browserify/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Guy Bedford",
"email": "guybedford@gmail.com"
},
{
"name": "Ionut-Cristian Florescu",
"email": "ionut.florescu@gmail.com"
},
{
"name": "James Halliday",
"email": "mail@substack.net"
},
{
"name": "Jan Schär",
"email": "jscissr@gmail.com"
},
{
"name": "Johannes Ewald",
"email": "johannes.ewald@peerigon.com"
},
{
"name": "Jonathan Prins",
"email": "jon@blip.tv"
},
{
"name": "Matt Esch",
"email": "matt@mattesch.info"
}
],
"dependencies": {
"process": "~0.11.0"
},
"deprecated": false,
"description": "timers module for browserify",
"devDependencies": {
"browserify": "~1.10.16",
"connect": "~2.3.0"
},
"engines": {
"node": ">=0.6.0"
},
"homepage": "https://github.com/jryans/timers-browserify",
"jspm": {
"map": {
"./main.js": {
"node": "@node/timers"
}
}
},
"keywords": [
"timers",
"browserify",
"browser"
],
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jryans/timers-browserify/blob/master/LICENSE.md"
}
],
"main": "main.js",
"name": "timers-browserify",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git://github.com/jryans/timers-browserify.git"
},
"version": "1.4.2"
}