@gravityforms/dependency-extraction-webpack-plugin 4.5.0-beta.1 → 4.6.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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Gravity Forms Dependency Extraction Webpack Plugin
2
2
 
3
- This plugin enhances the WordPress [Dependency Extraction Webpack Plugin](https://github.com/WordPress/gutenberg/tree/trunk/packages/dependency-extraction-webpack-plugin) by adding automatic inclusion of Gravity Forms dependencies alongside WordPress dependencies. Use this if you are developing features or addons that extend Gravity Forms and want to use our externals instead of bundling our code yourselves. Also used by the Gravity Forms plugin itself.
3
+ This plugin enhances the WordPress [Dependency Extraction Webpack Plugin](https://github.com/WordPress/gutenberg/tree/trunk/packages/dependency-extraction-webpack-plugin) by adding automatic inclusion of Gravity Forms dependencies alongside WordPress dependencies. Use this if you are developing features or add-ons that extend Gravity Forms and want to use our externals instead of bundling our code yourselves. This is also used by the Gravity Forms plugin itself.
4
4
 
5
5
  ## Installation
6
6
 
@@ -42,6 +42,15 @@ module.exports = {
42
42
  - Type: array
43
43
  - Default: []
44
44
 
45
- This option specifies an array of potential Gravity Forms excluded packages. These packages will be included within the bundle (as shown in the example above) and not mapped to the external.
45
+ This option specifies an array of packages to ignore during externals mapping. These packages will be included within your bundle and not mapped to the external.
46
+
47
+ An important note on our `@gravityforms/components` package. If you pass `@gravityforms/components` here, it will exclude all the components, but you can also pass `@gravityforms/components/react/admin/modules/Dialog` to only exclude the Dialog component. This could be useful if you want to use a version of the package that has that component in a state that is ahead of what core has shipped with. All other components will map to our externals, but this one will be included in the bundle.
48
+
49
+ #### `rootNamespace`
50
+
51
+ - Type: string
52
+ - Default: 'gform'
53
+
54
+ If you are using our components by enqueuing the compiled files yourself instead of using the ones enqueued by Gravity Forms, you need to set this option to the same one you used in that package. Check the components readme for more details.
46
55
 
47
56
  For more configuration options, refer to the original [dependency extraction plugin](https://github.com/WordPress/gutenberg/blob/trunk/packages/dependency-extraction-webpack-plugin/README.md#options).
@@ -37,25 +37,17 @@ module.exports = [
37
37
  "externalPath": "components.admin.html.elements"
38
38
  },
39
39
  {
40
- "defaultExport": "Textarea",
41
- "namedExports": [
42
- "textareaTemplate"
43
- ],
44
- "importPath": "html/admin/elements/",
45
- "externalPath": "components.admin.html.elements"
46
- },
47
- {
48
- "defaultExport": "StatusIndicator",
40
+ "defaultExport": "StackedIcon",
49
41
  "namedExports": [
50
- "statusIndicatorTemplate"
42
+ "stackedIconTemplate"
51
43
  ],
52
44
  "importPath": "html/admin/elements/",
53
45
  "externalPath": "components.admin.html.elements"
54
46
  },
55
47
  {
56
- "defaultExport": "Link",
48
+ "defaultExport": "Textarea",
57
49
  "namedExports": [
58
- "linkTemplate"
50
+ "textareaTemplate"
59
51
  ],
60
52
  "importPath": "html/admin/elements/",
61
53
  "externalPath": "components.admin.html.elements"
@@ -69,9 +61,9 @@ module.exports = [
69
61
  "externalPath": "components.admin.html.elements"
70
62
  },
71
63
  {
72
- "defaultExport": "StackedIcon",
64
+ "defaultExport": "StatusIndicator",
73
65
  "namedExports": [
74
- "stackedIconTemplate"
66
+ "statusIndicatorTemplate"
75
67
  ],
76
68
  "importPath": "html/admin/elements/",
77
69
  "externalPath": "components.admin.html.elements"
@@ -92,14 +84,6 @@ module.exports = [
92
84
  "importPath": "html/admin/elements/",
93
85
  "externalPath": "components.admin.html.elements"
94
86
  },
95
- {
96
- "defaultExport": "Label",
97
- "namedExports": [
98
- "labelTemplate"
99
- ],
100
- "importPath": "html/admin/elements/",
101
- "externalPath": "components.admin.html.elements"
102
- },
103
87
  {
104
88
  "defaultExport": "HelpText",
105
89
  "namedExports": [
@@ -117,9 +101,9 @@ module.exports = [
117
101
  "externalPath": "components.admin.html.elements"
118
102
  },
119
103
  {
120
- "defaultExport": "Button",
104
+ "defaultExport": "Label",
121
105
  "namedExports": [
122
- "buttonTemplate"
106
+ "labelTemplate"
123
107
  ],
124
108
  "importPath": "html/admin/elements/",
125
109
  "externalPath": "components.admin.html.elements"
@@ -133,6 +117,14 @@ module.exports = [
133
117
  "importPath": "html/admin/elements/",
134
118
  "externalPath": "components.admin.html.elements"
135
119
  },
120
+ {
121
+ "defaultExport": "Button",
122
+ "namedExports": [
123
+ "buttonTemplate"
124
+ ],
125
+ "importPath": "html/admin/elements/",
126
+ "externalPath": "components.admin.html.elements"
127
+ },
136
128
  {
137
129
  "defaultExport": "Alert",
138
130
  "namedExports": [
@@ -142,9 +134,12 @@ module.exports = [
142
134
  "externalPath": "components.admin.html.elements"
143
135
  },
144
136
  {
145
- "defaultExport": "Tooltip",
146
- "importPath": "react/admin/modules/",
147
- "externalPath": "components.admin.react.modules"
137
+ "defaultExport": "Link",
138
+ "namedExports": [
139
+ "linkTemplate"
140
+ ],
141
+ "importPath": "html/admin/elements/",
142
+ "externalPath": "components.admin.html.elements"
148
143
  },
149
144
  {
150
145
  "defaultExport": "Swatch",
@@ -152,7 +147,7 @@ module.exports = [
152
147
  "externalPath": "components.admin.react.modules"
153
148
  },
154
149
  {
155
- "defaultExport": "Steps",
150
+ "defaultExport": "Tooltip",
156
151
  "importPath": "react/admin/modules/",
157
152
  "externalPath": "components.admin.react.modules"
158
153
  },
@@ -162,12 +157,12 @@ module.exports = [
162
157
  "externalPath": "components.admin.react.modules"
163
158
  },
164
159
  {
165
- "defaultExport": "Pagination",
160
+ "defaultExport": "RouterNavBar",
166
161
  "importPath": "react/admin/modules/",
167
162
  "externalPath": "components.admin.react.modules"
168
163
  },
169
164
  {
170
- "defaultExport": "RouterNavBar",
165
+ "defaultExport": "Pagination",
171
166
  "importPath": "react/admin/modules/",
172
167
  "externalPath": "components.admin.react.modules"
173
168
  },
@@ -182,12 +177,12 @@ module.exports = [
182
177
  "externalPath": "components.admin.react.modules"
183
178
  },
184
179
  {
185
- "defaultExport": "List",
180
+ "defaultExport": "Steps",
186
181
  "importPath": "react/admin/modules/",
187
182
  "externalPath": "components.admin.react.modules"
188
183
  },
189
184
  {
190
- "defaultExport": "Gravatar",
185
+ "defaultExport": "List",
191
186
  "importPath": "react/admin/modules/",
192
187
  "externalPath": "components.admin.react.modules"
193
188
  },
@@ -196,13 +191,18 @@ module.exports = [
196
191
  "importPath": "react/admin/modules/",
197
192
  "externalPath": "components.admin.react.modules"
198
193
  },
194
+ {
195
+ "defaultExport": "Gravatar",
196
+ "importPath": "react/admin/modules/",
197
+ "externalPath": "components.admin.react.modules"
198
+ },
199
199
  {
200
200
  "defaultExport": "Flyout",
201
201
  "importPath": "react/admin/modules/",
202
202
  "externalPath": "components.admin.react.modules"
203
203
  },
204
204
  {
205
- "defaultExport": "Droplist",
205
+ "defaultExport": "Dialog",
206
206
  "importPath": "react/admin/modules/",
207
207
  "externalPath": "components.admin.react.modules"
208
208
  },
@@ -212,7 +212,7 @@ module.exports = [
212
212
  "externalPath": "components.admin.react.modules"
213
213
  },
214
214
  {
215
- "defaultExport": "ColorPicker",
215
+ "defaultExport": "Droplist",
216
216
  "importPath": "react/admin/modules/",
217
217
  "externalPath": "components.admin.react.modules"
218
218
  },
@@ -222,7 +222,12 @@ module.exports = [
222
222
  "externalPath": "components.admin.react.modules"
223
223
  },
224
224
  {
225
- "defaultExport": "Alert",
225
+ "defaultExport": "ColorPicker",
226
+ "importPath": "react/admin/modules/",
227
+ "externalPath": "components.admin.react.modules"
228
+ },
229
+ {
230
+ "defaultExport": "Chart",
226
231
  "importPath": "react/admin/modules/",
227
232
  "externalPath": "components.admin.react.modules"
228
233
  },
@@ -231,6 +236,11 @@ module.exports = [
231
236
  "importPath": "react/admin/modules/",
232
237
  "externalPath": "components.admin.react.modules"
233
238
  },
239
+ {
240
+ "defaultExport": "Alert",
241
+ "importPath": "react/admin/modules/",
242
+ "externalPath": "components.admin.react.modules"
243
+ },
234
244
  {
235
245
  "defaultExport": "Toggle",
236
246
  "importPath": "react/admin/elements/",
@@ -256,38 +266,28 @@ module.exports = [
256
266
  "importPath": "react/admin/elements/",
257
267
  "externalPath": "components.admin.react.elements"
258
268
  },
259
- {
260
- "defaultExport": "Dialog",
261
- "importPath": "react/admin/modules/",
262
- "externalPath": "components.admin.react.modules"
263
- },
264
- {
265
- "defaultExport": "Select",
266
- "importPath": "react/admin/elements/",
267
- "externalPath": "components.admin.react.elements"
268
- },
269
269
  {
270
270
  "defaultExport": "Range",
271
271
  "importPath": "react/admin/elements/",
272
272
  "externalPath": "components.admin.react.elements"
273
273
  },
274
274
  {
275
- "defaultExport": "Pill",
275
+ "defaultExport": "Select",
276
276
  "importPath": "react/admin/elements/",
277
277
  "externalPath": "components.admin.react.elements"
278
278
  },
279
279
  {
280
- "defaultExport": "Radio",
280
+ "defaultExport": "Link",
281
281
  "importPath": "react/admin/elements/",
282
282
  "externalPath": "components.admin.react.elements"
283
283
  },
284
284
  {
285
- "defaultExport": "Link",
285
+ "defaultExport": "Pill",
286
286
  "importPath": "react/admin/elements/",
287
287
  "externalPath": "components.admin.react.elements"
288
288
  },
289
289
  {
290
- "defaultExport": "Label",
290
+ "defaultExport": "Radio",
291
291
  "importPath": "react/admin/elements/",
292
292
  "externalPath": "components.admin.react.elements"
293
293
  },
@@ -312,27 +312,27 @@ module.exports = [
312
312
  "externalPath": "components.admin.react.elements"
313
313
  },
314
314
  {
315
- "defaultExport": "Grid",
315
+ "defaultExport": "Heading",
316
316
  "importPath": "react/admin/elements/",
317
317
  "externalPath": "components.admin.react.elements"
318
318
  },
319
319
  {
320
- "defaultExport": "Heading",
320
+ "defaultExport": "Grid",
321
321
  "importPath": "react/admin/elements/",
322
322
  "externalPath": "components.admin.react.elements"
323
323
  },
324
324
  {
325
- "defaultExport": "FileUpload",
325
+ "defaultExport": "Label",
326
326
  "importPath": "react/admin/elements/",
327
327
  "externalPath": "components.admin.react.elements"
328
328
  },
329
329
  {
330
- "defaultExport": "DescriptionList",
330
+ "defaultExport": "FileUpload",
331
331
  "importPath": "react/admin/elements/",
332
332
  "externalPath": "components.admin.react.elements"
333
333
  },
334
334
  {
335
- "defaultExport": "Checkbox",
335
+ "defaultExport": "DescriptionList",
336
336
  "importPath": "react/admin/elements/",
337
337
  "externalPath": "components.admin.react.elements"
338
338
  },
@@ -342,20 +342,20 @@ module.exports = [
342
342
  "externalPath": "components.admin.react.elements"
343
343
  },
344
344
  {
345
- "defaultExport": "Box",
345
+ "defaultExport": "Checkbox",
346
346
  "importPath": "react/admin/elements/",
347
347
  "externalPath": "components.admin.react.elements"
348
348
  },
349
- {
350
- "defaultExport": "RingLoader",
351
- "importPath": "react/admin/modules/Loaders/",
352
- "externalPath": "components.admin.react.modules"
353
- },
354
349
  {
355
350
  "defaultExport": "VidyardVideo",
356
351
  "importPath": "react/admin/modules/Videos/",
357
352
  "externalPath": "components.admin.react.modules"
358
353
  },
354
+ {
355
+ "defaultExport": "Box",
356
+ "importPath": "react/admin/elements/",
357
+ "externalPath": "components.admin.react.elements"
358
+ },
359
359
  {
360
360
  "defaultExport": "ModularSidebar",
361
361
  "importPath": "react/admin/modules/Layouts/",
@@ -366,6 +366,11 @@ module.exports = [
366
366
  "importPath": "react/admin/modules/Layouts/",
367
367
  "externalPath": "components.admin.react.modules"
368
368
  },
369
+ {
370
+ "defaultExport": "RingLoader",
371
+ "importPath": "react/admin/modules/Loaders/",
372
+ "externalPath": "components.admin.react.modules"
373
+ },
369
374
  {
370
375
  "defaultExport": "DotIndicator",
371
376
  "importPath": "react/admin/modules/Indicators/",
@@ -376,6 +381,11 @@ module.exports = [
376
381
  "importPath": "react/admin/modules/Indicators/",
377
382
  "externalPath": "components.admin.react.modules"
378
383
  },
384
+ {
385
+ "defaultExport": "MetricCard",
386
+ "importPath": "react/admin/modules/Cards/",
387
+ "externalPath": "components.admin.react.modules"
388
+ },
379
389
  {
380
390
  "defaultExport": "IntegrationCard",
381
391
  "importPath": "react/admin/modules/Cards/",
@@ -387,12 +397,12 @@ module.exports = [
387
397
  "externalPath": "components.admin.react.modules"
388
398
  },
389
399
  {
390
- "defaultExport": "WordPressLogo",
400
+ "defaultExport": "WhatsAppLogo",
391
401
  "importPath": "react/admin/elements/Svgs/",
392
402
  "externalPath": "components.admin.react.elements"
393
403
  },
394
404
  {
395
- "defaultExport": "WhatsAppLogo",
405
+ "defaultExport": "WordPressLogo",
396
406
  "importPath": "react/admin/elements/Svgs/",
397
407
  "externalPath": "components.admin.react.elements"
398
408
  },
@@ -402,12 +412,12 @@ module.exports = [
402
412
  "externalPath": "components.admin.react.elements"
403
413
  },
404
414
  {
405
- "defaultExport": "TelegramLogo",
415
+ "defaultExport": "TwilioLogo",
406
416
  "importPath": "react/admin/elements/Svgs/",
407
417
  "externalPath": "components.admin.react.elements"
408
418
  },
409
419
  {
410
- "defaultExport": "TwilioLogo",
420
+ "defaultExport": "TelegramLogo",
411
421
  "importPath": "react/admin/elements/Svgs/",
412
422
  "externalPath": "components.admin.react.elements"
413
423
  },
@@ -417,47 +427,47 @@ module.exports = [
417
427
  "externalPath": "components.admin.react.elements"
418
428
  },
419
429
  {
420
- "defaultExport": "SendGridFullLogo",
430
+ "defaultExport": "SendGridLogo",
421
431
  "importPath": "react/admin/elements/Svgs/",
422
432
  "externalPath": "components.admin.react.elements"
423
433
  },
424
434
  {
425
- "defaultExport": "SendGridLogo",
435
+ "defaultExport": "SlackLogo",
426
436
  "importPath": "react/admin/elements/Svgs/",
427
437
  "externalPath": "components.admin.react.elements"
428
438
  },
429
439
  {
430
- "defaultExport": "SearchNoResults",
440
+ "defaultExport": "WPMailSMTPFullLogo",
431
441
  "importPath": "react/admin/elements/Svgs/",
432
442
  "externalPath": "components.admin.react.elements"
433
443
  },
434
444
  {
435
- "defaultExport": "SlackLogo",
445
+ "defaultExport": "SMTP2GOLogo",
436
446
  "importPath": "react/admin/elements/Svgs/",
437
447
  "externalPath": "components.admin.react.elements"
438
448
  },
439
449
  {
440
- "defaultExport": "SMTP2GOLogo",
450
+ "defaultExport": "SearchNoResults",
441
451
  "importPath": "react/admin/elements/Svgs/",
442
452
  "externalPath": "components.admin.react.elements"
443
453
  },
444
454
  {
445
- "defaultExport": "PostmarkLogo",
455
+ "defaultExport": "PHPLogo",
446
456
  "importPath": "react/admin/elements/Svgs/",
447
457
  "externalPath": "components.admin.react.elements"
448
458
  },
449
459
  {
450
- "defaultExport": "PostmarkFullLogo",
460
+ "defaultExport": "PostmarkLogo",
451
461
  "importPath": "react/admin/elements/Svgs/",
452
462
  "externalPath": "components.admin.react.elements"
453
463
  },
454
464
  {
455
- "defaultExport": "PHPLogo",
465
+ "defaultExport": "PHPFullLogo",
456
466
  "importPath": "react/admin/elements/Svgs/",
457
467
  "externalPath": "components.admin.react.elements"
458
468
  },
459
469
  {
460
- "defaultExport": "PHPFullLogo",
470
+ "defaultExport": "MicrosoftLogo",
461
471
  "importPath": "react/admin/elements/Svgs/",
462
472
  "externalPath": "components.admin.react.elements"
463
473
  },
@@ -477,17 +487,17 @@ module.exports = [
477
487
  "externalPath": "components.admin.react.elements"
478
488
  },
479
489
  {
480
- "defaultExport": "MicrosoftLogo",
490
+ "defaultExport": "MailgunLogo",
481
491
  "importPath": "react/admin/elements/Svgs/",
482
492
  "externalPath": "components.admin.react.elements"
483
493
  },
484
494
  {
485
- "defaultExport": "MailgunLogo",
495
+ "defaultExport": "SendGridFullLogo",
486
496
  "importPath": "react/admin/elements/Svgs/",
487
497
  "externalPath": "components.admin.react.elements"
488
498
  },
489
499
  {
490
- "defaultExport": "MailSuccessBg",
500
+ "defaultExport": "PostmarkFullLogo",
491
501
  "importPath": "react/admin/elements/Svgs/",
492
502
  "externalPath": "components.admin.react.elements"
493
503
  },
@@ -497,7 +507,7 @@ module.exports = [
497
507
  "externalPath": "components.admin.react.elements"
498
508
  },
499
509
  {
500
- "defaultExport": "MailSuccess",
510
+ "defaultExport": "MailSuccessBg",
501
511
  "importPath": "react/admin/elements/Svgs/",
502
512
  "externalPath": "components.admin.react.elements"
503
513
  },
@@ -517,7 +527,7 @@ module.exports = [
517
527
  "externalPath": "components.admin.react.elements"
518
528
  },
519
529
  {
520
- "defaultExport": "GravitySMTPLogo",
530
+ "defaultExport": "MailSuccess",
521
531
  "importPath": "react/admin/elements/Svgs/",
522
532
  "externalPath": "components.admin.react.elements"
523
533
  },
@@ -527,7 +537,7 @@ module.exports = [
527
537
  "externalPath": "components.admin.react.elements"
528
538
  },
529
539
  {
530
- "defaultExport": "GoogleFullLogo",
540
+ "defaultExport": "GravitySMTPLogo",
531
541
  "importPath": "react/admin/elements/Svgs/",
532
542
  "externalPath": "components.admin.react.elements"
533
543
  },
@@ -537,12 +547,12 @@ module.exports = [
537
547
  "externalPath": "components.admin.react.elements"
538
548
  },
539
549
  {
540
- "defaultExport": "GoogleAltLogo",
550
+ "defaultExport": "GravityFormsStackedLogo",
541
551
  "importPath": "react/admin/elements/Svgs/",
542
552
  "externalPath": "components.admin.react.elements"
543
553
  },
544
554
  {
545
- "defaultExport": "CustomSMTPFull",
555
+ "defaultExport": "GoogleFullLogo",
546
556
  "importPath": "react/admin/elements/Svgs/",
547
557
  "externalPath": "components.admin.react.elements"
548
558
  },
@@ -552,22 +562,22 @@ module.exports = [
552
562
  "externalPath": "components.admin.react.elements"
553
563
  },
554
564
  {
555
- "defaultExport": "BrevoFullLogo",
565
+ "defaultExport": "BrevoLogo",
556
566
  "importPath": "react/admin/elements/Svgs/",
557
567
  "externalPath": "components.admin.react.elements"
558
568
  },
559
569
  {
560
- "defaultExport": "AmazonAWSLogo",
570
+ "defaultExport": "CustomSMTPFull",
561
571
  "importPath": "react/admin/elements/Svgs/",
562
572
  "externalPath": "components.admin.react.elements"
563
573
  },
564
574
  {
565
- "defaultExport": "BrevoLogo",
575
+ "defaultExport": "BrevoFullLogo",
566
576
  "importPath": "react/admin/elements/Svgs/",
567
577
  "externalPath": "components.admin.react.elements"
568
578
  },
569
579
  {
570
- "defaultExport": "GravityFormsStackedLogo",
580
+ "defaultExport": "AmazonAWSLogo",
571
581
  "importPath": "react/admin/elements/Svgs/",
572
582
  "externalPath": "components.admin.react.elements"
573
583
  },
@@ -576,6 +586,16 @@ module.exports = [
576
586
  "importPath": "react/admin/elements/Link/",
577
587
  "externalPath": "components.admin.react.elements"
578
588
  },
589
+ {
590
+ "defaultExport": "GoogleAltLogo",
591
+ "importPath": "react/admin/elements/Svgs/",
592
+ "externalPath": "components.admin.react.elements"
593
+ },
594
+ {
595
+ "defaultExport": "AmazonAWSFullLogo",
596
+ "importPath": "react/admin/elements/Svgs/",
597
+ "externalPath": "components.admin.react.elements"
598
+ },
579
599
  {
580
600
  "defaultExport": "BrandedButton",
581
601
  "importPath": "react/admin/elements/Button/",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravityforms/dependency-extraction-webpack-plugin",
3
- "version": "4.5.0-beta.1",
3
+ "version": "4.6.0",
4
4
  "description": "Dependency extraction webpack plugin for use in Gravity Forms development. Extends the WordPress plugin.",
5
5
  "author": "Rocketgenius",
6
6
  "license": "GPL-2.0-or-later",
package/src/index.js CHANGED
@@ -28,6 +28,14 @@ class DependencyExtractionWebpackPlugin extends WPDependencyExtractionWebpackPlu
28
28
  const rootNameSpace = this.options.rootNamespace || ROOT_NAMESPACE;
29
29
  let externalRequest;
30
30
 
31
+ // Determine if @gravityforms/components is bundled
32
+ const isGravityComponentsBundled = ( this.options.bundledPackages || [] ).includes( '@gravityforms/components' );
33
+
34
+ // If @gravityforms/components is bundled, exclude all requests that start with @gravityforms/components
35
+ if ( isGravityComponentsBundled && request.startsWith( '@gravityforms/components' ) ) {
36
+ return callback();
37
+ }
38
+
31
39
  // Handle via options.requestToExternal first
32
40
  if ( typeof this.options.requestToExternal === 'function' ) {
33
41
  externalRequest = this.options.requestToExternal( request );
@@ -47,7 +55,6 @@ class DependencyExtractionWebpackPlugin extends WPDependencyExtractionWebpackPlu
47
55
 
48
56
  if ( externalRequest ) {
49
57
  this.externalizedDeps.add( request );
50
-
51
58
  return callback( null, externalRequest );
52
59
  }
53
60