@featurevisor/core
Advanced tools
Comparing version 1.7.2 to 1.7.3
@@ -6,2 +6,13 @@ # Change Log | ||
## [1.7.3](https://github.com/featurevisor/featurevisor/compare/v1.7.2...v1.7.3) (2024-02-24) | ||
### Bug Fixes | ||
* lint entity names ([#266](https://github.com/featurevisor/featurevisor/issues/266)) ([7e63137](https://github.com/featurevisor/featurevisor/commit/7e63137fa2821605362c742475d78c8256f89fcd)) | ||
## [1.7.2](https://github.com/featurevisor/featurevisor/compare/v1.7.1...v1.7.2) (2024-02-21) | ||
@@ -8,0 +19,0 @@ |
@@ -52,2 +52,4 @@ "use strict"; | ||
var cliFormat_1 = require("../tester/cliFormat"); | ||
var ENTITY_NAME_REGEX = /^[a-zA-Z0-9_\-.]+$/; | ||
var ENTITY_NAME_REGEX_ERROR = "Names must be alphanumeric and can contain _, -, and ."; | ||
function lintProject(deps, options) { | ||
@@ -112,2 +114,9 @@ if (options === void 0) { options = {}; } | ||
fullPath = getFullPathFromKey("attribute", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: Invalid name: \"".concat(key, "\"")); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " ".concat(ENTITY_NAME_REGEX_ERROR)); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
_e.label = 3; | ||
@@ -154,2 +163,9 @@ case 3: | ||
fullPath = getFullPathFromKey("segment", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: Invalid name: \"".concat(key, "\"")); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " ".concat(ENTITY_NAME_REGEX_ERROR)); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
_e.label = 10; | ||
@@ -195,2 +211,9 @@ case 10: | ||
fullPath = getFullPathFromKey("feature", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: Invalid name: \"".concat(key, "\"")); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " ".concat(ENTITY_NAME_REGEX_ERROR)); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
parsed = void 0; | ||
@@ -252,2 +275,9 @@ _e.label = 17; | ||
fullPath = getFullPathFromKey("group", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: Invalid name: \"".concat(key, "\"")); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " ".concat(ENTITY_NAME_REGEX_ERROR)); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
parsed = void 0; | ||
@@ -309,2 +339,9 @@ _e.label = 28; | ||
fullPath = getFullPathFromKey("test", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(cliFormat_1.CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " => Error: Invalid name: \"".concat(key, "\"")); | ||
console.log(cliFormat_1.CLI_FORMAT_RED, " ".concat(ENTITY_NAME_REGEX_ERROR)); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
_e.label = 39; | ||
@@ -311,0 +348,0 @@ case 39: |
{ | ||
"name": "@featurevisor/core", | ||
"version": "1.7.2", | ||
"version": "1.7.3", | ||
"description": "Core package of Featurevisor for Node.js usage", | ||
@@ -60,3 +60,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "c6ea5767c24263a215a4134beef16831467a8c49" | ||
"gitHead": "0bdf54e6fc1be788ec762c256ae6c9591794abfa" | ||
} |
@@ -22,2 +22,5 @@ // for use in node only | ||
const ENTITY_NAME_REGEX = /^[a-zA-Z0-9_\-.]+$/; | ||
const ENTITY_NAME_REGEX_ERROR = "Names must be alphanumeric and can contain _, -, and ."; | ||
export async function lintProject( | ||
@@ -80,2 +83,10 @@ deps: Dependencies, | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(CLI_FORMAT_RED, ` => Error: Invalid name: "${key}"`); | ||
console.log(CLI_FORMAT_RED, ` ${ENTITY_NAME_REGEX_ERROR}`); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
try { | ||
@@ -123,2 +134,10 @@ const parsed = await datasource.readAttribute(key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(CLI_FORMAT_RED, ` => Error: Invalid name: "${key}"`); | ||
console.log(CLI_FORMAT_RED, ` ${ENTITY_NAME_REGEX_ERROR}`); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
try { | ||
@@ -167,2 +186,11 @@ const parsed = await datasource.readSegment(key); | ||
const fullPath = getFullPathFromKey("feature", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(CLI_FORMAT_RED, ` => Error: Invalid name: "${key}"`); | ||
console.log(CLI_FORMAT_RED, ` ${ENTITY_NAME_REGEX_ERROR}`); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
let parsed; | ||
@@ -217,2 +245,11 @@ | ||
const fullPath = getFullPathFromKey("group", key); | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(CLI_FORMAT_RED, ` => Error: Invalid name: "${key}"`); | ||
console.log(CLI_FORMAT_RED, ` ${ENTITY_NAME_REGEX_ERROR}`); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
let parsed; | ||
@@ -275,2 +312,10 @@ | ||
if (!ENTITY_NAME_REGEX.test(key)) { | ||
console.log(CLI_FORMAT_UNDERLINE, fullPath); | ||
console.log(CLI_FORMAT_RED, ` => Error: Invalid name: "${key}"`); | ||
console.log(CLI_FORMAT_RED, ` ${ENTITY_NAME_REGEX_ERROR}`); | ||
console.log(""); | ||
hasError = true; | ||
} | ||
try { | ||
@@ -277,0 +322,0 @@ const parsed = await datasource.readTest(key); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
922452
11578