@sprucelabs/spruce-cli 17.0.16 → 17.1.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/build/__tests__/behavioral/polish/SettingUpPolish.test.d.ts +10 -0
  3. package/build/__tests__/behavioral/polish/SettingUpPolish.test.js +305 -0
  4. package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -0
  5. package/build/features/FeatureInstaller.d.ts +1 -1
  6. package/build/features/FeatureInstallerFactory.js +4 -2
  7. package/build/features/FeatureInstallerFactory.js.map +1 -1
  8. package/build/features/person/PersonFeature.d.ts +5 -5
  9. package/build/features/person/PersonFeature.js.map +1 -1
  10. package/build/features/polish/PolishFeature.d.ts +19 -0
  11. package/build/features/polish/PolishFeature.js +69 -0
  12. package/build/features/polish/PolishFeature.js.map +1 -0
  13. package/build/features/polish/actions/SetupAction.d.ts +13 -0
  14. package/build/features/polish/actions/SetupAction.js +115 -0
  15. package/build/features/polish/actions/SetupAction.js.map +1 -0
  16. package/build/features/polish/writers/PolishWriter.d.ts +4 -0
  17. package/build/features/polish/writers/PolishWriter.js +84 -0
  18. package/build/features/polish/writers/PolishWriter.js.map +1 -0
  19. package/build/widgets/terminalKit/TkBaseWidget.js +2 -2
  20. package/build/writers/WriterFactory.d.ts +2 -0
  21. package/build/writers/WriterFactory.js +4 -1
  22. package/build/writers/WriterFactory.js.map +1 -1
  23. package/package.json +39 -24
  24. package/src/__tests__/behavioral/polish/SettingUpPolish.test.ts +71 -0
  25. package/src/features/FeatureInstallerFactory.ts +3 -0
  26. package/src/features/person/PersonFeature.ts +6 -6
  27. package/src/features/polish/PolishFeature.ts +33 -0
  28. package/src/features/polish/actions/SetupAction.ts +36 -0
  29. package/src/features/polish/writers/PolishWriter.ts +23 -0
  30. package/src/writers/WriterFactory.ts +3 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [17.1.1](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v17.1.0...v17.1.1) (2022-07-02)
