@sprucelabs/spruce-cli 14.28.4 → 14.28.5

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 CHANGED
@@ -3,6 +3,14 @@
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
+ ## [14.28.5](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.28.4...v14.28.5) (2021-12-04)
7
+
8
+ **Note:** Version bump only for package @sprucelabs/spruce-cli
9
+
10
+
11
+
12
+
13
+
6
14
  ## [14.28.4](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.28.3...v14.28.4) (2021-12-04)
7
15
 
8
16
  **Note:** Version bump only for package @sprucelabs/spruce-cli
@@ -1,4 +1,6 @@
1
1
  import AbstractCliTest from '../../tests/AbstractCliTest';
2
2
  export default class BootingWithBadFilesTest extends AbstractCliTest {
3
3
  protected static bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema(): Promise<void>;
4
+ protected static disablesSchemaCheckingWithFlag(): Promise<void>;
5
+ private static breakSchemaAndBoot;
4
6
  }
@@ -31,13 +31,13 @@ var _AbstractCliTest2 = _interopRequireDefault(require("../../tests/AbstractCliT
31
31
 
32
32
  var _test2 = _interopRequireDefault(require("../../tests/utilities/test.utility"));
33
33
 
34
- var _dec, _class;
34
+ var _dec, _dec2, _class;
35
35
 
36
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
37
 
38
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
39
 
40
- var BootingWithBadFilesTest = (_dec = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractCliTest) {
40
+ var BootingWithBadFilesTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(), (_class = /*#__PURE__*/function (_AbstractCliTest) {
41
41
  (0, _inherits2["default"])(BootingWithBadFilesTest, _AbstractCliTest);
42
42
 
43
43
  var _super = _createSuper(BootingWithBadFilesTest);
@@ -51,52 +51,106 @@ var BootingWithBadFilesTest = (_dec = (0, _test.test)(), (_class = /*#__PURE__*/
51
51
  key: "bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema",
52
52
  value: function () {
53
53
  var _bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
54
- var results, match, bootResults;
54
+ var bootResults;
55
55
  return _regenerator["default"].wrap(function _callee$(_context) {
56
56
  while (1) {
57
57
  switch (_context.prev = _context.next) {
58
58
  case 0:
59
59
  _context.next = 2;
60
+ return this.breakSchemaAndBoot();
61
+
62
+ case 2:
63
+ bootResults = _context.sent;
64
+
65
+ _test.assert.isTruthy(bootResults.errors);
66
+
67
+ _test.assert.doesInclude(bootResults.errors[0].message, 'location.schema.ts');
68
+
69
+ case 5:
70
+ case "end":
71
+ return _context.stop();
72
+ }
73
+ }
74
+ }, _callee, this);
75
+ }));
76
+
77
+ function bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema() {
78
+ return _bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema.apply(this, arguments);
79
+ }
80
+
81
+ return bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema;
82
+ }()
83
+ }, {
84
+ key: "disablesSchemaCheckingWithFlag",
85
+ value: function () {
86
+ var _disablesSchemaCheckingWithFlag = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
87
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
88
+ while (1) {
89
+ switch (_context2.prev = _context2.next) {
90
+ case 0:
91
+ process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT = 'false';
92
+
93
+ case 1:
94
+ case "end":
95
+ return _context2.stop();
96
+ }
97
+ }
98
+ }, _callee2);
99
+ }));
100
+
101
+ function disablesSchemaCheckingWithFlag() {
102
+ return _disablesSchemaCheckingWithFlag.apply(this, arguments);
103
+ }
104
+
105
+ return disablesSchemaCheckingWithFlag;
106
+ }()
107
+ }, {
108
+ key: "breakSchemaAndBoot",
109
+ value: function () {
110
+ var _breakSchemaAndBoot = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
111
+ var results, match, bootResults;
112
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
113
+ while (1) {
114
+ switch (_context3.prev = _context3.next) {
115
+ case 0:
116
+ _context3.next = 2;
60
117
  return this.FeatureFixture().installCachedFeatures('schemas');
61
118
 
62
119
  case 2:
63
- _context.next = 4;
120
+ _context3.next = 4;
64
121
  return this.Action('schema', 'sync').execute({});
65
122
 
66
123
  case 4:
67
- results = _context.sent;
124
+ results = _context3.sent;
68
125
  match = _test2["default"].assertFileByNameInGeneratedFiles('location.schema.ts', results.files);
69
126
 
70
127
  _spruceSkillUtils.diskUtil.writeFile(match, '');
71
128
 
72
- _context.next = 9;
129
+ _context3.next = 9;
73
130
  return this.Action('skill', 'boot').execute({
74
131
  local: true
75
132
  });
76
133
 
77
134
  case 9:
78
- bootResults = _context.sent;
79
-
80
- _test.assert.isTruthy(bootResults.errors);
81
-
82
- _test.assert.doesInclude(bootResults.errors[0].message, 'location.schema.ts');
135
+ bootResults = _context3.sent;
136
+ return _context3.abrupt("return", bootResults);
83
137
 
84
- case 12:
138
+ case 11:
85
139
  case "end":
86
- return _context.stop();
140
+ return _context3.stop();
87
141
  }
88
142
  }
89
- }, _callee, this);
143
+ }, _callee3, this);
90
144
  }));
