@atlaskit/adf-schema-generator
Advanced tools
Comparing version 1.28.2 to 1.29.0
# @atlaskit/adf-schema-generator | ||
## 1.28.2 | ||
## 1.29.0 | ||
### Patch Changes | ||
### Minor Changes | ||
- ba6e68e: Update adf-schema-generator docs | ||
- 1d3ae85: feat: add noExtend to ADFNodeSpec to opt-out of extends behaviour |
@@ -130,3 +130,3 @@ "use strict"; | ||
// The purpose of this is to force people to manually clone these if needed. | ||
var NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0']; | ||
var NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0', 'noExtend']; | ||
var baseSpec = _objectSpread({}, _classPrivateFieldGet(_spec, this)); | ||
@@ -133,0 +133,0 @@ for (var _i = 0, _NOT_INHERITED_PROPER = NOT_INHERITED_PROPERTIES; _i < _NOT_INHERITED_PROPER.length; _i++) { |
@@ -40,3 +40,3 @@ "use strict"; | ||
var required = (0, _requiredBuilder.buildRequired)(nodeSpec.attrs, ((_content$ = content[0]) === null || _content$ === void 0 ? void 0 : _content$.minItems) === 1 || Boolean((_content$2 = content[0]) === null || _content$2 === void 0 ? void 0 : (_content$2$range = _content$2.range) === null || _content$2$range === void 0 ? void 0 : _content$2$range.type), node.getName()); | ||
if (node.getVariant() === 'base') { | ||
if (node.getVariant() === 'base' || nodeSpec.noExtend) { | ||
json.type = 'object'; | ||
@@ -43,0 +43,0 @@ json.properties = _objectSpread(_objectSpread(_objectSpread(_objectSpread({ |
@@ -104,3 +104,3 @@ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); } | ||
// The purpose of this is to force people to manually clone these if needed. | ||
const NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0']; | ||
const NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0', 'noExtend']; | ||
const baseSpec = { | ||
@@ -107,0 +107,0 @@ ..._classPrivateFieldGet(_spec, this) |
@@ -30,3 +30,3 @@ import { JSONSchemaTransformerName } from '../transformerNames'; | ||
const required = buildRequired(nodeSpec.attrs, ((_content$ = content[0]) === null || _content$ === void 0 ? void 0 : _content$.minItems) === 1 || Boolean((_content$2 = content[0]) === null || _content$2 === void 0 ? void 0 : (_content$2$range = _content$2.range) === null || _content$2$range === void 0 ? void 0 : _content$2$range.type), node.getName()); | ||
if (node.getVariant() === 'base') { | ||
if (node.getVariant() === 'base' || nodeSpec.noExtend) { | ||
json.type = 'object'; | ||
@@ -33,0 +33,0 @@ json.properties = { |
@@ -122,3 +122,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
// The purpose of this is to force people to manually clone these if needed. | ||
var NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0']; | ||
var NOT_INHERITED_PROPERTIES = ['DANGEROUS_MANUAL_OVERRIDE', 'hasEmptyMarks', 'stage0', 'noExtend']; | ||
var baseSpec = _objectSpread({}, _classPrivateFieldGet(_spec, this)); | ||
@@ -125,0 +125,0 @@ for (var _i = 0, _NOT_INHERITED_PROPER = NOT_INHERITED_PROPERTIES; _i < _NOT_INHERITED_PROPER.length; _i++) { |
@@ -33,3 +33,3 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty"; | ||
var required = buildRequired(nodeSpec.attrs, ((_content$ = content[0]) === null || _content$ === void 0 ? void 0 : _content$.minItems) === 1 || Boolean((_content$2 = content[0]) === null || _content$2 === void 0 ? void 0 : (_content$2$range = _content$2.range) === null || _content$2$range === void 0 ? void 0 : _content$2$range.type), node.getName()); | ||
if (node.getVariant() === 'base') { | ||
if (node.getVariant() === 'base' || nodeSpec.noExtend) { | ||
json.type = 'object'; | ||
@@ -36,0 +36,0 @@ json.properties = _objectSpread(_objectSpread(_objectSpread(_objectSpread({ |
@@ -168,2 +168,14 @@ import { ADFNode } from '../adfNode'; | ||
/** | ||
* Some transformers implement an "extends" mechanism. This allows to avoid full | ||
* node duplication and only override the necessary properties. | ||
* | ||
* The logic to decide when extends is appropriate can't be 100% sound | ||
* and may require manual intervention. | ||
* | ||
* This flag allows to opt-out of the extends mechanism. | ||
* | ||
* Currently only supported by json-schema transformation. | ||
*/ | ||
noExtend?: boolean; | ||
/** | ||
* PLEASE DO NOT USE THIS PROPERTY. | ||
@@ -170,0 +182,0 @@ * |
{ | ||
"name": "@atlaskit/adf-schema-generator", | ||
"version": "1.28.2", | ||
"version": "1.29.0", | ||
"description": "Generates ADF and PM schemas", | ||
@@ -5,0 +5,0 @@ "repository": "https://bitbucket.org/atlassian/adf-schema", |
@@ -250,2 +250,12 @@ import { adfNodeGroup } from '../../adfNodeGroup'; | ||
test('should not inherit noExtend from a base node', () => { | ||
const node = adfNode('paragraph') | ||
.define({ | ||
noExtend: true, | ||
}) | ||
.variant('with-attrs', {}); | ||
expect(node.use('with-attrs').getSpec().noExtend).not.toBeDefined(); | ||
}); | ||
test('should not inherit hasEmptyMarks from a base node', () => { | ||
@@ -252,0 +262,0 @@ const node = adfNode('paragraph') |
@@ -113,2 +113,3 @@ import type { TransformerNames } from './transforms/transformerNames'; | ||
'stage0', | ||
'noExtend', | ||
]; | ||
@@ -115,0 +116,0 @@ const baseSpec = { ...this.#spec }; |
@@ -48,3 +48,3 @@ import { ADFNode } from '../../adfNode'; | ||
if (node.getVariant() === 'base') { | ||
if (node.getVariant() === 'base' || nodeSpec.noExtend) { | ||
json.type = 'object'; | ||
@@ -51,0 +51,0 @@ json.properties = { |
@@ -193,2 +193,15 @@ import { ADFNode } from '../adfNode'; | ||
/** | ||
* Some transformers implement an "extends" mechanism. This allows to avoid full | ||
* node duplication and only override the necessary properties. | ||
* | ||
* The logic to decide when extends is appropriate can't be 100% sound | ||
* and may require manual intervention. | ||
* | ||
* This flag allows to opt-out of the extends mechanism. | ||
* | ||
* Currently only supported by json-schema transformation. | ||
*/ | ||
noExtend?: boolean; | ||
/** | ||
* PLEASE DO NOT USE THIS PROPERTY. | ||
@@ -195,0 +208,0 @@ * |
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
566979
267
14841