1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.findComponentDescriptors = findComponentDescriptors;
|
7 | function _fs() {
|
8 | const data = _interopRequireDefault(require("fs"));
|
9 | _fs = function () {
|
10 | return data;
|
11 | };
|
12 | return data;
|
13 | }
|
14 | function _path() {
|
15 | const data = _interopRequireDefault(require("path"));
|
16 | _path = function () {
|
17 | return data;
|
18 | };
|
19 | return data;
|
20 | }
|
21 | function _glob() {
|
22 | const data = _interopRequireDefault(require("glob"));
|
23 | _glob = function () {
|
24 | return data;
|
25 | };
|
26 | return data;
|
27 | }
|
28 | var _extractComponentDescriptors = require("./extractComponentDescriptors");
|
29 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
30 | function findComponentDescriptors(packageRoot) {
|
31 | const files = _glob().default.sync('**/+(*.js|*.jsx|*.ts|*.tsx)', {
|
32 | cwd: packageRoot,
|
33 | nodir: true,
|
34 | ignore: '**/node_modules/**'
|
35 | });
|
36 | const codegenComponent = files.map(filePath => _fs().default.readFileSync(_path().default.join(packageRoot, filePath), 'utf8')).map(_extractComponentDescriptors.extractComponentDescriptors).filter(Boolean);
|
37 |
|
38 |
|
39 |
|
40 | return Array.from(new Set(codegenComponent));
|
41 | }
|
42 |
|
43 |
|
\ | No newline at end of file |