91
145
 
92
- function bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema() {
93
- return _bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema.apply(this, arguments);
146
+ function breakSchemaAndBoot() {
147
+ return _breakSchemaAndBoot.apply(this, arguments);
94
148
  }
95
149
 
96
- return bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema;
150
+ return breakSchemaAndBoot;
97
151
  }()
98
152
  }]);
99
153
  return BootingWithBadFilesTest;
100
- }(_AbstractCliTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema", [_dec], Object.getOwnPropertyDescriptor(_class, "bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema"), _class)), _class));
154
+ }(_AbstractCliTest2["default"]), ((0, _applyDecoratedDescriptor2["default"])(_class, "bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema", [_dec], Object.getOwnPropertyDescriptor(_class, "bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema"), _class), (0, _applyDecoratedDescriptor2["default"])(_class, "disablesSchemaCheckingWithFlag", [_dec2], Object.getOwnPropertyDescriptor(_class, "disablesSchemaCheckingWithFlag"), _class)), _class));
101
155
  exports["default"] = BootingWithBadFilesTest;
102
156
  //# sourceMappingURL=BootingWithBadFiles.test.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/__tests__/behavioral/BootingWithBadFiles.test.ts"],"names":["BootingWithBadFilesTest","FeatureFixture","installCachedFeatures","Action","execute","results","match","testUtil","assertFileByNameInGeneratedFiles","files","diskUtil","writeFile","local","bootResults","assert","isTruthy","errors","doesInclude","message","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,uB,WACnB,iB;;;;;;;;;;;;;iJAAD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEO,KAAKC,cAAL,GAAsBC,qBAAtB,CAA4C,SAA5C,CAFP;;AAAA;AAAA;AAAA,uBAIuB,KAAKC,MAAL,CAAY,QAAZ,EAAsB,MAAtB,EAA8BC,OAA9B,CAAsC,EAAtC,CAJvB;;AAAA;AAIOC,gBAAAA,OAJP;AAMOC,gBAAAA,KANP,GAMeC,kBAASC,gCAAT,CACb,oBADa,EAEbH,OAAO,CAACI,KAFK,CANf;;AAWCC,2CAASC,SAAT,CAAmBL,KAAnB,EAA0B,EAA1B;;AAXD;AAAA,uBAa2B,KAAKH,MAAL,CAAY,OAAZ,EAAqB,MAArB,EAA6BC,OAA7B,CAAqC;AAC9DQ,kBAAAA,KAAK,EAAE;AADuD,iBAArC,CAb3B;;AAAA;AAaOC,gBAAAA,WAbP;;AAgBCC,6BAAOC,QAAP,CAAgBF,WAAW,CAACG,MAA5B;;AAEAF,6BAAOG,WAAP,CAAmBJ,WAAW,CAACG,MAAZ,CAAmB,CAAnB,EAAsBE,OAAzC,EAAkD,oBAAlD;;AAlBD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EADoDC,4B","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport AbstractCliTest from '../../tests/AbstractCliTest'\nimport testUtil from '../../tests/utilities/test.utility'\n\nexport default class BootingWithBadFilesTest extends AbstractCliTest {\n\t@test()\n\tprotected static async bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema() {\n\t\tawait this.FeatureFixture().installCachedFeatures('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'location.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tdiskUtil.writeFile(match, '')\n\n\t\tconst bootResults = await this.Action('skill', 'boot').execute({\n\t\t\tlocal: true,\n\t\t})\n\t\tassert.isTruthy(bootResults.errors)\n\n\t\tassert.doesInclude(bootResults.errors[0].message, 'location.schema.ts')\n\t}\n}\n"],"file":"BootingWithBadFiles.test.js"}