7
+
8
+ **Note:** Version bump only for package @sprucelabs/spruce-cli
9
+
10
+
11
+
12
+
13
+
14
+ # [17.1.0](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v17.0.17...v17.1.0) (2022-06-30)
15
+
16
+
17
+ ### Features
18
+
19
+ * polish support ([a21645f](https://github.com/sprucelabsai/spruce-cli-workspace/commit/a21645f))
20
+
21
+
22
+
23
+
24
+
25
+ ## [17.0.17](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v17.0.16...v17.0.17) (2022-06-18)
26
+
27
+ **Note:** Version bump only for package @sprucelabs/spruce-cli
28
+
29
+
30
+
31
+
32
+
6
33
  ## [17.0.16](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v17.0.15...v17.0.16) (2022-06-18)
7
34
 
8
35
  **Note:** Version bump only for package @sprucelabs/spruce-cli
@@ -0,0 +1,10 @@
1
+ import AbstractCliTest from '../../../tests/AbstractCliTest';
2
+ export default class SettingUpPolishTest extends AbstractCliTest {
3
+ protected static hasCreateAction(): Promise<void>;
4
+ protected static setsUpExpectedScript(): Promise<void>;
5
+ protected static polishResultsAreExpected(): Promise<void>;
6
+ protected static createsExpectedScript(): Promise<void>;
7
+ protected static makeSureScriptHasSomethingAndIsValid(): Promise<void>;
8
+ private static generateExpectedFile;
9
+ private static setupPolish;
10
+ }
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
14
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
+
16
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
+
22
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
+
24
+ var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime/helpers/applyDecoratedDescriptor"));
25
+
26
+ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
27
+
28
+ var _test = require("@sprucelabs/test");
29
+
30
+ var _AbstractCliTest2 = _interopRequireDefault(require("../../../tests/AbstractCliTest"));
31
+
32
+ var _dec, _dec2, _dec3, _dec4, _dec5, _class;
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
35
+
36
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
+
38
+ var SettingUpPolishTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), _dec3 = (0, _test.test)(), _dec4 = (0, _test.test)(), _dec5 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractCliTest) {
39
+ (0, _inherits2["default"])(SettingUpPolishTest, _AbstractCliTest);
40
+
41
+ var _super = _createSuper(SettingUpPolishTest);
42
+
43
+ function SettingUpPolishTest() {
44
+ (0, _classCallCheck2["default"])(this, SettingUpPolishTest);
45
+ return _super.apply(this, arguments);
46
+ }
47
+
48
+ (0, _createClass2["default"])(SettingUpPolishTest, null, [{
49
+ key: "hasCreateAction",
50
+ value: function () {
51
+ var _hasCreateAction = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
52
+ return _regenerator["default"].wrap(function _callee$(_context) {
53
+ while (1) {
54
+ switch (_context.prev = _context.next) {
55
+ case 0:
56
+ _test.assert.isFunction(this.Action('polish', 'setup').execute);
57
+
58
+ case 1:
59
+ case "end":
60
+ return _context.stop();
61
+ }
62
+ }
63
+ }, _callee, this);
64
+ }));
65
+
66
+ function hasCreateAction() {
67
+ return _hasCreateAction.apply(this, arguments);
68
+ }
69
+
70
+ return hasCreateAction;
71
+ }()
72
+ }, {
73
+ key: "setsUpExpectedScript",
74
+ value: function () {
75
+ var _setsUpExpectedScript = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
76
+ var _yield$this$generateE, destination;
77
+
78
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
79
+ while (1) {
80
+ switch (_context2.prev = _context2.next) {
81
+ case 0:
82
+ _context2.next = 2;
83
+ return this.setupPolish();
84
+
85
+ case 2:
86
+ _context2.next = 4;
87
+ return this.generateExpectedFile();
88
+
89
+ case 4:
90
+ _yield$this$generateE = _context2.sent;
91
+ destination = _yield$this$generateE.destination;
92
+
93
+ _test.assert.isTrue(_spruceSkillUtils.diskUtil.doesFileExist(destination), "Did not find polish script at ".concat(destination, "!"));
94
+
95
+ case 7:
96
+ case "end":
97
+ return _context2.stop();
98
+ }
99
+ }
100
+ }, _callee2, this);
101
+ }));
102
+
103
+ function setsUpExpectedScript() {
104
+ return _setsUpExpectedScript.apply(this, arguments);
105
+ }
106
+
107
+ return setsUpExpectedScript;
108
+ }()
109
+ }, {
110
+ key: "polishResultsAreExpected",
111
+ value: function () {
112
+ var _polishResultsAreExpected = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
113
+ var results, _yield$this$generateE2, filename, destination;
114
+
115
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
116
+ while (1) {
117
+ switch (_context3.prev = _context3.next) {
118
+ case 0:
119
+ _context3.next = 2;
120
+ return this.setupPolish();
121
+
122
+ case 2:
123
+ results = _context3.sent;
124
+ _context3.next = 5;
125
+ return this.generateExpectedFile();
126
+
127
+ case 5:
128
+ _yield$this$generateE2 = _context3.sent;
129
+ filename = _yield$this$generateE2.filename;
130
+ destination = _yield$this$generateE2.destination;
131
+
132
+ _test.assert.isLength(results.files, 1);
133
+
134
+ _test.assert.isEqualDeep(results, {
135
+ files: [{
136
+ name: filename,
137
+ description: "Polish script at ".concat(filename, "!"),
138
+ path: destination,
139
+ action: 'generated'
140
+ }]
141
+ });
142
+
143
+ case 10:
144
+ case "end":
145
+ return _context3.stop();
146
+ }
147
+ }
148
+ }, _callee3, this);
149
+ }));
150
+
151
+ function polishResultsAreExpected() {
152
+ return _polishResultsAreExpected.apply(this, arguments);
153
+ }
154
+
155
+ return polishResultsAreExpected;
156
+ }()
157
+ }, {
158
+ key: "createsExpectedScript",
159
+ value: function () {
160
+ var _createsExpectedScript = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
161
+ var pkg, scripts;
162
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
163
+ while (1) {
164
+ switch (_context4.prev = _context4.next) {
165
+ case 0:
166
+ _context4.next = 2;
167
+ return this.setupPolish();
168
+
169
+ case 2:
170
+ pkg = this.Service('pkg');
171
+ scripts = pkg.get('scripts');
172
+
173
+ _test.assert.isEqual(scripts.polish, 'heartwood-polish');
174
+
175
+ case 5:
176
+ case "end":
177
+ return _context4.stop();
178
+ }
179
+ }
180
+ }, _callee4, this);
181
+ }));
182
+
183
+ function createsExpectedScript() {
184
+ return _createsExpectedScript.apply(this, arguments);
185
+ }
186
+
187
+ return createsExpectedScript;
188
+ }()
189
+ }, {
190
+ key: "makeSureScriptHasSomethingAndIsValid",
191
+ value: function () {
192
+ var _makeSureScriptHasSomethingAndIsValid = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
193
+ var results, _yield$this$generateE3, destination, contents;
194
+
195
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
196
+ while (1) {
197
+ switch (_context5.prev = _context5.next) {
198
+ case 0:
199
+ _context5.next = 2;
200
+ return this.setupPolish();
201
+
202
+ case 2:
203
+ results = _context5.sent;
204
+ _context5.next = 5;
205
+ return this.generateExpectedFile();
206
+
207
+ case 5:
208
+ _yield$this$generateE3 = _context5.sent;
209
+ destination = _yield$this$generateE3.destination;
210
+ contents = _spruceSkillUtils.diskUtil.readFile(destination);
211
+
212
+ _test.assert.isNotEqual(contents, '');
213
+
214
+ _context5.next = 11;
215
+ return this.assertValidActionResponseFiles(results);
216
+
217
+ case 11:
218
+ case "end":
219
+ return _context5.stop();
220
+ }
221
+ }
222
+ }, _callee5, this);
223
+ }));
224
+
225
+ function makeSureScriptHasSomethingAndIsValid() {
226
+ return _makeSureScriptHasSomethingAndIsValid.apply(this, arguments);
227
+ }
228
+
229
+ return makeSureScriptHasSomethingAndIsValid;
230
+ }()
231
+ }, {
232
+ key: "generateExpectedFile",
233
+ value: function () {
234
+ var _generateExpectedFile = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
235
+ var store, namespace, filename, destination;
236
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
237
+ while (1) {
238
+ switch (_context6.prev = _context6.next) {
239
+ case 0:
240
+ store = this.Store('skill');
241
+ _context6.next = 3;
242
+ return store.loadCurrentSkillsNamespace();
243
+
244
+ case 3:
245
+ namespace = _context6.sent;
246
+ filename = "".concat(namespace.toLowerCase(), ".polish.ts");
247
+ destination = this.resolvePath('src', filename);
248
+ return _context6.abrupt("return", {
249
+ filename: filename,
250
+ destination: destination
251
+ });
252
+
253
+ case 7:
254
+ case "end":
255
+ return _context6.stop();
256
+ }
257
+ }
258
+ }, _callee6, this);
259
+ }));
260
+
261
+ function generateExpectedFile() {
262
+ return _generateExpectedFile.apply(this, arguments);
263
+ }
264
+
265
+ return generateExpectedFile;
266
+ }()
267
+ }, {
268
+ key: "setupPolish",
269
+ value: function () {
270
+ var _setupPolish = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {
271
+ var results;
272
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
273
+ while (1) {
274
+ switch (_context7.prev = _context7.next) {
275
+ case 0:
276
+ _context7.next = 2;
277
+ return this.FeatureFixture().installCachedFeatures('polish');
278
+
279
+ case 2:
280
+ _context7.next = 4;
281
+ return this.Action('polish', 'setup').execute({});
282
+
283
+ case 4:
284
+ results = _context7.sent;
285
+ return _context7.abrupt("return", results);
286
+
287
+ case 6:
288
+ case "end":
289
+ return _context7.stop();
290
+ }
291
+ }
292
+ }, _callee7, this);
293
+ }));
294
+
295
+ function setupPolish() {
296
+ return _setupPolish.apply(this, arguments);
297
+ }
298
+
299
+ return setupPolish;
300
+ }()
301
+ }]);
302
+ return SettingUpPolishTest;
303
+ }(_AbstractCliTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "hasCreateAction", [_dec], Object.getOwnPropertyDescriptor(_class, "hasCreateAction"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "setsUpExpectedScript", [_dec2], Object.getOwnPropertyDescriptor(_class, "setsUpExpectedScript"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "polishResultsAreExpected", [_dec3], Object.getOwnPropertyDescriptor(_class, "polishResultsAreExpected"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "createsExpectedScript", [_dec4], Object.getOwnPropertyDescriptor(_class, "createsExpectedScript"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "makeSureScriptHasSomethingAndIsValid", [_dec5], Object.getOwnPropertyDescriptor(_class, "makeSureScriptHasSomethingAndIsValid"), _class)), _class));
304
+ exports["default"] = SettingUpPolishTest;
305
+ //# sourceMappingURL=SettingUpPolish.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingUpPolish.test.js","names":["SettingUpPolishTest","test","assert","isFunction","Action","execute","setupPolish","generateExpectedFile","destination","isTrue","diskUtil","doesFileExist","results","filename","isLength","files","isEqualDeep","name","description","path","action","pkg","Service","scripts","get","isEqual","polish","contents","readFile","isNotEqual","assertValidActionResponseFiles","store","Store","loadCurrentSkillsNamespace","namespace","toLowerCase","resolvePath","FeatureFixture","installCachedFeatures","AbstractCliTest"],"sources":["../../../../src/__tests__/behavioral/polish/SettingUpPolish.test.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport AbstractCliTest from '../../../tests/AbstractCliTest'\n\nexport default class SettingUpPolishTest extends AbstractCliTest {\n\t@test()\n\tprotected static async hasCreateAction() {\n\t\tassert.isFunction(this.Action('polish', 'setup').execute)\n\t}\n\n\t@test()\n\tprotected static async setsUpExpectedScript() {\n\t\tawait this.setupPolish()\n\n\t\tconst { destination } = await this.generateExpectedFile()\n\n\t\tassert.isTrue(\n\t\t\tdiskUtil.doesFileExist(destination),\n\t\t\t`Did not find polish script at ${destination}!`\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async polishResultsAreExpected() {\n\t\tconst results = await this.setupPolish()\n\t\tconst { filename, destination } = await this.generateExpectedFile()\n\n\t\tassert.isLength(results.files, 1)\n\t\tassert.isEqualDeep(results, {\n\t\t\tfiles: [\n\t\t\t\t{\n\t\t\t\t\tname: filename,\n\t\t\t\t\tdescription: `Polish script at ${filename}!`,\n\t\t\t\t\tpath: destination,\n\t\t\t\t\taction: 'generated',\n\t\t\t\t},\n\t\t\t],\n\t\t})\n\t}\n\n\t@test()\n\tprotected static async createsExpectedScript() {\n\t\tawait this.setupPolish()\n\t\tconst pkg = this.Service('pkg')\n\t\tconst scripts = pkg.get('scripts')\n\t\tassert.isEqual(scripts.polish, 'heartwood-polish')\n\t}\n\n\t@test()\n\tprotected static async makeSureScriptHasSomethingAndIsValid() {\n\t\tconst results = await this.setupPolish()\n\t\tconst { destination } = await this.generateExpectedFile()\n\t\tconst contents = diskUtil.readFile(destination)\n\t\tassert.isNotEqual(contents, '')\n\t\tawait this.assertValidActionResponseFiles(results)\n\t}\n\n\tprivate static async generateExpectedFile() {\n\t\tconst store = this.Store('skill')\n\t\tconst namespace = await store.loadCurrentSkillsNamespace()\n\t\tconst filename = `${namespace.toLowerCase()}.polish.ts`\n\t\tconst destination = this.resolvePath('src', filename)\n\t\treturn { filename, destination }\n\t}\n\n\tprivate static async setupPolish() {\n\t\tawait this.FeatureFixture().installCachedFeatures('polish')\n\t\tconst results = await this.Action('polish', 'setup').execute({})\n\t\treturn results\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;;;IAEqBA,mB,WACnB,IAAAC,UAAA,G,UAKA,IAAAA,UAAA,G,UAYA,IAAAA,UAAA,G,UAkBA,IAAAA,UAAA,G,UAQA,IAAAA,UAAA,G;;;;;;;;;;;;;2GA3CD;QAAA;UAAA;YAAA;cAAA;gBAECC,YAAA,CAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,QAAZ,EAAsB,OAAtB,EAA+BC,OAAjD;;cAFD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;gHAKA;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEO,KAAKC,WAAL,EAFP;;cAAA;gBAAA;gBAAA,OAI+B,KAAKC,oBAAL,EAJ/B;;cAAA;gBAAA;gBAISC,WAJT,yBAISA,WAJT;;gBAMCN,YAAA,CAAOO,MAAP,CACCC,0BAAA,CAASC,aAAT,CAAuBH,WAAvB,CADD,0CAEkCA,WAFlC;;cAND;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;oHAYA;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEuB,KAAKF,WAAL,EAFvB;;cAAA;gBAEOM,OAFP;gBAAA;gBAAA,OAGyC,KAAKL,oBAAL,EAHzC;;cAAA;gBAAA;gBAGSM,QAHT,0BAGSA,QAHT;gBAGmBL,WAHnB,0BAGmBA,WAHnB;;gBAKCN,YAAA,CAAOY,QAAP,CAAgBF,OAAO,CAACG,KAAxB,EAA+B,CAA/B;;gBACAb,YAAA,CAAOc,WAAP,CAAmBJ,OAAnB,EAA4B;kBAC3BG,KAAK,EAAE,CACN;oBACCE,IAAI,EAAEJ,QADP;oBAECK,WAAW,6BAAsBL,QAAtB,MAFZ;oBAGCM,IAAI,EAAEX,WAHP;oBAICY,MAAM,EAAE;kBAJT,CADM;gBADoB,CAA5B;;cAND;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;iHAkBA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEO,KAAKd,WAAL,EAFP;;cAAA;gBAGOe,GAHP,GAGa,KAAKC,OAAL,CAAa,KAAb,CAHb;gBAIOC,OAJP,GAIiBF,GAAG,CAACG,GAAJ,CAAQ,SAAR,CAJjB;;gBAKCtB,YAAA,CAAOuB,OAAP,CAAeF,OAAO,CAACG,MAAvB,EAA+B,kBAA/B;;cALD;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;gIAQA;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OAEuB,KAAKpB,WAAL,EAFvB;;cAAA;gBAEOM,OAFP;gBAAA;gBAAA,OAG+B,KAAKL,oBAAL,EAH/B;;cAAA;gBAAA;gBAGSC,WAHT,0BAGSA,WAHT;gBAIOmB,QAJP,GAIkBjB,0BAAA,CAASkB,QAAT,CAAkBpB,WAAlB,CAJlB;;gBAKCN,YAAA,CAAO2B,UAAP,CAAkBF,QAAlB,EAA4B,EAA5B;;gBALD;gBAAA,OAMO,KAAKG,8BAAL,CAAoClB,OAApC,CANP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;gHASA;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOmB,KADP,GACe,KAAKC,KAAL,CAAW,OAAX,CADf;gBAAA;gBAAA,OAEyBD,KAAK,CAACE,0BAAN,EAFzB;;cAAA;gBAEOC,SAFP;gBAGOrB,QAHP,aAGqBqB,SAAS,CAACC,WAAV,EAHrB;gBAIO3B,WAJP,GAIqB,KAAK4B,WAAL,CAAiB,KAAjB,EAAwBvB,QAAxB,CAJrB;gBAAA,kCAKQ;kBAAEA,QAAQ,EAARA,QAAF;kBAAYL,WAAW,EAAXA;gBAAZ,CALR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;uGAQA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACO,KAAK6B,cAAL,GAAsBC,qBAAtB,CAA4C,QAA5C,CADP;;cAAA;gBAAA;gBAAA,OAEuB,KAAKlC,MAAL,CAAY,QAAZ,EAAsB,OAAtB,EAA+BC,OAA/B,CAAuC,EAAvC,CAFvB;;cAAA;gBAEOO,OAFP;gBAAA,kCAGQA,OAHR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EA7DgD2B,4B"}
@@ -37,5 +37,5 @@ export default class FeatureInstaller implements ServiceProvider {
37
37
  Service<S extends Service>(type: S, cwd?: string): ServiceMap[S];
38
38
  getOptionsForFeature(code: FeatureCode): import("@sprucelabs/schema").Schema | import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.SkillFeatureSchema | import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema | undefined;
39
39
  getAllCodes(): FeatureCode[];
40
- getInstalledFeatures(): Promise<(import("./schema/SchemaFeature").default | import("./test/TestFeature").default | import("./skill/SkillFeature").default<import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.SkillFeatureSchema> | import("./error/ErrorFeature").default | import("./node/NodeFeature").default<import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema> | import("./dependencies/DependencyFeature").default | import("./cache/CacheFeature").default | import("./conversation/ConversationFeature").default | import("./deploy/DeployFeature").default | import("./event/EventFeature").default | import("./eventContract/EventContractFeature").default | import("./log/LogFeature").default | import("./onboard/OnboardFeature").default | import("./organization/OrganizationFeature").default | import("./person/PersonFeature").default | import("./sandbox/SandboxFeature").default | import("./store/StoreFeature").default | import("./view/ViewFeature").default | import("./vscode/VsCodeFeature").default | import("./watch/WatchFeature").default)[]>;
40
+ getInstalledFeatures(): Promise<(import("./schema/SchemaFeature").default | import("./test/TestFeature").default | import("./skill/SkillFeature").default<import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.SkillFeatureSchema> | import("./error/ErrorFeature").default | import("./node/NodeFeature").default<import("@sprucelabs/mercury-types").SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema> | import("./dependencies/DependencyFeature").default | import("./cache/CacheFeature").default | import("./conversation/ConversationFeature").default | import("./deploy/DeployFeature").default | import("./event/EventFeature").default | import("./eventContract/EventContractFeature").default | import("./log/LogFeature").default | import("./onboard/OnboardFeature").default | import("./organization/OrganizationFeature").default | import("./person/PersonFeature").default | import("./polish/PolishFeature").default | import("./sandbox/SandboxFeature").default | import("./store/StoreFeature").default | import("./view/ViewFeature").default | import("./vscode/VsCodeFeature").default | import("./watch/WatchFeature").default)[]>;
41
41
  }
@@ -41,6 +41,8 @@ var _OrganizationFeature = _interopRequireDefault(require("./organization/Organi
41
41
 
42
42
  var _PersonFeature = _interopRequireDefault(require("./person/PersonFeature"));
43
43
 
44
+ var _PolishFeature = _interopRequireDefault(require("./polish/PolishFeature"));
45
+
44
46
  var _SandboxFeature = _interopRequireDefault(require("./sandbox/SandboxFeature"));
45
47
 
46
48
  var _SchemaFeature = _interopRequireDefault(require("./schema/SchemaFeature"));
@@ -96,6 +98,6 @@ var FeatureInstallerFactory = /*#__PURE__*/function () {
96
98
  }();
97
99
 
98
100
  exports["default"] = FeatureInstallerFactory;
99
- (0, _defineProperty2["default"])(FeatureInstallerFactory, "features", [_ErrorFeature["default"], _SchemaFeature["default"], _SkillFeature["default"], _TestFeature["default"], _VsCodeFeature["default"], _EventFeature["default"], _WatchFeature["default"], _NodeFeature["default"], _OnboardFeature["default"], _PersonFeature["default"], _OrganizationFeature["default"], _ConversationFeature["default"], _EventContractFeature["default"], _DeployFeature["default"], _SandboxFeature["default"], _StoreFeature["default"], _ViewFeature["default"], _CacheFeature["default"], _LogFeature["default"], _DependencyFeature["default"]]);
100
- (0, _defineProperty2["default"])(FeatureInstallerFactory, "featureCodes", ['error', 'schema', 'skill', 'test', 'vscode', 'event', 'watch', 'node', 'onboard', 'person', 'organization', 'conversation', 'eventContract', 'deploy', 'sandbox', 'store', 'view', 'cache', 'log', 'dependency']);
101
+ (0, _defineProperty2["default"])(FeatureInstallerFactory, "features", [_ErrorFeature["default"], _SchemaFeature["default"], _SkillFeature["default"], _TestFeature["default"], _VsCodeFeature["default"], _EventFeature["default"], _WatchFeature["default"], _NodeFeature["default"], _OnboardFeature["default"], _PersonFeature["default"], _OrganizationFeature["default"], _ConversationFeature["default"], _EventContractFeature["default"], _DeployFeature["default"], _SandboxFeature["default"], _StoreFeature["default"], _ViewFeature["default"], _CacheFeature["default"], _LogFeature["default"], _DependencyFeature["default"], _PolishFeature["default"]]);
102
+ (0, _defineProperty2["default"])(FeatureInstallerFactory, "featureCodes", ['error', 'schema', 'skill', 'test', 'vscode', 'event', 'watch', 'node', 'onboard', 'person', 'organization', 'conversation', 'eventContract', 'deploy', 'sandbox', 'store', 'view', 'cache', 'log', 'dependency', 'polish']);
101
103
  //# sourceMappingURL=FeatureInstallerFactory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FeatureInstallerFactory.js","names":["FeatureInstallerFactory","options","cwd","serviceFactory","storeFactory","ui","emitter","actionExecuter","featureInstaller","FeatureInstaller","featureOptions","templates","apiClientFactory","features","forEach","Feature","feature","mapFeature","code","ErrorFeature","SchemaFeature","SkillFeature","TestFeature","VsCodeFeature","EventFeature","WatchFeature","NodeFeature","OnboardFeature","PersonFeature","OrganizationFeature","ConversationFeature","EventContractFeature","DeployFeature","SandboxFeature","StoreFeature","ViewFeature","CacheFeature","LogFeature","DependencyFeature"],"sources":["../../src/features/FeatureInstallerFactory.ts"],"sourcesContent":["import { templates } from '@sprucelabs/spruce-templates'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { FeatureOptions } from './AbstractFeature'\nimport ActionExecuter from './ActionExecuter'\nimport CacheFeature from './cache/CacheFeature'\nimport ConversationFeature from './conversation/ConversationFeature'\nimport DependencyFeature from './dependencies/DependencyFeature'\nimport DeployFeature from './deploy/DeployFeature'\nimport ErrorFeature from './error/ErrorFeature'\nimport EventFeature from './event/EventFeature'\nimport EventContractFeature from './eventContract/EventContractFeature'\nimport FeatureInstaller from './FeatureInstaller'\nimport { FeatureCode } from './features.types'\nimport LogFeature from './log/LogFeature'\nimport NodeFeature from './node/NodeFeature'\nimport OnboardFeature from './onboard/OnboardFeature'\nimport OrganizationFeature from './organization/OrganizationFeature'\nimport PersonFeature from './person/PersonFeature'\nimport SandboxFeature from './sandbox/SandboxFeature'\nimport SchemaFeature from './schema/SchemaFeature'\nimport SkillFeature from './skill/SkillFeature'\nimport StoreFeature from './store/StoreFeature'\nimport TestFeature from './test/TestFeature'\nimport ViewFeature from './view/ViewFeature'\nimport VsCodeFeature from './vscode/VsCodeFeature'\nimport WatchFeature from './watch/WatchFeature'\nexport default class FeatureInstallerFactory {\n\tprivate static readonly features: any[] = [\n\t\tErrorFeature,\n\t\tSchemaFeature,\n\t\tSkillFeature,\n\t\tTestFeature,\n\t\tVsCodeFeature,\n\t\tEventFeature,\n\t\tWatchFeature,\n\t\tNodeFeature,\n\t\tOnboardFeature,\n\t\tPersonFeature,\n\t\tOrganizationFeature,\n\t\tConversationFeature,\n\t\tEventContractFeature,\n\t\tDeployFeature,\n\t\tSandboxFeature,\n\t\tStoreFeature,\n\t\tViewFeature,\n\t\tCacheFeature,\n\t\tLogFeature,\n\t\tDependencyFeature,\n\t]\n\n\tpublic static readonly featureCodes: FeatureCode[] = [\n\t\t'error',\n\t\t'schema',\n\t\t'skill',\n\t\t'test',\n\t\t'vscode',\n\t\t'event',\n\t\t'watch',\n\t\t'node',\n\t\t'onboard',\n\t\t'person',\n\t\t'organization',\n\t\t'conversation',\n\t\t'eventContract',\n\t\t'deploy',\n\t\t'sandbox',\n\t\t'store',\n\t\t'view',\n\t\t'cache',\n\t\t'log',\n\t\t'dependency',\n\t]\n\n\tpublic static WithAllFeatures(options: {\n\t\tcwd: string\n\t\tserviceFactory: ServiceFactory\n\t\tstoreFactory: StoreFactory\n\t\tfeatureInstaller?: FeatureInstaller\n\t\tui: GraphicsInterface\n\t\temitter: GlobalEmitter\n\t\tapiClientFactory: ApiClientFactory\n\t\tactionExecuter: ActionExecuter\n\t}): FeatureInstaller {\n\t\tconst { cwd, serviceFactory, storeFactory, ui, emitter, actionExecuter } =\n\t\t\toptions\n\n\t\tconst featureInstaller =\n\t\t\toptions.featureInstaller ?? new FeatureInstaller(cwd, serviceFactory)\n\n\t\tconst featureOptions: FeatureOptions = {\n\t\t\tcwd,\n\t\t\tserviceFactory,\n\t\t\ttemplates,\n\t\t\tstoreFactory,\n\t\t\tfeatureInstaller,\n\t\t\tui,\n\t\t\temitter,\n\t\t\tactionExecuter,\n\t\t\tapiClientFactory: options.apiClientFactory,\n\t\t}\n\n\t\tthis.features.forEach((Feature) => {\n\t\t\tconst feature = new Feature(featureOptions)\n\n\t\t\tfeatureInstaller.mapFeature(feature.code, feature)\n\t\t})\n\n\t\treturn featureInstaller\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;IACqBA,uB;;;;;;;WA+CpB,yBAA8BC,OAA9B,EASqB;MAAA;;MACpB,IAAQC,GAAR,GACCD,OADD,CAAQC,GAAR;MAAA,IAAaC,cAAb,GACCF,OADD,CAAaE,cAAb;MAAA,IAA6BC,YAA7B,GACCH,OADD,CAA6BG,YAA7B;MAAA,IAA2CC,EAA3C,GACCJ,OADD,CAA2CI,EAA3C;MAAA,IAA+CC,OAA/C,GACCL,OADD,CAA+CK,OAA/C;MAAA,IAAwDC,cAAxD,GACCN,OADD,CAAwDM,cAAxD;MAGA,IAAMC,gBAAgB,4BACrBP,OAAO,CAACO,gBADa,yEACO,IAAIC,4BAAJ,CAAqBP,GAArB,EAA0BC,cAA1B,CAD7B;MAGA,IAAMO,cAA8B,GAAG;QACtCR,GAAG,EAAHA,GADsC;QAEtCC,cAAc,EAAdA,cAFsC;QAGtCQ,SAAS,EAATA,0BAHsC;QAItCP,YAAY,EAAZA,YAJsC;QAKtCI,gBAAgB,EAAhBA,gBALsC;QAMtCH,EAAE,EAAFA,EANsC;QAOtCC,OAAO,EAAPA,OAPsC;QAQtCC,cAAc,EAAdA,cARsC;QAStCK,gBAAgB,EAAEX,OAAO,CAACW;MATY,CAAvC;MAYA,KAAKC,QAAL,CAAcC,OAAd,CAAsB,UAACC,OAAD,EAAa;QAClC,IAAMC,OAAO,GAAG,IAAID,OAAJ,CAAYL,cAAZ,CAAhB;QAEAF,gBAAgB,CAACS,UAAjB,CAA4BD,OAAO,CAACE,IAApC,EAA0CF,OAA1C;MACA,CAJD;MAMA,OAAOR,gBAAP;IACA;;;;;;iCAlFmBR,uB,cACsB,CACzCmB,wBADyC,EAEzCC,yBAFyC,EAGzCC,wBAHyC,EAIzCC,uBAJyC,EAKzCC,yBALyC,EAMzCC,wBANyC,EAOzCC,wBAPyC,EAQzCC,uBARyC,EASzCC,0BATyC,EAUzCC,yBAVyC,EAWzCC,+BAXyC,EAYzCC,+BAZyC,EAazCC,gCAbyC,EAczCC,yBAdyC,EAezCC,0BAfyC,EAgBzCC,wBAhByC,EAiBzCC,uBAjByC,EAkBzCC,wBAlByC,EAmBzCC,sBAnByC,EAoBzCC,6BApByC,C;iCADtBtC,uB,kBAwBiC,CACpD,OADoD,EAEpD,QAFoD,EAGpD,OAHoD,EAIpD,MAJoD,EAKpD,QALoD,EAMpD,OANoD,EAOpD,OAPoD,EAQpD,MARoD,EASpD,SAToD,EAUpD,QAVoD,EAWpD,cAXoD,EAYpD,cAZoD,EAapD,eAboD,EAcpD,QAdoD,EAepD,SAfoD,EAgBpD,OAhBoD,EAiBpD,MAjBoD,EAkBpD,OAlBoD,EAmBpD,KAnBoD,EAoBpD,YApBoD,C"}
1
+ {"version":3,"file":"FeatureInstallerFactory.js","names":["FeatureInstallerFactory","options","cwd","serviceFactory","storeFactory","ui","emitter","actionExecuter","featureInstaller","FeatureInstaller","featureOptions","templates","apiClientFactory","features","forEach","Feature","feature","mapFeature","code","ErrorFeature","SchemaFeature","SkillFeature","TestFeature","VsCodeFeature","EventFeature","WatchFeature","NodeFeature","OnboardFeature","PersonFeature","OrganizationFeature","ConversationFeature","EventContractFeature","DeployFeature","SandboxFeature","StoreFeature","ViewFeature","CacheFeature","LogFeature","DependencyFeature","PolishFeature"],"sources":["../../src/features/FeatureInstallerFactory.ts"],"sourcesContent":["import { templates } from '@sprucelabs/spruce-templates'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { FeatureOptions } from './AbstractFeature'\nimport ActionExecuter from './ActionExecuter'\nimport CacheFeature from './cache/CacheFeature'\nimport ConversationFeature from './conversation/ConversationFeature'\nimport DependencyFeature from './dependencies/DependencyFeature'\nimport DeployFeature from './deploy/DeployFeature'\nimport ErrorFeature from './error/ErrorFeature'\nimport EventFeature from './event/EventFeature'\nimport EventContractFeature from './eventContract/EventContractFeature'\nimport FeatureInstaller from './FeatureInstaller'\nimport { FeatureCode } from './features.types'\nimport LogFeature from './log/LogFeature'\nimport NodeFeature from './node/NodeFeature'\nimport OnboardFeature from './onboard/OnboardFeature'\nimport OrganizationFeature from './organization/OrganizationFeature'\nimport PersonFeature from './person/PersonFeature'\nimport PolishFeature from './polish/PolishFeature'\nimport SandboxFeature from './sandbox/SandboxFeature'\nimport SchemaFeature from './schema/SchemaFeature'\nimport SkillFeature from './skill/SkillFeature'\nimport StoreFeature from './store/StoreFeature'\nimport TestFeature from './test/TestFeature'\nimport ViewFeature from './view/ViewFeature'\nimport VsCodeFeature from './vscode/VsCodeFeature'\nimport WatchFeature from './watch/WatchFeature'\nexport default class FeatureInstallerFactory {\n\tprivate static readonly features: any[] = [\n\t\tErrorFeature,\n\t\tSchemaFeature,\n\t\tSkillFeature,\n\t\tTestFeature,\n\t\tVsCodeFeature,\n\t\tEventFeature,\n\t\tWatchFeature,\n\t\tNodeFeature,\n\t\tOnboardFeature,\n\t\tPersonFeature,\n\t\tOrganizationFeature,\n\t\tConversationFeature,\n\t\tEventContractFeature,\n\t\tDeployFeature,\n\t\tSandboxFeature,\n\t\tStoreFeature,\n\t\tViewFeature,\n\t\tCacheFeature,\n\t\tLogFeature,\n\t\tDependencyFeature,\n\t\tPolishFeature,\n\t]\n\n\tpublic static readonly featureCodes: FeatureCode[] = [\n\t\t'error',\n\t\t'schema',\n\t\t'skill',\n\t\t'test',\n\t\t'vscode',\n\t\t'event',\n\t\t'watch',\n\t\t'node',\n\t\t'onboard',\n\t\t'person',\n\t\t'organization',\n\t\t'conversation',\n\t\t'eventContract',\n\t\t'deploy',\n\t\t'sandbox',\n\t\t'store',\n\t\t'view',\n\t\t'cache',\n\t\t'log',\n\t\t'dependency',\n\t\t'polish',\n\t]\n\n\tpublic static WithAllFeatures(options: {\n\t\tcwd: string\n\t\tserviceFactory: ServiceFactory\n\t\tstoreFactory: StoreFactory\n\t\tfeatureInstaller?: FeatureInstaller\n\t\tui: GraphicsInterface\n\t\temitter: GlobalEmitter\n\t\tapiClientFactory: ApiClientFactory\n\t\tactionExecuter: ActionExecuter\n\t}): FeatureInstaller {\n\t\tconst { cwd, serviceFactory, storeFactory, ui, emitter, actionExecuter } =\n\t\t\toptions\n\n\t\tconst featureInstaller =\n\t\t\toptions.featureInstaller ?? new FeatureInstaller(cwd, serviceFactory)\n\n\t\tconst featureOptions: FeatureOptions = {\n\t\t\tcwd,\n\t\t\tserviceFactory,\n\t\t\ttemplates,\n\t\t\tstoreFactory,\n\t\t\tfeatureInstaller,\n\t\t\tui,\n\t\t\temitter,\n\t\t\tactionExecuter,\n\t\t\tapiClientFactory: options.apiClientFactory,\n\t\t}\n\n\t\tthis.features.forEach((Feature) => {\n\t\t\tconst feature = new Feature(featureOptions)\n\n\t\t\tfeatureInstaller.mapFeature(feature.code, feature)\n\t\t})\n\n\t\treturn featureInstaller\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;IACqBA,uB;;;;;;;WAiDpB,yBAA8BC,OAA9B,EASqB;MAAA;;MACpB,IAAQC,GAAR,GACCD,OADD,CAAQC,GAAR;MAAA,IAAaC,cAAb,GACCF,OADD,CAAaE,cAAb;MAAA,IAA6BC,YAA7B,GACCH,OADD,CAA6BG,YAA7B;MAAA,IAA2CC,EAA3C,GACCJ,OADD,CAA2CI,EAA3C;MAAA,IAA+CC,OAA/C,GACCL,OADD,CAA+CK,OAA/C;MAAA,IAAwDC,cAAxD,GACCN,OADD,CAAwDM,cAAxD;MAGA,IAAMC,gBAAgB,4BACrBP,OAAO,CAACO,gBADa,yEACO,IAAIC,4BAAJ,CAAqBP,GAArB,EAA0BC,cAA1B,CAD7B;MAGA,IAAMO,cAA8B,GAAG;QACtCR,GAAG,EAAHA,GADsC;QAEtCC,cAAc,EAAdA,cAFsC;QAGtCQ,SAAS,EAATA,0BAHsC;QAItCP,YAAY,EAAZA,YAJsC;QAKtCI,gBAAgB,EAAhBA,gBALsC;QAMtCH,EAAE,EAAFA,EANsC;QAOtCC,OAAO,EAAPA,OAPsC;QAQtCC,cAAc,EAAdA,cARsC;QAStCK,gBAAgB,EAAEX,OAAO,CAACW;MATY,CAAvC;MAYA,KAAKC,QAAL,CAAcC,OAAd,CAAsB,UAACC,OAAD,EAAa;QAClC,IAAMC,OAAO,GAAG,IAAID,OAAJ,CAAYL,cAAZ,CAAhB;QAEAF,gBAAgB,CAACS,UAAjB,CAA4BD,OAAO,CAACE,IAApC,EAA0CF,OAA1C;MACA,CAJD;MAMA,OAAOR,gBAAP;IACA;;;;;;iCApFmBR,uB,cACsB,CACzCmB,wBADyC,EAEzCC,yBAFyC,EAGzCC,wBAHyC,EAIzCC,uBAJyC,EAKzCC,yBALyC,EAMzCC,wBANyC,EAOzCC,wBAPyC,EAQzCC,uBARyC,EASzCC,0BATyC,EAUzCC,yBAVyC,EAWzCC,+BAXyC,EAYzCC,+BAZyC,EAazCC,gCAbyC,EAczCC,yBAdyC,EAezCC,0BAfyC,EAgBzCC,wBAhByC,EAiBzCC,uBAjByC,EAkBzCC,wBAlByC,EAmBzCC,sBAnByC,EAoBzCC,6BApByC,EAqBzCC,yBArByC,C;iCADtBvC,uB,kBAyBiC,CACpD,OADoD,EAEpD,QAFoD,EAGpD,OAHoD,EAIpD,MAJoD,EAKpD,QALoD,EAMpD,OANoD,EAOpD,OAPoD,EAQpD,MARoD,EASpD,SAToD,EAUpD,QAVoD,EAWpD,cAXoD,EAYpD,cAZoD,EAapD,eAboD,EAcpD,QAdoD,EAepD,SAfoD,EAgBpD,OAhBoD,EAiBpD,MAjBoD,EAkBpD,OAlBoD,EAmBpD,KAnBoD,EAoBpD,YApBoD,EAqBpD,QArBoD,C"}
@@ -1,10 +1,5 @@
1
1
  import AbstractFeature, { FeatureDependency } from '../AbstractFeature';
2
2
  import { FeatureCode } from '../features.types';
3
- declare module '../../features/features.types' {
4
- interface FeatureMap {
5
- person: PersonFeature;
6
- }
7
- }
8
3
  export default class PersonFeature extends AbstractFeature {
9
4
  code: FeatureCode;
10
5
  nameReadable: string;
@@ -14,3 +9,8 @@ export default class PersonFeature extends AbstractFeature {
14
9
  actionsDir: string;
15
10
  isInstalled: () => Promise<boolean>;
16
11
  }
12
+ declare module '../../features/features.types' {
13
+ interface FeatureMap {
14
+ person: PersonFeature;
15
+ }
16
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"PersonFeature.js","names":["PersonFeature","code","isRequired","diskUtil","resolvePath","__dirname","featureInstaller","isInstalled","AbstractFeature"],"sources":["../../../src/features/person/PersonFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tperson: PersonFeature\n\t}\n}\n\nexport default class PersonFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'person'\n\tpublic nameReadable = 'Person'\n\tpublic description = 'Log in, log out, etc.'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic isInstalled = () => {\n\t\treturn this.featureInstaller.isInstalled('skill')\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IASqBA,a;;;;;;;;;;;;;;;6FACO,Q;qGACL,Q;oGACD,uB;qGACsB,CAC1C;MACCC,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAD0C,C;4GAMd,E;mGAETC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;oGAEC,YAAM;MAC1B,OAAO,MAAKC,gBAAL,CAAsBC,WAAtB,CAAkC,OAAlC,CAAP;IACA,C;;;;;EAhByCC,4B"}
1
+ {"version":3,"file":"PersonFeature.js","names":["PersonFeature","code","isRequired","diskUtil","resolvePath","__dirname","featureInstaller","isInstalled","AbstractFeature"],"sources":["../../../src/features/person/PersonFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\nexport default class PersonFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'person'\n\tpublic nameReadable = 'Person'\n\tpublic description = 'Log in, log out, etc.'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic isInstalled = () => {\n\t\treturn this.featureInstaller.isInstalled('skill')\n\t}\n}\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tperson: PersonFeature\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IAGqBA,a;;;;;;;;;;;;;;;6FACO,Q;qGACL,Q;oGACD,uB;qGACsB,CAC1C;MACCC,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAD0C,C;4GAMd,E;mGAETC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;oGAEC,YAAM;MAC1B,OAAO,MAAKC,gBAAL,CAAsBC,WAAtB,CAAkC,OAAlC,CAAP;IACA,C;;;;;EAhByCC,4B"}
@@ -0,0 +1,19 @@
1
+ import { NpmPackage } from '@sprucelabs/spruce-skill-utils';
2
+ import AbstractFeature, { FeatureDependency } from '../AbstractFeature';
3
+ import { FeatureCode } from '../features.types';
4
+ export default class PolishFeature extends AbstractFeature {
5
+ code: FeatureCode;
6
+ nameReadable: string;
7
+ description: string;
8
+ dependencies: FeatureDependency[];
9
+ packageDependencies: NpmPackage[];
10
+ actionsDir: string;
11
+ scripts: {
12
+ polish: string;
13
+ };
14
+ }
15
+ declare module '../../features/features.types' {
16
+ interface FeatureMap {
17
+ polish: PolishFeature;
18
+ }
19
+ }
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
15
+
16
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
+
18
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
19
+
20
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
25
+
26
+ var _AbstractFeature2 = _interopRequireDefault(require("../AbstractFeature"));
27
+
28
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ var PolishFeature = /*#__PURE__*/function (_AbstractFeature) {
33
+ (0, _inherits2["default"])(PolishFeature, _AbstractFeature);
34
+
35
+ var _super = _createSuper(PolishFeature);
36
+
37
+ function PolishFeature() {
38
+ var _this;
39
+
40
+ (0, _classCallCheck2["default"])(this, PolishFeature);
41
+
42
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
+ args[_key] = arguments[_key];
44
+ }
45
+
46
+ _this = _super.call.apply(_super, [this].concat(args));
47
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "code", 'polish');
48
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "nameReadable", 'Polish');
49
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "description", 'Run through your skill as a robot, clicking and typing and asserting!');
50
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "dependencies", [{
51
+ code: 'skill',
52
+ isRequired: true
53
+ }]);
54
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "packageDependencies", [{
55
+ name: '@sprucelabs/heartwood-polish',
56
+ isDev: true
57
+ }]);
58
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "actionsDir", _spruceSkillUtils.diskUtil.resolvePath(__dirname, 'actions'));
59
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "scripts", {
60
+ polish: 'heartwood-polish'
61
+ });
62
+ return _this;
63
+ }
64
+
65
+ return (0, _createClass2["default"])(PolishFeature);
66
+ }(_AbstractFeature2["default"]);
67
+
68
+ exports["default"] = PolishFeature;
69
+ //# sourceMappingURL=PolishFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolishFeature.js","names":["PolishFeature","code","isRequired","name","isDev","diskUtil","resolvePath","__dirname","polish","AbstractFeature"],"sources":["../../../src/features/polish/PolishFeature.ts"],"sourcesContent":["import { diskUtil, NpmPackage } from '@sprucelabs/spruce-skill-utils'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\nexport default class PolishFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'polish'\n\tpublic nameReadable = 'Polish'\n\tpublic description =\n\t\t'Run through your skill as a robot, clicking and typing and asserting!'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies: NpmPackage[] = [\n\t\t{\n\t\t\tname: '@sprucelabs/heartwood-polish',\n\t\t\tisDev: true,\n\t\t},\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\tpublic scripts = {\n\t\tpolish: 'heartwood-polish',\n\t}\n}\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tpolish: PolishFeature\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IAGqBA,a;;;;;;;;;;;;;;;6FACO,Q;qGACL,Q;oGAErB,uE;qGAC0C,CAC1C;MACCC,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAD0C,C;4GAMA,CAC1C;MACCC,IAAI,EAAE,8BADP;MAECC,KAAK,EAAE;IAFR,CAD0C,C;mGAOvBC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;gGACH;MAChBC,MAAM,EAAE;IADQ,C;;;;;EAnByBC,4B"}
@@ -0,0 +1,13 @@
1
+ import AbstractAction from '../../AbstractAction';
2
+ import { FeatureActionResponse } from '../../features.types';
3
+ declare const optionsSchema: {
4
+ id: string;
5
+ fields: {};
6
+ };
7
+ declare type OptionsSchema = typeof optionsSchema;
8
+ export default class SetupAction extends AbstractAction<OptionsSchema> {
9
+ optionsSchema: OptionsSchema;
10
+ invocationMessage: string;
11
+ execute(): Promise<FeatureActionResponse>;
12
+ }
13
+ export {};
@@ -0,0 +1,115 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
14
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
+
16
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
+
18
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
19
+
20
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
21
+
22
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
23
+
24
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
25
+
26
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
+
28
+ var _schema = require("@sprucelabs/schema");
29
+
30
+ var _spruceSkillUtils = require("@sprucelabs/spruce-skill-utils");
31
+
32
+ var _ScriptUpdater = _interopRequireDefault(require("../../../updaters/ScriptUpdater"));
33
+
34
+ var _AbstractAction2 = _interopRequireDefault(require("../../AbstractAction"));
35
+
36
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
37
+
38
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
+
40
+ var optionsSchema = (0, _schema.buildSchema)({
41
+ id: 'setupPolishAction',
42
+ fields: {}
43
+ });
44
+
45
+ var SetupAction = /*#__PURE__*/function (_AbstractAction) {
46
+ (0, _inherits2["default"])(SetupAction, _AbstractAction);
47
+
48
+ var _super = _createSuper(SetupAction);
49
+
50
+ function SetupAction() {
51
+ var _this;
52
+
53
+ (0, _classCallCheck2["default"])(this, SetupAction);
54
+
55
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
56
+ args[_key] = arguments[_key];
57
+ }
58
+
59
+ _this = _super.call.apply(_super, [this].concat(args));
60
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "optionsSchema", optionsSchema);
61
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "invocationMessage", 'Setting up polish... ✨');
62
+ return _this;
63
+ }
64
+
65
+ (0, _createClass2["default"])(SetupAction, [{
66
+ key: "execute",
67
+ value: function () {
68
+ var _execute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
69
+ var namespace, writer, files, scriptUpdater;
70
+ return _regenerator["default"].wrap(function _callee$(_context) {
71
+ while (1) {
72
+ switch (_context.prev = _context.next) {
73
+ case 0:
74
+ _context.next = 2;
75
+ return this.Store('skill').loadCurrentSkillsNamespace();
76
+
77
+ case 2:
78
+ namespace = _context.sent;
79
+ writer = this.Writer('polish');
80
+ _context.next = 6;
81
+ return writer.writePolishScript(_spruceSkillUtils.diskUtil.resolvePath(this.cwd, 'src'), namespace.toLowerCase());
82
+
83
+ case 6:
84
+ files = _context.sent;
85
+ scriptUpdater = _ScriptUpdater["default"].FromFeature(this.parent, {
86
+ cwd: this.cwd
87
+ });
88
+ _context.next = 10;
89
+ return scriptUpdater.update();
90
+
91
+ case 10:
92
+ return _context.abrupt("return", {
93
+ files: files
94
+ });
95
+
96
+ case 11:
97
+ case "end":
98
+ return _context.stop();
99
+ }
100
+ }
101
+ }, _callee, this);
102
+ }));
103
+
104
+ function execute() {
105
+ return _execute.apply(this, arguments);
106
+ }
107
+
108
+ return execute;
109
+ }()
110
+ }]);
111
+ return SetupAction;
112
+ }(_AbstractAction2["default"]);
113
+
114
+ exports["default"] = SetupAction;
115
+ //# sourceMappingURL=SetupAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SetupAction.js","names":["optionsSchema","buildSchema","id","fields","SetupAction","Store","loadCurrentSkillsNamespace","namespace","writer","Writer","writePolishScript","diskUtil","resolvePath","cwd","toLowerCase","files","scriptUpdater","ScriptUpdater","FromFeature","parent","update","AbstractAction"],"sources":["../../../../src/features/polish/actions/SetupAction.ts"],"sourcesContent":["import { buildSchema } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport ScriptUpdater from '../../../updaters/ScriptUpdater'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'setupPolishAction',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\n\nexport default class SetupAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema: OptionsSchema = optionsSchema\n\tpublic invocationMessage = 'Setting up polish... ✨'\n\n\tpublic async execute(): Promise<FeatureActionResponse> {\n\t\tconst namespace = await this.Store('skill').loadCurrentSkillsNamespace()\n\t\tconst writer = this.Writer('polish')\n\t\tconst files = await writer.writePolishScript(\n\t\t\tdiskUtil.resolvePath(this.cwd, 'src'),\n\t\t\tnamespace.toLowerCase()\n\t\t)\n\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this.parent, {\n\t\t\tcwd: this.cwd,\n\t\t})\n\n\t\tawait scriptUpdater.update()\n\n\t\treturn {\n\t\t\tfiles,\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;AAGA,IAAMA,aAAa,GAAG,IAAAC,mBAAA,EAAY;EACjCC,EAAE,EAAE,mBAD6B;EAEjCC,MAAM,EAAE;AAFyB,CAAZ,CAAtB;;IAOqBC,W;;;;;;;;;;;;;;;sGACkBJ,a;0GACX,wB;;;;;;;mGAE3B;QAAA;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACyB,KAAKK,KAAL,CAAW,OAAX,EAAoBC,0BAApB,EADzB;;cAAA;gBACOC,SADP;gBAEOC,MAFP,GAEgB,KAAKC,MAAL,CAAY,QAAZ,CAFhB;gBAAA;gBAAA,OAGqBD,MAAM,CAACE,iBAAP,CACnBC,0BAAA,CAASC,WAAT,CAAqB,KAAKC,GAA1B,EAA+B,KAA/B,CADmB,EAEnBN,SAAS,CAACO,WAAV,EAFmB,CAHrB;;cAAA;gBAGOC,KAHP;gBAQOC,aARP,GAQuBC,yBAAA,CAAcC,WAAd,CAA0B,KAAKC,MAA/B,EAAuC;kBAC5DN,GAAG,EAAE,KAAKA;gBADkD,CAAvC,CARvB;gBAAA;gBAAA,OAYOG,aAAa,CAACI,MAAd,EAZP;;cAAA;gBAAA,iCAcQ;kBACNL,KAAK,EAALA;gBADM,CAdR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAJwCM,2B"}
@@ -0,0 +1,4 @@
1
+ import AbstractWriter from '../../../writers/AbstractWriter';
2
+ export default class PolishWriter extends AbstractWriter {
3
+ writePolishScript(destinationDir: string, skillNamespace: string): Promise<import("../../../writers/AbstractWriter").WriteResults>;
4
+ }
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+
12
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
+
14
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
15
+
16
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
17
+
18
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
19
+
20
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
21
+
22
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
23
+
24
+ var _path = _interopRequireDefault(require("path"));
25
+
26
+ var _AbstractWriter2 = _interopRequireDefault(require("../../../writers/AbstractWriter"));
27
+
28
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ var PolishWriter = /*#__PURE__*/function (_AbstractWriter) {
33
+ (0, _inherits2["default"])(PolishWriter, _AbstractWriter);
34
+
35
+ var _super = _createSuper(PolishWriter);
36
+
37
+ function PolishWriter() {
38
+ (0, _classCallCheck2["default"])(this, PolishWriter);
39
+ return _super.apply(this, arguments);
40
+ }
41
+
42
+ (0, _createClass2["default"])(PolishWriter, [{
43
+ key: "writePolishScript",
44
+ value: function () {
45
+ var _writePolishScript = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(destinationDir, skillNamespace) {
46
+ var filename, resolvedDestination, content, results;
47
+ return _regenerator["default"].wrap(function _callee$(_context) {
48
+ while (1) {
49
+ switch (_context.prev = _context.next) {
50
+ case 0:
51
+ filename = "".concat(skillNamespace, ".polish.ts");
52
+ resolvedDestination = _path["default"].join(destinationDir, filename);
53
+ content = this.templates.polish();
54
+ _context.next = 5;
55
+ return this.writeFileIfChangedMixinResults(resolvedDestination, content, "Polish script at ".concat(filename, "!"));
56
+
57
+ case 5:
58
+ results = _context.sent;
59
+ _context.next = 8;
60
+ return this.lint(resolvedDestination);
61
+
62
+ case 8:
63
+ return _context.abrupt("return", results);
64
+
65
+ case 9:
66
+ case "end":
67
+ return _context.stop();
68
+ }
69
+ }
70
+ }, _callee, this);
71
+ }));
72
+
73
+ function writePolishScript(_x, _x2) {
74
+ return _writePolishScript.apply(this, arguments);
75
+ }
76
+
77
+ return writePolishScript;
78
+ }()
79
+ }]);
80
+ return PolishWriter;
81
+ }(_AbstractWriter2["default"]);
82
+
83
+ exports["default"] = PolishWriter;
84
+ //# sourceMappingURL=PolishWriter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolishWriter.js","names":["PolishWriter","destinationDir","skillNamespace","filename","resolvedDestination","pathUtil","join","content","templates","polish","writeFileIfChangedMixinResults","results","lint","AbstractWriter"],"sources":["../../../../src/features/polish/writers/PolishWriter.ts"],"sourcesContent":["import pathUtil from 'path'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nexport default class PolishWriter extends AbstractWriter {\n\tpublic async writePolishScript(\n\t\tdestinationDir: string,\n\t\tskillNamespace: string\n\t) {\n\t\tconst filename = `${skillNamespace}.polish.ts`\n\t\tconst resolvedDestination = pathUtil.join(destinationDir, filename)\n\t\tconst content = this.templates.polish()\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tresolvedDestination,\n\t\t\tcontent,\n\t\t\t`Polish script at ${filename}!`\n\t\t)\n\n\t\tawait this.lint(resolvedDestination)\n\n\t\treturn results\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IAEqBA,Y;;;;;;;;;;;;;6GACpB,iBACCC,cADD,EAECC,cAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAIOC,QAJP,aAIqBD,cAJrB;gBAKOE,mBALP,GAK6BC,gBAAA,CAASC,IAAT,CAAcL,cAAd,EAA8BE,QAA9B,CAL7B;gBAMOI,OANP,GAMiB,KAAKC,SAAL,CAAeC,MAAf,EANjB;gBAAA;gBAAA,OAQuB,KAAKC,8BAAL,CACrBN,mBADqB,EAErBG,OAFqB,6BAGDJ,QAHC,OARvB;;cAAA;gBAQOQ,OARP;gBAAA;gBAAA,OAcO,KAAKC,IAAL,CAAUR,mBAAV,CAdP;;cAAA;gBAAA,iCAgBQO,OAhBR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EADyCE,2B"}
@@ -41,8 +41,8 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
41
41
 
