@movable/rollup-plugin-package-manifest-validator
Advanced tools
Comparing version 2.43.0 to 3.0.0-esmodules.0
{ | ||
"presets": ["@babel/preset-env"] | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { "safari": "16" }, | ||
"bugfixes": true | ||
} | ||
] | ||
] | ||
} |
@@ -8,4 +8,4 @@ "use strict"; | ||
enumerable: true, | ||
get: function get() { | ||
return _packageManifestValidator["default"]; | ||
get: function () { | ||
return _packageManifestValidator.default; | ||
} | ||
@@ -16,2 +16,2 @@ }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -15,37 +15,32 @@ var _yamljs = _interopRequireDefault(require("yamljs")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var formatJSON = function formatJSON(j) { | ||
return JSON.stringify(j, null, 1); | ||
}; | ||
const formatJSON = j => JSON.stringify(j, null, 1); | ||
var _default = function _default(_ref) { | ||
var manifestPath = _ref.manifestPath; | ||
return { | ||
buildStart: function buildStart() { | ||
var _this = this; | ||
var _default = ({ | ||
manifestPath | ||
}) => ({ | ||
buildStart() { | ||
this.addWatchFile(manifestPath); | ||
this.addWatchFile(manifestPath); | ||
const manifest = _yamljs.default.parse((0, _fs.readFileSync)(manifestPath).toString('utf-8')); | ||
var manifest = _yamljs["default"].parse((0, _fs.readFileSync)(manifestPath).toString('utf-8')); | ||
const { | ||
warnings, | ||
errors | ||
} = (0, _packageManifestValidator.default)(manifest); | ||
var _packageManifestValid = (0, _packageManifestValidator["default"])(manifest), | ||
warnings = _packageManifestValid.warnings, | ||
errors = _packageManifestValid.errors; | ||
if (errors.length) { | ||
this.error({ | ||
message: "INVALID PACKAGE MANIFEST: ".concat(formatJSON(errors)) | ||
}); | ||
} | ||
warnings.forEach(function (w) { | ||
return _this.warn({ | ||
message: "'PACKAGE MANIFEST VALIDATION WARNING': ".concat(formatJSON(w)) | ||
}); | ||
if (errors.length) { | ||
this.error({ | ||
message: `INVALID PACKAGE MANIFEST: ${formatJSON(errors)}` | ||
}); | ||
} | ||
}; | ||
}; | ||
exports["default"] = _default; | ||
warnings.forEach(w => this.warn({ | ||
message: `'PACKAGE MANIFEST VALIDATION WARNING': ${formatJSON(w)}` | ||
})); | ||
} | ||
}); | ||
exports.default = _default; |
@@ -6,10 +6,10 @@ "use strict"; | ||
}); | ||
exports.contextOptionTypes = exports.propertyTypes = exports.fieldTypes = exports.studioIcons = void 0; | ||
var contextOptionTypes = ['select', 'text', 'hidden']; | ||
exports.studioIcons = exports.propertyTypes = exports.fieldTypes = exports.contextOptionTypes = void 0; | ||
const contextOptionTypes = ['select', 'text', 'hidden']; | ||
exports.contextOptionTypes = contextOptionTypes; | ||
var propertyTypes = ['text', 'image', 'link', 'api', 'boolean']; | ||
const propertyTypes = ['text', 'image', 'link', 'api', 'boolean']; | ||
exports.propertyTypes = propertyTypes; | ||
var fieldTypes = ['asset', 'checkbox', 'color', 'data-source', 'data-source-package', 'date', 'datetime', 'dynamic-text', 'font', 'image', 'map', 'number', 'oauth2', 'oAuthAccount', 'radio', 'select', 'text', 'token', 'upload', 'url']; | ||
const fieldTypes = ['asset', 'checkbox', 'color', 'data-source', 'data-source-package', 'date', 'datetime', 'dynamic-text', 'font', 'image', 'map', 'number', 'oauth2', 'oAuthAccount', 'radio', 'select', 'text', 'token', 'upload', 'url']; | ||
exports.fieldTypes = fieldTypes; | ||
var studioIcons = ['align-bottom', 'align-center', 'align-left', 'align-middle', 'align-right', 'align-top', 'arrange-center', 'arrange-left', 'arrange-right', 'arrows-select', 'avatar', 'bar-chart', 'barcode', 'calendar', 'cart', 'chatter', 'clock', 'code', 'condensed-view', 'copy', 'countdown-timer', 'countdown', 'crop', 'cursor-grab', 'cursor-move', 'cursor', 'distribute-horizontal', 'distribute-vertical', 'dropdown-arrow', 'duplicate', 'expanded-view', 'external-link', 'globe', 'grab', 'image-layer', 'image', 'images', 'instagram', 'local-time', 'locked', 'map-helper', 'maps', 'media-library', 'minus', 'move', 'olapic', 'param', 'personal', 'picture', 'pie-chart', 'pin', 'pinterest', 'plus', 'polling', 'proximity-pin', 'QR', 'qr-code', 'redo', 'rotate', 'rss', 'settings', 'shape', 'sharing', 'square', 'text-center', 'text-justify', 'text-layer', 'text-left', 'text-right', 'text-tool', 'text-vector', 'text', 'tools', 'trash', 'twitter-favorite', 'twitter-retweet', 'twitter-username', 'twitter', 'undo', 'unlocked', 'vector-square', 'vector-tool', 'video', 'weather-average', 'weather-city', 'weather-day', 'weather-description', 'weather-high-temp', 'weather-icon', 'weather', 'workspace-barcode', 'workspace-favorites', 'workspace-instagram', 'workspace-olapic', 'workspace-picture', 'workspace-pinterest', 'workspace-qr-code', 'workspace-retweets', 'workspace-weather']; | ||
const studioIcons = ['align-bottom', 'align-center', 'align-left', 'align-middle', 'align-right', 'align-top', 'arrange-center', 'arrange-left', 'arrange-right', 'arrows-select', 'avatar', 'bar-chart', 'barcode', 'calendar', 'cart', 'chatter', 'clock', 'code', 'condensed-view', 'copy', 'countdown-timer', 'countdown', 'crop', 'cursor-grab', 'cursor-move', 'cursor', 'distribute-horizontal', 'distribute-vertical', 'dropdown-arrow', 'duplicate', 'expanded-view', 'external-link', 'globe', 'grab', 'image-layer', 'image', 'images', 'instagram', 'local-time', 'locked', 'map-helper', 'maps', 'media-library', 'minus', 'move', 'olapic', 'param', 'personal', 'picture', 'pie-chart', 'pin', 'pinterest', 'plus', 'polling', 'proximity-pin', 'QR', 'qr-code', 'redo', 'rotate', 'rss', 'settings', 'shape', 'sharing', 'square', 'text-center', 'text-justify', 'text-layer', 'text-left', 'text-right', 'text-tool', 'text-vector', 'text', 'tools', 'trash', 'twitter-favorite', 'twitter-retweet', 'twitter-username', 'twitter', 'undo', 'unlocked', 'vector-square', 'vector-tool', 'video', 'weather-average', 'weather-city', 'weather-day', 'weather-description', 'weather-high-temp', 'weather-icon', 'weather', 'workspace-barcode', 'workspace-favorites', 'workspace-instagram', 'workspace-olapic', 'workspace-picture', 'workspace-pinterest', 'workspace-qr-code', 'workspace-retweets', 'workspace-weather']; | ||
exports.studioIcons = studioIcons; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
var _default = { | ||
@@ -18,2 +18,2 @@ type: 'object', | ||
}; | ||
exports["default"] = _default; | ||
exports.default = _default; |
@@ -6,12 +6,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "warningSchema", { | ||
Object.defineProperty(exports, "erroringSchema", { | ||
enumerable: true, | ||
get: function get() { | ||
return _warningSchema["default"]; | ||
get: function () { | ||
return _erroringSchema.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "erroringSchema", { | ||
Object.defineProperty(exports, "warningSchema", { | ||
enumerable: true, | ||
get: function get() { | ||
return _erroringSchema["default"]; | ||
get: function () { | ||
return _warningSchema.default; | ||
} | ||
@@ -24,2 +24,2 @@ }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -6,8 +6,8 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
var _enums = require("./enums"); | ||
var strNumBool = ['string', 'number', 'boolean']; | ||
var fieldSchema = { | ||
const strNumBool = ['string', 'number', 'boolean']; | ||
const fieldSchema = { | ||
type: 'object', | ||
@@ -18,3 +18,3 @@ properties: { | ||
}, | ||
"default": { | ||
default: { | ||
type: strNumBool | ||
@@ -67,3 +67,3 @@ }, | ||
type: 'string', | ||
"enum": _enums.fieldTypes | ||
enum: _enums.fieldTypes | ||
}, | ||
@@ -80,10 +80,10 @@ value: { | ||
allOf: [{ | ||
"if": { | ||
if: { | ||
properties: { | ||
type: { | ||
"enum": ['number', 'token'] | ||
enum: ['number', 'token'] | ||
} | ||
} | ||
}, | ||
"else": { | ||
else: { | ||
not: { | ||
@@ -94,6 +94,6 @@ required: ['max'] | ||
}, { | ||
"if": { | ||
if: { | ||
properties: { | ||
type: { | ||
"const": 'oAuthAccount' | ||
const: 'oAuthAccount' | ||
} | ||
@@ -105,3 +105,3 @@ } | ||
}, | ||
"else": { | ||
else: { | ||
not: { | ||
@@ -112,10 +112,10 @@ required: ['provider'] | ||
}, { | ||
"if": { | ||
if: { | ||
properties: { | ||
type: { | ||
"const": 'data-source' | ||
const: 'data-source' | ||
} | ||
} | ||
}, | ||
"else": { | ||
else: { | ||
not: { | ||
@@ -126,10 +126,10 @@ required: ['template'] | ||
}, { | ||
"if": { | ||
if: { | ||
properties: { | ||
type: { | ||
"enum": ['select', 'radio', 'checkbox'] | ||
enum: ['select', 'radio', 'checkbox'] | ||
} | ||
} | ||
}, | ||
"else": { | ||
else: { | ||
not: { | ||
@@ -141,3 +141,3 @@ required: ['options'] | ||
}; | ||
var dynamicPropertySchema = { | ||
const dynamicPropertySchema = { | ||
propertyGroupKey: { | ||
@@ -162,3 +162,3 @@ type: 'string' | ||
}; | ||
var toolSchema = { | ||
const toolSchema = { | ||
type: 'object', | ||
@@ -175,3 +175,3 @@ properties: { | ||
type: 'string', | ||
"enum": _enums.studioIcons | ||
enum: _enums.studioIcons | ||
}, | ||
@@ -197,3 +197,3 @@ label: { | ||
type: 'string', | ||
"enum": _enums.propertyTypes | ||
enum: _enums.propertyTypes | ||
}, | ||
@@ -236,3 +236,3 @@ name: { | ||
}; | ||
var propertySchema = { | ||
const propertySchema = { | ||
type: 'object', | ||
@@ -251,3 +251,3 @@ properties: { | ||
type: 'string', | ||
"enum": _enums.propertyTypes | ||
enum: _enums.propertyTypes | ||
}, | ||
@@ -276,3 +276,3 @@ preview_text: { | ||
type: 'string', | ||
"enum": _enums.contextOptionTypes | ||
enum: _enums.contextOptionTypes | ||
}, | ||
@@ -306,6 +306,6 @@ description: { | ||
allOf: [{ | ||
"if": { | ||
if: { | ||
properties: { | ||
type: { | ||
"enum": ['select'] | ||
enum: ['select'] | ||
} | ||
@@ -471,3 +471,3 @@ } | ||
type: 'string', | ||
"enum": _enums.propertyTypes | ||
enum: _enums.propertyTypes | ||
}, | ||
@@ -521,2 +521,2 @@ preview_text: { | ||
}; | ||
exports["default"] = _default; | ||
exports.default = _default; |
@@ -6,20 +6,21 @@ "use strict"; | ||
}); | ||
exports["default"] = validateManifest; | ||
exports.TOP_LEVEL_PROHIBITED_PROPERTY_MESSAGE = void 0; | ||
exports.default = validateManifest; | ||
var _validators = require("../validators"); | ||
var TOP_LEVEL_PROHIBITED_PROPERTY_MESSAGE = 'Manifest has a prohibited keyword at the top level.'; | ||
const TOP_LEVEL_PROHIBITED_PROPERTY_MESSAGE = 'Manifest has a prohibited keyword at the top level.'; | ||
exports.TOP_LEVEL_PROHIBITED_PROPERTY_MESSAGE = TOP_LEVEL_PROHIBITED_PROPERTY_MESSAGE; | ||
var TOP_LEVEL_PATH = 'package-manifest.yml'; | ||
const TOP_LEVEL_PATH = 'package-manifest.yml'; | ||
var parseValidationItem = function parseValidationItem(_ref) { | ||
var message = _ref.message, | ||
dataPath = _ref.dataPath, | ||
params = _ref.params, | ||
keyword = _ref.keyword; | ||
var validation = { | ||
message: message, | ||
dataPath: dataPath, | ||
params: params | ||
const parseValidationItem = ({ | ||
message, | ||
dataPath, | ||
params, | ||
keyword | ||
}) => { | ||
const validation = { | ||
message, | ||
dataPath, | ||
params | ||
}; | ||
@@ -36,8 +37,6 @@ | ||
function validateManifest(manifest) { | ||
var _warningValidator$err, _erroringValidator$er; | ||
(0, _validators.warningValidator)(manifest); | ||
(0, _validators.erroringValidator)(manifest); | ||
var warnings = (_warningValidator$err = _validators.warningValidator.errors) !== null && _warningValidator$err !== void 0 ? _warningValidator$err : []; | ||
var errors = (_erroringValidator$er = _validators.erroringValidator.errors) !== null && _erroringValidator$er !== void 0 ? _erroringValidator$er : []; | ||
const warnings = _validators.warningValidator.errors ?? []; | ||
const errors = _validators.erroringValidator.errors ?? []; | ||
return { | ||
@@ -44,0 +43,0 @@ warnings: warnings.map(parseValidationItem), |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -13,17 +13,17 @@ var _ajv = _interopRequireDefault(require("ajv")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var compiler = new _ajv["default"]({ | ||
const compiler = new _ajv.default({ | ||
allErrors: true | ||
}); | ||
(0, _ajvKeywords["default"])(compiler); | ||
(0, _ajvKeywords.default)(compiler); | ||
compiler.addKeyword('name', { | ||
schema: false, | ||
validate: function validation(data) { | ||
var _data$studio_options, _data$studio_options$; | ||
const { | ||
name: packageName | ||
} = data; | ||
const propertyGroup = data.studio_options?.property_groups?.[0]; | ||
var packageName = data.name; | ||
var propertyGroup = (_data$studio_options = data.studio_options) === null || _data$studio_options === void 0 ? void 0 : (_data$studio_options$ = _data$studio_options.property_groups) === null || _data$studio_options$ === void 0 ? void 0 : _data$studio_options$[0]; | ||
if (propertyGroup !== null && propertyGroup !== void 0 && propertyGroup.name) { | ||
if (propertyGroup?.name) { | ||
validation.errors = [{ | ||
@@ -45,2 +45,2 @@ message: 'property_group name must match package name', | ||
var _default = compiler; | ||
exports["default"] = _default; | ||
exports.default = _default; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -13,6 +13,6 @@ var _ajvCompiler = _interopRequireDefault(require("./ajvCompiler")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _default = _ajvCompiler["default"].compile(_schemas.erroringSchema); | ||
var _default = _ajvCompiler.default.compile(_schemas.erroringSchema); | ||
exports["default"] = _default; | ||
exports.default = _default; |
@@ -6,12 +6,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "warningValidator", { | ||
Object.defineProperty(exports, "erroringValidator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _warningValidator["default"]; | ||
get: function () { | ||
return _erroringValidator.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "erroringValidator", { | ||
Object.defineProperty(exports, "warningValidator", { | ||
enumerable: true, | ||
get: function get() { | ||
return _erroringValidator["default"]; | ||
get: function () { | ||
return _warningValidator.default; | ||
} | ||
@@ -24,2 +24,2 @@ }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = void 0; | ||
exports.default = void 0; | ||
@@ -13,6 +13,6 @@ var _ajvCompiler = _interopRequireDefault(require("./ajvCompiler")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _default = _ajvCompiler["default"].compile(_schemas.warningSchema); | ||
var _default = _ajvCompiler.default.compile(_schemas.warningSchema); | ||
exports["default"] = _default; | ||
exports.default = _default; |
{ | ||
"name": "@movable/rollup-plugin-package-manifest-validator", | ||
"version": "2.43.0", | ||
"version": "3.0.0-esmodules.0", | ||
"description": "Validates package-manifest.yml", | ||
@@ -27,7 +27,6 @@ "main": "dist", | ||
"@babel/core": "^7.14.0", | ||
"@babel/preset-env": "^7.14.1", | ||
"@babel/preset-env": "^7.20.2", | ||
"@babel/register": "^7.13.16", | ||
"chai": "^4.3.4", | ||
"mocha": "^8.3.2", | ||
"regenerator-runtime": "^0.13.7", | ||
"rollup": "^2.52.2" | ||
@@ -43,3 +42,3 @@ }, | ||
}, | ||
"gitHead": "463c301a85be7f9a36d1695be3f4de3c75721d29" | ||
"gitHead": "70ac10408686fdf679ee04cde278285f7778eaf1" | ||
} |
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
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
7
2666
82484
2