@sprucelabs/spruce-cli 19.1.42 → 19.2.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/CHANGELOG.md +12 -0
- package/build/.spruce/errors/errors.types.d.ts +19 -0
- package/build/.spruce/errors/errors.types.js.map +1 -1
- package/build/.spruce/errors/options.types.d.ts +4 -1
- package/build/.spruce/errors/options.types.js.map +1 -1
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.d.ts +3 -0
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.js +23 -0
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.js.map +1 -0
- package/build/__tests__/behavioral/views/CreatingASkillView.test.d.ts +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js +6 -6
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.d.ts +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js +6 -6
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.d.ts +23 -0
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.js +355 -0
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.js.map +1 -0
- package/build/errors/SpruceError.js +3 -0
- package/build/errors/SpruceError.js.map +1 -1
- package/build/errors/viewPluginAlreadyExists.builder.d.ts +11 -0
- package/build/errors/viewPluginAlreadyExists.builder.js +18 -0
- package/build/errors/viewPluginAlreadyExists.builder.js.map +1 -0
- package/build/features/view/actions/CreateAction.d.ts +6 -6
- package/build/features/view/actions/CreateAction.js +59 -59
- package/build/features/view/actions/CreateAction.js.map +1 -1
- package/build/features/view/actions/CreatePluginAction.d.ts +56 -0
- package/build/features/view/actions/CreatePluginAction.js +95 -0
- package/build/features/view/actions/CreatePluginAction.js.map +1 -0
- package/build/features/view/actions/SyncAction.d.ts +6 -6
- package/build/features/view/actions/SyncAction.js +29 -15
- package/build/features/view/actions/SyncAction.js.map +1 -1
- package/build/features/view/writers/ViewWriter.d.ts +5 -0
- package/build/features/view/writers/ViewWriter.js +44 -7
- package/build/features/view/writers/ViewWriter.js.map +1 -1
- package/package.json +3 -3
- package/src/.spruce/errors/errors.types.ts +29 -0
- package/src/.spruce/errors/options.types.ts +4 -1
- package/src/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.ts +22 -0
- package/src/__tests__/behavioral/views/CreatingASkillView.test.ts +1 -1
- package/src/__tests__/behavioral/views/KeepingViewsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.ts +161 -0
- package/src/errors/SpruceError.ts +4 -0
- package/src/errors/viewPluginAlreadyExists.builder.ts +12 -0
- package/src/features/view/actions/CreateAction.ts +72 -72
- package/src/features/view/actions/CreatePluginAction.ts +54 -0
- package/src/features/view/actions/SyncAction.ts +30 -14
- package/src/features/view/writers/ViewWriter.ts +45 -5
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AbstractSkillTest from '../../../../tests/AbstractSkillTest';
|
|
2
|
+
export default class CreatingAViewPluginTest extends AbstractSkillTest {
|
|
3
|
+
protected static skillCacheKey: string;
|
|
4
|
+
private static action;
|
|
5
|
+
protected static beforeEach(): Promise<void>;
|
|
6
|
+
protected static hasAction(): Promise<void>;
|
|
7
|
+
protected static createsExpectedFile(readable: string, expected: string, combinedViewAction: string): Promise<void>;
|
|
8
|
+
protected static usesCamelNameIfProvided(): Promise<void>;
|
|
9
|
+
protected static actuallyCreatesFile(): Promise<void>;
|
|
10
|
+
protected static throwsIfPluginAlreadyExists(): Promise<void>;
|
|
11
|
+
protected static contentsAreEqualToExpected(): Promise<void>;
|
|
12
|
+
protected static combineViewsFileIsValid(): Promise<void>;
|
|
13
|
+
protected static updatesViewCombinedFileWithTypesAsExpected(): Promise<void>;
|
|
14
|
+
protected static updatesViewCombinedWithPluginsAsExpected(): Promise<void>;
|
|
15
|
+
private static assertCombinedFileIncludes;
|
|
16
|
+
private static assertPluginContentsEqualExpected;
|
|
17
|
+
private static assertThrowsAlreadyExists;
|
|
18
|
+
private static assertViewPluginWritten;
|
|
19
|
+
private static buildPathToViewPlugin;
|
|
20
|
+
private static execute;
|
|
21
|
+
private static assertExpectedFileCreated;
|
|
22
|
+
private static getPathToCombinedViewsFile;
|
|
23
|
+
}
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
+
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
+
var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
|
|
14
|
+
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
|
+
var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
|
|
18
|
+
var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
|
|
19
|
+
var _testUtils = require("@sprucelabs/test-utils");
|
|
20
|
+
var _AbstractSkillTest2 = _interopRequireDefault(require("../../../../tests/AbstractSkillTest"));
|
|
21
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _CreatingAViewPluginTest;
|
|
22
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
23
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
|
+
var CreatingAViewPluginTest = exports["default"] = (_dec = (0, _testUtils.test)(), _dec2 = (0, _testUtils.test)('creates expected plugin file 1', 'test', 'test', 'updated'), _dec3 = (0, _testUtils.test)('creates expected plugin file 2', 'another', 'another', 'updated'), _dec4 = (0, _testUtils.test)('creates expected plugin file 3', 'a third', 'aThird', 'generated'), _dec5 = (0, _testUtils.test)(), _dec6 = (0, _testUtils.test)(), _dec7 = (0, _testUtils.test)(), _dec8 = (0, _testUtils.test)(), _dec9 = (0, _testUtils.test)(), _dec10 = (0, _testUtils.test)(), _dec11 = (0, _testUtils.test)(), (_class = (_CreatingAViewPluginTest = /*#__PURE__*/function (_AbstractSkillTest) {
|
|
25
|
+
(0, _inherits2["default"])(CreatingAViewPluginTest, _AbstractSkillTest);
|
|
26
|
+
function CreatingAViewPluginTest() {
|
|
27
|
+
(0, _classCallCheck2["default"])(this, CreatingAViewPluginTest);
|
|
28
|
+
return _callSuper(this, CreatingAViewPluginTest, arguments);
|
|
29
|
+
}
|
|
30
|
+
(0, _createClass2["default"])(CreatingAViewPluginTest, null, [{
|
|
31
|
+
key: "beforeEach",
|
|
32
|
+
value: function () {
|
|
33
|
+
var _beforeEach = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
34
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
35
|
+
while (1) switch (_context.prev = _context.next) {
|
|
36
|
+
case 0:
|
|
37
|
+
_context.next = 2;
|
|
38
|
+
return (0, _get2["default"])((0, _getPrototypeOf2["default"])(CreatingAViewPluginTest), "beforeEach", this).call(this);
|
|
39
|
+
case 2:
|
|
40
|
+
this.action = this.Action('view', 'createPlugin');
|
|
41
|
+
case 3:
|
|
42
|
+
case "end":
|
|
43
|
+
return _context.stop();
|
|
44
|
+
}
|
|
45
|
+
}, _callee, this);
|
|
46
|
+
}));
|
|
47
|
+
function beforeEach() {
|
|
48
|
+
return _beforeEach.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
return beforeEach;
|
|
51
|
+
}()
|
|
52
|
+
}, {
|
|
53
|
+
key: "hasAction",
|
|
54
|
+
value: function () {
|
|
55
|
+
var _hasAction = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
56
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
57
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
58
|
+
case 0:
|
|
59
|
+
_testUtils.assert.isFunction(this.action.execute);
|
|
60
|
+
case 1:
|
|
61
|
+
case "end":
|
|
62
|
+
return _context2.stop();
|
|
63
|
+
}
|
|
64
|
+
}, _callee2, this);
|
|
65
|
+
}));
|
|
66
|
+
function hasAction() {
|
|
67
|
+
return _hasAction.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
return hasAction;
|
|
70
|
+
}()
|
|
71
|
+
}, {
|
|
72
|
+
key: "createsExpectedFile",
|
|
73
|
+
value: function () {
|
|
74
|
+
var _createsExpectedFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(readable, expected, combinedViewAction) {
|
|
75
|
+
var results;
|
|
76
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
77
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
78
|
+
case 0:
|
|
79
|
+
_context3.next = 2;
|
|
80
|
+
return this.execute({
|
|
81
|
+
nameReadable: readable
|
|
82
|
+
});
|
|
83
|
+
case 2:
|
|
84
|
+
results = _context3.sent;
|
|
85
|
+
this.assertExpectedFileCreated(results, expected, combinedViewAction);
|
|
86
|
+
_testUtils.assert.isFalsy(results.errors, 'Errors were returned and none were expected!');
|
|
87
|
+
case 5:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context3.stop();
|
|
90
|
+
}
|
|
91
|
+
}, _callee3, this);
|
|
92
|
+
}));
|
|
93
|
+
function createsExpectedFile(_x, _x2, _x3) {
|
|
94
|
+
return _createsExpectedFile.apply(this, arguments);
|
|
95
|
+
}
|
|
96
|
+
return createsExpectedFile;
|
|
97
|
+
}()
|
|
98
|
+
}, {
|
|
99
|
+
key: "usesCamelNameIfProvided",
|
|
100
|
+
value: function () {
|
|
101
|
+
var _usesCamelNameIfProvided = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
|
|
102
|
+
var results;
|
|
103
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
104
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
105
|
+
case 0:
|
|
106
|
+
_context4.next = 2;
|
|
107
|
+
return this.execute({
|
|
108
|
+
nameReadable: 'test',
|
|
109
|
+
nameCamel: 'testCamel'
|
|
110
|
+
});
|
|
111
|
+
case 2:
|
|
112
|
+
results = _context4.sent;
|
|
113
|
+
this.assertExpectedFileCreated(results, 'testCamel', 'updated');
|
|
114
|
+
case 4:
|
|
115
|
+
case "end":
|
|
116
|
+
return _context4.stop();
|
|
117
|
+
}
|
|
118
|
+
}, _callee4, this);
|
|
119
|
+
}));
|
|
120
|
+
function usesCamelNameIfProvided() {
|
|
121
|
+
return _usesCamelNameIfProvided.apply(this, arguments);
|
|
122
|
+
}
|
|
123
|
+
return usesCamelNameIfProvided;
|
|
124
|
+
}()
|
|
125
|
+
}, {
|
|
126
|
+
key: "actuallyCreatesFile",
|
|
127
|
+
value: function () {
|
|
128
|
+
var _actuallyCreatesFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
|
|
129
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
130
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
131
|
+
case 0:
|
|
132
|
+
this.assertViewPluginWritten('test');
|
|
133
|
+
this.assertViewPluginWritten('another');
|
|
134
|
+
this.assertViewPluginWritten('aThird');
|
|
135
|
+
case 3:
|
|
136
|
+
case "end":
|
|
137
|
+
return _context5.stop();
|
|
138
|
+
}
|
|
139
|
+
}, _callee5, this);
|
|
140
|
+
}));
|
|
141
|
+
function actuallyCreatesFile() {
|
|
142
|
+
return _actuallyCreatesFile.apply(this, arguments);
|
|
143
|
+
}
|
|
144
|
+
return actuallyCreatesFile;
|
|
145
|
+
}()
|
|
146
|
+
}, {
|
|
147
|
+
key: "throwsIfPluginAlreadyExists",
|
|
148
|
+
value: function () {
|
|
149
|
+
var _throwsIfPluginAlreadyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
|
|
150
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
151
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
152
|
+
case 0:
|
|
153
|
+
_context6.next = 2;
|
|
154
|
+
return this.assertThrowsAlreadyExists('test');
|
|
155
|
+
case 2:
|
|
156
|
+
_context6.next = 4;
|
|
157
|
+
return this.assertThrowsAlreadyExists('another');
|
|
158
|
+
case 4:
|
|
159
|
+
case "end":
|
|
160
|
+
return _context6.stop();
|
|
161
|
+
}
|
|
162
|
+
}, _callee6, this);
|
|
163
|
+
}));
|
|
164
|
+
function throwsIfPluginAlreadyExists() {
|
|
165
|
+
return _throwsIfPluginAlreadyExists.apply(this, arguments);
|
|
166
|
+
}
|
|
167
|
+
return throwsIfPluginAlreadyExists;
|
|
168
|
+
}()
|
|
169
|
+
}, {
|
|
170
|
+
key: "contentsAreEqualToExpected",
|
|
171
|
+
value: function () {
|
|
172
|
+
var _contentsAreEqualToExpected = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
|
|
173
|
+
return _regenerator["default"].wrap(function _callee7$(_context7) {
|
|
174
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
175
|
+
case 0:
|
|
176
|
+
this.assertPluginContentsEqualExpected('test', 'Test');
|
|
177
|
+
this.assertPluginContentsEqualExpected('another', 'Another');
|
|
178
|
+
this.assertPluginContentsEqualExpected('aThird', 'AThird');
|
|
179
|
+
case 3:
|
|
180
|
+
case "end":
|
|
181
|
+
return _context7.stop();
|
|
182
|
+
}
|
|
183
|
+
}, _callee7, this);
|
|
184
|
+
}));
|
|
185
|
+
function contentsAreEqualToExpected() {
|
|
186
|
+
return _contentsAreEqualToExpected.apply(this, arguments);
|
|
187
|
+
}
|
|
188
|
+
return contentsAreEqualToExpected;
|
|
189
|
+
}()
|
|
190
|
+
}, {
|
|
191
|
+
key: "combineViewsFileIsValid",
|
|
192
|
+
value: function () {
|
|
193
|
+
var _combineViewsFileIsValid = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
|
|
194
|
+
var combined;
|
|
195
|
+
return _regenerator["default"].wrap(function _callee8$(_context8) {
|
|
196
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
197
|
+
case 0:
|
|
198
|
+
combined = this.getPathToCombinedViewsFile();
|
|
199
|
+
_context8.next = 3;
|
|
200
|
+
return this.Service('typeChecker').check(combined);
|
|
201
|
+
case 3:
|
|
202
|
+
case "end":
|
|
203
|
+
return _context8.stop();
|
|
204
|
+
}
|
|
205
|
+
}, _callee8, this);
|
|
206
|
+
}));
|
|
207
|
+
function combineViewsFileIsValid() {
|
|
208
|
+
return _combineViewsFileIsValid.apply(this, arguments);
|
|
209
|
+
}
|
|
210
|
+
return combineViewsFileIsValid;
|
|
211
|
+
}()
|
|
212
|
+
}, {
|
|
213
|
+
key: "updatesViewCombinedFileWithTypesAsExpected",
|
|
214
|
+
value: function () {
|
|
215
|
+
var _updatesViewCombinedFileWithTypesAsExpected = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {
|
|
216
|
+
var expected;
|
|
217
|
+
return _regenerator["default"].wrap(function _callee9$(_context9) {
|
|
218
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
219
|
+
case 0:
|
|
220
|
+
expected = "\tinterface ViewControllerPlugins {\n\t\taThird: AThirdViewPlugin\n\t\tanother: AnotherViewPlugin\n\t\ttest: TestViewPlugin\n\t\ttestCamel: TestCamelViewPlugin\n\t}";
|
|
221
|
+
this.assertCombinedFileIncludes(expected);
|
|
222
|
+
case 2:
|
|
223
|
+
case "end":
|
|
224
|
+
return _context9.stop();
|
|
225
|
+
}
|
|
226
|
+
}, _callee9, this);
|
|
227
|
+
}));
|
|
228
|
+
function updatesViewCombinedFileWithTypesAsExpected() {
|
|
229
|
+
return _updatesViewCombinedFileWithTypesAsExpected.apply(this, arguments);
|
|
230
|
+
}
|
|
231
|
+
return updatesViewCombinedFileWithTypesAsExpected;
|
|
232
|
+
}()
|
|
233
|
+
}, {
|
|
234
|
+
key: "updatesViewCombinedWithPluginsAsExpected",
|
|
235
|
+
value: function () {
|
|
236
|
+
var _updatesViewCombinedWithPluginsAsExpected = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {
|
|
237
|
+
var expected;
|
|
238
|
+
return _regenerator["default"].wrap(function _callee10$(_context10) {
|
|
239
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
240
|
+
case 0:
|
|
241
|
+
expected = "export const pluginClasses = {\n\taThird: AThirdViewPlugin,\n\tanother: AnotherViewPlugin,\n\ttest: TestViewPlugin,\n\ttestCamel: TestCamelViewPlugin,\n}\n";
|
|
242
|
+
this.assertCombinedFileIncludes(expected);
|
|
243
|
+
this.assertCombinedFileIncludes('heartwood(vcs, pluginClasses)');
|
|
244
|
+
case 3:
|
|
245
|
+
case "end":
|
|
246
|
+
return _context10.stop();
|
|
247
|
+
}
|
|
248
|
+
}, _callee10, this);
|
|
249
|
+
}));
|
|
250
|
+
function updatesViewCombinedWithPluginsAsExpected() {
|
|
251
|
+
return _updatesViewCombinedWithPluginsAsExpected.apply(this, arguments);
|
|
252
|
+
}
|
|
253
|
+
return updatesViewCombinedWithPluginsAsExpected;
|
|
254
|
+
}()
|
|
255
|
+
}, {
|
|
256
|
+
key: "assertCombinedFileIncludes",
|
|
257
|
+
value: function assertCombinedFileIncludes(expected) {
|
|
258
|
+
var combined = this.getPathToCombinedViewsFile();
|
|
259
|
+
var contents = _spruceSkillUtils.diskUtil.readFile(combined);
|
|
260
|
+
_testUtils.assert.doesInclude(contents, expected);
|
|
261
|
+
}
|
|
262
|
+
}, {
|
|
263
|
+
key: "assertPluginContentsEqualExpected",
|
|
264
|
+
value: function assertPluginContentsEqualExpected(nameCamel, namePascal) {
|
|
265
|
+
var contents = _spruceSkillUtils.diskUtil.readFile(this.buildPathToViewPlugin(nameCamel));
|
|
266
|
+
var expected = "export default class ".concat(namePascal, "ViewPlugin {}");
|
|
267
|
+
_testUtils.assert.isEqual(contents.trim(), expected.trim());
|
|
268
|
+
}
|
|
269
|
+
}, {
|
|
270
|
+
key: "assertThrowsAlreadyExists",
|
|
271
|
+
value: function () {
|
|
272
|
+
var _assertThrowsAlreadyExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(name) {
|
|
273
|
+
var results;
|
|
274
|
+
return _regenerator["default"].wrap(function _callee11$(_context11) {
|
|
275
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
276
|
+
case 0:
|
|
277
|
+
_context11.next = 2;
|
|
278
|
+
return this.execute({
|
|
279
|
+
nameReadable: name
|
|
280
|
+
});
|
|
281
|
+
case 2:
|
|
282
|
+
results = _context11.sent;
|
|
283
|
+
_testUtils.assert.isTruthy(results.errors);
|
|
284
|
+
_testUtils.errorAssert.assertError(results.errors[0], 'VIEW_PLUGIN_ALREADY_EXISTS', {
|
|
285
|
+
name: name
|
|
286
|
+
});
|
|
287
|
+
case 5:
|
|
288
|
+
case "end":
|
|
289
|
+
return _context11.stop();
|
|
290
|
+
}
|
|
291
|
+
}, _callee11, this);
|
|
292
|
+
}));
|
|
293
|
+
function assertThrowsAlreadyExists(_x4) {
|
|
294
|
+
return _assertThrowsAlreadyExists.apply(this, arguments);
|
|
295
|
+
}
|
|
296
|
+
return assertThrowsAlreadyExists;
|
|
297
|
+
}()
|
|
298
|
+
}, {
|
|
299
|
+
key: "assertViewPluginWritten",
|
|
300
|
+
value: function assertViewPluginWritten(name) {
|
|
301
|
+
var path = this.buildPathToViewPlugin(name);
|
|
302
|
+
_testUtils.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(path), "File ".concat(path, " was not written!"));
|
|
303
|
+
}
|
|
304
|
+
}, {
|
|
305
|
+
key: "buildPathToViewPlugin",
|
|
306
|
+
value: function buildPathToViewPlugin(name) {
|
|
307
|
+
return this.resolvePath('src', 'viewPlugins', "".concat(name, ".view.plugin.ts"));
|
|
308
|
+
}
|
|
309
|
+
}, {
|
|
310
|
+
key: "execute",
|
|
311
|
+
value: function () {
|
|
312
|
+
var _execute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(options) {
|
|
313
|
+
return _regenerator["default"].wrap(function _callee12$(_context12) {
|
|
314
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
315
|
+
case 0:
|
|
316
|
+
_context12.next = 2;
|
|
317
|
+
return this.action.execute(options);
|
|
318
|
+
case 2:
|
|
319
|
+
return _context12.abrupt("return", _context12.sent);
|
|
320
|
+
case 3:
|
|
321
|
+
case "end":
|
|
322
|
+
return _context12.stop();
|
|
323
|
+
}
|
|
324
|
+
}, _callee12, this);
|
|
325
|
+
}));
|
|
326
|
+
function execute(_x5) {
|
|
327
|
+
return _execute.apply(this, arguments);
|
|
328
|
+
}
|
|
329
|
+
return execute;
|
|
330
|
+
}()
|
|
331
|
+
}, {
|
|
332
|
+
key: "assertExpectedFileCreated",
|
|
333
|
+
value: function assertExpectedFileCreated(results, expected, combinedViewAction) {
|
|
334
|
+
var _results$files, _results$files2;
|
|
335
|
+
var expectedName = "".concat(expected, ".view.plugin.ts");
|
|
336
|
+
_testUtils.assert.doesInclude((_results$files = results.files) === null || _results$files === void 0 ? void 0 : _results$files[0], {
|
|
337
|
+
action: 'generated',
|
|
338
|
+
name: expectedName,
|
|
339
|
+
path: this.resolvePath('src', 'viewPlugins', expectedName)
|
|
340
|
+
});
|
|
341
|
+
_testUtils.assert.doesInclude((_results$files2 = results.files) === null || _results$files2 === void 0 ? void 0 : _results$files2[1], {
|
|
342
|
+
action: combinedViewAction,
|
|
343
|
+
name: 'views.ts',
|
|
344
|
+
path: this.getPathToCombinedViewsFile()
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}, {
|
|
348
|
+
key: "getPathToCombinedViewsFile",
|
|
349
|
+
value: function getPathToCombinedViewsFile() {
|
|
350
|
+
return this.resolveHashSprucePath('views', 'views.ts');
|
|
351
|
+
}
|
|
352
|
+
}]);
|
|
353
|
+
return CreatingAViewPluginTest;
|
|
354
|
+
}(_AbstractSkillTest2["default"]), (0, _defineProperty2["default"])(_CreatingAViewPluginTest, "skillCacheKey", 'views'), (0, _defineProperty2["default"])(_CreatingAViewPluginTest, "action", void 0), _CreatingAViewPluginTest), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "createsExpectedFile", [_dec2, _dec3, _dec4], Object.getOwnPropertyDescriptor(_class, "createsExpectedFile"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "usesCamelNameIfProvided", [_dec5], Object.getOwnPropertyDescriptor(_class, "usesCamelNameIfProvided"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "actuallyCreatesFile", [_dec6], Object.getOwnPropertyDescriptor(_class, "actuallyCreatesFile"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "throwsIfPluginAlreadyExists", [_dec7], Object.getOwnPropertyDescriptor(_class, "throwsIfPluginAlreadyExists"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "contentsAreEqualToExpected", [_dec8], Object.getOwnPropertyDescriptor(_class, "contentsAreEqualToExpected"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "combineViewsFileIsValid", [_dec9], Object.getOwnPropertyDescriptor(_class, "combineViewsFileIsValid"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "updatesViewCombinedFileWithTypesAsExpected", [_dec10], Object.getOwnPropertyDescriptor(_class, "updatesViewCombinedFileWithTypesAsExpected"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "updatesViewCombinedWithPluginsAsExpected", [_dec11], Object.getOwnPropertyDescriptor(_class, "updatesViewCombinedWithPluginsAsExpected"), _class)), _class));
|
|
355
|
+
//# sourceMappingURL=CreatingAViewPlugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreatingAViewPlugin.test.js","names":["_spruceSkillUtils","require","_testUtils","_AbstractSkillTest2","_interopRequireDefault","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_dec10","_dec11","_class","_CreatingAViewPluginTest","_callSuper","t","o","e","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","apply","Boolean","prototype","valueOf","call","CreatingAViewPluginTest","exports","test","_AbstractSkillTest","_inherits2","_classCallCheck2","arguments","_createClass2","key","value","_beforeEach","_asyncToGenerator2","_regenerator","mark","_callee","wrap","_callee$","_context","prev","next","_get2","action","Action","stop","beforeEach","_hasAction","_callee2","_callee2$","_context2","assert","isFunction","execute","hasAction","_createsExpectedFile","_callee3","readable","expected","combinedViewAction","results","_callee3$","_context3","nameReadable","sent","assertExpectedFileCreated","isFalsy","errors","createsExpectedFile","_x","_x2","_x3","_usesCamelNameIfProvided","_callee4","_callee4$","_context4","nameCamel","usesCamelNameIfProvided","_actuallyCreatesFile","_callee5","_callee5$","_context5","assertViewPluginWritten","actuallyCreatesFile","_throwsIfPluginAlreadyExists","_callee6","_callee6$","_context6","assertThrowsAlreadyExists","throwsIfPluginAlreadyExists","_contentsAreEqualToExpected","_callee7","_callee7$","_context7","assertPluginContentsEqualExpected","contentsAreEqualToExpected","_combineViewsFileIsValid","_callee8","combined","_callee8$","_context8","getPathToCombinedViewsFile","Service","check","combineViewsFileIsValid","_updatesViewCombinedFileWithTypesAsExpected","_callee9","_callee9$","_context9","assertCombinedFileIncludes","updatesViewCombinedFileWithTypesAsExpected","_updatesViewCombinedWithPluginsAsExpected","_callee10","_callee10$","_context10","updatesViewCombinedWithPluginsAsExpected","contents","diskUtil","readFile","doesInclude","namePascal","buildPathToViewPlugin","concat","isEqual","trim","_assertThrowsAlreadyExists","_callee11","name","_callee11$","_context11","isTruthy","errorAssert","assertError","_x4","path","isTrue","doesFileExist","resolvePath","_execute","_callee12","options","_callee12$","_context12","abrupt","_x5","_results$files","_results$files2","expectedName","files","resolveHashSprucePath","AbstractSkillTest","_defineProperty2","_applyDecoratedDescriptor2","Object","getOwnPropertyDescriptor"],"sources":["../../../../../src/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert, errorAssert } from '@sprucelabs/test-utils'\nimport { FeatureActionResponse } from '../../../../features/features.types'\nimport CreatePluginAction from '../../../../features/view/actions/CreatePluginAction'\nimport AbstractSkillTest from '../../../../tests/AbstractSkillTest'\n\nexport default class CreatingAViewPluginTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'views'\n\tprivate static action: CreatePluginAction\n\n\tprotected static async beforeEach(): Promise<void> {\n\t\tawait super.beforeEach()\n\t\tthis.action = this.Action('view', 'createPlugin')\n\t}\n\n\t@test()\n\tprotected static async hasAction() {\n\t\tassert.isFunction(this.action.execute)\n\t}\n\n\t@test('creates expected plugin file 1', 'test', 'test', 'updated')\n\t@test('creates expected plugin file 2', 'another', 'another', 'updated')\n\t@test('creates expected plugin file 3', 'a third', 'aThird', 'generated')\n\tprotected static async createsExpectedFile(\n\t\treadable: string,\n\t\texpected: string,\n\t\tcombinedViewAction: string\n\t) {\n\t\tconst results = await this.execute({ nameReadable: readable })\n\t\tthis.assertExpectedFileCreated(results, expected, combinedViewAction)\n\t\tassert.isFalsy(\n\t\t\tresults.errors,\n\t\t\t'Errors were returned and none were expected!'\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async usesCamelNameIfProvided() {\n\t\tconst results = await this.execute({\n\t\t\tnameReadable: 'test',\n\t\t\tnameCamel: 'testCamel',\n\t\t})\n\n\t\tthis.assertExpectedFileCreated(results, 'testCamel', 'updated')\n\t}\n\n\t@test()\n\tprotected static async actuallyCreatesFile() {\n\t\tthis.assertViewPluginWritten('test')\n\t\tthis.assertViewPluginWritten('another')\n\t\tthis.assertViewPluginWritten('aThird')\n\t}\n\n\t@test()\n\tprotected static async throwsIfPluginAlreadyExists() {\n\t\tawait this.assertThrowsAlreadyExists('test')\n\t\tawait this.assertThrowsAlreadyExists('another')\n\t}\n\n\t@test()\n\tprotected static async contentsAreEqualToExpected() {\n\t\tthis.assertPluginContentsEqualExpected('test', 'Test')\n\t\tthis.assertPluginContentsEqualExpected('another', 'Another')\n\t\tthis.assertPluginContentsEqualExpected('aThird', 'AThird')\n\t}\n\n\t@test()\n\tprotected static async combineViewsFileIsValid() {\n\t\tconst combined = this.getPathToCombinedViewsFile()\n\t\tawait this.Service('typeChecker').check(combined)\n\t}\n\n\t@test()\n\tprotected static async updatesViewCombinedFileWithTypesAsExpected() {\n\t\tconst expected = `\tinterface ViewControllerPlugins {\n\t\taThird: AThirdViewPlugin\n\t\tanother: AnotherViewPlugin\n\t\ttest: TestViewPlugin\n\t\ttestCamel: TestCamelViewPlugin\n\t}`\n\t\tthis.assertCombinedFileIncludes(expected)\n\t}\n\n\t@test()\n\tprotected static async updatesViewCombinedWithPluginsAsExpected() {\n\t\tconst expected = `export const pluginClasses = {\n\taThird: AThirdViewPlugin,\n\tanother: AnotherViewPlugin,\n\ttest: TestViewPlugin,\n\ttestCamel: TestCamelViewPlugin,\n}\n`\n\n\t\tthis.assertCombinedFileIncludes(expected)\n\t\tthis.assertCombinedFileIncludes('heartwood(vcs, pluginClasses)')\n\t}\n\n\tprivate static assertCombinedFileIncludes(expected: string) {\n\t\tconst combined = this.getPathToCombinedViewsFile()\n\t\tconst contents = diskUtil.readFile(combined)\n\t\tassert.doesInclude(contents, expected)\n\t}\n\n\tprivate static assertPluginContentsEqualExpected(\n\t\tnameCamel: string,\n\t\tnamePascal: string\n\t) {\n\t\tconst contents = diskUtil.readFile(this.buildPathToViewPlugin(nameCamel))\n\t\tconst expected = `export default class ${namePascal}ViewPlugin {}`\n\n\t\tassert.isEqual(contents.trim(), expected.trim())\n\t}\n\n\tprivate static async assertThrowsAlreadyExists(name: string) {\n\t\tconst results = await this.execute({ nameReadable: name })\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssert.assertError(results.errors[0], 'VIEW_PLUGIN_ALREADY_EXISTS', {\n\t\t\tname,\n\t\t})\n\t}\n\n\tprivate static assertViewPluginWritten(name: string) {\n\t\tconst path = this.buildPathToViewPlugin(name)\n\t\tassert.isTrue(diskUtil.doesFileExist(path), `File ${path} was not written!`)\n\t}\n\n\tprivate static buildPathToViewPlugin(name: string) {\n\t\treturn this.resolvePath('src', 'viewPlugins', `${name}.view.plugin.ts`)\n\t}\n\n\tprivate static async execute(options: {\n\t\tnameReadable: string\n\t\tnameCamel?: string\n\t}) {\n\t\treturn await this.action.execute(options)\n\t}\n\n\tprivate static assertExpectedFileCreated(\n\t\tresults: FeatureActionResponse,\n\t\texpected: string,\n\t\tcombinedViewAction: string\n\t) {\n\t\tconst expectedName = `${expected}.view.plugin.ts`\n\n\t\tassert.doesInclude(results.files?.[0], {\n\t\t\taction: 'generated',\n\t\t\tname: expectedName,\n\t\t\tpath: this.resolvePath('src', 'viewPlugins', expectedName),\n\t\t})\n\n\t\tassert.doesInclude(results.files?.[1], {\n\t\t\taction: combinedViewAction,\n\t\t\tname: 'views.ts',\n\t\t\tpath: this.getPathToCombinedViewsFile(),\n\t\t})\n\t}\n\n\tprivate static getPathToCombinedViewsFile() {\n\t\treturn this.resolveHashSprucePath('views', 'views.ts')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGA,IAAAE,mBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAmE,IAAAI,IAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,MAAA,EAAAC,MAAA,EAAAC,wBAAA;AAAA,SAAAC,WAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,WAAAD,CAAA,OAAAE,gBAAA,aAAAF,CAAA,OAAAG,2BAAA,aAAAJ,CAAA,EAAAK,yBAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,CAAA,EAAAC,CAAA,YAAAC,gBAAA,aAAAH,CAAA,EAAAQ,WAAA,IAAAP,CAAA,CAAAQ,KAAA,CAAAT,CAAA,EAAAE,CAAA;AAAA,SAAAG,0BAAA,cAAAL,CAAA,IAAAU,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAP,OAAA,CAAAC,SAAA,CAAAG,OAAA,iCAAAV,CAAA,aAAAK,yBAAA,YAAAA,0BAAA,aAAAL,CAAA;AAAA,IAE9Cc,uBAAuB,GAAAC,OAAA,eAAA7B,IAAA,GAS1C,IAAA8B,eAAI,EAAC,CAAC,EA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AA,OAAAmJ,0BAAA,aAAAnJ,MAAA,iDAAAF,MAAA,GAAAsJ,MAAA,CAAAC,wBAAA,CAAArJ,MAAA,iDAAAA,MAAA,OAAAmJ,0BAAA,aAAAnJ,MAAA,+CAAAD,MAAA,GAAAqJ,MAAA,CAAAC,wBAAA,CAAArJ,MAAA,+CAAAA,MAAA,IAAAA,MAAA","ignoreList":[]}
|
|
@@ -210,6 +210,9 @@ var SpruceError = exports["default"] = /*#__PURE__*/function (_AbstractSpruceErr
|
|
|
210
210
|
case 'DEPENDENCY_EXISTS':
|
|
211
211
|
message = "You already have ".concat(options.namespace, " as a dependency!");
|
|
212
212
|
break;
|
|
213
|
+
case 'VIEW_PLUGIN_ALREADY_EXISTS':
|
|
214
|
+
message = "A view plugin by the name ".concat(options.name, " already exists!");
|
|
215
|
+
break;
|
|
213
216
|
default:
|
|
214
217
|
message = (0, _get2["default"])((0, _getPrototypeOf2["default"])(SpruceError.prototype), "friendlyMessage", this).call(this);
|
|
215
218
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpruceError.js","names":["_error","_interopRequireDefault","require","_spruceSkillUtils","_upperFirst","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","_callSuper","t","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","valueOf","SpruceError","exports","_AbstractSpruceError","_inherits2","_classCallCheck2","arguments","_createClass2","key","friendlyMessage","_options$friendlyMess","_options$originalErro2","_options$originalErro3","_options$friendlyMess2","_options$originalErro4","_options$originalErro5","_options$originalErro7","_ref","_options$friendlyMess3","_options$originalErro8","_options$friendlyMess4","options","message","code","args","concat","join","originalError","_options$originalErro","stack","command","file","pattern","_options$originalErro6","cmd","cwd","stderr","cleanStdErr","stdout","schemaId","destination","featureCode","fileName","testName","errorMessage","split","map","line","upperFirst","errors","responseErrors","errorMessages","_iterator","_step","push","fullyQualifiedEventName","brokenProperty","dependencies","d","hint","namesUtil","toPascal","schemaNamespace","fieldName","JSON","stringify","fieldOptions","namespace","_get2","replace","trim","AbstractSpruceError"],"sources":["../../src/errors/SpruceError.ts"],"sourcesContent":["import AbstractSpruceError from '@sprucelabs/error'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport upperFirst from 'lodash/upperFirst'\nimport ErrorOptions from '#spruce/errors/options.types'\n\nexport default class SpruceError extends AbstractSpruceError<ErrorOptions> {\n\t/** An easy to understand version of the errors */\n\tpublic friendlyMessage(): string {\n\t\tconst { options } = this\n\t\tlet message\n\n\t\tswitch (options?.code) {\n\t\t\tcase 'INVALID_COMMAND':\n\t\t\t\tif (!options.args || options.args.length === 0) {\n\t\t\t\t\tmessage = `Hey friend 👋.. I don't support the command you tried.`\n\t\t\t\t} else {\n\t\t\t\t\tmessage = `Hey friend 👋. I don't know the command: ${options.args.join(\n\t\t\t\t\t\t' '\n\t\t\t\t\t)}.`\n\t\t\t\t}\n\t\t\t\tmessage += ' Try running `spruce --help`'\n\t\t\t\tbreak\n\n\t\t\tcase 'GENERIC':\n\t\t\t\tmessage = options.friendlyMessage ?? 'Oh shoot! 🤔'\n\n\t\t\t\tif (options.originalError) {\n\t\t\t\t\tmessage += `\\n\\n${\n\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.name\n\t\t\t\t\t}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'NOT_IMPLEMENTED':\n\t\t\t\tmessage = ''\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'COMMAND_NOT_IMPLEMENTED':\n\t\t\t\tmessage = `${options.command} has not yet been implemented. ${\n\t\t\t\t\toptions.args ? `Args: ${options.args.join(', ')}` : ''\n\t\t\t\t}`\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_FAILED_TO_IMPORT':\n\t\t\t\tmessage = `Error importing \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BUILD_FAILED':\n\t\t\t\tmessage = `Build${\n\t\t\t\t\toptions.file ? `ing ${options.file}` : ''\n\t\t\t\t} failed. It looks like you're not running 'yarn watch'. Run it and then run 'spruce all:sync'.`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FAILED_TO_IMPORT':\n\t\t\t\tmessage =\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\t`Failed to import \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'LINT_FAILED':\n\t\t\t\tmessage = options.friendlyMessage\n\n\t\t\t\tif (!message) {\n\t\t\t\t\tmessage = `Lint failed on pattern ${options.pattern}.`\n\n\t\t\t\t\tif (options.originalError) {\n\t\t\t\t\t\tmessage += `\\n\\nOriginal error:${\n\t\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.message\n\t\t\t\t\t\t}`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'EXECUTING_COMMAND_FAILED':\n\t\t\t\tif (this.originalError && this.originalError.message) {\n\t\t\t\t\tmessage = this.originalError.message + '\\n\\n'\n\t\t\t\t} else {\n\t\t\t\t\tmessage = ''\n\t\t\t\t}\n\t\t\t\tmessage += `Executing command failed '${options.cmd}'.\\n\\n`\n\t\t\t\tif (options.cwd) {\n\t\t\t\t\tmessage += `cwd: ${options.cwd}\\n\\n`\n\t\t\t\t}\n\n\t\t\t\tif (options.stderr) {\n\t\t\t\t\tmessage += this.cleanStdErr(options.stderr) + '\\n\\n'\n\t\t\t\t}\n\n\t\t\t\tif (options.stdout) {\n\t\t\t\t\tmessage += options.stdout\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'CREATE_AUTOLOADER_FAILED':\n\t\t\t\tmessage = 'A Could not create an autoloader just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_EMPTY':\n\t\t\t\tmessage = 'A directory empty just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'FILE_EXISTS':\n\t\t\t\tmessage = 'A fail already exists.'\n\t\t\t\tbreak\n\n\t\t\tcase 'VSCODE_NOT_INSTALLED':\n\t\t\t\tmessage =\n\t\t\t\t\t\"vscode's 'code' is not installed.\\n\\nMac instructions: https://code.visualstudio.com/docs/setup/mac\\n\\nLinux instructions: https://code.visualstudio.com/docs/setup/linux\\n\\nWindows instructions: https://code.visualstudio.com/docs/setup/windows\"\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_EXISTS':\n\t\t\t\tmessage = `A schema called ${options.schemaId} already exists at ${options.destination}`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_ABORTED':\n\t\t\t\tmessage = 'Aborted! See ya later! ✌️'\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_FEATURE_CODE':\n\t\t\t\tmessage = `Oh no! I couldn't find a feature with the code '${options.featureCode}'.`\n\t\t\t\tbreak\n\n\t\t\tcase 'TEST_FAILED':\n\t\t\t\tmessage = `${options.fileName}\\n - ${\n\t\t\t\t\toptions.testName\n\t\t\t\t}\\n\\n${options.errorMessage\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((line) => ` ${line}`)\n\t\t\t\t\t.join('\\n')}`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FEATURE_NOT_INSTALLED':\n\t\t\t\tmessage = `\\`${upperFirst(\n\t\t\t\t\toptions.featureCode\n\t\t\t\t)}\\` feature is not installed. Install it first, then try again.`\n\t\t\t\tbreak\n\n\t\t\tcase 'MERCURY_RESPONSE_ERROR': {\n\t\t\t\tconst errors = options.responseErrors\n\t\t\t\tmessage = `Got ${\n\t\t\t\t\terrors.length === 1 ? 'an error' : `${errors.length} errors`\n\t\t\t\t} from the server:\\n\\n`\n\n\t\t\t\tconst errorMessages: string[] = []\n\t\t\t\tfor (const err of errors) {\n\t\t\t\t\terrorMessages.push(err.message)\n\t\t\t\t}\n\n\t\t\t\tmessage += errorMessages.join('\\n')\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase 'INVALID_TEST_DIRECTORY':\n\t\t\t\tmessage = `You are missing dependencies I need to run tests. Try \\`spruce test.install\\` to reinstall.`\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_NOT_SKILL':\n\t\t\t\tmessage = 'The directory you are in is not a skill!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_REGISTERED':\n\t\t\t\tmessage = `Dang! I can't continue until you register your skill! Run \\`spruce login\\` and then \\`spruce register.skill\\` to get the ball rolling!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_ORGANIZATIONS_FOUND':\n\t\t\t\tmessage =\n\t\t\t\t\t\"It looks like you don't have any organizations setup yet. Try `spruce create.organization` first.\"\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_EVENT_CONTRACT':\n\t\t\t\tmessage = `The event named \\`${options.fullyQualifiedEventName}\\` is not valid. Check ${options.brokenProperty}. The original error is:\\n\\n${options.originalError?.message}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BOOT_ERROR':\n\t\t\t\tmessage = `Booting your skill failed: ${\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\toptions.originalError?.message ??\n\t\t\t\t\t'Not sure why, tho.'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPLOY_FAILED':\n\t\t\t\tmessage = 'Deploy halted!'\n\t\t\t\tbreak\n\n\t\t\tcase 'MISSING_DEPENDENCIES':\n\t\t\t\tmessage = `Looks like you're missing some dependencies:\\n\\n${options.dependencies\n\t\t\t\t\t.map((d) => `${d.name}: ${d.hint}`)\n\t\t\t\t\t.join('\\n')}`\n\t\t\t\tbreak\n\n\t\t\tcase 'STORE_EXISTS':\n\t\t\t\tmessage = 'A Store exists just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'NOT_LOGGED_IN':\n\t\t\t\tmessage = 'You have to be logged in to do that!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_FOUND':\n\t\t\t\tmessage = options.friendlyMessage ?? `I couldn't find that skill!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_SKILLS_REGISTERED':\n\t\t\t\tmessage = `Whoa! Looks like you haven't registered your skill yet! Try \\`spruce register\\` to get that done!`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_BLOCKED':\n\t\t\t\tmessage = `${options.command} is blocked! ${options.hint}`\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_VIEW_EXISTS':\n\t\t\t\tmessage = `A skill view controller already exists named ${options.name}!`\n\t\t\t\tbreak\n\n\t\t\tcase 'THEME_EXISTS':\n\t\t\t\tmessage = `Yikes! You can't create a new theme. One per skill for now.`\n\t\t\t\tbreak\n\n\t\t\tcase 'CACHE_NOT_ENABLED':\n\t\t\t\tmessage = \"Cache is not enabled, so it can't be disabled!\"\n\t\t\t\tbreak\n\n\t\t\tcase 'DOCKER_NOT_STARTED':\n\t\t\t\tmessage = 'Docker has not been started! Start it and try again!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_TEMPLATE_ITEM_BUILDING_FAILED':\n\t\t\t\tmessage = `Failed to build schema template item for '${namesUtil.toPascal(\n\t\t\t\t\toptions.schemaNamespace\n\t\t\t\t)}.${options.schemaId}'. The field I had an issue on was '${\n\t\t\t\t\toptions.fieldName\n\t\t\t\t}'. It's options are:\\n\\n${JSON.stringify(\n\t\t\t\t\toptions.fieldOptions\n\t\t\t\t)}.\\n\\nChances are you have a circular reference in your schemas. You'll need to extract shared fields to a new file and have your schemas mix those in, vs referencing eath other.`\n\t\t\t\tbreak\n\n\t\t\tcase 'ACTION_CANCELLED':\n\t\t\t\tmessage = 'A Action cancelled just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'TRANSPORT_ALREADY_EXISTS':\n\t\t\t\tmessage = `A transport named '${options.name}' already exists!`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPENDENCY_EXISTS':\n\t\t\t\tmessage = `You already have ${options.namespace} as a dependency!`\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tmessage = super.friendlyMessage()\n\t\t}\n\n\t\treturn message\n\t}\n\n\tprivate cleanStdErr(stderr: string) {\n\t\treturn stderr.replace('warning package.json: No license field', '').trim()\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0C,SAAAG,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,EAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,EAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,cAAA,IAAAD,CAAA,WAAAA,CAAA,CAAAQ,MAAA,qBAAAN,EAAA,EAAAF,CAAA,GAAAE,EAAA,MAAAO,CAAA,UAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,QAAAH,CAAA,IAAAT,CAAA,CAAAQ,MAAA,WAAAK,IAAA,mBAAAA,IAAA,SAAAC,KAAA,EAAAd,CAAA,CAAAS,CAAA,UAAAM,CAAA,WAAAA,EAAAC,EAAA,UAAAA,EAAA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AkB;UACtB5C,OAAO,GAAG,mCAAmC;UAC7C;QAED,KAAK,0BAA0B;UAC9BA,OAAO,yBAAAG,MAAA,CAAyBJ,OAAO,CAACpC,IAAI,sBAAmB;UAC/D;QAED,KAAK,mBAAmB;UACvBqC,OAAO,uBAAAG,MAAA,CAAuBJ,OAAO,CAAC8C,SAAS,sBAAmB;UAClE;QAED;UACC7C,OAAO,OAAA8C,KAAA,iBAAA3E,gBAAA,aAAAQ,WAAA,CAAApB,SAAA,4BAAAP,IAAA,MAA0B;MACnC;MAEA,OAAOgD,OAAO;IACf;EAAC;IAAAd,GAAA;IAAA1C,KAAA,EAED,SAAAuE,YAAoBD,MAAc,EAAE;MACnC,OAAOA,MAAM,CAACiC,OAAO,CAAC,wCAAwC,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;IAC3E;EAAC;EAAA,OAAArE,WAAA;AAAA,EA1QuCsE,iBAAmB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"SpruceError.js","names":["_error","_interopRequireDefault","require","_spruceSkillUtils","_upperFirst","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","minLen","_arrayLikeToArray","Object","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","_callSuper","t","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","apply","Boolean","valueOf","SpruceError","exports","_AbstractSpruceError","_inherits2","_classCallCheck2","arguments","_createClass2","key","friendlyMessage","_options$friendlyMess","_options$originalErro2","_options$originalErro3","_options$friendlyMess2","_options$originalErro4","_options$originalErro5","_options$originalErro7","_ref","_options$friendlyMess3","_options$originalErro8","_options$friendlyMess4","options","message","code","args","concat","join","originalError","_options$originalErro","stack","command","file","pattern","_options$originalErro6","cmd","cwd","stderr","cleanStdErr","stdout","schemaId","destination","featureCode","fileName","testName","errorMessage","split","map","line","upperFirst","errors","responseErrors","errorMessages","_iterator","_step","push","fullyQualifiedEventName","brokenProperty","dependencies","d","hint","namesUtil","toPascal","schemaNamespace","fieldName","JSON","stringify","fieldOptions","namespace","_get2","replace","trim","AbstractSpruceError"],"sources":["../../src/errors/SpruceError.ts"],"sourcesContent":["import AbstractSpruceError from '@sprucelabs/error'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport upperFirst from 'lodash/upperFirst'\nimport ErrorOptions from '#spruce/errors/options.types'\n\nexport default class SpruceError extends AbstractSpruceError<ErrorOptions> {\n\t/** An easy to understand version of the errors */\n\tpublic friendlyMessage(): string {\n\t\tconst { options } = this\n\t\tlet message\n\n\t\tswitch (options?.code) {\n\t\t\tcase 'INVALID_COMMAND':\n\t\t\t\tif (!options.args || options.args.length === 0) {\n\t\t\t\t\tmessage = `Hey friend 👋.. I don't support the command you tried.`\n\t\t\t\t} else {\n\t\t\t\t\tmessage = `Hey friend 👋. I don't know the command: ${options.args.join(\n\t\t\t\t\t\t' '\n\t\t\t\t\t)}.`\n\t\t\t\t}\n\t\t\t\tmessage += ' Try running `spruce --help`'\n\t\t\t\tbreak\n\n\t\t\tcase 'GENERIC':\n\t\t\t\tmessage = options.friendlyMessage ?? 'Oh shoot! 🤔'\n\n\t\t\t\tif (options.originalError) {\n\t\t\t\t\tmessage += `\\n\\n${\n\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.name\n\t\t\t\t\t}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'NOT_IMPLEMENTED':\n\t\t\t\tmessage = ''\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\tcase 'COMMAND_NOT_IMPLEMENTED':\n\t\t\t\tmessage = `${options.command} has not yet been implemented. ${\n\t\t\t\t\toptions.args ? `Args: ${options.args.join(', ')}` : ''\n\t\t\t\t}`\n\t\t\t\tif (options.friendlyMessage) {\n\t\t\t\t\tmessage += `\\n\\n${options.friendlyMessage}`\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_FAILED_TO_IMPORT':\n\t\t\t\tmessage = `Error importing \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BUILD_FAILED':\n\t\t\t\tmessage = `Build${\n\t\t\t\t\toptions.file ? `ing ${options.file}` : ''\n\t\t\t\t} failed. It looks like you're not running 'yarn watch'. Run it and then run 'spruce all:sync'.`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FAILED_TO_IMPORT':\n\t\t\t\tmessage =\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\t`Failed to import \"${options.file}\". Original error:\\n\\n${\n\t\t\t\t\t\toptions.originalError?.message ?? '**MISSING**'\n\t\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'LINT_FAILED':\n\t\t\t\tmessage = options.friendlyMessage\n\n\t\t\t\tif (!message) {\n\t\t\t\t\tmessage = `Lint failed on pattern ${options.pattern}.`\n\n\t\t\t\t\tif (options.originalError) {\n\t\t\t\t\t\tmessage += `\\n\\nOriginal error:${\n\t\t\t\t\t\t\toptions.originalError.stack ?? options.originalError.message\n\t\t\t\t\t\t}`\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'EXECUTING_COMMAND_FAILED':\n\t\t\t\tif (this.originalError && this.originalError.message) {\n\t\t\t\t\tmessage = this.originalError.message + '\\n\\n'\n\t\t\t\t} else {\n\t\t\t\t\tmessage = ''\n\t\t\t\t}\n\t\t\t\tmessage += `Executing command failed '${options.cmd}'.\\n\\n`\n\t\t\t\tif (options.cwd) {\n\t\t\t\t\tmessage += `cwd: ${options.cwd}\\n\\n`\n\t\t\t\t}\n\n\t\t\t\tif (options.stderr) {\n\t\t\t\t\tmessage += this.cleanStdErr(options.stderr) + '\\n\\n'\n\t\t\t\t}\n\n\t\t\t\tif (options.stdout) {\n\t\t\t\t\tmessage += options.stdout\n\t\t\t\t}\n\n\t\t\t\tbreak\n\n\t\t\tcase 'CREATE_AUTOLOADER_FAILED':\n\t\t\t\tmessage = 'A Could not create an autoloader just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_EMPTY':\n\t\t\t\tmessage = 'A directory empty just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'FILE_EXISTS':\n\t\t\t\tmessage = 'A fail already exists.'\n\t\t\t\tbreak\n\n\t\t\tcase 'VSCODE_NOT_INSTALLED':\n\t\t\t\tmessage =\n\t\t\t\t\t\"vscode's 'code' is not installed.\\n\\nMac instructions: https://code.visualstudio.com/docs/setup/mac\\n\\nLinux instructions: https://code.visualstudio.com/docs/setup/linux\\n\\nWindows instructions: https://code.visualstudio.com/docs/setup/windows\"\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_EXISTS':\n\t\t\t\tmessage = `A schema called ${options.schemaId} already exists at ${options.destination}`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_ABORTED':\n\t\t\t\tmessage = 'Aborted! See ya later! ✌️'\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_FEATURE_CODE':\n\t\t\t\tmessage = `Oh no! I couldn't find a feature with the code '${options.featureCode}'.`\n\t\t\t\tbreak\n\n\t\t\tcase 'TEST_FAILED':\n\t\t\t\tmessage = `${options.fileName}\\n - ${\n\t\t\t\t\toptions.testName\n\t\t\t\t}\\n\\n${options.errorMessage\n\t\t\t\t\t.split('\\n')\n\t\t\t\t\t.map((line) => ` ${line}`)\n\t\t\t\t\t.join('\\n')}`\n\n\t\t\t\tbreak\n\n\t\t\tcase 'FEATURE_NOT_INSTALLED':\n\t\t\t\tmessage = `\\`${upperFirst(\n\t\t\t\t\toptions.featureCode\n\t\t\t\t)}\\` feature is not installed. Install it first, then try again.`\n\t\t\t\tbreak\n\n\t\t\tcase 'MERCURY_RESPONSE_ERROR': {\n\t\t\t\tconst errors = options.responseErrors\n\t\t\t\tmessage = `Got ${\n\t\t\t\t\terrors.length === 1 ? 'an error' : `${errors.length} errors`\n\t\t\t\t} from the server:\\n\\n`\n\n\t\t\t\tconst errorMessages: string[] = []\n\t\t\t\tfor (const err of errors) {\n\t\t\t\t\terrorMessages.push(err.message)\n\t\t\t\t}\n\n\t\t\t\tmessage += errorMessages.join('\\n')\n\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tcase 'INVALID_TEST_DIRECTORY':\n\t\t\t\tmessage = `You are missing dependencies I need to run tests. Try \\`spruce test.install\\` to reinstall.`\n\t\t\t\tbreak\n\n\t\t\tcase 'DIRECTORY_NOT_SKILL':\n\t\t\t\tmessage = 'The directory you are in is not a skill!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_REGISTERED':\n\t\t\t\tmessage = `Dang! I can't continue until you register your skill! Run \\`spruce login\\` and then \\`spruce register.skill\\` to get the ball rolling!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_ORGANIZATIONS_FOUND':\n\t\t\t\tmessage =\n\t\t\t\t\t\"It looks like you don't have any organizations setup yet. Try `spruce create.organization` first.\"\n\t\t\t\tbreak\n\n\t\t\tcase 'INVALID_EVENT_CONTRACT':\n\t\t\t\tmessage = `The event named \\`${options.fullyQualifiedEventName}\\` is not valid. Check ${options.brokenProperty}. The original error is:\\n\\n${options.originalError?.message}`\n\t\t\t\tbreak\n\n\t\t\tcase 'BOOT_ERROR':\n\t\t\t\tmessage = `Booting your skill failed: ${\n\t\t\t\t\toptions.friendlyMessage ??\n\t\t\t\t\toptions.originalError?.message ??\n\t\t\t\t\t'Not sure why, tho.'\n\t\t\t\t}`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPLOY_FAILED':\n\t\t\t\tmessage = 'Deploy halted!'\n\t\t\t\tbreak\n\n\t\t\tcase 'MISSING_DEPENDENCIES':\n\t\t\t\tmessage = `Looks like you're missing some dependencies:\\n\\n${options.dependencies\n\t\t\t\t\t.map((d) => `${d.name}: ${d.hint}`)\n\t\t\t\t\t.join('\\n')}`\n\t\t\t\tbreak\n\n\t\t\tcase 'STORE_EXISTS':\n\t\t\t\tmessage = 'A Store exists just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'NOT_LOGGED_IN':\n\t\t\t\tmessage = 'You have to be logged in to do that!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_NOT_FOUND':\n\t\t\t\tmessage = options.friendlyMessage ?? `I couldn't find that skill!`\n\t\t\t\tbreak\n\n\t\t\tcase 'NO_SKILLS_REGISTERED':\n\t\t\t\tmessage = `Whoa! Looks like you haven't registered your skill yet! Try \\`spruce register\\` to get that done!`\n\t\t\t\tbreak\n\n\t\t\tcase 'COMMAND_BLOCKED':\n\t\t\t\tmessage = `${options.command} is blocked! ${options.hint}`\n\t\t\t\tbreak\n\n\t\t\tcase 'SKILL_VIEW_EXISTS':\n\t\t\t\tmessage = `A skill view controller already exists named ${options.name}!`\n\t\t\t\tbreak\n\n\t\t\tcase 'THEME_EXISTS':\n\t\t\t\tmessage = `Yikes! You can't create a new theme. One per skill for now.`\n\t\t\t\tbreak\n\n\t\t\tcase 'CACHE_NOT_ENABLED':\n\t\t\t\tmessage = \"Cache is not enabled, so it can't be disabled!\"\n\t\t\t\tbreak\n\n\t\t\tcase 'DOCKER_NOT_STARTED':\n\t\t\t\tmessage = 'Docker has not been started! Start it and try again!'\n\t\t\t\tbreak\n\n\t\t\tcase 'SCHEMA_TEMPLATE_ITEM_BUILDING_FAILED':\n\t\t\t\tmessage = `Failed to build schema template item for '${namesUtil.toPascal(\n\t\t\t\t\toptions.schemaNamespace\n\t\t\t\t)}.${options.schemaId}'. The field I had an issue on was '${\n\t\t\t\t\toptions.fieldName\n\t\t\t\t}'. It's options are:\\n\\n${JSON.stringify(\n\t\t\t\t\toptions.fieldOptions\n\t\t\t\t)}.\\n\\nChances are you have a circular reference in your schemas. You'll need to extract shared fields to a new file and have your schemas mix those in, vs referencing eath other.`\n\t\t\t\tbreak\n\n\t\t\tcase 'ACTION_CANCELLED':\n\t\t\t\tmessage = 'A Action cancelled just happened!'\n\t\t\t\tbreak\n\n\t\t\tcase 'TRANSPORT_ALREADY_EXISTS':\n\t\t\t\tmessage = `A transport named '${options.name}' already exists!`\n\t\t\t\tbreak\n\n\t\t\tcase 'DEPENDENCY_EXISTS':\n\t\t\t\tmessage = `You already have ${options.namespace} as a dependency!`\n\t\t\t\tbreak\n\n\t\t\tcase 'VIEW_PLUGIN_ALREADY_EXISTS':\n\t\t\t\tmessage = `A view plugin by the name ${options.name} already exists!`\n\t\t\t\tbreak\n\n\t\t\tdefault:\n\t\t\t\tmessage = super.friendlyMessage()\n\t\t}\n\n\t\treturn message\n\t}\n\n\tprivate cleanStdErr(stderr: string) {\n\t\treturn stderr.replace('warning package.json: No license field', '').trim()\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA0C,SAAAG,2BAAAC,CAAA,EAAAC,cAAA,QAAAC,EAAA,UAAAC,MAAA,oBAAAH,CAAA,CAAAG,MAAA,CAAAC,QAAA,KAAAJ,CAAA,qBAAAE,EAAA,QAAAG,KAAA,CAAAC,OAAA,CAAAN,CAAA,MAAAE,EAAA,GAAAK,2BAAA,CAAAP,CAAA,MAAAC,cAAA,IAAAD,CAAA,WAAAA,CAAA,CAAAQ,MAAA,qBAAAN,EAAA,EAAAF,CAAA,GAAAE,EAAA,MAAAO,CAAA,UAAAC,CAAA,YAAAA,EAAA,eAAAC,CAAA,EAAAD,CAAA,EAAAE,CAAA,WAAAA,EAAA,QAAAH,CAAA,IAAAT,CAAA,CAAAQ,MAAA,WAAAK,IAAA,mBAAAA,IAAA,SAAAC,KAAA,EAAAd,CAAA,CAAAS,CAAA,UAAA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,YACT,CAAC,sLAAmL;UACpL;QAED,KAAK,kBAAkB;UACtB5C,OAAO,GAAG,mCAAmC;UAC7C;QAED,KAAK,0BAA0B;UAC9BA,OAAO,yBAAAG,MAAA,CAAyBJ,OAAO,CAACpC,IAAI,sBAAmB;UAC/D;QAED,KAAK,mBAAmB;UACvBqC,OAAO,uBAAAG,MAAA,CAAuBJ,OAAO,CAAC8C,SAAS,sBAAmB;UAClE;QAED,KAAK,4BAA4B;UAChC7C,OAAO,gCAAAG,MAAA,CAAgCJ,OAAO,CAACpC,IAAI,qBAAkB;UACrE;QAED;UACCqC,OAAO,OAAA8C,KAAA,iBAAA3E,gBAAA,aAAAQ,WAAA,CAAApB,SAAA,4BAAAP,IAAA,MAA0B;MACnC;MAEA,OAAOgD,OAAO;IACf;EAAC;IAAAd,GAAA;IAAA1C,KAAA,EAED,SAAAuE,YAAoBD,MAAc,EAAE;MACnC,OAAOA,MAAM,CAACiC,OAAO,CAAC,wCAAwC,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,CAAC;IAC3E;EAAC;EAAA,OAAArE,WAAA;AAAA,EA9QuCsE,iBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
var _schema = require("@sprucelabs/schema");
|
|
8
|
+
var _default = exports["default"] = (0, _schema.buildErrorSchema)({
|
|
9
|
+
id: 'viewPluginAlreadyExists',
|
|
10
|
+
name: 'View plugin already exists',
|
|
11
|
+
fields: {
|
|
12
|
+
name: {
|
|
13
|
+
type: 'text',
|
|
14
|
+
isRequired: true
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=viewPluginAlreadyExists.builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewPluginAlreadyExists.builder.js","names":["_schema","require","_default","exports","buildErrorSchema","id","name","fields","type","isRequired"],"sources":["../../src/errors/viewPluginAlreadyExists.builder.ts"],"sourcesContent":["import { buildErrorSchema } from '@sprucelabs/schema'\n\nexport default buildErrorSchema({\n\tid: 'viewPluginAlreadyExists',\n\tname: 'View plugin already exists',\n\tfields: {\n\t\tname: {\n\t\t\ttype: 'text',\n\t\t\tisRequired: true,\n\t\t},\n\t},\n})\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAqD,IAAAC,QAAA,GAAAC,OAAA,cAEtC,IAAAC,wBAAgB,EAAC;EAC/BC,EAAE,EAAE,yBAAyB;EAC7BC,IAAI,EAAE,4BAA4B;EAClCC,MAAM,EAAE;IACPD,IAAI,EAAE;MACLE,IAAI,EAAE,MAAM;MACZC,UAAU,EAAE;IACb;EACD;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { SchemaValues } from '@sprucelabs/schema';
|
|
2
2
|
import AbstractAction from '../../AbstractAction';
|
|
3
3
|
import { FeatureActionResponse } from '../../features.types';
|
|
4
|
+
export default class CreateAction extends AbstractAction<OptionsSchema> {
|
|
5
|
+
optionsSchema: OptionsSchema;
|
|
6
|
+
commandAliases: string[];
|
|
7
|
+
invocationMessage: string;
|
|
8
|
+
execute(options: SchemaValues<OptionsSchema>): Promise<FeatureActionResponse>;
|
|
9
|
+
}
|
|
4
10
|
declare const optionsSchema: {
|
|
5
11
|
id: string;
|
|
6
12
|
description: string;
|
|
@@ -46,10 +52,4 @@ declare const optionsSchema: {
|
|
|
46
52
|
};
|
|
47
53
|
};
|
|
48
54
|
type OptionsSchema = typeof optionsSchema;
|
|
49
|
-
export default class CreateAction extends AbstractAction<OptionsSchema> {
|
|
50
|
-
optionsSchema: OptionsSchema;
|
|
51
|
-
commandAliases: string[];
|
|
52
|
-
invocationMessage: string;
|
|
53
|
-
execute(options: SchemaValues<OptionsSchema>): Promise<FeatureActionResponse>;
|
|
54
|
-
}
|
|
55
55
|
export {};
|