@hubspot/cli-lib
Advanced tools
Comparing version 3.0.7-beta.10 to 3.0.7
@@ -121,2 +121,45 @@ const ENVIRONMENTS = { | ||
const TEMPLATE_TYPES = { | ||
unmapped: 0, | ||
email_base_template: 1, | ||
email: 2, | ||
landing_page_base_template: 3, | ||
landing_page: 4, | ||
blog_base: 5, | ||
blog: 6, | ||
blog_listing: 42, | ||
site_page: 8, | ||
blog_listing_context: 9, | ||
blog_post_context: 10, | ||
error_page: 11, | ||
subscription_preferences: 12, | ||
unsubscribe_confirmation: 13, | ||
unsubscribe_simple: 14, | ||
optin_email: 15, | ||
optin_followup_email: 16, | ||
optin_confirmation_page: 17, | ||
global_group: 18, | ||
password_prompt_page: 19, | ||
resubscribe_email: 20, | ||
unsubscribe_confirmation_email: 21, | ||
resubscribe_confirmation_email: 22, | ||
custom_module: 23, | ||
css: 24, | ||
js: 25, | ||
search_results: 27, | ||
membership_login: 29, | ||
membership_register: 30, | ||
membership_reset: 31, | ||
membership_reset_request: 32, | ||
drag_drop_email: 34, | ||
knowledge_article: 35, | ||
membership_email: 36, | ||
section: 37, | ||
global_content_partial: 38, | ||
simple_landing_page_template: 39, | ||
proposal: 40, | ||
blog_post: 41, | ||
quote: 43, | ||
}; | ||
const PROJECT_BUILD_STATUS = { | ||
@@ -166,2 +209,3 @@ BUILDING: 'BUILDING', | ||
SCOPE_GROUPS, | ||
TEMPLATE_TYPES, | ||
}; |
@@ -7,2 +7,7 @@ const path = require('path'); | ||
// Matches files named module.html | ||
const MODULE_HTML_EXTENSION_REGEX = new RegExp(/\.module\/module\.html$/); | ||
// Matches files named module.css | ||
const MODULE_CSS_EXTENSION_REGEX = new RegExp(/\.module\/module\.css$/); | ||
const isBool = x => !!x === x; | ||
@@ -154,2 +159,16 @@ | ||
/** | ||
* Checks if the given path points to an .html file within a .module folder | ||
* @param {string} filePath | ||
* @returns {boolean} | ||
*/ | ||
const isModuleHTMLFile = filePath => MODULE_HTML_EXTENSION_REGEX.test(filePath); | ||
/** | ||
* Checks if the given path points to an .css file within a .module folder | ||
* @param {string} filePath | ||
* @returns {boolean} | ||
*/ | ||
const isModuleCSSFile = filePath => MODULE_CSS_EXTENSION_REGEX.test(filePath); | ||
module.exports = { | ||
@@ -160,2 +179,4 @@ isModuleFolder, | ||
ValidationIds, | ||
isModuleHTMLFile, | ||
isModuleCSSFile, | ||
}; |
{ | ||
"name": "@hubspot/cli-lib", | ||
"version": "3.0.7-beta.10", | ||
"version": "3.0.7", | ||
"description": "Library for creating scripts for working with HubSpot", | ||
@@ -35,3 +35,3 @@ "license": "Apache-2.0", | ||
}, | ||
"gitHead": "19b50f345d559b802b3d39265de6964c58d17a60" | ||
"gitHead": "cbba1945bc472da0e40ef2e5049a75da687798ca" | ||
} |
@@ -1,6 +0,4 @@ | ||
const fs = require('fs'); | ||
const { logger } = require('./logger'); | ||
// Matches the .html file extension, excluding module.html | ||
const TEMPLATE_EXTENSION_REGEX = new RegExp(/(?<!module)\.html$/); | ||
// Matches the comment brackets that wrap annotations | ||
@@ -16,16 +14,6 @@ const ANNOTATIONS_REGEX = /<!--([\s\S]*?)-->/; | ||
screenshotPath: 'screenshotPath', | ||
// 'description' is specific to Sections | ||
description: 'description', | ||
}; | ||
const getFileAnnotations = filePath => { | ||
try { | ||
const data = fs.readFileSync(filePath, 'utf8'); | ||
const match = data.match(ANNOTATIONS_REGEX); | ||
const annotation = match && match[1] ? match[1] : ''; | ||
return annotation; | ||
} catch (err) { | ||
logger.debug(err); | ||
return ''; | ||
} | ||
}; | ||
const getAnnotationValue = (annotations, key) => { | ||
@@ -37,2 +25,8 @@ const valueRegex = new RegExp(`${key}${ANNOTATION_VALUE_REGEX}`); | ||
const buildAnnotationValueGetter = source => { | ||
const match = source.match(ANNOTATIONS_REGEX); | ||
const annotation = match && match[1] ? match[1] : ''; | ||
return annotationKey => getAnnotationValue(annotation, annotationKey); | ||
}; | ||
/* | ||
@@ -47,4 +41,4 @@ * Returns true if: | ||
getAnnotationValue, | ||
getFileAnnotations, | ||
buildAnnotationValueGetter, | ||
isCodedFile, | ||
}; |
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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
312433
9971
1
41