Automatically detect requirements in *.aff.html
authorTim Otten <totten@civicrm.org>
Fri, 18 Oct 2019 22:05:22 +0000 (15:05 -0700)
committerCiviCRM <info@civicrm.org>
Wed, 16 Sep 2020 02:13:19 +0000 (19:13 -0700)
commit77dccccbeb37630ba0b4a98c02c3d22b10a2d6d2
tree10c4c61e22c14974b3f816632bc621251a28d62e
parentf9c20b0c40a4f20944a1cf60bc0bbf0bafd174ea
Automatically detect requirements in *.aff.html

PART A: EXPORT LIST

Suppose you create a form `downstreamForm.aff.html`.

The metadata for `downstreamForm` will indicate that it exports an element `<downstream-form/>`:

```php
$angularModules['downstreamForm']['exports']['el'] = ['downstream-form'];
```

PART B: AUTO-REQUIRES

Suppose that:

1. he form `downstreamForm.aff.html` uses element `<upstream-el/>`.
2. The `$angularModules['upsteamMod']['exports']['el']` defines an exported element `upstream-el`.

Then the `downstreamForm` module will automatically requires the `upstreamMod`, as in

```php
$angularModules['downstreamForm']['requires'][] = 'upstreamMod';
```
ext/afform/core/CRM/Afform/AfformScanner.php
ext/afform/core/Civi/Afform/Symbols.php [new file with mode: 0644]
ext/afform/core/afform.php