Socket
Socket
Sign inDemoInstall

@clabs/packages-publisher

Package Overview
Dependencies
Maintainers
5
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clabs/packages-publisher - npm Package Compare versions

Comparing version 0.0.1-alpha.3 to 0.0.1

12

dist/cli/commands/publish/handler.js

@@ -147,3 +147,3 @@ "use strict";

_loop_1 = function (packageName) {
var _d, json, folderPath, version, publishResult;
var _d, json, folderPath, version, privatePackage, publishResult;
return __generator(this, function (_e) {

@@ -160,3 +160,11 @@ switch (_e.label) {

_d = packages[packageName], json = _d.json, folderPath = _d.folderPath;
version = json.version;
version = json.version, privatePackage = json.private;
if (privatePackage) {
logger_1.logger.info("".concat(packageName, " is private and will be skipped"));
output.addPublishResult(packageName, {
status: 'skipped',
context: 'private'
});
return [2 /*return*/, "continue"];
}
assertNonDevVersion(version, packageName);

@@ -163,0 +171,0 @@ return [4 /*yield*/, withRetryOnOtpError(function () { return (0, npmPublish_1.publishToNpm)(otp.getLatest(), dryRun, folderPath, version); }, otp)];

2

package.json
{
"version": "0.0.1-alpha.3",
"version": "0.0.1",
"name": "@clabs/packages-publisher",

@@ -4,0 +4,0 @@ "repository": "celo-org/packages-publisher",

@@ -77,2 +77,30 @@ import { createFakePackages } from '../../../test/mock-system';

it('should skip publish for private packages', async () => {
const packageName = 'packageA';
const versionInPackageJson = '1.0.1';
mockedGetAllPackageJsons.mockReturnValue(
createFakePackages({
name: packageName,
version: versionInPackageJson,
private: true,
})
);
// Mock that all CLI commands resolved without errors
mockedExecCommand.mockResolvedValue(createExecaReturnValue());
const resultCollector = resultBuilder();
await buildAndPublishAllPackages(baseFlags, resultCollector);
expect(resultCollector.getResult()).toStrictEqual({
[packageName]: {
build: { status: 'success' },
publish: {
status: 'skipped',
context: 'private',
},
},
});
});
it('should be successful on first publish (error about not finding package is ignored)', async () => {

@@ -79,0 +107,0 @@ const packageName = 'packageA';

@@ -107,4 +107,13 @@ import { ArgumentsCamelCase } from 'yargs';

const { json, folderPath } = packages[packageName];
const { version } = json;
const { version, private: privatePackage } = json;
if (privatePackage) {
logger.info(`${packageName} is private and will be skipped`);
output.addPublishResult(packageName, {
status: 'skipped',
context: 'private',
});
continue;
}
assertNonDevVersion(version, packageName);

@@ -111,0 +120,0 @@

@@ -9,2 +9,3 @@ import fs from 'fs';

name: string;
private?: boolean;
version: string;

@@ -11,0 +12,0 @@ dependencies: { [key: string]: string };

@@ -13,2 +13,3 @@ import mockFileSystem from 'mock-fs';

dependencies: props.dependencies || {},
private: props.private || false,
devDependencies: {},

@@ -15,0 +16,0 @@ };

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