42
42
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
43
43
 
44
- var TkBaseWidget = /*#__PURE__*/function (_AbstractEventEmitter) {
45
- (0, _inherits2["default"])(TkBaseWidget, _AbstractEventEmitter);
44
+ var TkBaseWidget = /*#__PURE__*/function (_ref) {
45
+ (0, _inherits2["default"])(TkBaseWidget, _ref);
46
46
 
47
47
  var _super = _createSuper(TkBaseWidget);
48
48
 
@@ -6,6 +6,7 @@ import ErrorWriter from '../features/error/writers/ErrorWriter';
6
6
  import EventWriter from '../features/event/writers/EventWriter';
7
7
  import LogWriter from '../features/log/writers/LogWriter';
8
8
  import NodeWriter from '../features/node/writers/NodeWriter';
9
+ import PolishWriter from '../features/polish/writers/PolishWriter';
9
10
  import SandboxWriter from '../features/sandbox/writers/SandboxWriter';
10
11
  import SchemaWriter from '../features/schema/writers/SchemaWriter';
11
12
  import SkillGenerator from '../features/skill/writers/SkillWriter';
@@ -31,6 +32,7 @@ export interface WriterMap {
31
32
  store: StoreWriter;
32
33
  view: ViewWriter;
33
34
  log: LogWriter;
35
+ polish: PolishWriter;
34
36
  }
35
37
  export declare type WriterCode = keyof WriterMap;
36
38
  export default class WriterFactory {
@@ -25,6 +25,8 @@ var _LogWriter = _interopRequireDefault(require("../features/log/writers/LogWrit
25
25
 
26
26
  var _NodeWriter = _interopRequireDefault(require("../features/node/writers/NodeWriter"));
27
27
 
28
+ var _PolishWriter = _interopRequireDefault(require("../features/polish/writers/PolishWriter"));
29
+
28
30
  var _SandboxWriter = _interopRequireDefault(require("../features/sandbox/writers/SandboxWriter"));
29
31
 
30
32
  var _SchemaWriter = _interopRequireDefault(require("../features/schema/writers/SchemaWriter"));
@@ -56,7 +58,8 @@ var classMap = {
56
58
  sandbox: _SandboxWriter["default"],
57
59
  store: _StoreWriter["default"],
58
60
  view: _ViewWriter["default"],
59
- log: _LogWriter["default"]
61
+ log: _LogWriter["default"],
62
+ polish: _PolishWriter["default"]
60
63
  };
61
64
 
62
65
  var WriterFactory = /*#__PURE__*/function () {
@@ -1 +1 @@
1
- {"version":3,"file":"WriterFactory.js","names":["classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","WriterFactory","options","templates","ui","linter","settings","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,IAAMA,QAAQ,GAAG;EAChBC,KAAK,EAAEC,uBADS;EAEhBC,KAAK,EAAEC,uBAFS;EAGhBC,MAAM,EAAEC,wBAHQ;EAIhBC,KAAK,EAAEC,uBAJS;EAKhBC,IAAI,EAAEC,sBALU;EAMhBC,IAAI,EAAEC,sBANU;EAOhBC,MAAM,EAAEC,wBAPQ;EAQhBC,YAAY,EAAEC,8BARE;EAShBC,MAAM,EAAEC,wBATQ;EAUhBC,OAAO,EAAEC,yBAVO;EAWhBC,KAAK,EAAEC,uBAXS;EAYhBC,IAAI,EAAEC,sBAZU;EAahBC,GAAG,EAAEC;AAbW,CAAjB;;IAkCqBC,a;EAMpB,uBAAmBC,OAAnB,EAKG;IAAA;IAAA;IAAA;IAAA;IAAA;IACF,IAAQC,SAAR,GAA4CD,OAA5C,CAAQC,SAAR;IAAA,IAAmBC,EAAnB,GAA4CF,OAA5C,CAAmBE,EAAnB;IAAA,IAAuBC,MAAvB,GAA4CH,OAA5C,CAAuBG,MAAvB;IAAA,IAA+BC,QAA/B,GAA4CJ,OAA5C,CAA+BI,QAA/B;IAEA,KAAKH,SAAL,GAAiBA,SAAjB;IACA,KAAKC,EAAL,GAAUA,EAAV;IACA,KAAKC,MAAL,GAAcA,MAAd;IACA,KAAKC,QAAL,GAAgBA,QAAhB;EACA;;;;WAED,gBACCC,IADD,EAECL,OAFD,EAGgB;MACf,IAAMM,KAAK,GAAGlC,QAAQ,CAACiC,IAAD,CAAtB;MACA,OAAO,IAAIC,KAAJ;QACNL,SAAS,EAAE,KAAKA,SADV;QAENM,IAAI,EAAE,KAAKL,EAFL;QAGNC,MAAM,EAAE,KAAKA,MAHP;QAINC,QAAQ,EAAE,KAAKA;MAJT,GAKFJ,OAAO,IAAI,EALT,EAAP;IAOA"}
1
+ {"version":3,"file":"WriterFactory.js","names":["classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","polish","PolishWriter","WriterFactory","options","templates","ui","linter","settings","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport PolishWriter from '../features/polish/writers/PolishWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n\tpolish: PolishWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n\tpolish: PolishWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAMA,IAAMA,QAAQ,GAAG;EAChBC,KAAK,EAAEC,uBADS;EAEhBC,KAAK,EAAEC,uBAFS;EAGhBC,MAAM,EAAEC,wBAHQ;EAIhBC,KAAK,EAAEC,uBAJS;EAKhBC,IAAI,EAAEC,sBALU;EAMhBC,IAAI,EAAEC,sBANU;EAOhBC,MAAM,EAAEC,wBAPQ;EAQhBC,YAAY,EAAEC,8BARE;EAShBC,MAAM,EAAEC,wBATQ;EAUhBC,OAAO,EAAEC,yBAVO;EAWhBC,KAAK,EAAEC,uBAXS;EAYhBC,IAAI,EAAEC,sBAZU;EAahBC,GAAG,EAAEC,qBAbW;EAchBC,MAAM,EAAEC;AAdQ,CAAjB;;IAoCqBC,a;EAMpB,uBAAmBC,OAAnB,EAKG;IAAA;IAAA;IAAA;IAAA;IAAA;IACF,IAAQC,SAAR,GAA4CD,OAA5C,CAAQC,SAAR;IAAA,IAAmBC,EAAnB,GAA4CF,OAA5C,CAAmBE,EAAnB;IAAA,IAAuBC,MAAvB,GAA4CH,OAA5C,CAAuBG,MAAvB;IAAA,IAA+BC,QAA/B,GAA4CJ,OAA5C,CAA+BI,QAA/B;IAEA,KAAKH,SAAL,GAAiBA,SAAjB;IACA,KAAKC,EAAL,GAAUA,EAAV;IACA,KAAKC,MAAL,GAAcA,MAAd;IACA,KAAKC,QAAL,GAAgBA,QAAhB;EACA;;;;WAED,gBACCC,IADD,EAECL,OAFD,EAGgB;MACf,IAAMM,KAAK,GAAGpC,QAAQ,CAACmC,IAAD,CAAtB;MACA,OAAO,IAAIC,KAAJ;QACNL,SAAS,EAAE,KAAKA,SADV;QAENM,IAAI,EAAE,KAAKL,EAFL;QAGNC,MAAM,EAAE,KAAKA,MAHP;QAINC,QAAQ,EAAE,KAAKA;MAJT,GAKFJ,OAAO,IAAI,EALT,EAAP;IAOA"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "license": "MIT",
21
- "version": "17.0.16",
21
+ "version": "17.1.1",
22
22
  "bin": {
23
23
  "spruce": "./build/index.js"
24
24
  },
@@ -76,19 +76,19 @@
76
76
  "@babel/plugin-proposal-decorators": "^7.18.2",
77
77
  "@babel/runtime": "^7.18.3",
78
78
  "@jest/reporters": "^28.1.1",
79
- "@sprucelabs/error": "^5.0.473",
80
- "@sprucelabs/heartwood-view-controllers": "^84.3.3",
81
- "@sprucelabs/jest-json-reporter": "^6.0.407",
82
- "@sprucelabs/mercury-client": "^31.0.3",
83
- "@sprucelabs/mercury-event-emitter": "^31.0.3",
84
- "@sprucelabs/mercury-types": "^35.0.1",
85
- "@sprucelabs/schema": "^28.2.49",
86
- "@sprucelabs/spruce-core-schemas": "^34.0.2",
87
- "@sprucelabs/spruce-event-plugin": "^41.0.0",
88
- "@sprucelabs/spruce-event-utils": "^27.0.2",
89
- "@sprucelabs/spruce-skill-booter": "^41.0.0",
90
- "@sprucelabs/spruce-skill-utils": "^26.0.85",
91
- "@sprucelabs/spruce-templates": "^17.0.16",
79
+ "@sprucelabs/error": "^5.0.475",
80
+ "@sprucelabs/heartwood-view-controllers": "^84.3.7",
81
+ "@sprucelabs/jest-json-reporter": "^6.0.408",
82
+ "@sprucelabs/mercury-client": "^31.0.7",
83
+ "@sprucelabs/mercury-event-emitter": "^31.0.7",
84
+ "@sprucelabs/mercury-types": "^35.0.3",
85
+ "@sprucelabs/schema": "^28.2.51",
86
+ "@sprucelabs/spruce-core-schemas": "^34.0.4",
87
+ "@sprucelabs/spruce-event-plugin": "^41.0.4",
88
+ "@sprucelabs/spruce-event-utils": "^27.0.5",
89
+ "@sprucelabs/spruce-skill-booter": "^41.0.4",
90
+ "@sprucelabs/spruce-skill-utils": "^26.0.88",
91
+ "@sprucelabs/spruce-templates": "^17.1.1",
92
92
  "@typescript-eslint/eslint-plugin": "^5.27.1",
93
93
  "@typescript-eslint/parser": "^5.27.1",
94
94
  "cfonts": "^3.1.0",
@@ -119,16 +119,16 @@
119
119
  "uuid": "^8.3.2"
120
120
  },
121
121
  "devDependencies": {
122
- "@sprucelabs/data-stores": "^17.0.1",
122
+ "@sprucelabs/data-stores": "^17.0.3",
123
123
  "@sprucelabs/jest-sheets-reporter": "^1.3.47",
124
- "@sprucelabs/mercury-core-events": "^12.0.2",
125
- "@sprucelabs/resolve-path-aliases": "^1.1.61",
126
- "@sprucelabs/spruce-conversation-plugin": "^41.0.0",
127
- "@sprucelabs/spruce-deploy-plugin": "^41.0.0",
128
- "@sprucelabs/spruce-store-plugin": "^41.0.0",
129
- "@sprucelabs/spruce-test-fixtures": "^41.0.0",
130
- "@sprucelabs/test": "^7.7.328",
131
- "@sprucelabs/test-utils": "^3.1.12",
124
+ "@sprucelabs/mercury-core-events": "^12.0.5",
125
+ "@sprucelabs/resolve-path-aliases": "^1.1.62",
126
+ "@sprucelabs/spruce-conversation-plugin": "^41.0.4",
127
+ "@sprucelabs/spruce-deploy-plugin": "^41.0.4",
128
+ "@sprucelabs/spruce-store-plugin": "^41.0.4",
129
+ "@sprucelabs/spruce-test-fixtures": "^41.0.4",
130
+ "@sprucelabs/test": "^7.7.329",
131
+ "@sprucelabs/test-utils": "^3.1.14",
132
132
  "@types/blessed": "^0.1.19",
133
133
  "@types/eslint": "^8.4.3",
134
134
  "@types/fs-extra": "^9.0.13",
@@ -194,6 +194,9 @@
194
194
  },
195
195
  {
196
196
  "code": "conversation"
197
+ },
198
+ {
199
+ "code": "polish"
197
200
  }
198
201
  ],
199
202
  "everythingInNode": [
@@ -277,6 +280,18 @@
277
280
  "code": "event"
278
281
  }
279
282
  ],
283
+ "polish": [
284
+ {
285
+ "code": "skill",
286
+ "options": {
287
+ "name": "testing polish",
288
+ "description": "this too, is a great test!"
289
+ }
290
+ },
291
+ {
292
+ "code": "polish"
293
+ }
294
+ ],
280
295
  "sandbox": [
281
296
  {
282
297
  "code": "skill",
@@ -597,5 +612,5 @@
597
612
  "terminal-kit"
598
613
  ]
599
614
  },
600
- "gitHead": "d66182f37d68afbfb059fc64f442caab9fe8b09f"
615
+ "gitHead": "1f61d0423bf24fdea6d1e27fa9d6d9be0972b642"
601
616
  }
@@ -0,0 +1,71 @@
1
+ import { diskUtil } from '@sprucelabs/spruce-skill-utils'
2
+ import { test, assert } from '@sprucelabs/test'
3
+ import AbstractCliTest from '../../../tests/AbstractCliTest'
4
+
5
+ export default class SettingUpPolishTest extends AbstractCliTest {
6
+ @test()
7
+ protected static async hasCreateAction() {
8
+ assert.isFunction(this.Action('polish', 'setup').execute)
9
+ }
10
+
11
+ @test()
12
+ protected static async setsUpExpectedScript() {
13
+ await this.setupPolish()
14
+
15
+ const { destination } = await this.generateExpectedFile()
16
+
17
+ assert.isTrue(
18
+ diskUtil.doesFileExist(destination),
19
+ `Did not find polish script at ${destination}!`
20
+ )
21
+ }
22
+
23
+ @test()
24
+ protected static async polishResultsAreExpected() {
25
+ const results = await this.setupPolish()
26
+ const { filename, destination } = await this.generateExpectedFile()
27
+
28
+ assert.isLength(results.files, 1)
29
+ assert.isEqualDeep(results, {
30
+ files: [
31
+ {
32
+ name: filename,
33
+ description: `Polish script at ${filename}!`,
34
+ path: destination,
35
+ action: 'generated',
36
+ },
37
+ ],
38
+ })
39
+ }
40
+
41
+ @test()
42
+ protected static async createsExpectedScript() {
43
+ await this.setupPolish()
44
+ const pkg = this.Service('pkg')
45
+ const scripts = pkg.get('scripts')
46
+ assert.isEqual(scripts.polish, 'heartwood-polish')
47
+ }
48
+
49
+ @test()
50
+ protected static async makeSureScriptHasSomethingAndIsValid() {
51
+ const results = await this.setupPolish()
52
+ const { destination } = await this.generateExpectedFile()
53
+ const contents = diskUtil.readFile(destination)
54
+ assert.isNotEqual(contents, '')
55
+ await this.assertValidActionResponseFiles(results)
56
+ }
57
+
58
+ private static async generateExpectedFile() {
59
+ const store = this.Store('skill')
60
+ const namespace = await store.loadCurrentSkillsNamespace()
61
+ const filename = `${namespace.toLowerCase()}.polish.ts`
62
+ const destination = this.resolvePath('src', filename)
63
+ return { filename, destination }
64
+ }
65
+
66
+ private static async setupPolish() {
67
+ await this.FeatureFixture().installCachedFeatures('polish')
68
+ const results = await this.Action('polish', 'setup').execute({})
69
+ return results
70
+ }
71
+ }
@@ -20,6 +20,7 @@ import NodeFeature from './node/NodeFeature'
20
20
  import OnboardFeature from './onboard/OnboardFeature'
21
21
  import OrganizationFeature from './organization/OrganizationFeature'
22
22
  import PersonFeature from './person/PersonFeature'
23
+ import PolishFeature from './polish/PolishFeature'
23
24
  import SandboxFeature from './sandbox/SandboxFeature'
24
25
  import SchemaFeature from './schema/SchemaFeature'
25
26
  import SkillFeature from './skill/SkillFeature'
@@ -50,6 +51,7 @@ export default class FeatureInstallerFactory {
50
51
  CacheFeature,
51
52
  LogFeature,
52
53
  DependencyFeature,
54
+ PolishFeature,
53
55
  ]
54
56
 
55
57
  public static readonly featureCodes: FeatureCode[] = [
@@ -73,6 +75,7 @@ export default class FeatureInstallerFactory {
73
75
  'cache',
74
76
  'log',
75
77
  'dependency',
78
+ 'polish',
76
79
  ]
77
80
 
78
81
  public static WithAllFeatures(options: {
@@ -2,12 +2,6 @@ import { diskUtil } from '@sprucelabs/spruce-skill-utils'
2
2
  import AbstractFeature, { FeatureDependency } from '../AbstractFeature'
3
3
  import { FeatureCode } from '../features.types'
4
4
 
5
- declare module '../../features/features.types' {
6
- interface FeatureMap {
7
- person: PersonFeature
8
- }
9
- }
10
-
11
5
  export default class PersonFeature extends AbstractFeature {
12
6
  public code: FeatureCode = 'person'
13
7
  public nameReadable = 'Person'
@@ -26,3 +20,9 @@ export default class PersonFeature extends AbstractFeature {
26
20
  return this.featureInstaller.isInstalled('skill')
27
21
  }
28
22
  }
23
+
24
+ declare module '../../features/features.types' {
25
+ interface FeatureMap {
26
+ person: PersonFeature
27
+ }
28
+ }
@@ -0,0 +1,33 @@
1
+ import { diskUtil, NpmPackage } from '@sprucelabs/spruce-skill-utils'
2
+ import AbstractFeature, { FeatureDependency } from '../AbstractFeature'
3
+ import { FeatureCode } from '../features.types'
4
+
5
+ export default class PolishFeature extends AbstractFeature {
6
+ public code: FeatureCode = 'polish'
7
+ public nameReadable = 'Polish'
8
+ public description =
9
+ 'Run through your skill as a robot, clicking and typing and asserting!'
10
+ public dependencies: FeatureDependency[] = [
11
+ {
12
+ code: 'skill',
13
+ isRequired: true,
14
+ },
15
+ ]
16
+ public packageDependencies: NpmPackage[] = [
17
+ {
18
+ name: '@sprucelabs/heartwood-polish',
19
+ isDev: true,
20
+ },
21
+ ]
22
+
23
+ public actionsDir = diskUtil.resolvePath(__dirname, 'actions')
24
+ public scripts = {
25
+ polish: 'heartwood-polish',
26
+ }
27
+ }
28
+
29
+ declare module '../../features/features.types' {
30
+ interface FeatureMap {
31
+ polish: PolishFeature
32
+ }
33
+ }
@@ -0,0 +1,36 @@
1
+ import { buildSchema } from '@sprucelabs/schema'
2
+ import { diskUtil } from '@sprucelabs/spruce-skill-utils'
3
+ import ScriptUpdater from '../../../updaters/ScriptUpdater'
4
+ import AbstractAction from '../../AbstractAction'
5
+ import { FeatureActionResponse } from '../../features.types'
6
+
7
+ const optionsSchema = buildSchema({
8
+ id: 'setupPolishAction',
9
+ fields: {},
10
+ })
11
+
12
+ type OptionsSchema = typeof optionsSchema
13
+
14
+ export default class SetupAction extends AbstractAction<OptionsSchema> {
15
+ public optionsSchema: OptionsSchema = optionsSchema
16
+ public invocationMessage = 'Setting up polish... ✨'
17
+
18
+ public async execute(): Promise<FeatureActionResponse> {
19
+ const namespace = await this.Store('skill').loadCurrentSkillsNamespace()
20
+ const writer = this.Writer('polish')
21
+ const files = await writer.writePolishScript(
22
+ diskUtil.resolvePath(this.cwd, 'src'),
23
+ namespace.toLowerCase()
24
+ )
25
+
26
+ const scriptUpdater = ScriptUpdater.FromFeature(this.parent, {
27
+ cwd: this.cwd,
28
+ })
29
+
30
+ await scriptUpdater.update()
31
+
32
+ return {
33
+ files,
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,23 @@
1
+ import pathUtil from 'path'
2
+ import AbstractWriter from '../../../writers/AbstractWriter'
3
+
4
+ export default class PolishWriter extends AbstractWriter {
5
+ public async writePolishScript(
6
+ destinationDir: string,
7
+ skillNamespace: string
8
+ ) {
9
+ const filename = `${skillNamespace}.polish.ts`
10
+ const resolvedDestination = pathUtil.join(destinationDir, filename)
11
+ const content = this.templates.polish()
12
+
13
+ const results = await this.writeFileIfChangedMixinResults(
14
+ resolvedDestination,
15
+ content,
16
+ `Polish script at ${filename}!`
17
+ )
18
+
19
+ await this.lint(resolvedDestination)
20
+
21
+ return results
22
+ }
23
+ }
@@ -6,6 +6,7 @@ import ErrorWriter from '../features/error/writers/ErrorWriter'
6
6
  import EventWriter from '../features/event/writers/EventWriter'
7
7
  import LogWriter from '../features/log/writers/LogWriter'
8
8
  import NodeWriter from '../features/node/writers/NodeWriter'
9
+ import PolishWriter from '../features/polish/writers/PolishWriter'
9
10
  import SandboxWriter from '../features/sandbox/writers/SandboxWriter'
10
11
  import SchemaWriter from '../features/schema/writers/SchemaWriter'
11
12
  import SkillGenerator from '../features/skill/writers/SkillWriter'
@@ -32,6 +33,7 @@ const classMap = {
32
33
  store: StoreWriter,
33
34
  view: ViewWriter,
34
35
  log: LogWriter,
36
+ polish: PolishWriter,
35
37
  }
36
38
 
37
39
  export interface WriterMap {
@@ -48,6 +50,7 @@ export interface WriterMap {
48
50
  store: StoreWriter
49
51
  view: ViewWriter
50
52
  log: LogWriter
53
+ polish: PolishWriter
51
54
  }
52
55
 
53
56
  export type WriterCode = keyof WriterMap