2.2.2 • Published 7 years ago

electrum-require-components v2.2.2

Weekly downloads
27
License
MIT
Repository
github
Last release
7 years ago

electrum-require-components

NPM version

This tool synthesizes a source file with a list of requires.

electrum-require-components --wrap --crlf ./src widgets .component.js all.js

Produces file ./src/all.js while recursively exploring folder widgets found in the source folder ./src, looking for *.component.js.

  • The --wrap option inserts calls to Electrum.wrap().
  • The --crlf option uses CR+LF line endings (for Windows files).

Here is an example of a resulting source file with --wrap:

import Electrum from 'electrum';
import _CheckBox from './widgets/buttons/check-box.component.js'
import _Panel from './widgets/layout/panel.component.js';
export const CheckBox = Electrum.wrap ('CheckBox', _CheckBox);
export const Panel = Electrum.wrap ('Panel', _Panel);

And the same example without --wrap:

import _CheckBox from './widgets/buttons/check-box.component.js'
import _Panel from './widgets/layout/panel.component.js';
export const CheckBox = _CheckBox;
export const Panel = _Panel;

Note how check-box produces an export named CheckBox.

Companion files

If there are companion files (e.g. panel.styles.js located beside the panel.component.js file), then they will also get imported and provided to Electrum.wrap as an additional argument:

import Electrum from 'electrum';
import _Panel from './widgets/layout/Panel.component.js';
import _Panel$about from './widgets/layout/panel.about.js';
import _Panel$styles from './widgets/layout/panel.styles.js';
export const Panel = Electrum.wrap ('Panel', _Panel, {about: _Panel$about, styles: _Panel$styles});
2.2.2

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

1.8.2

7 years ago

1.8.1

7 years ago

1.8.0

7 years ago

1.7.3

7 years ago

1.7.2

7 years ago

1.7.1

7 years ago

1.7.0

8 years ago

1.6.2

8 years ago

1.6.1

8 years ago

1.6.0

8 years ago

1.5.1

8 years ago

1.5.0

8 years ago

1.4.1

8 years ago

1.4.0

8 years ago

1.3.0

8 years ago

1.2.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago