@atlaskit/editor-plugins 10.2.24 → 10.2.25
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 +6 -0
- package/package.json +98 -98
- package/scripts/entrypoint-data.ts +20 -23
- package/scripts/generate-tests.ts +2 -2
- package/scripts/update-editor-plugins.ts +18 -10
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugins",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.25",
|
|
4
4
|
"description": "A convenience facade package that exposes all @atlaskit/editor-plugin-* plugins so that users can add this package without having to manually add all their plugins",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,103 +29,103 @@
|
|
|
29
29
|
"update-editor-plugins": "run-ts scripts/update-editor-plugins.ts"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/editor-plugin-accessibility-utils": "
|
|
33
|
-
"@atlaskit/editor-plugin-alignment": "
|
|
34
|
-
"@atlaskit/editor-plugin-analytics": "
|
|
35
|
-
"@atlaskit/editor-plugin-annotation": "
|
|
36
|
-
"@atlaskit/editor-plugin-avatar-group": "
|
|
37
|
-
"@atlaskit/editor-plugin-base": "
|
|
38
|
-
"@atlaskit/editor-plugin-batch-attribute-updates": "
|
|
39
|
-
"@atlaskit/editor-plugin-before-primary-toolbar": "
|
|
40
|
-
"@atlaskit/editor-plugin-better-type-history": "
|
|
41
|
-
"@atlaskit/editor-plugin-block-controls": "
|
|
42
|
-
"@atlaskit/editor-plugin-block-menu": "0.0
|
|
43
|
-
"@atlaskit/editor-plugin-block-type": "
|
|
44
|
-
"@atlaskit/editor-plugin-border": "
|
|
45
|
-
"@atlaskit/editor-plugin-breakout": "
|
|
46
|
-
"@atlaskit/editor-plugin-caption": "
|
|
47
|
-
"@atlaskit/editor-plugin-card": "
|
|
48
|
-
"@atlaskit/editor-plugin-clear-marks-on-empty-doc": "
|
|
49
|
-
"@atlaskit/editor-plugin-clipboard": "
|
|
50
|
-
"@atlaskit/editor-plugin-code-bidi-warning": "
|
|
51
|
-
"@atlaskit/editor-plugin-code-block": "
|
|
52
|
-
"@atlaskit/editor-plugin-collab-edit": "
|
|
53
|
-
"@atlaskit/editor-plugin-composition": "
|
|
54
|
-
"@atlaskit/editor-plugin-connectivity": "
|
|
55
|
-
"@atlaskit/editor-plugin-content-insertion": "
|
|
56
|
-
"@atlaskit/editor-plugin-context-identifier": "
|
|
57
|
-
"@atlaskit/editor-plugin-context-panel": "
|
|
58
|
-
"@atlaskit/editor-plugin-copy-button": "
|
|
59
|
-
"@atlaskit/editor-plugin-custom-autoformat": "
|
|
60
|
-
"@atlaskit/editor-plugin-data-consumer": "
|
|
61
|
-
"@atlaskit/editor-plugin-date": "
|
|
62
|
-
"@atlaskit/editor-plugin-decorations": "
|
|
63
|
-
"@atlaskit/editor-plugin-editor-disabled": "
|
|
64
|
-
"@atlaskit/editor-plugin-editor-viewmode": "
|
|
65
|
-
"@atlaskit/editor-plugin-editor-viewmode-effects": "
|
|
66
|
-
"@atlaskit/editor-plugin-emoji": "
|
|
67
|
-
"@atlaskit/editor-plugin-engagement-platform": "
|
|
68
|
-
"@atlaskit/editor-plugin-expand": "
|
|
69
|
-
"@atlaskit/editor-plugin-extension": "
|
|
70
|
-
"@atlaskit/editor-plugin-feature-flags": "
|
|
71
|
-
"@atlaskit/editor-plugin-feedback-dialog": "
|
|
72
|
-
"@atlaskit/editor-plugin-find-replace": "
|
|
73
|
-
"@atlaskit/editor-plugin-floating-toolbar": "
|
|
74
|
-
"@atlaskit/editor-plugin-focus": "
|
|
75
|
-
"@atlaskit/editor-plugin-fragment": "
|
|
76
|
-
"@atlaskit/editor-plugin-grid": "
|
|
77
|
-
"@atlaskit/editor-plugin-guideline": "
|
|
78
|
-
"@atlaskit/editor-plugin-help-dialog": "
|
|
79
|
-
"@atlaskit/editor-plugin-highlight": "
|
|
80
|
-
"@atlaskit/editor-plugin-history": "
|
|
81
|
-
"@atlaskit/editor-plugin-hyperlink": "
|
|
82
|
-
"@atlaskit/editor-plugin-image-upload": "
|
|
83
|
-
"@atlaskit/editor-plugin-indentation": "
|
|
84
|
-
"@atlaskit/editor-plugin-insert-block": "
|
|
85
|
-
"@atlaskit/editor-plugin-interaction": "
|
|
86
|
-
"@atlaskit/editor-plugin-layout": "
|
|
87
|
-
"@atlaskit/editor-plugin-limited-mode": "0.0
|
|
88
|
-
"@atlaskit/editor-plugin-list": "
|
|
89
|
-
"@atlaskit/editor-plugin-local-id": "
|
|
90
|
-
"@atlaskit/editor-plugin-loom": "
|
|
91
|
-
"@atlaskit/editor-plugin-max-content-size": "
|
|
92
|
-
"@atlaskit/editor-plugin-media": "
|
|
93
|
-
"@atlaskit/editor-plugin-media-insert": "
|
|
94
|
-
"@atlaskit/editor-plugin-mentions": "
|
|
95
|
-
"@atlaskit/editor-plugin-metrics": "
|
|
96
|
-
"@atlaskit/editor-plugin-ncs-step-metrics": "
|
|
97
|
-
"@atlaskit/editor-plugin-panel": "
|
|
98
|
-
"@atlaskit/editor-plugin-paste": "
|
|
99
|
-
"@atlaskit/editor-plugin-paste-options-toolbar": "
|
|
100
|
-
"@atlaskit/editor-plugin-placeholder": "
|
|
101
|
-
"@atlaskit/editor-plugin-placeholder-text": "
|
|
102
|
-
"@atlaskit/editor-plugin-primary-toolbar": "
|
|
103
|
-
"@atlaskit/editor-plugin-quick-insert": "
|
|
104
|
-
"@atlaskit/editor-plugin-rule": "
|
|
105
|
-
"@atlaskit/editor-plugin-save-on-enter": "
|
|
106
|
-
"@atlaskit/editor-plugin-scroll-into-view": "
|
|
107
|
-
"@atlaskit/editor-plugin-selection": "
|
|
108
|
-
"@atlaskit/editor-plugin-selection-extension": "
|
|
109
|
-
"@atlaskit/editor-plugin-selection-marker": "
|
|
110
|
-
"@atlaskit/editor-plugin-selection-toolbar": "
|
|
111
|
-
"@atlaskit/editor-plugin-show-diff": "0.
|
|
112
|
-
"@atlaskit/editor-plugin-status": "
|
|
113
|
-
"@atlaskit/editor-plugin-submit-editor": "
|
|
114
|
-
"@atlaskit/editor-plugin-synced-block": "0.
|
|
115
|
-
"@atlaskit/editor-plugin-table": "
|
|
116
|
-
"@atlaskit/editor-plugin-tasks-and-decisions": "
|
|
117
|
-
"@atlaskit/editor-plugin-text-color": "
|
|
118
|
-
"@atlaskit/editor-plugin-text-formatting": "
|
|
119
|
-
"@atlaskit/editor-plugin-toolbar": "0.
|
|
120
|
-
"@atlaskit/editor-plugin-toolbar-lists-indentation": "
|
|
121
|
-
"@atlaskit/editor-plugin-track-changes": "
|
|
122
|
-
"@atlaskit/editor-plugin-type-ahead": "
|
|
123
|
-
"@atlaskit/editor-plugin-ufo": "
|
|
124
|
-
"@atlaskit/editor-plugin-undo-redo": "
|
|
125
|
-
"@atlaskit/editor-plugin-unsupported-content": "
|
|
126
|
-
"@atlaskit/editor-plugin-user-intent": "
|
|
127
|
-
"@atlaskit/editor-plugin-user-preferences": "
|
|
128
|
-
"@atlaskit/editor-plugin-width": "
|
|
32
|
+
"@atlaskit/editor-plugin-accessibility-utils": "4.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-alignment": "5.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-analytics": "4.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-annotation": "4.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-avatar-group": "5.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-base": "5.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-batch-attribute-updates": "4.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-before-primary-toolbar": "4.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-better-type-history": "4.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-block-controls": "5.0.0",
|
|
42
|
+
"@atlaskit/editor-plugin-block-menu": "1.0.0",
|
|
43
|
+
"@atlaskit/editor-plugin-block-type": "7.0.0",
|
|
44
|
+
"@atlaskit/editor-plugin-border": "4.0.0",
|
|
45
|
+
"@atlaskit/editor-plugin-breakout": "4.0.0",
|
|
46
|
+
"@atlaskit/editor-plugin-caption": "4.0.0",
|
|
47
|
+
"@atlaskit/editor-plugin-card": "8.0.0",
|
|
48
|
+
"@atlaskit/editor-plugin-clear-marks-on-empty-doc": "4.0.0",
|
|
49
|
+
"@atlaskit/editor-plugin-clipboard": "4.0.0",
|
|
50
|
+
"@atlaskit/editor-plugin-code-bidi-warning": "4.0.0",
|
|
51
|
+
"@atlaskit/editor-plugin-code-block": "6.0.0",
|
|
52
|
+
"@atlaskit/editor-plugin-collab-edit": "5.0.0",
|
|
53
|
+
"@atlaskit/editor-plugin-composition": "3.0.0",
|
|
54
|
+
"@atlaskit/editor-plugin-connectivity": "4.0.0",
|
|
55
|
+
"@atlaskit/editor-plugin-content-insertion": "4.0.0",
|
|
56
|
+
"@atlaskit/editor-plugin-context-identifier": "4.0.0",
|
|
57
|
+
"@atlaskit/editor-plugin-context-panel": "6.0.0",
|
|
58
|
+
"@atlaskit/editor-plugin-copy-button": "4.0.0",
|
|
59
|
+
"@atlaskit/editor-plugin-custom-autoformat": "4.0.0",
|
|
60
|
+
"@atlaskit/editor-plugin-data-consumer": "4.0.0",
|
|
61
|
+
"@atlaskit/editor-plugin-date": "6.0.0",
|
|
62
|
+
"@atlaskit/editor-plugin-decorations": "4.0.0",
|
|
63
|
+
"@atlaskit/editor-plugin-editor-disabled": "4.0.0",
|
|
64
|
+
"@atlaskit/editor-plugin-editor-viewmode": "6.0.0",
|
|
65
|
+
"@atlaskit/editor-plugin-editor-viewmode-effects": "4.0.0",
|
|
66
|
+
"@atlaskit/editor-plugin-emoji": "5.0.0",
|
|
67
|
+
"@atlaskit/editor-plugin-engagement-platform": "5.0.0",
|
|
68
|
+
"@atlaskit/editor-plugin-expand": "5.0.0",
|
|
69
|
+
"@atlaskit/editor-plugin-extension": "7.0.0",
|
|
70
|
+
"@atlaskit/editor-plugin-feature-flags": "3.0.0",
|
|
71
|
+
"@atlaskit/editor-plugin-feedback-dialog": "4.0.0",
|
|
72
|
+
"@atlaskit/editor-plugin-find-replace": "4.0.0",
|
|
73
|
+
"@atlaskit/editor-plugin-floating-toolbar": "6.0.0",
|
|
74
|
+
"@atlaskit/editor-plugin-focus": "3.0.0",
|
|
75
|
+
"@atlaskit/editor-plugin-fragment": "4.0.0",
|
|
76
|
+
"@atlaskit/editor-plugin-grid": "4.0.0",
|
|
77
|
+
"@atlaskit/editor-plugin-guideline": "4.0.0",
|
|
78
|
+
"@atlaskit/editor-plugin-help-dialog": "4.0.0",
|
|
79
|
+
"@atlaskit/editor-plugin-highlight": "4.0.0",
|
|
80
|
+
"@atlaskit/editor-plugin-history": "4.0.0",
|
|
81
|
+
"@atlaskit/editor-plugin-hyperlink": "6.0.0",
|
|
82
|
+
"@atlaskit/editor-plugin-image-upload": "4.0.0",
|
|
83
|
+
"@atlaskit/editor-plugin-indentation": "4.0.0",
|
|
84
|
+
"@atlaskit/editor-plugin-insert-block": "5.0.0",
|
|
85
|
+
"@atlaskit/editor-plugin-interaction": "6.0.0",
|
|
86
|
+
"@atlaskit/editor-plugin-layout": "4.0.0",
|
|
87
|
+
"@atlaskit/editor-plugin-limited-mode": "1.0.0",
|
|
88
|
+
"@atlaskit/editor-plugin-list": "6.0.0",
|
|
89
|
+
"@atlaskit/editor-plugin-local-id": "2.0.0",
|
|
90
|
+
"@atlaskit/editor-plugin-loom": "6.0.0",
|
|
91
|
+
"@atlaskit/editor-plugin-max-content-size": "4.0.0",
|
|
92
|
+
"@atlaskit/editor-plugin-media": "6.0.0",
|
|
93
|
+
"@atlaskit/editor-plugin-media-insert": "10.0.0",
|
|
94
|
+
"@atlaskit/editor-plugin-mentions": "6.0.0",
|
|
95
|
+
"@atlaskit/editor-plugin-metrics": "5.0.0",
|
|
96
|
+
"@atlaskit/editor-plugin-ncs-step-metrics": "3.0.0",
|
|
97
|
+
"@atlaskit/editor-plugin-panel": "6.0.0",
|
|
98
|
+
"@atlaskit/editor-plugin-paste": "5.0.0",
|
|
99
|
+
"@atlaskit/editor-plugin-paste-options-toolbar": "4.0.0",
|
|
100
|
+
"@atlaskit/editor-plugin-placeholder": "4.0.0",
|
|
101
|
+
"@atlaskit/editor-plugin-placeholder-text": "4.0.0",
|
|
102
|
+
"@atlaskit/editor-plugin-primary-toolbar": "5.0.0",
|
|
103
|
+
"@atlaskit/editor-plugin-quick-insert": "4.0.0",
|
|
104
|
+
"@atlaskit/editor-plugin-rule": "4.0.0",
|
|
105
|
+
"@atlaskit/editor-plugin-save-on-enter": "4.0.0",
|
|
106
|
+
"@atlaskit/editor-plugin-scroll-into-view": "4.0.0",
|
|
107
|
+
"@atlaskit/editor-plugin-selection": "4.0.0",
|
|
108
|
+
"@atlaskit/editor-plugin-selection-extension": "4.0.0",
|
|
109
|
+
"@atlaskit/editor-plugin-selection-marker": "4.0.0",
|
|
110
|
+
"@atlaskit/editor-plugin-selection-toolbar": "5.0.0",
|
|
111
|
+
"@atlaskit/editor-plugin-show-diff": "1.0.0",
|
|
112
|
+
"@atlaskit/editor-plugin-status": "5.0.0",
|
|
113
|
+
"@atlaskit/editor-plugin-submit-editor": "4.0.0",
|
|
114
|
+
"@atlaskit/editor-plugin-synced-block": "1.0.0",
|
|
115
|
+
"@atlaskit/editor-plugin-table": "13.0.0",
|
|
116
|
+
"@atlaskit/editor-plugin-tasks-and-decisions": "7.0.0",
|
|
117
|
+
"@atlaskit/editor-plugin-text-color": "4.0.0",
|
|
118
|
+
"@atlaskit/editor-plugin-text-formatting": "4.0.0",
|
|
119
|
+
"@atlaskit/editor-plugin-toolbar": "1.0.0",
|
|
120
|
+
"@atlaskit/editor-plugin-toolbar-lists-indentation": "5.0.0",
|
|
121
|
+
"@atlaskit/editor-plugin-track-changes": "3.0.0",
|
|
122
|
+
"@atlaskit/editor-plugin-type-ahead": "4.0.0",
|
|
123
|
+
"@atlaskit/editor-plugin-ufo": "4.0.0",
|
|
124
|
+
"@atlaskit/editor-plugin-undo-redo": "4.0.0",
|
|
125
|
+
"@atlaskit/editor-plugin-unsupported-content": "4.0.0",
|
|
126
|
+
"@atlaskit/editor-plugin-user-intent": "2.0.0",
|
|
127
|
+
"@atlaskit/editor-plugin-user-preferences": "2.0.0",
|
|
128
|
+
"@atlaskit/editor-plugin-width": "5.0.0",
|
|
129
129
|
"@babel/runtime": "^7.0.0"
|
|
130
130
|
},
|
|
131
131
|
"peerDependencies": {
|
|
@@ -7,11 +7,11 @@ import path from 'path';
|
|
|
7
7
|
// eslint-disable-next-line import/no-namespace
|
|
8
8
|
import * as ts from 'typescript';
|
|
9
9
|
|
|
10
|
-
interface
|
|
10
|
+
interface ExtractedExportData {
|
|
11
11
|
absoluteFilePath: string;
|
|
12
12
|
atlaskitImportName: string;
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
newExportKey: string;
|
|
14
|
+
newExportValue: string;
|
|
15
15
|
newRelativeFilePath: string;
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -20,13 +20,13 @@ interface FileData {
|
|
|
20
20
|
newRelativeFilePath: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
interface
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
interface NewExportData {
|
|
24
|
+
newExportKey: string;
|
|
25
|
+
newExportValue: string;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface EntryPointData {
|
|
29
|
-
|
|
29
|
+
exportData: NewExportData;
|
|
30
30
|
atlaskitImportName: string;
|
|
31
31
|
fileData: FileData;
|
|
32
32
|
}
|
|
@@ -41,7 +41,7 @@ function getExports(folderPath: string) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
const folderName = path.basename(folderPath);
|
|
44
|
-
const data:
|
|
44
|
+
const data: ExtractedExportData[] = [];
|
|
45
45
|
|
|
46
46
|
for (const key in exportsValue) {
|
|
47
47
|
if (exportsValue.hasOwnProperty(key)) {
|
|
@@ -57,8 +57,8 @@ function getExports(folderPath: string) {
|
|
|
57
57
|
);
|
|
58
58
|
data.push({
|
|
59
59
|
newRelativeFilePath: newRelativeFilePath,
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
newExportKey: './' + path.join(shortenedFolderName, normalizedKey),
|
|
61
|
+
newExportValue: './' + newRelativeFilePath,
|
|
62
62
|
atlaskitImportName: path.join('@atlaskit', folderName, normalizedKey),
|
|
63
63
|
absoluteFilePath: path.join(folderPath, normalizedValue),
|
|
64
64
|
});
|
|
@@ -99,7 +99,7 @@ function isTypeExport(exportName: string, statements: string[]): boolean {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
function
|
|
102
|
+
function createExportStatementsForExport(importName: string, filePath: string) {
|
|
103
103
|
const { variableExports, typeExports } = findExportedVariablesAndTypes(filePath);
|
|
104
104
|
|
|
105
105
|
const exportStatements = [
|
|
@@ -209,31 +209,28 @@ function getFileExportNames(fileName: string) {
|
|
|
209
209
|
|
|
210
210
|
export function getEntryPointDataForPlugin(pluginPath: string): EntryPointData[] {
|
|
211
211
|
const exportsValue = getExports(pluginPath);
|
|
212
|
-
const
|
|
212
|
+
const newExportData: EntryPointData[] = [];
|
|
213
213
|
|
|
214
214
|
for (const {
|
|
215
215
|
newRelativeFilePath,
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
newExportKey,
|
|
217
|
+
newExportValue,
|
|
218
218
|
atlaskitImportName,
|
|
219
219
|
absoluteFilePath,
|
|
220
220
|
} of exportsValue) {
|
|
221
|
-
const exportStatements =
|
|
222
|
-
|
|
223
|
-
absoluteFilePath,
|
|
224
|
-
);
|
|
225
|
-
newAfExportData.push({
|
|
221
|
+
const exportStatements = createExportStatementsForExport(atlaskitImportName, absoluteFilePath);
|
|
222
|
+
newExportData.push({
|
|
226
223
|
fileData: {
|
|
227
224
|
newRelativeFilePath,
|
|
228
225
|
fileContent: exportStatements,
|
|
229
226
|
},
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
exportData: {
|
|
228
|
+
newExportKey,
|
|
229
|
+
newExportValue,
|
|
233
230
|
},
|
|
234
231
|
atlaskitImportName,
|
|
235
232
|
});
|
|
236
233
|
}
|
|
237
234
|
|
|
238
|
-
return
|
|
235
|
+
return newExportData;
|
|
239
236
|
}
|
|
@@ -51,11 +51,11 @@ describe('${pluginName} wrapper', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
function generateEntryPointTest(entryPointData: EntryPointData) {
|
|
54
|
-
const wrapperImport = entryPointData.
|
|
54
|
+
const wrapperImport = entryPointData.exportData.newExportValue
|
|
55
55
|
.replace('src/', '')
|
|
56
56
|
.replace('.ts', '');
|
|
57
57
|
return `
|
|
58
|
-
it('check ${entryPointData.
|
|
58
|
+
it('check ${entryPointData.exportData.newExportKey} exports all the same variables as the original', () => {
|
|
59
59
|
const original = require('${entryPointData.atlaskitImportName}');
|
|
60
60
|
const wrapper = require('.${wrapperImport}');
|
|
61
61
|
const originalKeys = Object.keys(original).sort();
|
|
@@ -142,13 +142,13 @@ function orderObjectByDepthAndRoot(input: { [key: string]: string }): {
|
|
|
142
142
|
);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
function
|
|
146
|
-
//
|
|
147
|
-
const
|
|
148
|
-
entryPointData.forEach(({
|
|
149
|
-
|
|
145
|
+
function getNewExports(entryPointData: EntryPointData[]): Record<string, string> {
|
|
146
|
+
// exports we want to keep are hardcoded here
|
|
147
|
+
const newExports: Record<string, string> = {};
|
|
148
|
+
entryPointData.forEach(({ exportData }) => {
|
|
149
|
+
newExports[exportData.newExportKey] = exportData.newExportValue;
|
|
150
150
|
});
|
|
151
|
-
return
|
|
151
|
+
return newExports;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
function getUpdatedDependenciesFromPackageJsons(
|
|
@@ -265,7 +265,7 @@ This may be a problem with Prettier rather than code. Please check support chann
|
|
|
265
265
|
}
|
|
266
266
|
|
|
267
267
|
// Function to update plugin files based on dependencies
|
|
268
|
-
// returns the
|
|
268
|
+
// returns the exports object
|
|
269
269
|
function updatePluginsFiles(
|
|
270
270
|
depFolderNames: string[],
|
|
271
271
|
entryPointDatas: EntryPointData[],
|
|
@@ -464,7 +464,7 @@ async function run() {
|
|
|
464
464
|
});
|
|
465
465
|
const allEntryPointData = Object.values(pluginEntryPointDataMap).flat();
|
|
466
466
|
updatePluginsFiles(depFolderNames, allEntryPointData, argv['dry-run']);
|
|
467
|
-
const
|
|
467
|
+
const newEditorPluginsExports = getNewExports(allEntryPointData);
|
|
468
468
|
generateAllPluginTests(
|
|
469
469
|
pluginEntryPointDataMap,
|
|
470
470
|
path.join(editorPluginsPath, 'src', '__tests__'),
|
|
@@ -479,11 +479,19 @@ async function run() {
|
|
|
479
479
|
};
|
|
480
480
|
const updatedPackageJson = {
|
|
481
481
|
...editorPluginsPackageJson,
|
|
482
|
-
|
|
483
|
-
exports: orderObjectByDepthAndRoot(newEditorPluginsAfExports),
|
|
482
|
+
exports: orderObjectByDepthAndRoot(newEditorPluginsExports),
|
|
484
483
|
dependencies: sortObjectKeys(updatedDeps),
|
|
485
484
|
'platform-feature-flags': featureFlags,
|
|
485
|
+
// only update the 'af:exports' property if it already exists in the package
|
|
486
|
+
...(editorPluginsPackageJson['af:exports'] && {
|
|
487
|
+
'af:exports': orderObjectByDepthAndRoot(newEditorPluginsExports),
|
|
488
|
+
}),
|
|
489
|
+
// only update the 'exports' property if it already exists in the package
|
|
490
|
+
...(editorPluginsPackageJson.exports && {
|
|
491
|
+
exports: orderObjectByDepthAndRoot(newEditorPluginsExports),
|
|
492
|
+
}),
|
|
486
493
|
};
|
|
494
|
+
|
|
487
495
|
const updatedPackageJsonString = JSON.stringify(updatedPackageJson, null, '\t') + '\n';
|
|
488
496
|
|
|
489
497
|
fs.writeFileSync(editorPluginsPackageJsonPath, updatedPackageJsonString);
|