@atlaskit/adf-schema 56.0.13 → 56.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/adf-schema
2
2
 
3
+ ## 56.0.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c2986ab2c7a01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c2986ab2c7a01) -
8
+ Cleans up prefer static regex violations and enables e18e rule
9
+
10
+ ## 56.0.14
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
3
16
  ## 56.0.13
4
17
 
5
18
  ### Patch Changes
package/compass.yml CHANGED
@@ -24,6 +24,9 @@ customFields:
24
24
  - name: Department
25
25
  type: text
26
26
  value: Eng - Editor Frontend Platform
27
+ - name: Trusted Reviewer Teams
28
+ type: text
29
+ value: ari:cloud:identity::team/cf6a670b-5252-4c68-a769-9207de366beb
27
30
  - name: Technical Owner
28
31
  type: user
29
32
  value: ari:cloud:identity::user/5ea93c14a4c57d0b8bd65a16 # Anand Raj
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/adf-schema",
3
- "version": "56.0.13",
3
+ "version": "56.0.15",
4
4
  "description": "Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/adf-schema-generator": "^3.1.0",
41
41
  "@atlaskit/editor-prosemirror": "^8.0.0",
42
42
  "@atlaskit/platform-feature-flags": "^2.0.0",
43
- "@atlaskit/tmp-editor-statsig": "^119.0.0",
43
+ "@atlaskit/tmp-editor-statsig": "^120.1.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "css-color-names": "0.0.4",
46
46
  "linkify-it": "^3.0.3",
@@ -3,6 +3,8 @@ import { adfToValidatorSpec } from '@atlaskit/adf-schema-generator';
3
3
  import adfNode from '../src/next-schema/full-schema.adf';
4
4
  import { writeToFile } from './helpers/writeToFile';
5
5
 
6
+ const VALID_JS_IDENTIFIER_REGEX = /^[a-zA-Z_$][\w$]*$/u;
7
+
6
8
  const outputPath = path.join('src', 'validator-schema', 'generated');
7
9
 
8
10
  const indent = (level: number) => '\n' + ' '.repeat(level);
@@ -55,7 +57,7 @@ function serializeValidatorJson(value: unknown, depth = 0): string {
55
57
  }
56
58
  const inner = entries
57
59
  .map(([k, v]) => {
58
- const keyName = /^[a-zA-Z_$][\w$]*$/u.test(k) ? k : JSON.stringify(k);
60
+ const keyName = VALID_JS_IDENTIFIER_REGEX.test(k) ? k : JSON.stringify(k);
59
61
  return `${keyName}: ${serializeValidatorJson(v, depth + 1)}`;
60
62
  })
61
63
  .join(`,${indent(depth + 1)}`);
@@ -139,7 +141,7 @@ function serializeValidatorType(value: unknown, depth = 0, siblings: unknown[] =
139
141
  const sortedKeys = [...allKeys].sort((a, b) => a.localeCompare(b));
140
142
  const inner = sortedKeys
141
143
  .map((k) => {
142
- const keyName = /^[a-zA-Z_$][\w$]*$/u.test(k) ? k : JSON.stringify(k);
144
+ const keyName = VALID_JS_IDENTIFIER_REGEX.test(k) ? k : JSON.stringify(k);
143
145
  if (k in selfRecord) {
144
146
  const siblingsForK = siblingObjects.filter((s) => k in s).map((s) => s[k]);
145
147
  return `${keyName}: ${serializeValidatorType(selfRecord[k], depth + 1, siblingsForK)}`;
@@ -1,3 +1,6 @@
1
+ const NEXT_SCHEMA_FILES_PATTERN = /.*\/adf-schema\/packages\/adf-schema\/src\/next-schema\/.*/u;
2
+ const SCHEMA_FILES_PATTERN = /.*\/adf-schema\/packages\/adf-schema\/src\/schema\/.*/u;
3
+
1
4
  module.exports = {
2
5
  meta: {
3
6
  type: 'suggestion',
@@ -8,8 +11,8 @@ module.exports = {
8
11
  },
9
12
  create(context) {
10
13
  const { filename } = context;
11
- const nextSchemaFilesPattern = /.*\/adf-schema\/packages\/adf-schema\/src\/next-schema\/.*/u;
12
- const schemaFilesPattern = /.*\/adf-schema\/packages\/adf-schema\/src\/schema\/.*/u;
14
+ const nextSchemaFilesPattern = NEXT_SCHEMA_FILES_PATTERN;
15
+ const schemaFilesPattern = SCHEMA_FILES_PATTERN;
13
16
 
14
17
  const isInSchemaOrNextSchema =
15
18
  filename.match(nextSchemaFilesPattern) || filename.match(schemaFilesPattern);