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

@hubspot/cms-lib

Package Overview
Dependencies
Maintainers
10
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hubspot/cms-lib - npm Package Compare versions

Comparing version 0.0.25-beta.0 to 0.0.25-beta.1

ignoreRules.js

4

index.js

@@ -9,3 +9,3 @@ const { ALLOWED_EXTENSIONS, Mode, DEFAULT_MODE } = require('./lib/constants');

} = require('./lib/config');
const { sync } = require('./lib/sync');
const { uploadFolder } = require('./lib/uploadFolder');
const { watch } = require('./lib/watch');

@@ -23,5 +23,5 @@ const { walk } = require('./lib/walk');

updatePortalConfig,
sync,
uploadFolder,
watch,
walk,
};

@@ -10,3 +10,4 @@ const path = require('path');

} = require('../errorHandlers');
const { sync } = require('./sync');
const { uploadFolder } = require('./uploadFolder');
const { ignoreRules, loadIgnoreConfig } = require('../ignoreRules');
const { getFileMapperApiQueryFromMode } = require('../fileMapper');

@@ -17,3 +18,3 @@ const { upload, deleteFile } = require('../api/fileMapper');

function uploadFile(portalId, file, dest, mode) {
function uploadFile(portalId, file, dest, { mode, cwd }) {
if (!isAllowedExtension(file)) {

@@ -23,2 +24,7 @@ logger.debug(`Skipping ${file} due to unsupported extension`);

}
if (ignoreRules.ignores(path.relative(cwd, file))) {
logger.debug(`Skipping ${file} due to an ignore rule`);
return;
}
logger.debug('Attempting to upload file "%s" to "%s"', file, dest);

@@ -49,4 +55,7 @@ const apiOptions = {

function watch(portalId, src, dest, mode) {
function watch(portalId, src, dest, { mode, cwd }) {
const regex = new RegExp(`^${escapeRegExp(src)}`);
loadIgnoreConfig();
const watcher = chokidar.watch(src, {

@@ -61,5 +70,4 @@ ignoreInitial: true,

// Use sync so that failures of initial sync are queued to the
// end of the sync and retried
sync(portalId, src, dest, mode).then(() => {
// Use uploadFolder so that failures of initial upload are retried
uploadFolder(portalId, src, dest, { mode, cwd }).then(() => {
logger.log(`Completed uploading files in ${src} to ${dest} in ${portalId}`);

@@ -74,3 +82,3 @@ });

const destPath = getDesignManagerPath(file);
uploadFile(portalId, file, destPath, mode);
uploadFile(portalId, file, destPath, { mode, cwd });
});

@@ -80,2 +88,8 @@

const remotePath = getDesignManagerPath(filePath);
if (ignoreRules.ignores(path.relative(cwd, filePath))) {
logger.debug(`Skipping ${filePath} due to an ignore rule`);
return;
}
logger.debug('Attempting to delete file "%s"', remotePath);

@@ -100,3 +114,3 @@ deleteFile(portalId, remotePath)

const destPath = getDesignManagerPath(file);
uploadFile(portalId, file, destPath, mode);
uploadFile(portalId, file, destPath, { mode, cwd });
});

@@ -103,0 +117,0 @@

{
"name": "@hubspot/cms-lib",
"version": "0.0.25-beta.0",
"version": "0.0.25-beta.1",
"description": "Library for working with the HubSpot CMS",

@@ -13,2 +13,3 @@ "license": "Apache-2.0",

"fs-extra": "^8.1.0",
"ignore": "^5.1.4",
"js-yaml": "^3.12.2",

@@ -27,3 +28,3 @@ "p-queue": "^6.0.2",

},
"gitHead": "1a23dc94b84ed2cf2c0eeacbac3a41d467b95484"
"gitHead": "02a1a5afba8a712974a0e0fd7e7c49ea2cfa109f"
}
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