1
+ {"version":3,"sources":["../../../src/__tests__/behavioral/BootingWithBadFiles.test.ts"],"names":["BootingWithBadFilesTest","breakSchemaAndBoot","bootResults","assert","isTruthy","errors","doesInclude","message","process","env","SHOULD_VALIDATE_SCHEMAS_ON_BOOT","FeatureFixture","installCachedFeatures","Action","execute","results","match","testUtil","assertFileByNameInGeneratedFiles","files","diskUtil","writeFile","local","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,uB,WACnB,iB,UAOA,iB;;;;;;;;;;;;;iJAPD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAE2B,KAAKC,kBAAL,EAF3B;;AAAA;AAEOC,gBAAAA,WAFP;;AAGCC,6BAAOC,QAAP,CAAgBF,WAAW,CAACG,MAA5B;;AACAF,6BAAOG,WAAP,CAAmBJ,WAAW,CAACG,MAAZ,CAAmB,CAAnB,EAAsBE,OAAzC,EAAkD,oBAAlD;;AAJD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;0HAOA;AAAA;AAAA;AAAA;AAAA;AAECC,gBAAAA,OAAO,CAACC,GAAR,CAAYC,+BAAZ,GAA8C,OAA9C;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;8GAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBACO,KAAKC,cAAL,GAAsBC,qBAAtB,CAA4C,SAA5C,CADP;;AAAA;AAAA;AAAA,uBAGuB,KAAKC,MAAL,CAAY,QAAZ,EAAsB,MAAtB,EAA8BC,OAA9B,CAAsC,EAAtC,CAHvB;;AAAA;AAGOC,gBAAAA,OAHP;AAKOC,gBAAAA,KALP,GAKeC,kBAASC,gCAAT,CACb,oBADa,EAEbH,OAAO,CAACI,KAFK,CALf;;AAUCC,2CAASC,SAAT,CAAmBL,KAAnB,EAA0B,EAA1B;;AAVD;AAAA,uBAY2B,KAAKH,MAAL,CAAY,OAAZ,EAAqB,MAArB,EAA6BC,OAA7B,CAAqC;AAC9DQ,kBAAAA,KAAK,EAAE;AADuD,iBAArC,CAZ3B;;AAAA;AAYOpB,gBAAAA,WAZP;AAAA,kDAgBQA,WAhBR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EAboDqB,4B","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport AbstractCliTest from '../../tests/AbstractCliTest'\nimport testUtil from '../../tests/utilities/test.utility'\n\nexport default class BootingWithBadFilesTest extends AbstractCliTest {\n\t@test()\n\tprotected static async bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema() {\n\t\tconst bootResults = await this.breakSchemaAndBoot()\n\t\tassert.isTruthy(bootResults.errors)\n\t\tassert.doesInclude(bootResults.errors[0].message, 'location.schema.ts')\n\t}\n\n\t@test()\n\tprotected static async disablesSchemaCheckingWithFlag() {\n\t\tprocess.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT = 'false'\n\t}\n\n\tprivate static async breakSchemaAndBoot() {\n\t\tawait this.FeatureFixture().installCachedFeatures('schemas')\n\n\t\tconst results = await this.Action('schema', 'sync').execute({})\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'location.schema.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tdiskUtil.writeFile(match, '')\n\n\t\tconst bootResults = await this.Action('skill', 'boot').execute({\n\t\t\tlocal: true,\n\t\t})\n\n\t\treturn bootResults\n\t}\n}\n"],"file":"BootingWithBadFiles.test.js"}
package/package.json CHANGED
@@ -18,7 +18,7 @@
18
18
  ]
19
19
  },
20
20
  "license": "MIT",
21
- "version": "14.28.4",
21
+ "version": "14.28.5",
22
22
  "bin": {
23
23
  "spruce": "./build/index.js"
24
24
  },
@@ -88,7 +88,7 @@
88
88
  "@sprucelabs/spruce-event-utils": "^17.1.249",
89
89
  "@sprucelabs/spruce-skill-booter": "^17.0.2",
90
90
  "@sprucelabs/spruce-skill-utils": "^22.1.40",
91
- "@sprucelabs/spruce-templates": "^14.28.4",
91
+ "@sprucelabs/spruce-templates": "^14.28.5",
92
92
  "cfonts": "^2.10.0",
93
93
  "chalk": "^4.1.2",
94
94
  "chokidar": "^3.5.2",
@@ -595,5 +595,5 @@
595
595
  "ora"
596
596
  ]
597
597
  },
598
- "gitHead": "378e6487a21c3bc526641b491e950e9f1e4f7eca"
598
+ "gitHead": "17c5f22c01c26e065a1d85beb2ce0a4a187a0d6b"
599
599
  }
@@ -6,6 +6,17 @@ import testUtil from '../../tests/utilities/test.utility'
6
6
  export default class BootingWithBadFilesTest extends AbstractCliTest {
7
7
  @test()
8
8
  protected static async bootingWithAEmptySchemaThrowsErrorWithNameOfBadSchema() {
9
+ const bootResults = await this.breakSchemaAndBoot()
10
+ assert.isTruthy(bootResults.errors)
11
+ assert.doesInclude(bootResults.errors[0].message, 'location.schema.ts')
12
+ }
13
+
14
+ @test()
15
+ protected static async disablesSchemaCheckingWithFlag() {
16
+ process.env.SHOULD_VALIDATE_SCHEMAS_ON_BOOT = 'false'
17
+ }
18
+
19
+ private static async breakSchemaAndBoot() {
9
20
  await this.FeatureFixture().installCachedFeatures('schemas')
10
21
 
11
22
  const results = await this.Action('schema', 'sync').execute({})
@@ -20,8 +31,7 @@ export default class BootingWithBadFilesTest extends AbstractCliTest {
20
31
  const bootResults = await this.Action('skill', 'boot').execute({
21
32
  local: true,
22
33
  })
23
- assert.isTruthy(bootResults.errors)
24
34
 
25
- assert.doesInclude(bootResults.errors[0].message, 'location.schema.ts')
35
+ return bootResults
26
36
  }
27
37
  }