@driveflux/fab 1.0.0-next.2 → 1.0.1
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +18 -0
- package/package.json +1 -1
- package/dist/src/build.js +0 -737
- package/dist/src/clean.js +0 -258
- package/dist/src/config.js +0 -279
- package/dist/src/create.js +0 -270
- package/dist/src/index.js +0 -5
- package/dist/src/types.js +0 -1
- package/dist/src/utils.js +0 -308
package/dist/src/clean.js
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
function _array_like_to_array(arr, len) {
|
|
2
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
-
return arr2;
|
|
5
|
-
}
|
|
6
|
-
function _array_without_holes(arr) {
|
|
7
|
-
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
-
}
|
|
9
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
|
-
try {
|
|
11
|
-
var info = gen[key](arg);
|
|
12
|
-
var value = info.value;
|
|
13
|
-
} catch (error) {
|
|
14
|
-
reject(error);
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
if (info.done) {
|
|
18
|
-
resolve(value);
|
|
19
|
-
} else {
|
|
20
|
-
Promise.resolve(value).then(_next, _throw);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
function _async_to_generator(fn) {
|
|
24
|
-
return function() {
|
|
25
|
-
var self = this, args = arguments;
|
|
26
|
-
return new Promise(function(resolve, reject) {
|
|
27
|
-
var gen = fn.apply(self, args);
|
|
28
|
-
function _next(value) {
|
|
29
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
30
|
-
}
|
|
31
|
-
function _throw(err) {
|
|
32
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
-
}
|
|
34
|
-
_next(undefined);
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function _define_property(obj, key, value) {
|
|
39
|
-
if (key in obj) {
|
|
40
|
-
Object.defineProperty(obj, key, {
|
|
41
|
-
value: value,
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
obj[key] = value;
|
|
48
|
-
}
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
function _iterable_to_array(iter) {
|
|
52
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
53
|
-
}
|
|
54
|
-
function _non_iterable_spread() {
|
|
55
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
56
|
-
}
|
|
57
|
-
function _object_spread(target) {
|
|
58
|
-
for(var i = 1; i < arguments.length; i++){
|
|
59
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
60
|
-
var ownKeys = Object.keys(source);
|
|
61
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
62
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
63
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
ownKeys.forEach(function(key) {
|
|
67
|
-
_define_property(target, key, source[key]);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
return target;
|
|
71
|
-
}
|
|
72
|
-
function _to_consumable_array(arr) {
|
|
73
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
74
|
-
}
|
|
75
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
76
|
-
if (!o) return;
|
|
77
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
78
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
79
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
80
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
81
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
82
|
-
}
|
|
83
|
-
function _ts_generator(thisArg, body) {
|
|
84
|
-
var f, y, t, g, _ = {
|
|
85
|
-
label: 0,
|
|
86
|
-
sent: function() {
|
|
87
|
-
if (t[0] & 1) throw t[1];
|
|
88
|
-
return t[1];
|
|
89
|
-
},
|
|
90
|
-
trys: [],
|
|
91
|
-
ops: []
|
|
92
|
-
};
|
|
93
|
-
return g = {
|
|
94
|
-
next: verb(0),
|
|
95
|
-
"throw": verb(1),
|
|
96
|
-
"return": verb(2)
|
|
97
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
98
|
-
return this;
|
|
99
|
-
}), g;
|
|
100
|
-
function verb(n) {
|
|
101
|
-
return function(v) {
|
|
102
|
-
return step([
|
|
103
|
-
n,
|
|
104
|
-
v
|
|
105
|
-
]);
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
function step(op) {
|
|
109
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
110
|
-
while(_)try {
|
|
111
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
112
|
-
if (y = 0, t) op = [
|
|
113
|
-
op[0] & 2,
|
|
114
|
-
t.value
|
|
115
|
-
];
|
|
116
|
-
switch(op[0]){
|
|
117
|
-
case 0:
|
|
118
|
-
case 1:
|
|
119
|
-
t = op;
|
|
120
|
-
break;
|
|
121
|
-
case 4:
|
|
122
|
-
_.label++;
|
|
123
|
-
return {
|
|
124
|
-
value: op[1],
|
|
125
|
-
done: false
|
|
126
|
-
};
|
|
127
|
-
case 5:
|
|
128
|
-
_.label++;
|
|
129
|
-
y = op[1];
|
|
130
|
-
op = [
|
|
131
|
-
0
|
|
132
|
-
];
|
|
133
|
-
continue;
|
|
134
|
-
case 7:
|
|
135
|
-
op = _.ops.pop();
|
|
136
|
-
_.trys.pop();
|
|
137
|
-
continue;
|
|
138
|
-
default:
|
|
139
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
140
|
-
_ = 0;
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
144
|
-
_.label = op[1];
|
|
145
|
-
break;
|
|
146
|
-
}
|
|
147
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
148
|
-
_.label = t[1];
|
|
149
|
-
t = op;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
if (t && _.label < t[2]) {
|
|
153
|
-
_.label = t[2];
|
|
154
|
-
_.ops.push(op);
|
|
155
|
-
break;
|
|
156
|
-
}
|
|
157
|
-
if (t[2]) _.ops.pop();
|
|
158
|
-
_.trys.pop();
|
|
159
|
-
continue;
|
|
160
|
-
}
|
|
161
|
-
op = body.call(thisArg, _);
|
|
162
|
-
} catch (e) {
|
|
163
|
-
op = [
|
|
164
|
-
6,
|
|
165
|
-
e
|
|
166
|
-
];
|
|
167
|
-
y = 0;
|
|
168
|
-
} finally{
|
|
169
|
-
f = t = 0;
|
|
170
|
-
}
|
|
171
|
-
if (op[0] & 5) throw op[1];
|
|
172
|
-
return {
|
|
173
|
-
value: op[0] ? op[1] : void 0,
|
|
174
|
-
done: true
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
import path from "node:path";
|
|
179
|
-
import { getDefaultOptions, runCommand, validatePackageJson } from "./utils.js";
|
|
180
|
-
export var clean = function() {
|
|
181
|
-
var _ref = _async_to_generator(function() {
|
|
182
|
-
var rawOptions, _$_object_spread, cwd, destination, cleanTs, all, rawDoNotCleanup, doNotCleanup;
|
|
183
|
-
var _arguments = arguments;
|
|
184
|
-
return _ts_generator(this, function(_state) {
|
|
185
|
-
switch(_state.label){
|
|
186
|
-
case 0:
|
|
187
|
-
rawOptions = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : getDefaultOptions();
|
|
188
|
-
_$_object_spread = _object_spread({}, getDefaultOptions(), rawOptions), cwd = _$_object_spread.cwd, destination = _$_object_spread.destination, cleanTs = _$_object_spread.cleanTs, all = _$_object_spread.all, rawDoNotCleanup = _$_object_spread.doNotCleanup;
|
|
189
|
-
return [
|
|
190
|
-
4,
|
|
191
|
-
validatePackageJson({
|
|
192
|
-
command: "del",
|
|
193
|
-
cwd: cwd
|
|
194
|
-
})
|
|
195
|
-
];
|
|
196
|
-
case 1:
|
|
197
|
-
_state.sent();
|
|
198
|
-
doNotCleanup = rawDoNotCleanup.map(function(f) {
|
|
199
|
-
return "!".concat(f);
|
|
200
|
-
});
|
|
201
|
-
if (!all) return [
|
|
202
|
-
3,
|
|
203
|
-
3
|
|
204
|
-
];
|
|
205
|
-
return [
|
|
206
|
-
4,
|
|
207
|
-
runCommand("pnpm", [
|
|
208
|
-
"del",
|
|
209
|
-
"**/*.cjs",
|
|
210
|
-
"**/*.d.ts",
|
|
211
|
-
"tsconfig.tsbuildinfo"
|
|
212
|
-
].concat(_to_consumable_array(doNotCleanup)), {
|
|
213
|
-
cwd: cwd
|
|
214
|
-
})
|
|
215
|
-
];
|
|
216
|
-
case 2:
|
|
217
|
-
_state.sent();
|
|
218
|
-
_state.label = 3;
|
|
219
|
-
case 3:
|
|
220
|
-
return [
|
|
221
|
-
4,
|
|
222
|
-
runCommand("pnpm", [
|
|
223
|
-
"del",
|
|
224
|
-
path.resolve(destination, "**/*.js")
|
|
225
|
-
].concat(_to_consumable_array(doNotCleanup)), {
|
|
226
|
-
cwd: cwd
|
|
227
|
-
})
|
|
228
|
-
];
|
|
229
|
-
case 4:
|
|
230
|
-
_state.sent();
|
|
231
|
-
if (!cleanTs) return [
|
|
232
|
-
3,
|
|
233
|
-
6
|
|
234
|
-
];
|
|
235
|
-
return [
|
|
236
|
-
4,
|
|
237
|
-
runCommand("pnpm", [
|
|
238
|
-
"del",
|
|
239
|
-
path.resolve(destination, "**/*.d.ts"),
|
|
240
|
-
path.resolve(destination, "tsconfig.tsbuildinfo")
|
|
241
|
-
].concat(_to_consumable_array(doNotCleanup)), {
|
|
242
|
-
cwd: cwd
|
|
243
|
-
})
|
|
244
|
-
];
|
|
245
|
-
case 5:
|
|
246
|
-
_state.sent();
|
|
247
|
-
_state.label = 6;
|
|
248
|
-
case 6:
|
|
249
|
-
return [
|
|
250
|
-
2
|
|
251
|
-
];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
return function clean() {
|
|
256
|
-
return _ref.apply(this, arguments);
|
|
257
|
-
};
|
|
258
|
-
}();
|
package/dist/src/config.js
DELETED
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
2
|
-
try {
|
|
3
|
-
var info = gen[key](arg);
|
|
4
|
-
var value = info.value;
|
|
5
|
-
} catch (error) {
|
|
6
|
-
reject(error);
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
if (info.done) {
|
|
10
|
-
resolve(value);
|
|
11
|
-
} else {
|
|
12
|
-
Promise.resolve(value).then(_next, _throw);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function _async_to_generator(fn) {
|
|
16
|
-
return function() {
|
|
17
|
-
var self = this, args = arguments;
|
|
18
|
-
return new Promise(function(resolve, reject) {
|
|
19
|
-
var gen = fn.apply(self, args);
|
|
20
|
-
function _next(value) {
|
|
21
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
22
|
-
}
|
|
23
|
-
function _throw(err) {
|
|
24
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
25
|
-
}
|
|
26
|
-
_next(undefined);
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function _ts_generator(thisArg, body) {
|
|
31
|
-
var f, y, t, g, _ = {
|
|
32
|
-
label: 0,
|
|
33
|
-
sent: function() {
|
|
34
|
-
if (t[0] & 1) throw t[1];
|
|
35
|
-
return t[1];
|
|
36
|
-
},
|
|
37
|
-
trys: [],
|
|
38
|
-
ops: []
|
|
39
|
-
};
|
|
40
|
-
return g = {
|
|
41
|
-
next: verb(0),
|
|
42
|
-
"throw": verb(1),
|
|
43
|
-
"return": verb(2)
|
|
44
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
45
|
-
return this;
|
|
46
|
-
}), g;
|
|
47
|
-
function verb(n) {
|
|
48
|
-
return function(v) {
|
|
49
|
-
return step([
|
|
50
|
-
n,
|
|
51
|
-
v
|
|
52
|
-
]);
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function step(op) {
|
|
56
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
57
|
-
while(_)try {
|
|
58
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
59
|
-
if (y = 0, t) op = [
|
|
60
|
-
op[0] & 2,
|
|
61
|
-
t.value
|
|
62
|
-
];
|
|
63
|
-
switch(op[0]){
|
|
64
|
-
case 0:
|
|
65
|
-
case 1:
|
|
66
|
-
t = op;
|
|
67
|
-
break;
|
|
68
|
-
case 4:
|
|
69
|
-
_.label++;
|
|
70
|
-
return {
|
|
71
|
-
value: op[1],
|
|
72
|
-
done: false
|
|
73
|
-
};
|
|
74
|
-
case 5:
|
|
75
|
-
_.label++;
|
|
76
|
-
y = op[1];
|
|
77
|
-
op = [
|
|
78
|
-
0
|
|
79
|
-
];
|
|
80
|
-
continue;
|
|
81
|
-
case 7:
|
|
82
|
-
op = _.ops.pop();
|
|
83
|
-
_.trys.pop();
|
|
84
|
-
continue;
|
|
85
|
-
default:
|
|
86
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
87
|
-
_ = 0;
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
91
|
-
_.label = op[1];
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
95
|
-
_.label = t[1];
|
|
96
|
-
t = op;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
if (t && _.label < t[2]) {
|
|
100
|
-
_.label = t[2];
|
|
101
|
-
_.ops.push(op);
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
if (t[2]) _.ops.pop();
|
|
105
|
-
_.trys.pop();
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
op = body.call(thisArg, _);
|
|
109
|
-
} catch (e) {
|
|
110
|
-
op = [
|
|
111
|
-
6,
|
|
112
|
-
e
|
|
113
|
-
];
|
|
114
|
-
y = 0;
|
|
115
|
-
} finally{
|
|
116
|
-
f = t = 0;
|
|
117
|
-
}
|
|
118
|
-
if (op[0] & 5) throw op[1];
|
|
119
|
-
return {
|
|
120
|
-
value: op[0] ? op[1] : void 0,
|
|
121
|
-
done: true
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
import fs from "node:fs/promises";
|
|
126
|
-
import path from "node:path";
|
|
127
|
-
import { z } from "zod";
|
|
128
|
-
var ConfigValidation = z.object({
|
|
129
|
-
doNotCleanup: z.array(z.string())
|
|
130
|
-
}).partial();
|
|
131
|
-
export var parseConfig = function() {
|
|
132
|
-
var _ref = _async_to_generator(function(options) {
|
|
133
|
-
var cwd, config;
|
|
134
|
-
return _ts_generator(this, function(_state) {
|
|
135
|
-
switch(_state.label){
|
|
136
|
-
case 0:
|
|
137
|
-
cwd = (options === null || options === void 0 ? void 0 : options.cwd) || process.cwd();
|
|
138
|
-
if (!(options === null || options === void 0 ? void 0 : options.config)) return [
|
|
139
|
-
3,
|
|
140
|
-
1
|
|
141
|
-
];
|
|
142
|
-
config = options.config;
|
|
143
|
-
return [
|
|
144
|
-
3,
|
|
145
|
-
5
|
|
146
|
-
];
|
|
147
|
-
case 1:
|
|
148
|
-
if (!(options === null || options === void 0 ? void 0 : options.configFile)) return [
|
|
149
|
-
3,
|
|
150
|
-
3
|
|
151
|
-
];
|
|
152
|
-
return [
|
|
153
|
-
4,
|
|
154
|
-
readConfigFile(path.resolve(cwd, options.configFile))
|
|
155
|
-
];
|
|
156
|
-
case 2:
|
|
157
|
-
config = _state.sent();
|
|
158
|
-
return [
|
|
159
|
-
3,
|
|
160
|
-
5
|
|
161
|
-
];
|
|
162
|
-
case 3:
|
|
163
|
-
return [
|
|
164
|
-
4,
|
|
165
|
-
findConfigFile(cwd)
|
|
166
|
-
];
|
|
167
|
-
case 4:
|
|
168
|
-
config = _state.sent();
|
|
169
|
-
_state.label = 5;
|
|
170
|
-
case 5:
|
|
171
|
-
if (!config) {
|
|
172
|
-
return [
|
|
173
|
-
2,
|
|
174
|
-
{}
|
|
175
|
-
];
|
|
176
|
-
}
|
|
177
|
-
return [
|
|
178
|
-
2,
|
|
179
|
-
ConfigValidation.parse(config)
|
|
180
|
-
];
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
return function parseConfig(options) {
|
|
185
|
-
return _ref.apply(this, arguments);
|
|
186
|
-
};
|
|
187
|
-
}();
|
|
188
|
-
var findConfigFile = function() {
|
|
189
|
-
var _ref = _async_to_generator(function() {
|
|
190
|
-
var cwd, files, configFile, _tmp;
|
|
191
|
-
var _arguments = arguments;
|
|
192
|
-
return _ts_generator(this, function(_state) {
|
|
193
|
-
switch(_state.label){
|
|
194
|
-
case 0:
|
|
195
|
-
cwd = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : process.cwd();
|
|
196
|
-
return [
|
|
197
|
-
4,
|
|
198
|
-
fs.readdir(cwd)
|
|
199
|
-
];
|
|
200
|
-
case 1:
|
|
201
|
-
files = _state.sent();
|
|
202
|
-
configFile = files.find(function(f) {
|
|
203
|
-
return [
|
|
204
|
-
"fab.config.js",
|
|
205
|
-
"fab.config.cjs",
|
|
206
|
-
"fab.config.mjs",
|
|
207
|
-
"fabrc.json",
|
|
208
|
-
".fabrc"
|
|
209
|
-
].includes(f);
|
|
210
|
-
});
|
|
211
|
-
_tmp = configFile;
|
|
212
|
-
if (!_tmp) return [
|
|
213
|
-
3,
|
|
214
|
-
3
|
|
215
|
-
];
|
|
216
|
-
return [
|
|
217
|
-
4,
|
|
218
|
-
readConfigFile(path.resolve(cwd, configFile))
|
|
219
|
-
];
|
|
220
|
-
case 2:
|
|
221
|
-
_tmp = _state.sent();
|
|
222
|
-
_state.label = 3;
|
|
223
|
-
case 3:
|
|
224
|
-
return [
|
|
225
|
-
2,
|
|
226
|
-
_tmp
|
|
227
|
-
];
|
|
228
|
-
}
|
|
229
|
-
});
|
|
230
|
-
});
|
|
231
|
-
return function findConfigFile() {
|
|
232
|
-
return _ref.apply(this, arguments);
|
|
233
|
-
};
|
|
234
|
-
}();
|
|
235
|
-
var readConfigFile = function() {
|
|
236
|
-
var _ref = _async_to_generator(function(configPath) {
|
|
237
|
-
var _;
|
|
238
|
-
return _ts_generator(this, function(_state) {
|
|
239
|
-
switch(_state.label){
|
|
240
|
-
case 0:
|
|
241
|
-
if (!/.+\.(js|cjs|mjs)$/.test(configPath)) return [
|
|
242
|
-
3,
|
|
243
|
-
2
|
|
244
|
-
];
|
|
245
|
-
return [
|
|
246
|
-
4,
|
|
247
|
-
import(configPath)
|
|
248
|
-
];
|
|
249
|
-
case 1:
|
|
250
|
-
return [
|
|
251
|
-
2,
|
|
252
|
-
_state.sent().default
|
|
253
|
-
];
|
|
254
|
-
case 2:
|
|
255
|
-
if (!(configPath.endsWith(".json") || configPath.split("/").pop() === ".fabrc")) return [
|
|
256
|
-
3,
|
|
257
|
-
4
|
|
258
|
-
];
|
|
259
|
-
_ = JSON.parse;
|
|
260
|
-
return [
|
|
261
|
-
4,
|
|
262
|
-
fs.readFile(configPath, "utf-8")
|
|
263
|
-
];
|
|
264
|
-
case 3:
|
|
265
|
-
return [
|
|
266
|
-
2,
|
|
267
|
-
_.apply(JSON, [
|
|
268
|
-
_state.sent()
|
|
269
|
-
])
|
|
270
|
-
];
|
|
271
|
-
case 4:
|
|
272
|
-
throw new Error("Unable to read the config file at ".concat(configPath));
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
});
|
|
276
|
-
return function readConfigFile(configPath) {
|
|
277
|
-
return _ref.apply(this, arguments);
|
|
278
|
-
};
|
|
279
|
-
}();
|