Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@knapsack-pro/core

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knapsack-pro/core - npm Package Compare versions

Comparing version 5.2.0 to 6.0.0

lib/ci-providers/unsupported-ci.js

14

lib/ci-providers/appveyor.js

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(AppVeyor, "detect", {
get: function () {
return 'APPVEYOR' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(AppVeyor, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return AppVeyor;
}(_1.CIProviderBase));
exports.AppVeyor = AppVeyor;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(Buildkite, "detect", {
get: function () {
return 'BUILDKITE' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Buildkite, "fixedQueueSplit", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
return Buildkite;
}(_1.CIProviderBase));
exports.Buildkite = Buildkite;

@@ -56,4 +56,11 @@ "use strict";

});
Object.defineProperty(CIProviderBase, "fixedQueueSplit", {
get: function () {
throw new Error('fixedQueueSplit getter is not implemented!');
},
enumerable: false,
configurable: true
});
return CIProviderBase;
}());
exports.CIProviderBase = CIProviderBase;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(CircleCI, "detect", {
get: function () {
return 'CIRCLECI' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CircleCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return CircleCI;
}(_1.CIProviderBase));
exports.CircleCI = CircleCI;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(CirrusCI, "detect", {
get: function () {
return 'CIRRUS_CI' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CirrusCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return CirrusCI;
}(_1.CIProviderBase));
exports.CirrusCI = CirrusCI;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(CodefreshCI, "detect", {
get: function () {
return 'CF_BUILD_ID' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(CodefreshCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return CodefreshCI;
}(_1.CIProviderBase));
exports.CodefreshCI = CodefreshCI;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(Codeship, "detect", {
get: function () {
return process.env.CI_NAME === 'codeship' ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(Codeship, "fixedQueueSplit", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
return Codeship;
}(_1.CIProviderBase));
exports.Codeship = Codeship;

@@ -79,4 +79,18 @@ "use strict";

});
Object.defineProperty(GithubActions, "detect", {
get: function () {
return 'GITHUB_ACTIONS' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GithubActions, "fixedQueueSplit", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
return GithubActions;
}(_1.CIProviderBase));
exports.GithubActions = GithubActions;

@@ -81,4 +81,18 @@ "use strict";

});
Object.defineProperty(GitlabCI, "detect", {
get: function () {
return 'GITLAB_CI' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(GitlabCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return GitlabCI;
}(_1.CIProviderBase));
exports.GitlabCI = GitlabCI;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(HerokuCI, "detect", {
get: function () {
return 'HEROKU_TEST_RUN_ID' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(HerokuCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return HerokuCI;
}(_1.CIProviderBase));
exports.HerokuCI = HerokuCI;

1

lib/ci-providers/index.js

@@ -30,1 +30,2 @@ "use strict";

__exportStar(require("./travis-ci"), exports);
__exportStar(require("./unsupported-ci"), exports);

@@ -77,4 +77,20 @@ "use strict";

});
Object.defineProperty(SemaphoreCI2, "detect", {
get: function () {
return 'SEMAPHORE' in process.env && 'SEMAPHORE_WORKFLOW_ID' in process.env
? this
: null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(SemaphoreCI2, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return SemaphoreCI2;
}(_1.CIProviderBase));
exports.SemaphoreCI2 = SemaphoreCI2;

@@ -77,4 +77,18 @@ "use strict";

});
Object.defineProperty(SemaphoreCI, "detect", {
get: function () {
return 'SEMAPHORE_BUILD_NUMBER' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(SemaphoreCI, "fixedQueueSplit", {
get: function () {
return false;
},
enumerable: false,
configurable: true
});
return SemaphoreCI;
}(_1.CIProviderBase));
exports.SemaphoreCI = SemaphoreCI;

@@ -74,4 +74,18 @@ "use strict";

});
Object.defineProperty(TravisCI, "detect", {
get: function () {
return 'TRAVIS' in process.env ? this : null;
},
enumerable: false,
configurable: true
});
Object.defineProperty(TravisCI, "fixedQueueSplit", {
get: function () {
return true;
},
enumerable: false,
configurable: true
});
return TravisCI;
}(_1.CIProviderBase));
exports.TravisCI = TravisCI;

26

lib/config/ci-env.config.js

@@ -57,5 +57,14 @@ "use strict";

});
Object.defineProperty(CIEnvConfig, "fixedQueueSplit", {
get: function () {
return this.ciEnvFor('fixedQueueSplit');
},
enumerable: false,
configurable: true
});
CIEnvConfig.ciEnvFor = function (functionName) {
var supportedCIProviders = [
ci_providers_1.GitlabCI,
return this.detectCi()[functionName];
};
CIEnvConfig.detectCi = function () {
var detected = [
ci_providers_1.AppVeyor,

@@ -68,2 +77,3 @@ ci_providers_1.Buildkite,

ci_providers_1.GithubActions,
ci_providers_1.GitlabCI,
ci_providers_1.HerokuCI,

@@ -73,10 +83,6 @@ ci_providers_1.SemaphoreCI,

ci_providers_1.TravisCI,
];
for (var _i = 0, supportedCIProviders_1 = supportedCIProviders; _i < supportedCIProviders_1.length; _i++) {
var ciProvider = supportedCIProviders_1[_i];
var value = ciProvider[functionName];
if (value) {
return value;
}
}
]
.map(function (provider) { return provider.detect; })
.filter(Boolean)[0];
return detected || ci_providers_1.UnsupportedCI;
};

@@ -83,0 +89,0 @@ return CIEnvConfig;

@@ -42,6 +42,12 @@ "use strict";

get: function () {
if (process.env.KNAPSACK_PRO_FIXED_QUEUE_SPLIT) {
return (process.env.KNAPSACK_PRO_FIXED_QUEUE_SPLIT.toLowerCase() === 'true');
var _a;
if (this.$fixedQueueSplit !== undefined) {
return this.$fixedQueueSplit;
}
return false;
this.$fixedQueueSplit =
(_a = this.parseBoolean(process.env.KNAPSACK_PRO_FIXED_QUEUE_SPLIT)) !== null && _a !== void 0 ? _a : _1.CIEnvConfig.fixedQueueSplit;
if (!('KNAPSACK_PRO_FIXED_QUEUE_SPLIT' in process.env)) {
this.$knapsackProLogger.info("KNAPSACK_PRO_FIXED_QUEUE_SPLIT is not set. Using default value: ".concat(this.$fixedQueueSplit, ". Learn more at ").concat(Urls.FIXED_QUEUE_SPLIT));
}
return this.$fixedQueueSplit;
},

@@ -51,2 +57,12 @@ enumerable: false,

});
KnapsackProEnvConfig.parseBoolean = function (value) {
switch (value === null || value === void 0 ? void 0 : value.toLowerCase()) {
case 'true':
return true;
case 'false':
return false;
default:
return null;
}
};
Object.defineProperty(KnapsackProEnvConfig, "ciNodeTotal", {

@@ -195,4 +211,5 @@ get: function () {

};
KnapsackProEnvConfig.$knapsackProLogger = knapsackProLogger;
return KnapsackProEnvConfig;
}());
exports.KnapsackProEnvConfig = KnapsackProEnvConfig;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.QUEUE_MODE_CONNECTION_ERROR_AND_POSITIVE_RETRY_COUNT = exports.KNAPSACK_PRO_CI_NODE_BUILD_ID = void 0;
exports.FIXED_QUEUE_SPLIT = exports.QUEUE_MODE_CONNECTION_ERROR_AND_POSITIVE_RETRY_COUNT = exports.KNAPSACK_PRO_CI_NODE_BUILD_ID = void 0;
exports.KNAPSACK_PRO_CI_NODE_BUILD_ID = 'https://knapsackpro.com/perma/js/knapsack-pro-ci-node-build-id';
exports.QUEUE_MODE_CONNECTION_ERROR_AND_POSITIVE_RETRY_COUNT = 'https://knapsackpro.com/perma/js/queue-mode-connection-error-and-positive-retry-count';
exports.FIXED_QUEUE_SPLIT = 'https://knapsackpro.com/perma/js/fixed-queue-split';
{
"name": "@knapsack-pro/core",
"version": "5.2.0",
"version": "6.0.0",
"description": "Knapsack Pro Core library splits tests across CI nodes and makes sure that tests will run in optimal time on each CI node. This library gives core features like communication with KnapsackPro.com API. This library is a dependency for other projects specific for particular test runner.",

@@ -69,2 +69,3 @@ "keywords": [

"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.2.1",
"eslint-plugin-prettier": "^4.0.0",

@@ -71,0 +72,0 @@ "gulp": "^4.0.2",

@@ -44,4 +44,4 @@ # @knapsack-pro/core

- [@knapsack-pro/jest](https://github.com/KnapsackPro/knapsack-pro-js/tree/setup/packages/jest)
- [@knapsack-pro/cypress](https://github.com/KnapsackPro/knapsack-pro-js/tree/setup/packages/cypress)
- [@knapsack-pro/jest](https://github.com/KnapsackPro/knapsack-pro-js/tree/main/packages/jest)
- [@knapsack-pro/cypress](https://github.com/KnapsackPro/knapsack-pro-js/tree/main/packages/cypress)

@@ -75,4 +75,4 @@ ## Contributing

github_changelog_generator --user KnapsackPro --project knapsack-pro-js --pr-wo-labels --issues-wo-labels --include-labels @knapsack-pro/core --since-tag @knapsack-pro/core@5.1.0 --exclude-tags-regex "@knapsack-pro\/(jest|cypress)@.*"
git commit -am "Update CHANGELOG.md"
git push origin master
git commit -am "docs(core): update CHANGELOG.md"
git push origin main
```

@@ -99,3 +99,3 @@

```bash
git commit -am x.x.x
git commit -am @knapsack-pro/core@x.x.x
git tag @knapsack-pro/core@x.x.x

@@ -107,3 +107,3 @@ ```

```bash
git push origin master --tags
git push origin main --tags
```

@@ -115,4 +115,4 @@

github_changelog_generator --user KnapsackPro --project knapsack-pro-js --pr-wo-labels --issues-wo-labels --include-labels @knapsack-pro/core --since-tag @knapsack-pro/core@5.1.0 --exclude-tags-regex "@knapsack-pro\/(jest|cypress)@.*"
git commit -am "Update CHANGELOG.md"
git push origin master
git commit -am "docs(core): update CHANGELOG.md"
git push origin main
```

@@ -128,3 +128,3 @@

- [@knapsack-pro/jest](https://github.com/KnapsackPro/knapsack-pro-js/tree/setup/packages/jest)
- [@knapsack-pro/cypress](https://github.com/KnapsackPro/knapsack-pro-js/tree/setup/packages/cypress)
- [@knapsack-pro/jest](https://github.com/KnapsackPro/knapsack-pro-js/tree/main/packages/jest)
- [@knapsack-pro/cypress](https://github.com/KnapsackPro/knapsack-pro-js/tree/main/packages/cypress)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc