@atlaskit/adf-utils 19.2.1 → 19.3.0

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.
Files changed (150) hide show
  1. package/CHANGELOG.md +968 -957
  2. package/afm-jira/tsconfig.json +24 -0
  3. package/codemods/17.0.0-update-imports-to-new-entry-points.ts +128 -136
  4. package/codemods/__tests__/next-update-imports-to-new-entry-points.ts +35 -35
  5. package/codemods/helpers/entry-points.ts +20 -28
  6. package/codemods/types/entry-points.ts +4 -4
  7. package/dist/cjs/validator/validator.js +3 -4
  8. package/dist/es2019/validator/validator.js +3 -4
  9. package/dist/esm/validator/validator.js +3 -4
  10. package/dist/types/builders/marks/alignment.d.ts +2 -2
  11. package/dist/types/builders/marks/annotation.d.ts +2 -2
  12. package/dist/types/builders/marks/border.d.ts +2 -2
  13. package/dist/types/builders/marks/breakout.d.ts +2 -2
  14. package/dist/types/builders/marks/code.d.ts +1 -1
  15. package/dist/types/builders/marks/data-consumer.d.ts +2 -2
  16. package/dist/types/builders/marks/em.d.ts +1 -1
  17. package/dist/types/builders/marks/fragment.d.ts +2 -2
  18. package/dist/types/builders/marks/indentation.d.ts +2 -2
  19. package/dist/types/builders/marks/link.d.ts +2 -2
  20. package/dist/types/builders/marks/strike.d.ts +1 -1
  21. package/dist/types/builders/marks/strong.d.ts +1 -1
  22. package/dist/types/builders/marks/subsup.d.ts +2 -2
  23. package/dist/types/builders/marks/text-color.d.ts +2 -2
  24. package/dist/types/builders/marks/underline.d.ts +1 -1
  25. package/dist/types/builders/nodes/block-card.d.ts +1 -1
  26. package/dist/types/builders/nodes/blockquote.d.ts +1 -1
  27. package/dist/types/builders/nodes/bodied-extension.d.ts +1 -1
  28. package/dist/types/builders/nodes/bullet-list.d.ts +1 -1
  29. package/dist/types/builders/nodes/caption.d.ts +1 -1
  30. package/dist/types/builders/nodes/code-block.d.ts +1 -1
  31. package/dist/types/builders/nodes/date.d.ts +1 -1
  32. package/dist/types/builders/nodes/decision-item.d.ts +1 -1
  33. package/dist/types/builders/nodes/decision-list.d.ts +1 -1
  34. package/dist/types/builders/nodes/embed-card.d.ts +1 -1
  35. package/dist/types/builders/nodes/expand.d.ts +1 -1
  36. package/dist/types/builders/nodes/extension.d.ts +1 -1
  37. package/dist/types/builders/nodes/hard-break.d.ts +1 -1
  38. package/dist/types/builders/nodes/heading.d.ts +1 -1
  39. package/dist/types/builders/nodes/inline-card.d.ts +1 -1
  40. package/dist/types/builders/nodes/inline-extension.d.ts +1 -1
  41. package/dist/types/builders/nodes/layout-column.d.ts +1 -1
  42. package/dist/types/builders/nodes/layout-section.d.ts +1 -1
  43. package/dist/types/builders/nodes/list-item.d.ts +1 -1
  44. package/dist/types/builders/nodes/media-group.d.ts +1 -1
  45. package/dist/types/builders/nodes/media-inline.d.ts +1 -1
  46. package/dist/types/builders/nodes/media-single.d.ts +1 -1
  47. package/dist/types/builders/nodes/media.d.ts +1 -1
  48. package/dist/types/builders/nodes/mention.d.ts +1 -1
  49. package/dist/types/builders/nodes/nested-expand.d.ts +1 -1
  50. package/dist/types/builders/nodes/ordered-list.d.ts +1 -1
  51. package/dist/types/builders/nodes/panel.d.ts +1 -1
  52. package/dist/types/builders/nodes/paragraph.d.ts +1 -1
  53. package/dist/types/builders/nodes/placeholder.d.ts +1 -1
  54. package/dist/types/builders/nodes/rule.d.ts +1 -1
  55. package/dist/types/builders/nodes/status.d.ts +1 -1
  56. package/dist/types/builders/nodes/table-cell.d.ts +1 -1
  57. package/dist/types/builders/nodes/table-header.d.ts +1 -1
  58. package/dist/types/builders/nodes/table-row.d.ts +1 -1
  59. package/dist/types/builders/nodes/table.d.ts +1 -1
  60. package/dist/types/builders/nodes/task-item.d.ts +1 -1
  61. package/dist/types/builders/nodes/task-list.d.ts +1 -1
  62. package/dist/types/builders/nodes/text.d.ts +1 -1
  63. package/dist/types/builders/utils/apply-mark.d.ts +1 -1
  64. package/dist/types/builders/utils/create-text-nodes.d.ts +1 -1
  65. package/dist/types/empty-adf.d.ts +1 -1
  66. package/dist/types/scrub/default-node-replacements.d.ts +2 -2
  67. package/dist/types/scrub/scrub-adf.d.ts +3 -3
  68. package/dist/types/scrub/scrub-content.d.ts +1 -1
  69. package/dist/types/transforms/helpers.d.ts +1 -1
  70. package/dist/types/transforms/indentation-marks-transform.d.ts +1 -1
  71. package/dist/types/transforms/invalid-media-content-transform.d.ts +1 -1
  72. package/dist/types/transforms/media-link-transform.d.ts +1 -1
  73. package/dist/types/transforms/nodes-missing-content-transform.d.ts +1 -1
  74. package/dist/types/transforms/text-link-code-transform.d.ts +1 -1
  75. package/dist/types/traverse/filter.d.ts +1 -1
  76. package/dist/types/traverse/map.d.ts +1 -1
  77. package/dist/types/traverse/reduce.d.ts +1 -1
  78. package/dist/types/traverse/traverse.d.ts +1 -1
  79. package/dist/types-ts4.5/builders/marks/alignment.d.ts +2 -2
  80. package/dist/types-ts4.5/builders/marks/annotation.d.ts +2 -2
  81. package/dist/types-ts4.5/builders/marks/border.d.ts +2 -2
  82. package/dist/types-ts4.5/builders/marks/breakout.d.ts +2 -2
  83. package/dist/types-ts4.5/builders/marks/code.d.ts +1 -1
  84. package/dist/types-ts4.5/builders/marks/data-consumer.d.ts +2 -2
  85. package/dist/types-ts4.5/builders/marks/em.d.ts +1 -1
  86. package/dist/types-ts4.5/builders/marks/fragment.d.ts +2 -2
  87. package/dist/types-ts4.5/builders/marks/indentation.d.ts +2 -2
  88. package/dist/types-ts4.5/builders/marks/link.d.ts +2 -2
  89. package/dist/types-ts4.5/builders/marks/strike.d.ts +1 -1
  90. package/dist/types-ts4.5/builders/marks/strong.d.ts +1 -1
  91. package/dist/types-ts4.5/builders/marks/subsup.d.ts +2 -2
  92. package/dist/types-ts4.5/builders/marks/text-color.d.ts +2 -2
  93. package/dist/types-ts4.5/builders/marks/underline.d.ts +1 -1
  94. package/dist/types-ts4.5/builders/nodes/block-card.d.ts +1 -1
  95. package/dist/types-ts4.5/builders/nodes/blockquote.d.ts +1 -1
  96. package/dist/types-ts4.5/builders/nodes/bodied-extension.d.ts +1 -1
  97. package/dist/types-ts4.5/builders/nodes/bullet-list.d.ts +1 -1
  98. package/dist/types-ts4.5/builders/nodes/caption.d.ts +1 -1
  99. package/dist/types-ts4.5/builders/nodes/code-block.d.ts +1 -1
  100. package/dist/types-ts4.5/builders/nodes/date.d.ts +1 -1
  101. package/dist/types-ts4.5/builders/nodes/decision-item.d.ts +1 -1
  102. package/dist/types-ts4.5/builders/nodes/decision-list.d.ts +1 -1
  103. package/dist/types-ts4.5/builders/nodes/embed-card.d.ts +1 -1
  104. package/dist/types-ts4.5/builders/nodes/expand.d.ts +1 -1
  105. package/dist/types-ts4.5/builders/nodes/extension.d.ts +1 -1
  106. package/dist/types-ts4.5/builders/nodes/hard-break.d.ts +1 -1
  107. package/dist/types-ts4.5/builders/nodes/heading.d.ts +1 -1
  108. package/dist/types-ts4.5/builders/nodes/inline-card.d.ts +1 -1
  109. package/dist/types-ts4.5/builders/nodes/inline-extension.d.ts +1 -1
  110. package/dist/types-ts4.5/builders/nodes/layout-column.d.ts +1 -1
  111. package/dist/types-ts4.5/builders/nodes/layout-section.d.ts +1 -1
  112. package/dist/types-ts4.5/builders/nodes/list-item.d.ts +1 -1
  113. package/dist/types-ts4.5/builders/nodes/media-group.d.ts +1 -1
  114. package/dist/types-ts4.5/builders/nodes/media-inline.d.ts +1 -1
  115. package/dist/types-ts4.5/builders/nodes/media-single.d.ts +1 -1
  116. package/dist/types-ts4.5/builders/nodes/media.d.ts +1 -1
  117. package/dist/types-ts4.5/builders/nodes/mention.d.ts +1 -1
  118. package/dist/types-ts4.5/builders/nodes/nested-expand.d.ts +1 -1
  119. package/dist/types-ts4.5/builders/nodes/ordered-list.d.ts +1 -1
  120. package/dist/types-ts4.5/builders/nodes/panel.d.ts +1 -1
  121. package/dist/types-ts4.5/builders/nodes/paragraph.d.ts +1 -1
  122. package/dist/types-ts4.5/builders/nodes/placeholder.d.ts +1 -1
  123. package/dist/types-ts4.5/builders/nodes/rule.d.ts +1 -1
  124. package/dist/types-ts4.5/builders/nodes/status.d.ts +1 -1
  125. package/dist/types-ts4.5/builders/nodes/table-cell.d.ts +1 -1
  126. package/dist/types-ts4.5/builders/nodes/table-header.d.ts +1 -1
  127. package/dist/types-ts4.5/builders/nodes/table-row.d.ts +1 -1
  128. package/dist/types-ts4.5/builders/nodes/table.d.ts +1 -1
  129. package/dist/types-ts4.5/builders/nodes/task-item.d.ts +1 -1
  130. package/dist/types-ts4.5/builders/nodes/task-list.d.ts +1 -1
  131. package/dist/types-ts4.5/builders/nodes/text.d.ts +1 -1
  132. package/dist/types-ts4.5/builders/utils/apply-mark.d.ts +1 -1
  133. package/dist/types-ts4.5/builders/utils/create-text-nodes.d.ts +1 -1
  134. package/dist/types-ts4.5/empty-adf.d.ts +1 -1
  135. package/dist/types-ts4.5/scrub/default-node-replacements.d.ts +2 -2
  136. package/dist/types-ts4.5/scrub/scrub-adf.d.ts +3 -3
  137. package/dist/types-ts4.5/scrub/scrub-content.d.ts +1 -1
  138. package/dist/types-ts4.5/transforms/helpers.d.ts +1 -1
  139. package/dist/types-ts4.5/transforms/indentation-marks-transform.d.ts +1 -1
  140. package/dist/types-ts4.5/transforms/invalid-media-content-transform.d.ts +1 -1
  141. package/dist/types-ts4.5/transforms/media-link-transform.d.ts +1 -1
  142. package/dist/types-ts4.5/transforms/nodes-missing-content-transform.d.ts +1 -1
  143. package/dist/types-ts4.5/transforms/text-link-code-transform.d.ts +1 -1
  144. package/dist/types-ts4.5/traverse/filter.d.ts +1 -1
  145. package/dist/types-ts4.5/traverse/map.d.ts +1 -1
  146. package/dist/types-ts4.5/traverse/reduce.d.ts +1 -1
  147. package/dist/types-ts4.5/traverse/traverse.d.ts +1 -1
  148. package/docs/0-intro.tsx +406 -406
  149. package/package.json +68 -70
  150. package/report.api.md +2 -1
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "../../../../tsconfig.entry-points.jira.json",
3
+ "compilerOptions": {
4
+ "declaration": true,
5
+ "target": "es5",
6
+ "outDir": "../../../../../tsDist/@atlaskit__adf-utils/app",
7
+ "composite": true,
8
+ "rootDir": "../"
9
+ },
10
+ "include": [
11
+ "../src/**/*.ts",
12
+ "../src/**/*.tsx"
13
+ ],
14
+ "exclude": [
15
+ "../src/**/__tests__/*",
16
+ "../src/**/*.test.*",
17
+ "../src/**/test.*"
18
+ ],
19
+ "references": [
20
+ {
21
+ "path": "../../../monorepo-tooling/codemod-utils/afm-jira/tsconfig.json"
22
+ }
23
+ ]
24
+ }
@@ -5,169 +5,161 @@ import type { EntryPointChangeRequest } from './types/entry-points';
5
5
  const DEFAULT_ADF_UTILS_IMPORT = '@atlaskit/adf-utils';
