@currents/cli
Advanced tools
Comparing version 3.1.3 to 4.0.0-aplha.0
#!/usr/bin/env node | ||
const lib = require('../'); | ||
const lib = require("../"); | ||
lib.run().catch((error) => { | ||
lib.spawn().catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
@@ -1,13 +0,15 @@ | ||
export declare function run(): Promise<void>; | ||
/// <reference types="cypress" /> | ||
/** | ||
* Patch Cypress to inject the Currents SDK. | ||
* | ||
* @param cypressPackage - the entry point to the Cypress package. | ||
* Run Cypress via [Module API]{@link https://docs.cypress.io/guides/guides/module-api}, using Currents.dev as cloud orchestration service. | ||
* | ||
* @param config configuration options for Cypress | ||
* @returns Cypress run results | ||
*/ | ||
export declare function patch(cypressPackage?: string): Promise<void>; | ||
export declare function run(config: CypressCommandLine.CypressRunOptions): Promise<any>; | ||
/** | ||
* Reset Cypress to use the original configuration. | ||
* Spawn cypress runner as a child process using [Currents.dev]{@link https://currents.dev} as cloud orchestration service. The child process inherits the all the environment variables and CLI flags | ||
* | ||
* @param cypressPackage - the entry point to the Cypress package. | ||
* @returns child process instance | ||
*/ | ||
export declare function reset(cypressPackage?: string): Promise<void>; | ||
export declare function spawn(): Promise<void>; |
@@ -1,73 +0,1 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _export(target, all) { | ||
for(var name in all)Object.defineProperty(target, name, { | ||
enumerable: true, | ||
get: all[name] | ||
}); | ||
} | ||
_export(exports, { | ||
run: ()=>run, | ||
patch: ()=>patch, | ||
reset: ()=>reset | ||
}); | ||
const _cy2 = require("cy2"); | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | ||
try { | ||
var info = gen[key](arg); | ||
var value = info.value; | ||
} catch (error) { | ||
reject(error); | ||
return; | ||
} | ||
if (info.done) { | ||
resolve(value); | ||
} else { | ||
Promise.resolve(value).then(_next, _throw); | ||
} | ||
} | ||
function _asyncToGenerator(fn) { | ||
return function() { | ||
var self = this, args = arguments; | ||
return new Promise(function(resolve, reject) { | ||
var gen = fn.apply(self, args); | ||
function _next(value) { | ||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); | ||
} | ||
function _throw(err) { | ||
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); | ||
} | ||
_next(undefined); | ||
}); | ||
}; | ||
} | ||
function run() { | ||
return _run.apply(this, arguments); | ||
} | ||
function _run() { | ||
_run = _asyncToGenerator(function*() { | ||
process.env.CYPRESS_API_URL = "https://cy.currents.dev/"; | ||
yield (0, _cy2.run)("currents"); | ||
}); | ||
return _run.apply(this, arguments); | ||
} | ||
function patch() { | ||
return _patch.apply(this, arguments); | ||
} | ||
function _patch() { | ||
_patch = _asyncToGenerator(function*(cypressPackage = require.resolve("cypress")) { | ||
yield (0, _cy2.inject)(`${__dirname}/inject.js`, cypressPackage); | ||
}); | ||
return _patch.apply(this, arguments); | ||
} | ||
function reset() { | ||
return _reset.apply(this, arguments); | ||
} | ||
function _reset() { | ||
_reset = _asyncToGenerator(function*(cypressPackage = require.resolve("cypress")) { | ||
yield (0, _cy2.patch)(cypressPackage); | ||
}); | ||
return _reset.apply(this, arguments); | ||
} | ||
var p=Object.create;var c=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var w=(n,r)=>{for(var s in r)c(n,s,{get:r[s],enumerable:!0})},i=(n,r,s,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of y(r))!f.call(n,t)&&t!==s&&c(n,t,{get:()=>r[t],enumerable:!(a=u(r,t))||a.enumerable});return n};var C=(n,r,s)=>(s=n!=null?p(m(n)):{},i(r||!n||!n.__esModule?c(s,"default",{value:n,enumerable:!0}):s,n)),d=n=>i(c({},"__esModule",{value:!0}),n);var l={};w(l,{run:()=>g,spawn:()=>h});module.exports=d(l);var e=C(require("cy2")),o="https://cy.currents.dev";async function g(n){return await e.run(o,n)}async function h(){return console.log(`[currents] Using orchestration service: ${o}`),e.spawn(o)}0&&(module.exports={run,spawn}); |
{ | ||
"name": "@currents/cli", | ||
"version": "3.1.3", | ||
"version": "4.0.0-aplha.0", | ||
"license": "MIT", | ||
@@ -8,7 +8,7 @@ "main": "./dist", | ||
"author": { | ||
"name": "Currents", | ||
"name": "Currents Software Inc", | ||
"email": "andrew@currents.dev" | ||
}, | ||
"scripts": { | ||
"build": "run-s tsc swc", | ||
"build": "run-s esbuild tsc", | ||
"dev": "run-p watch:*", | ||
@@ -18,5 +18,5 @@ "release": "release-it", | ||
"tsc": "tsc", | ||
"swc": "swc src -d dist", | ||
"esbuild": "esbuild ./src/index.ts --bundle --minify --platform=node --target=node14 --packages=external --outdir=dist", | ||
"watch:tsc": "run-s \"tsc --watch --preserveWatchOutput\"", | ||
"watch:swc": "run-s \"swc --watch\"" | ||
"watch:swc": "run-s \"esbuild --watch\"" | ||
}, | ||
@@ -32,8 +32,12 @@ "repository": { | ||
"bin": { | ||
"currents": "bin/currents.js", | ||
"currents-prepare": "bin/currents-prepare.js", | ||
"currents-reset": "bin/currents-reset.js" | ||
"currents": "bin/currents.js" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"peerDependencies": { | ||
"cypress": ">= 6.7.0" | ||
}, | ||
"dependencies": { | ||
"cy2": "3.4.1" | ||
"cy2": "4.0.0-beta.13" | ||
}, | ||
@@ -69,5 +73,5 @@ "keywords": [ | ||
"@release-it/conventional-changelog": "^5.1.0", | ||
"@swc/cli": "^0.1.49", | ||
"@swc/core": "^1.2.85", | ||
"@types/node": "^18.11.3", | ||
"cypress": "^12.1.0", | ||
"esbuild": "^0.16.9", | ||
"npm-run-all": "^4.1.5", | ||
@@ -74,0 +78,0 @@ "release-it": "^15.4.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
4476
2
5
25
3
+ Added@colors/colors@1.5.0(transitive)
+ Added@cypress/request@3.0.7(transitive)
+ Added@cypress/xvfb@1.2.4(transitive)
+ Added@types/node@22.10.2(transitive)
+ Added@types/sinonjs__fake-timers@8.1.1(transitive)
+ Added@types/sizzle@2.3.9(transitive)
+ Added@types/yauzl@2.10.3(transitive)
+ Addedagent-base@6.0.2(transitive)
+ Addedaggregate-error@3.1.0(transitive)
+ Addedansi-colors@4.1.3(transitive)
+ Addedansi-escapes@4.3.2(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedansi-styles@4.3.0(transitive)
+ Addedarch@2.2.0(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedastral-regex@2.0.0(transitive)
+ Addedasync@3.2.6(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedat-least-node@1.0.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbase64-js@1.5.1(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedblob-util@2.0.2(transitive)
+ Addedbluebird@3.7.2(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedbuffer-crc32@0.2.13(transitive)
+ Addedbuffer-from@1.1.2(transitive)
+ Addedcachedir@2.4.0(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.3(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedchalk@4.1.2(transitive)
+ Addedcheck-more-types@2.24.0(transitive)
+ Addedci-info@4.1.0(transitive)
+ Addedclean-stack@2.2.0(transitive)
+ Addedcli-cursor@3.1.0(transitive)
+ Addedcli-table3@0.6.5(transitive)
+ Addedcli-truncate@2.1.0(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcolorette@2.0.20(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@6.2.1(transitive)
+ Addedcommon-tags@1.8.2(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedcy2@4.0.0-beta.13(transitive)
+ Addedcypress@13.17.0(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddayjs@1.11.13(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedemoji-regex@8.0.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedenquirer@2.4.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedeventemitter2@6.4.7(transitive)
+ Addedeventemitter3@4.0.7(transitive)
+ Addedexeca@4.1.0(transitive)
+ Addedexecutable@4.1.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextract-zip@2.0.1(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfd-slicer@1.1.0(transitive)
+ Addedfigures@3.2.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedfs-extra@9.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedget-stream@5.2.0(transitive)
+ Addedgetos@3.2.1(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglobal-dirs@3.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhas-flag@4.0.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhttp-proxy@1.18.1(transitive)
+ Addedhttp-signature@1.4.0(transitive)
+ Addedhttps-proxy-agent@5.0.1(transitive)
+ Addedhuman-signals@1.1.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedindent-string@4.0.0(transitive)
+ Addedini@2.0.0(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedis-installed-globally@0.4.0(transitive)
+ Addedis-path-inside@3.0.3(transitive)
+ Addedis-stream@2.0.1(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedis-unicode-supported@0.1.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsonfile@6.1.0(transitive)
+ Addedjsprim@2.0.2(transitive)
+ Addedlazy-ass@1.6.0(transitive)
+ Addedlistr2@3.14.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlodash.once@4.1.1(transitive)
+ Addedlog-symbols@4.1.0(transitive)
+ Addedlog-update@4.0.0(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmerge-stream@2.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addednpm-run-path@4.0.1(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedonetime@5.1.2(transitive)
+ Addedospath@1.2.2(transitive)
+ Addedp-map@4.0.0(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpend@1.2.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpretty-bytes@5.6.0(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedproxy-from-env@1.0.0(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedqs@6.13.1(transitive)
+ Addedrequest-progress@3.0.0(transitive)
+ Addedrequires-port@1.0.0(transitive)
+ Addedrestore-cursor@3.1.0(transitive)
+ Addedrfdc@1.4.1(transitive)
+ Addedrxjs@7.8.1(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedside-channel@1.1.0(transitive)
+ Addedside-channel-list@1.0.0(transitive)
+ Addedside-channel-map@1.0.1(transitive)
+ Addedside-channel-weakmap@1.0.2(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedslice-ansi@3.0.04.0.0(transitive)
+ Addedsource-map-support@0.5.21(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring-width@4.2.3(transitive)
+ Addedstrip-ansi@6.0.1(transitive)
+ Addedstrip-final-newline@2.0.0(transitive)
+ Addedsupports-color@7.2.08.1.1(transitive)
+ Addedthrottleit@1.0.1(transitive)
+ Addedthrough@2.3.8(transitive)
+ Addedtldts@6.1.70(transitive)
+ Addedtldts-core@6.1.70(transitive)
+ Addedtmp@0.2.3(transitive)
+ Addedtough-cookie@5.0.0(transitive)
+ Addedtree-kill@1.2.2(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtype-fest@0.21.3(transitive)
+ Addedundici-types@6.20.0(transitive)
+ Addeduniversalify@2.0.1(transitive)
+ Addeduntildify@4.0.0(transitive)
+ Addeduuid@8.3.2(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@6.2.07.0.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyauzl@2.10.0(transitive)
- Removedacorn@8.14.0(transitive)
- Removedargparse@2.0.1(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcy2@3.4.1(transitive)
- Removedescodegen@2.1.0(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@5.3.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedjs-yaml@4.1.0(transitive)
- Removednpm-path@2.0.4(transitive)
- Removednpm-which@3.0.1(transitive)
- Removedslash@3.0.0(transitive)
- Removedwhich@1.3.1(transitive)
Updatedcy2@4.0.0-beta.13