6
6
 
7
7
  const types: EntryPointChangeRequest = {
8
- importSpecifiers: [
9
- 'ADFEntity',
10
- 'ADFEntityMark',
11
- 'Visitor',
12
- 'VisitorCollection',
13
- ],
14
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
15
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/types`,
16
- shouldBeTypeImport: true,
8
+ importSpecifiers: ['ADFEntity', 'ADFEntityMark', 'Visitor', 'VisitorCollection'],
9
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
10
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/types`,
11
+ shouldBeTypeImport: true,
17
12
  };
18
13
 
19
14
  const validatorTypes: EntryPointChangeRequest = {
20
- importSpecifiers: [
21
- 'Content',
22
- 'ErrorCallback',
23
- 'Output',
24
- 'ValidationError',
25
- 'ValidationErrorMap',
26
- 'ValidationErrorType',
27
- 'ValidationMode',
28
- 'ValidationOptions',
29
- 'ErrorCallbackOptions',
30
- 'Validate',
31
- 'NodeValidationResult',
32
- 'ValidatorSpec',
33
- 'AttributesSpec',
34
- 'ValidatorContent',
35
- 'MarkValidationResult',
36
- 'SpecValidatorResult',
37
- 'Err',
38
- ],
39
- oldEntryPointsToRemove: [
40
- DEFAULT_ADF_UTILS_IMPORT,
41
- `${DEFAULT_ADF_UTILS_IMPORT}/validator`,
42
- ],
43
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/validatorTypes`,
44
- shouldBeTypeImport: true,
15
+ importSpecifiers: [
16
+ 'Content',
17
+ 'ErrorCallback',
18
+ 'Output',
19
+ 'ValidationError',
20
+ 'ValidationErrorMap',
21
+ 'ValidationErrorType',
22
+ 'ValidationMode',
23
+ 'ValidationOptions',
24
+ 'ErrorCallbackOptions',
25
+ 'Validate',
26
+ 'NodeValidationResult',
27
+ 'ValidatorSpec',
28
+ 'AttributesSpec',
29
+ 'ValidatorContent',
30
+ 'MarkValidationResult',
31
+ 'SpecValidatorResult',
32
+ 'Err',
33
+ ],
34
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT, `${DEFAULT_ADF_UTILS_IMPORT}/validator`],
35
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/validatorTypes`,
36
+ shouldBeTypeImport: true,
45
37
  };
46
38
 
47
39
  const transforms: EntryPointChangeRequest = {
48
- importSpecifiers: [
49
- 'transformMediaLinkMarks',
50
- 'transformTextLinkCodeMarks',
51
- 'transformDedupeMarks',
52
- 'transformNodesMissingContent',
53
- 'transformIndentationMarks',
54
- ],
55
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
56
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/transforms`,
57
- shouldBeTypeImport: false,
40
+ importSpecifiers: [
41
+ 'transformMediaLinkMarks',
42
+ 'transformTextLinkCodeMarks',
43
+ 'transformDedupeMarks',
44
+ 'transformNodesMissingContent',
45
+ 'transformIndentationMarks',
46
+ ],
47
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
48
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/transforms`,
49
+ shouldBeTypeImport: false,
58
50
  };
59
51
 
60
52
  const traverse: EntryPointChangeRequest = {
61
- importSpecifiers: ['traverse', 'map', 'reduce', 'filter'],
62
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
63
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/traverse`,
64
- shouldBeTypeImport: false,
53
+ importSpecifiers: ['traverse', 'map', 'reduce', 'filter'],
54
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
55
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/traverse`,
56
+ shouldBeTypeImport: false,
65
57
  };
66
58
 
67
59
  const builders: EntryPointChangeRequest = {
68
- importSpecifiers: [
69
- 'a',
70
- 'alignment',
71
- 'b',
72
- 'blockCard',
73
- 'blockQuote',
74
- 'bodiedExtension',
75
- 'br',
76
- 'breakout',
77
- 'bulletList',
78
- 'code',
79
- 'codeBlock',
80
- 'date',
81
- 'decisionItem',
82
- 'decisionList',
83
- 'doc',
84
- 'em',
85
- 'embedCard',
86
- 'emoji',
87
- 'expand',
88
- 'extension',
89
- 'hardBreak',
90
- 'heading',
91
- 'hr',
92
- 'indentation',
93
- 'inlineCard',
94
- 'inlineExtension',
95
- 'layoutColumn',
96
- 'layoutSection',
97
- 'li',
98
- 'link',
99
- 'listItem',
100
- 'media',
101
- 'mediaGroup',
102
- 'mediaSingle',
103
- 'mention',
104
- 'nestedExpand',
105
- 'ol',
106
- 'orderedList',
107
- 'p',
108
- 'panel',
109
- 'paragraph',
110
- 'placeholder',
111
- 'rule',
112
- 'status',
113
- 'strike',
114
- 'strong',
115
- 'subsup',
116
- 'table',
117
- 'tableCell',
118
- 'tableHeader',
119
- 'tableRow',
120
- 'taskItem',
121
- 'taskList',
122
- 'td',
123
- 'text',
124
- 'textColor',
125
- 'th',
126
- 'tr',
127
- 'u',
128
- 'ul',
129
- 'underline',
130
- 'dataConsumer',
131
- ],
132
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
133
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/builders`,
134
- shouldBeTypeImport: false,
60
+ importSpecifiers: [
61
+ 'a',
62
+ 'alignment',
63
+ 'b',
64
+ 'blockCard',
65
+ 'blockQuote',
66
+ 'bodiedExtension',
67
+ 'br',
68
+ 'breakout',
69
+ 'bulletList',
70
+ 'code',
71
+ 'codeBlock',
72
+ 'date',
73
+ 'decisionItem',
74
+ 'decisionList',
75
+ 'doc',
76
+ 'em',
77
+ 'embedCard',
78
+ 'emoji',
79
+ 'expand',
80
+ 'extension',
81
+ 'hardBreak',
82
+ 'heading',
83
+ 'hr',
84
+ 'indentation',
85
+ 'inlineCard',
86
+ 'inlineExtension',
87
+ 'layoutColumn',
88
+ 'layoutSection',
89
+ 'li',
90
+ 'link',
91
+ 'listItem',
92
+ 'media',
93
+ 'mediaGroup',
94
+ 'mediaSingle',
95
+ 'mention',
96
+ 'nestedExpand',
97
+ 'ol',
98
+ 'orderedList',
99
+ 'p',
100
+ 'panel',
101
+ 'paragraph',
102
+ 'placeholder',
103
+ 'rule',
104
+ 'status',
105
+ 'strike',
106
+ 'strong',
107
+ 'subsup',
108
+ 'table',
109
+ 'tableCell',
110
+ 'tableHeader',
111
+ 'tableRow',
112
+ 'taskItem',
113
+ 'taskList',
114
+ 'td',
115
+ 'text',
116
+ 'textColor',
117
+ 'th',
118
+ 'tr',
119
+ 'u',
120
+ 'ul',
121
+ 'underline',
122
+ 'dataConsumer',
123
+ ],
124
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
125
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/builders`,
126
+ shouldBeTypeImport: false,
135
127
  };
136
128
 
137
129
  const emptyAdf: EntryPointChangeRequest = {
138
- importSpecifiers: ['getEmptyADF'],
139
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
140
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/empty-adf`,
141
- shouldBeTypeImport: false,
130
+ importSpecifiers: ['getEmptyADF'],
131
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
132
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/empty-adf`,
133
+ shouldBeTypeImport: false,
142
134
  };
143
135
 
144
136
  const validator: EntryPointChangeRequest = {
145
- importSpecifiers: ['validator', 'validateAttrs'],
146
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
147
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/validator`,
148
- shouldBeTypeImport: false,
137
+ importSpecifiers: ['validator', 'validateAttrs'],
138
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
139
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/validator`,
140
+ shouldBeTypeImport: false,
149
141
  };
150
142
 
151
143
  const scrub: EntryPointChangeRequest = {
152
- importSpecifiers: ['scrubAdf'],
153
- oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
154
- newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/scrub`,
155
- shouldBeTypeImport: false,
144
+ importSpecifiers: ['scrubAdf'],
145
+ oldEntryPointsToRemove: [DEFAULT_ADF_UTILS_IMPORT],
146
+ newEntryPoint: `${DEFAULT_ADF_UTILS_IMPORT}/scrub`,
147
+ shouldBeTypeImport: false,
156
148
  };
157
149
 
158
150
  const entryPointChangeRequests: EntryPointChangeRequest[] = [
159
- transforms,
160
- validatorTypes,
161
- types,
162
- traverse,
163
- builders,
164
- validator,
165
- emptyAdf,
166
- scrub,
151
+ transforms,
152
+ validatorTypes,
153
+ types,
154
+ traverse,
155
+ builders,
156
+ validator,
157
+ emptyAdf,
158
+ scrub,
167
159
  ];
168
160
 
169
161
  export const entryPointChangeMigrates =
170
- createMigratesFromEntryPointChangeRequests(entryPointChangeRequests);
162
+ createMigratesFromEntryPointChangeRequests(entryPointChangeRequests);
171
163
 
172
164
  const transformer = createTransformer(entryPointChangeMigrates);
173
165
 
@@ -3,10 +3,10 @@ import transformer from '../17.0.0-update-imports-to-new-entry-points';
3
3
  const defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;
4
4
 
5
5
  describe('updates adf-util imports to new child entry points', () => {
6
- defineInlineTest(
7
- { default: transformer, parser: 'tsx' },
8
- {},
9
- `
6
+ defineInlineTest(
7
+ { default: transformer, parser: 'tsx' },
8
+ {},
9
+ `
10
10
  import { traverse } from "@atlaskit/adf-utils";
11
11
  import { ADFEntity, ADFEntityMark } from "@atlaskit/adf-utils";
12
12
  import { validateAttrs, validator, ValidationErrorMap } from '@atlaskit/adf-utils';
@@ -19,7 +19,7 @@ describe('updates adf-util imports to new child entry points', () => {
19
19
  </div>
20
20
  );
21
21
  `,
22
- `
22
+ `
23
23
  import type { ValidationErrorMap, ValidationMode, NodeValidationResult } from "@atlaskit/adf-utils/validatorTypes";
24
24
  import type { ADFEntity, ADFEntityMark } from "@atlaskit/adf-utils/types";
25
25
  import { traverse } from "@atlaskit/adf-utils/traverse";
@@ -31,13 +31,13 @@ describe('updates adf-util imports to new child entry points', () => {
31
31
  </div>
32
32
  );
33
33
  `,
34
- 'should handle migrating any combination of old entry points (including type imports and imports with type modifiers) to new child entry points',
35
- );
34
+ 'should handle migrating any combination of old entry points (including type imports and imports with type modifiers) to new child entry points',
35
+ );
36
36
 
37
- defineInlineTest(
38
- { default: transformer, parser: 'tsx' },
39
- {},
40
- `
37
+ defineInlineTest(
38
+ { default: transformer, parser: 'tsx' },
39
+ {},
40
+ `
41
41
  import { traverse, teamRocketAndMeowth, scrubAdf } from "@atlaskit/adf-utils";
42
42
  import { Pokemon, ADFEntityMark, AshKetchum } from "@atlaskit/adf-utils";
43
43
  import type { PsyDuck } from "@atlaskit/adf-utils/pokemon-types";
@@ -49,7 +49,7 @@ describe('updates adf-util imports to new child entry points', () => {
49
49
  </div>
50
50
  );
51
51
  `,
52
- `
52
+ `
53
53
  import type { ADFEntityMark } from "@atlaskit/adf-utils/types";
54
54
  import { traverse } from "@atlaskit/adf-utils/traverse";
55
55
  import { scrubAdf } from "@atlaskit/adf-utils/scrub";
@@ -64,13 +64,13 @@ describe('updates adf-util imports to new child entry points', () => {
64
64
  </div>
65
65
  );
66
66
  `,
67
- 'should leave unknown entry points or import specifiers untouched (and unmerged if initially unmerged)',
68
- );
67
+ 'should leave unknown entry points or import specifiers untouched (and unmerged if initially unmerged)',
68
+ );
69
69
 
70
- defineInlineTest(
71
- { default: transformer, parser: 'tsx' },
72
- {},
73
- `
70
+ defineInlineTest(
71
+ { default: transformer, parser: 'tsx' },
72
+ {},
73
+ `
74
74
  import { VisitorCollection } from "@atlaskit/adf-utils/types";
75
75
  import type { Visitor } from "@atlaskit/adf-utils";
76
76
 
@@ -80,7 +80,7 @@ describe('updates adf-util imports to new child entry points', () => {
80
80
  </div>
81
81
  );
82
82
  `,
83
- `
83
+ `
84
84
  import type { VisitorCollection, Visitor } from "@atlaskit/adf-utils/types";
85
85
 
86
86
  export default () => (
@@ -89,13 +89,13 @@ describe('updates adf-util imports to new child entry points', () => {
89
89
  </div>
90
90
  );
91
91
  `,
92
- 'should handle migrating new child entry points with mismatched importKinds (e.g. non-type when should be type import)',
93
- );
92
+ 'should handle migrating new child entry points with mismatched importKinds (e.g. non-type when should be type import)',
93
+ );
94
94
 
95
- defineInlineTest(
96
- { default: transformer, parser: 'tsx' },
97
- {},
98
- `
95
+ defineInlineTest(
96
+ { default: transformer, parser: 'tsx' },
97
+ {},
98
+ `
99
99
  import { scrubAdf, doc, p, link } from "@atlaskit/adf-utils";
100
100
  import { blockCard, paragraph } from "@atlaskit/adf-utils/builders";
101
101
  import { placeholder, transformDedupeMarks } from "@atlaskit/adf-utils";
@@ -109,7 +109,7 @@ describe('updates adf-util imports to new child entry points', () => {
109
109
  </div>
110
110
  );
111
111
  `,
112
- `
112
+ `
113
113
  import { transformDedupeMarks } from "@atlaskit/adf-utils/transforms";
114
114
  import { getEmptyADF } from "@atlaskit/adf-utils/empty-adf";
115
115
  import { scrubAdf } from "@atlaskit/adf-utils/scrub";
@@ -122,13 +122,13 @@ describe('updates adf-util imports to new child entry points', () => {
122
122
  </div>
123
123
  );
124
124
  `,
125
- 'should handle migrating any combination of old and new entry points to new child entry points',
126
- );
125
+ 'should handle migrating any combination of old and new entry points to new child entry points',
126
+ );
127
127
 
128
- defineInlineTest(
129
- { default: transformer, parser: 'tsx' },
130
- {},
131
- `
128
+ defineInlineTest(
129
+ { default: transformer, parser: 'tsx' },
130
+ {},
131
+ `
132
132
  const { scrubAdf } = require("@atlaskit/adf-utils");
133
133
  import * as adfUtils from "@atlaskit/adf-utils";
134
134
 
@@ -149,7 +149,7 @@ describe('updates adf-util imports to new child entry points', () => {
149
149
  )
150
150
  }
151
151
  `,
152
- `
152
+ `
153
153
  const { scrubAdf } = require("@atlaskit/adf-utils");
154
154
  import * as adfUtils from "@atlaskit/adf-utils";
155
155
 
@@ -170,6 +170,6 @@ describe('updates adf-util imports to new child entry points', () => {
170
170
  )
171
171
  }
172
172
  `,
173
- 'should skip migrating other import syntaxes (namespace imports, CJS, dyamic imports)',
174
- );
173
+ 'should skip migrating other import syntaxes (namespace imports, CJS, dyamic imports)',
174
+ );
175
175
  });
@@ -1,33 +1,25 @@
1
1
  import { changeImportEntryPoint } from '@atlaskit/codemod-utils';
2
- import type {
3
- EntryPointChangeRequest,
4
- EntryPointChangeMigrates,
5
- } from '../types/entry-points';
2
+ import type { EntryPointChangeRequest, EntryPointChangeMigrates } from '../types/entry-points';
6
3
 
7
4
  export const createMigratesFromEntryPointChangeRequests = (
8
- changeRequests: EntryPointChangeRequest[],
5
+ changeRequests: EntryPointChangeRequest[],
9
6
  ) => {
10
- const entryPointChangeMigrates: EntryPointChangeMigrates = [];
11
- changeRequests.forEach(
12
- ({
13
- importSpecifiers,
14
- oldEntryPointsToRemove,
15
- newEntryPoint,
16
- shouldBeTypeImport,
17
- }) => {
18
- oldEntryPointsToRemove.forEach((oldEntryPoint) => {
19
- importSpecifiers.forEach((importSpecifier) => {
20
- entryPointChangeMigrates.push(
21
- changeImportEntryPoint(
22
- oldEntryPoint,
23
- importSpecifier,
24
- newEntryPoint,
25
- shouldBeTypeImport,
26
- ),
27
- );
28
- });
29
- });
30
- },
31
- );
32
- return entryPointChangeMigrates;
7
+ const entryPointChangeMigrates: EntryPointChangeMigrates = [];
8
+ changeRequests.forEach(
9
+ ({ importSpecifiers, oldEntryPointsToRemove, newEntryPoint, shouldBeTypeImport }) => {
10
+ oldEntryPointsToRemove.forEach((oldEntryPoint) => {
11
+ importSpecifiers.forEach((importSpecifier) => {
12
+ entryPointChangeMigrates.push(
13
+ changeImportEntryPoint(
14
+ oldEntryPoint,
15
+ importSpecifier,
16
+ newEntryPoint,
17
+ shouldBeTypeImport,
18
+ ),
19
+ );
20
+ });
21
+ });
22
+ },
23
+ );
24
+ return entryPointChangeMigrates;
33
25
  };
@@ -1,10 +1,10 @@
1
1
  import type { changeImportEntryPoint } from '@atlaskit/codemod-utils';
2
2
 
3
3
  export type EntryPointChangeRequest = {
4
- importSpecifiers: string[];
5
- oldEntryPointsToRemove: string[];
6
- newEntryPoint: string;
7
- shouldBeTypeImport: boolean;
4
+ importSpecifiers: string[];
5
+ oldEntryPointsToRemove: string[];
6
+ newEntryPoint: string;
7
+ shouldBeTypeImport: boolean;
8
8
  };
9
9
 
10
10
  export type EntryPointChange = ReturnType<typeof changeImportEntryPoint>;
@@ -85,7 +85,6 @@ function createSpec(nodes, marks) {
85
85
  spec.props.content = _objectSpread({}, spec.props.content);
86
86
  }
87
87
  spec.props.content.items = spec.props.content.items
88
-
89
88
  // ['inline'] => [['emoji', 'hr', ...]]
90
89
  // ['media'] => [['media']]
91
90
  .map(function (item) {
@@ -122,9 +121,9 @@ function createSpec(nodes, marks) {
122
121
  .map(function (subItem) {
123
122
  return Array.isArray(subItem) && marks ?
124
123
  /**
125
- * TODO: Probably try something like immer, but it's 3.3kb gzipped.
126
- * Not worth it just for this.
127
- */
124
+ * TODO: Probably try something like immer, but it's 3.3kb gzipped.
125
+ * Not worth it just for this.
126
+ */
128
127
  [subItem[0], mapMarksItems(subItem[1])] : subItem;
129
128
  });
130
129
  });
@@ -71,7 +71,6 @@ function createSpec(nodes, marks) {
71
71
  };
72
72
  }
73
73
  spec.props.content.items = spec.props.content.items
74
-
75
74
  // ['inline'] => [['emoji', 'hr', ...]]
76
75
  // ['media'] => [['media']]
77
76
  .map(item => isString(item) ? Array.isArray(specs[item]) ? specs[item] : [item] : item)
@@ -100,9 +99,9 @@ function createSpec(nodes, marks) {
100
99
  // Filter marks
101
100
  .map(subItem => Array.isArray(subItem) && marks ?
102
101
  /**
103
- * TODO: Probably try something like immer, but it's 3.3kb gzipped.
104
- * Not worth it just for this.
105
- */
102
+ * TODO: Probably try something like immer, but it's 3.3kb gzipped.
103
+ * Not worth it just for this.
104
+ */
106
105
  [subItem[0], mapMarksItems(subItem[1])] : subItem));
107
106
  }
108
107
  }
@@ -74,7 +74,6 @@ function createSpec(nodes, marks) {
74
74
  spec.props.content = _objectSpread({}, spec.props.content);
75
75
  }
76
76
  spec.props.content.items = spec.props.content.items
77
-
78
77
  // ['inline'] => [['emoji', 'hr', ...]]
79
78
  // ['media'] => [['media']]
80
79
  .map(function (item) {
@@ -111,9 +110,9 @@ function createSpec(nodes, marks) {
111
110
  .map(function (subItem) {
112
111
  return Array.isArray(subItem) && marks ?
113
112
  /**
114
- * TODO: Probably try something like immer, but it's 3.3kb gzipped.
115
- * Not worth it just for this.
116
- */
113
+ * TODO: Probably try something like immer, but it's 3.3kb gzipped.
114
+ * Not worth it just for this.
115
+ */
117
116
  [subItem[0], mapMarksItems(subItem[1])] : subItem;
118
117
  });
119
118
  });
@@ -1,3 +1,3 @@
1
- import { AlignmentMarkDefinition, AlignmentAttributes, ParagraphDefinition, HeadingDefinition } from '@atlaskit/adf-schema';
2
- import { WithMark, WithAppliedMark } from '../types';
1
+ import { type AlignmentMarkDefinition, type AlignmentAttributes, type ParagraphDefinition, type HeadingDefinition } from '@atlaskit/adf-schema';
2
+ import { type WithMark, type WithAppliedMark } from '../types';
3
3
  export declare const alignment: (attrs: AlignmentAttributes) => (maybeNode: WithMark | string) => WithAppliedMark<ParagraphDefinition | HeadingDefinition, AlignmentMarkDefinition>;
@@ -1,3 +1,3 @@
1
- import { AnnotationMarkAttributes } from '@atlaskit/adf-schema';
2
- import { WithMark } from '../types';
1
+ import { type AnnotationMarkAttributes } from '@atlaskit/adf-schema';
2
+ import { type WithMark } from '../types';
3
3
  export declare const annotation: (attrs: AnnotationMarkAttributes) => (maybeNode: WithMark | string) => WithMark | import("@atlaskit/adf-schema").TextDefinition;
@@ -1,3 +1,3 @@
1
- import { BorderMarkAttributes } from '@atlaskit/adf-schema';
2
- import { WithMark } from '../types';
1
+ import { type BorderMarkAttributes } from '@atlaskit/adf-schema';
2
+ import { type WithMark } from '../types';
3
3
  export declare const border: (attrs: BorderMarkAttributes) => (maybeNode: WithMark | string) => WithMark | import("@atlaskit/adf-schema").TextDefinition;
@@ -1,3 +1,3 @@
1
- import { BreakoutMarkAttrs, BreakoutMarkDefinition, CodeBlockDefinition, LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
- import { WithAppliedMark } from '../types';
1
+ import { type BreakoutMarkAttrs, type BreakoutMarkDefinition, type CodeBlockDefinition, type LayoutSectionDefinition } from '@atlaskit/adf-schema';
2
+ import { type WithAppliedMark } from '../types';
3
3
  export declare const breakout: (attrs: BreakoutMarkAttrs) => (maybeNode: CodeBlockDefinition | LayoutSectionDefinition) => WithAppliedMark<CodeBlockDefinition | LayoutSectionDefinition, BreakoutMarkDefinition>;
@@ -1,2 +1,2 @@
1
- import { WithMark } from '../types';
1
+ import { type WithMark } from '../types';
2
2
  export declare const code: (maybeNode: WithMark | string) => WithMark | import("@atlaskit/adf-schema").TextDefinition;
@@ -1,3 +1,3 @@
1
- import { ExtensionDefinition, BodiedExtensionDefinition, InlineExtensionDefinition, DataConsumerAttributes, DataConsumerDefinition } from '@atlaskit/adf-schema';
2
- import { WithAppliedMark } from '../types';
1
+ import { type ExtensionDefinition, type BodiedExtensionDefinition, type InlineExtensionDefinition, type DataConsumerAttributes, type DataConsumerDefinition } from '@atlaskit/adf-schema';
2
+ import { type WithAppliedMark } from '../types';
3
3
  export declare const dataConsumer: (attrs: DataConsumerAttributes) => (maybeNode: ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition) => WithAppliedMark<ExtensionDefinition | BodiedExtensionDefinition | InlineExtensionDefinition, DataConsumerDefinition>;
@@ -1,2 +1,2 @@
1
- import { WithMark } from '../types';
1
+ import { type WithMark } from '../types';
2
2
  export declare const em: (maybeNode: WithMark | string) => WithMark | import("@atlaskit/adf-schema").TextDefinition;