@sprucelabs/spruce-cli 14.30.6 → 14.30.7
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 +8 -0
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js +7 -3
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js +24 -11
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
- package/package.json +24 -24
- package/src/__tests__/behavioral/CreatingAConversationTopic.test.ts +4 -0
- package/src/__tests__/behavioral/stores/CreatingADataStore.test.ts +13 -0
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.30.7](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.30.6...v14.30.7) (2022-01-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [14.30.6](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.30.5...v14.30.6) (2022-01-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
@@ -140,11 +140,15 @@ var CreatingAConversationTopicTest = (_dec = (0, _test.test)(), _dec2 = (0, _tes
|
|
|
140
140
|
case 2:
|
|
141
141
|
health = _context3.sent;
|
|
142
142
|
|
|
143
|
-
|
|
143
|
+
//@ts-ignore
|
|
144
|
+
_test.assert.isTruthy(health.conversation); //@ts-ignore
|
|
144
145
|
|
|
145
|
-
_test.assert.isArray(health.conversation.topics);
|
|
146
146
|
|
|
147
|
-
_test.assert.
|
|
147
|
+
_test.assert.isArray(health.conversation.topics); //@ts-ignore
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
_test.assert.isLength(health.conversation.topics, 1); //@ts-ignore
|
|
151
|
+
|
|
148
152
|
|
|
149
153
|
_test.assert.doesInclude(health.conversation.topics, 'bookAnAppointment');
|
|
150
154
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/__tests__/behavioral/CreatingAConversationTopic.test.ts"],"names":["CreatingAConversationTopicTest","assert","isFunction","Action","execute","FeatureFixture","installCachedFeatures","cli","nameReadable","nameCamel","results","match","testUtil","assertFileByNameInGeneratedFiles","files","Service","importDefault","imported","isTruthy","isEqual","label","isArray","utterances","script","assertHealthCheckResultsAreValid","checkHealth","health","conversation","topics","isLength","doesInclude","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;IAEqBA,8B,WACnB,iB,UAKA,iB;;;;;;;;;;;;;uHALD;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,cAAZ,EAA4B,QAA5B,EAAsCC,OAAxD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;mIAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmB,KAAKC,cAAL,GAAsBC,qBAAtB,CACjB,cADiB,CAFnB;;AAAA;AAEOC,gBAAAA,GAFP;AAAA;AAAA,uBAMuB,KAAKJ,MAAL,CAAY,cAAZ,EAA4B,QAA5B,EAAsCC,OAAtC,CAA8C;AACnEI,kBAAAA,YAAY,EAAE,qBADqD;AAEnEC,kBAAAA,SAAS,EAAE;AAFwD,iBAA9C,CANvB;;AAAA;AAMOC,gBAAAA,OANP;AAWOC,gBAAAA,KAXP,GAWeC,kBAASC,gCAAT,CACb,4BADa,EAEbH,OAAO,CAACI,KAFK,CAXf;AAAA;AAAA,uBAgBwB,KAAKC,OAAL,CAAa,QAAb,EAAuBC,aAAvB,CAAqCL,KAArC,CAhBxB;;AAAA;AAgBOM,gBAAAA,QAhBP;;AAkBChB,6BAAOiB,QAAP,CAAgBD,QAAhB;;AACAhB,6BAAOkB,OAAP,CAAeF,QAAQ,CAACG,KAAxB,EAA+B,qBAA/B;;AACAnB,6BAAOoB,OAAP,CAAeJ,QAAQ,CAACK,UAAxB;;AACArB,6BAAOoB,OAAP,CAAeJ,QAAQ,CAACM,MAAxB;;AArBD;AAAA,uBAuBO,KAAKC,gCAAL,CAAsCjB,GAAtC,CAvBP;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;4HA0BA,kBAAsDA,GAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBACsBA,GAAG,CAACkB,WAAJ,EADtB;;AAAA;AACOC,gBAAAA,MADP;;
|
|
1
|
+
{"version":3,"sources":["../../../src/__tests__/behavioral/CreatingAConversationTopic.test.ts"],"names":["CreatingAConversationTopicTest","assert","isFunction","Action","execute","FeatureFixture","installCachedFeatures","cli","nameReadable","nameCamel","results","match","testUtil","assertFileByNameInGeneratedFiles","files","Service","importDefault","imported","isTruthy","isEqual","label","isArray","utterances","script","assertHealthCheckResultsAreValid","checkHealth","health","conversation","topics","isLength","doesInclude","AbstractCliTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;;;IAEqBA,8B,WACnB,iB,UAKA,iB;;;;;;;;;;;;;uHALD;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,cAAZ,EAA4B,QAA5B,EAAsCC,OAAxD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;mIAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEmB,KAAKC,cAAL,GAAsBC,qBAAtB,CACjB,cADiB,CAFnB;;AAAA;AAEOC,gBAAAA,GAFP;AAAA;AAA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AhC2DG,4B","sourcesContent":["import '@sprucelabs/spruce-conversation-plugin'\nimport { test, assert } from '@sprucelabs/test'\nimport { CliInterface } from '../../cli'\nimport AbstractCliTest from '../../tests/AbstractCliTest'\nimport testUtil from '../../tests/utilities/test.utility'\n\nexport default class CreatingAConversationTopicTest extends AbstractCliTest {\n\t@test()\n\tprotected static async hasCreateConversationAction() {\n\t\tassert.isFunction(this.Action('conversation', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async createsValidConversationTopicDefinition() {\n\t\tconst cli = await this.FeatureFixture().installCachedFeatures(\n\t\t\t'conversation'\n\t\t)\n\n\t\tconst results = await this.Action('conversation', 'create').execute({\n\t\t\tnameReadable: 'book an appointment',\n\t\t\tnameCamel: 'bookAnAppointment',\n\t\t})\n\n\t\tconst match = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'bookAnAppointment.topic.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst imported = await this.Service('import').importDefault(match)\n\n\t\tassert.isTruthy(imported)\n\t\tassert.isEqual(imported.label, 'book an appointment')\n\t\tassert.isArray(imported.utterances)\n\t\tassert.isArray(imported.script)\n\n\t\tawait this.assertHealthCheckResultsAreValid(cli)\n\t}\n\n\tprivate static async assertHealthCheckResultsAreValid(cli: CliInterface) {\n\t\tconst health = await cli.checkHealth()\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.conversation)\n\t\t//@ts-ignore\n\t\tassert.isArray(health.conversation.topics)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.conversation.topics, 1)\n\t\t//@ts-ignore\n\t\tassert.doesInclude(health.conversation.topics, 'bookAnAppointment')\n\t}\n}\n"],"file":"CreatingAConversationTopic.test.js"}
|
|
@@ -96,13 +96,17 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
96
96
|
case 2:
|
|
97
97
|
health = _context2.sent;
|
|
98
98
|
|
|
99
|
-
_test.assert.isFalsy(health.skill.errors);
|
|
99
|
+
_test.assert.isFalsy(health.skill.errors); //@ts-ignore
|
|
100
100
|
|
|
101
|
-
_test.assert.isTruthy(health.store);
|
|
102
101
|
|
|
103
|
-
_test.assert.
|
|
102
|
+
_test.assert.isTruthy(health.store); //@ts-ignore
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
_test.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
_test.assert.isArray(health.store.stores); //@ts-ignore
|
|
104
109
|
|
|
105
|
-
_test.assert.isArray(health.store.stores);
|
|
106
110
|
|
|
107
111
|
_test.assert.isLength(health.store.stores, 0);
|
|
108
112
|
|
|
@@ -206,11 +210,15 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
206
210
|
case 2:
|
|
207
211
|
health = _context5.sent;
|
|
208
212
|
|
|
209
|
-
|
|
213
|
+
//@ts-ignore
|
|
214
|
+
_test.assert.isTruthy(health.store); //@ts-ignore
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
_test.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
210
218
|
|
|
211
|
-
_test.assert.isFalsy(health.store.errors);
|
|
212
219
|
|
|
213
|
-
_test.assert.isLength(health.store.stores, 1);
|
|
220
|
+
_test.assert.isLength(health.store.stores, 1); //@ts-ignore
|
|
221
|
+
|
|
214
222
|
|
|
215
223
|
_test.assert.isEqual(health.store.stores[0].name, 'People');
|
|
216
224
|
|
|
@@ -284,13 +292,18 @@ var CreatingDataStoresTest = (_dec = (0, _test.test)(), _dec2 = (0, _test.test)(
|
|
|
284
292
|
case 2:
|
|
285
293
|
health = _context7.sent;
|
|
286
294
|
|
|
287
|
-
|
|
295
|
+
//@ts-ignore
|
|
296
|
+
_test.assert.isTruthy(health.store); //@ts-ignore
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
_test.assert.isFalsy(health.store.errors); //@ts-ignore
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
_test.assert.isLength(health.store.stores, 2); //@ts-ignore
|
|
288
303
|
|
|
289
|
-
_test.assert.isFalsy(health.store.errors);
|
|
290
304
|
|
|
291
|
-
_test.assert.
|
|
305
|
+
_test.assert.isEqual(health.store.stores[0].name, 'Bids'); //@ts-ignore
|
|
292
306
|
|
|
293
|
-
_test.assert.isEqual(health.store.stores[0].name, 'Bids');
|
|
294
307
|
|
|
295
308
|
_test.assert.isEqual(health.store.stores[1].name, 'People');
|
|
296
309
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/__tests__/behavioral/stores/CreatingADataStore.test.ts"],"names":["CreatingDataStoresTest","assert","isFunction","Action","execute","cli","checkHealth","shouldRunOnSourceFiles","health","isFalsy","skill","errors","isTruthy","store","isArray","stores","isLength","nameReadable","nameReadablePlural","namePascal","results","path","testUtil","assertFileByNameInGeneratedFiles","files","Service","check","file","resolveHashSprucePath","isTrue","diskUtil","doesFileExist","isEqual","name","errorAssertUtil","assertError","storeContents","readFile","replace","writeFile","testFile","resolveTestPath","testContents","dest","resolvePath","isFalse","getAbstractTestPath","CommandService","setMockResponse","code","storesFile","deleteFile","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,sB,WAGnB,iB,UAKA,iB,UAWA,iB,UAkBA,iB,UAOA,iB,UASA,iB,UAkBA,iB,UAWA,iB,UAYA,iB,WA+BA,iB,WAOA,iB;;;;;;;;;;;;;gHAjID;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,OAAZ,EAAqB,QAArB,EAA+BC,OAAjD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;2HAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEsB,KAAKC,GAAL,CAASC,WAAT,CAAqB;AAAEC,kBAAAA,sBAAsB,EAAE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ApB;;AAXD;AAAA,uBAYO,KAAK/C,MAAL,CAAY,MAAZ,EAAoB,SAApB,EAA+BC,OAA/B,CAAuC,EAAvC,CAZP;;AAAA;AAaCH,6BAAO4B,MAAP,CAAcC,2BAASC,aAAT,CAAuBmB,UAAvB,CAAd;;AAbD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;WAgBA,+BAA6C;AAC5C,aAAO,KAAKN,WAAL,CAAiB,KAAjB,EAAwB,OAAxB,EAAiC,0BAAjC,CAAP;AACA;;;EAtJkDQ,8B,8DAClB,Q","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport '@sprucelabs/spruce-store-plugin'\nimport CommandService from '../../../services/CommandService'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingDataStoresTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\n\t@test()\n\tprotected static async hasCreateStoreAction() {\n\t\tassert.isFunction(this.Action('store', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async getsNoStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\tassert.isFalsy(health.skill.errors)\n\t\tassert.isTruthy(health.store)\n\t\tassert.isFalsy(health.store.errors)\n\t\tassert.isArray(health.store.stores)\n\t\tassert.isLength(health.store.stores, 0)\n\t}\n\n\t@test()\n\tprotected static async generatesValidStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'People.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async generatesAMapFile() {\n\t\tconst file = this.resolveHashSprucePath('stores', 'stores.ts')\n\t\tassert.isTrue(diskUtil.doesFileExist(file))\n\t\tawait this.Service('typeChecker').check(file)\n\t}\n\n\t@test()\n\tprotected static async getsOneStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\t\tassert.isTruthy(health.store)\n\t\tassert.isFalsy(health.store.errors)\n\t\tassert.isLength(health.store.stores, 1)\n\t\tassert.isEqual(health.store.stores[0].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async canGenerateASecondStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Bids.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async getsSecondStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\tassert.isTruthy(health.store)\n\t\tassert.isFalsy(health.store.errors)\n\t\tassert.isLength(health.store.stores, 2)\n\t\tassert.isEqual(health.store.stores[0].name, 'Bids')\n\t\tassert.isEqual(health.store.stores[1].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async errorsWhenGeneratingAStoreWithTheSameName() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssertUtil.assertError(results.errors[0], 'STORE_EXISTS')\n\t}\n\n\t@test()\n\tprotected static async storeFactoryAndStoresAreTyped() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Product',\n\t\t\tnameReadablePlural: 'Products',\n\t\t\tnamePascal: 'Product',\n\t\t})\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Products.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst storeContents = diskUtil\n\t\t\t.readFile(path)\n\t\t\t.replace(\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions',\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions & {hello: string}'\n\t\t\t)\n\n\t\tdiskUtil.writeFile(path, storeContents)\n\n\t\tconst testFile = this.resolveTestPath('store-test.ts.hbs')\n\t\tconst testContents = diskUtil.readFile(testFile)\n\n\t\tconst dest = this.resolvePath('src', 'test.ts')\n\t\tdiskUtil.writeFile(dest, testContents)\n\n\t\tawait this.Service('typeChecker').check(dest)\n\t}\n\n\t@test()\n\tprotected static async doesNotCreateAbstractTestFileBecauseTestIsNotInstalled() {\n\t\tassert.isFalse(\n\t\t\tdiskUtil.doesFileExist(CreatingDataStoresTest.getAbstractTestPath())\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async upgradeRestoresDataStoreTypes() {\n\t\tCommandService.setMockResponse('yarn rebuild', {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tCommandService.setMockResponse(/yarn add/gis, {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tconst storesFile = this.resolveHashSprucePath('stores/stores.types.ts')\n\t\tdiskUtil.deleteFile(storesFile)\n\t\tawait this.Action('node', 'upgrade').execute({})\n\t\tassert.isTrue(diskUtil.doesFileExist(storesFile))\n\t}\n\n\tprivate static getAbstractTestPath(): string {\n\t\treturn this.resolvePath('src', 'tests', 'AbstractDataStoreTest.ts')\n\t}\n}\n"],"file":"CreatingADataStore.test.js"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/__tests__/behavioral/stores/CreatingADataStore.test.ts"],"names":["CreatingDataStoresTest","assert","isFunction","Action","execute","cli","checkHealth","shouldRunOnSourceFiles","health","isFalsy","skill","errors","isTruthy","store","isArray","stores","isLength","nameReadable","nameReadablePlural","namePascal","results","path","testUtil","assertFileByNameInGeneratedFiles","files","Service","check","file","resolveHashSprucePath","isTrue","diskUtil","doesFileExist","isEqual","name","errorAssertUtil","assertError","storeContents","readFile","replace","writeFile","testFile","resolveTestPath","testContents","dest","resolvePath","isFalse","getAbstractTestPath","CommandService","setMockResponse","code","storesFile","deleteFile","AbstractSkillTest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;IAEqBA,sB,WAGnB,iB,UAKA,iB,UAeA,iB,UAkBA,iB,UAOA,iB,UAaA,iB,UAkBA,iB,UAgBA,iB,UAYA,iB,WA+BA,iB,WAOA,iB;;;;;;;;;;;;;gHA9ID;AAAA;AAAA;AAAA;AAAA;AAECC,6BAAOC,UAAP,CAAkB,KAAKC,MAAL,CAAY,OAAZ,EAAqB,QAArB,EAA+BC,OAAjD;;AAFD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;;2HAKA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAEsB,KAAKC,GAAL,CAASC,WAAT,CAAqB;AAAEC,kBAAAA,sBAAsB,EAAE;AAA1B,iBAArB,CAFtB;;AAAA;AAEOC,gBAAAA,MAFP;;AAICP,6BAAOQ,OAAP,CAAeD,MAAM,CAACE,KAAP,CAAaC,MAA5B,EAJD,CAKC;;;AACAV,6BAAOW,QAAP,CAAgBJ,MAAM,CAACK,KAAvB,EAND,CAOC;;;AACAZ,6BAAOQ,OAAP,CAAeD,MAAM,CAACK,KAAP,CAAaF,MAA5B,EARD,CASC;;;AACAV,6BAAOa,OAAP,CAAeN,MAAM,CAACK,KAAP,CAAaE,MAA5B,EAVD,CAWC;;;AACAd,6BAAOe,QAAP,CAAgBR,MAAM,CAACK,KAAP,CAAaE,MAA7B,EAAqC,CAArC;;AAZD;AAAA;AAAA;AAAA;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EAAwB,OAAxB,EAAiC,0BAAjC,CAAP;AACA;;;EAnKkDQ,8B,8DAClB,Q","sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { test, assert } from '@sprucelabs/test'\nimport { errorAssertUtil } from '@sprucelabs/test-utils'\nimport '@sprucelabs/spruce-store-plugin'\nimport CommandService from '../../../services/CommandService'\nimport AbstractSkillTest from '../../../tests/AbstractSkillTest'\nimport testUtil from '../../../tests/utilities/test.utility'\n\nexport default class CreatingDataStoresTest extends AbstractSkillTest {\n\tprotected static skillCacheKey = 'stores'\n\n\t@test()\n\tprotected static async hasCreateStoreAction() {\n\t\tassert.isFunction(this.Action('store', 'create').execute)\n\t}\n\n\t@test()\n\tprotected static async getsNoStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\tassert.isFalsy(health.skill.errors)\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isArray(health.store.stores)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 0)\n\t}\n\n\t@test()\n\tprotected static async generatesValidStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Person',\n\t\t\tnameReadablePlural: 'People',\n\t\t\tnamePascal: 'Person',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'People.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async generatesAMapFile() {\n\t\tconst file = this.resolveHashSprucePath('stores', 'stores.ts')\n\t\tassert.isTrue(diskUtil.doesFileExist(file))\n\t\tawait this.Service('typeChecker').check(file)\n\t}\n\n\t@test()\n\tprotected static async getsOneStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 1)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async canGenerateASecondStoreFile() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isFalsy(results.errors)\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Bids.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tawait this.Service('typeChecker').check(path)\n\t}\n\n\t@test()\n\tprotected static async getsSecondStoresBackFromHealthCheck() {\n\t\tconst health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })\n\n\t\t//@ts-ignore\n\t\tassert.isTruthy(health.store)\n\t\t//@ts-ignore\n\t\tassert.isFalsy(health.store.errors)\n\t\t//@ts-ignore\n\t\tassert.isLength(health.store.stores, 2)\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[0].name, 'Bids')\n\t\t//@ts-ignore\n\t\tassert.isEqual(health.store.stores[1].name, 'People')\n\t}\n\n\t@test()\n\tprotected static async errorsWhenGeneratingAStoreWithTheSameName() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Bid',\n\t\t\tnameReadablePlural: 'Bids',\n\t\t\tnamePascal: 'Bid',\n\t\t})\n\n\t\tassert.isTruthy(results.errors)\n\t\terrorAssertUtil.assertError(results.errors[0], 'STORE_EXISTS')\n\t}\n\n\t@test()\n\tprotected static async storeFactoryAndStoresAreTyped() {\n\t\tconst results = await this.Action('store', 'create').execute({\n\t\t\tnameReadable: 'Product',\n\t\t\tnameReadablePlural: 'Products',\n\t\t\tnamePascal: 'Product',\n\t\t})\n\n\t\tconst path = testUtil.assertFileByNameInGeneratedFiles(\n\t\t\t'Products.store.ts',\n\t\t\tresults.files\n\t\t)\n\n\t\tconst storeContents = diskUtil\n\t\t\t.readFile(path)\n\t\t\t.replace(\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions',\n\t\t\t\t'type ProductsStoreOptions = UniversalStoreOptions & {hello: string}'\n\t\t\t)\n\n\t\tdiskUtil.writeFile(path, storeContents)\n\n\t\tconst testFile = this.resolveTestPath('store-test.ts.hbs')\n\t\tconst testContents = diskUtil.readFile(testFile)\n\n\t\tconst dest = this.resolvePath('src', 'test.ts')\n\t\tdiskUtil.writeFile(dest, testContents)\n\n\t\tawait this.Service('typeChecker').check(dest)\n\t}\n\n\t@test()\n\tprotected static async doesNotCreateAbstractTestFileBecauseTestIsNotInstalled() {\n\t\tassert.isFalse(\n\t\t\tdiskUtil.doesFileExist(CreatingDataStoresTest.getAbstractTestPath())\n\t\t)\n\t}\n\n\t@test()\n\tprotected static async upgradeRestoresDataStoreTypes() {\n\t\tCommandService.setMockResponse('yarn rebuild', {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tCommandService.setMockResponse(/yarn add/gis, {\n\t\t\tcode: 0,\n\t\t})\n\n\t\tconst storesFile = this.resolveHashSprucePath('stores/stores.types.ts')\n\t\tdiskUtil.deleteFile(storesFile)\n\t\tawait this.Action('node', 'upgrade').execute({})\n\t\tassert.isTrue(diskUtil.doesFileExist(storesFile))\n\t}\n\n\tprivate static getAbstractTestPath(): string {\n\t\treturn this.resolvePath('src', 'tests', 'AbstractDataStoreTest.ts')\n\t}\n}\n"],"file":"CreatingADataStore.test.js"}
|
package/package.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"version": "14.30.
|
|
21
|
+
"version": "14.30.7",
|
|
22
22
|
"bin": {
|
|
23
23
|
"spruce": "./build/index.js"
|
|
24
24
|
},
|
|
@@ -76,19 +76,19 @@
|
|
|
76
76
|
"@babel/plugin-proposal-decorators": "^7.16.7",
|
|
77
77
|
"@babel/runtime": "^7.16.7",
|
|
78
78
|
"@jest/reporters": "^27.4.6",
|
|
79
|
-
"@sprucelabs/error": "^5.0.
|
|
80
|
-
"@sprucelabs/heartwood-view-controllers": "^56.
|
|
81
|
-
"@sprucelabs/jest-json-reporter": "^6.0.
|
|
82
|
-
"@sprucelabs/mercury-client": "^
|
|
83
|
-
"@sprucelabs/mercury-event-emitter": "^
|
|
84
|
-
"@sprucelabs/mercury-types": "^26.2.
|
|
85
|
-
"@sprucelabs/schema": "^25.6.
|
|
86
|
-
"@sprucelabs/spruce-core-schemas": "^22.8.
|
|
87
|
-
"@sprucelabs/spruce-event-plugin": "^
|
|
88
|
-
"@sprucelabs/spruce-event-utils": "^17.1.
|
|
89
|
-
"@sprucelabs/spruce-skill-booter": "^
|
|
90
|
-
"@sprucelabs/spruce-skill-utils": "^
|
|
91
|
-
"@sprucelabs/spruce-templates": "^14.30.
|
|
79
|
+
"@sprucelabs/error": "^5.0.377",
|
|
80
|
+
"@sprucelabs/heartwood-view-controllers": "^56.8.4",
|
|
81
|
+
"@sprucelabs/jest-json-reporter": "^6.0.310",
|
|
82
|
+
"@sprucelabs/mercury-client": "^20.0.2",
|
|
83
|
+
"@sprucelabs/mercury-event-emitter": "^20.0.2",
|
|
84
|
+
"@sprucelabs/mercury-types": "^26.2.74",
|
|
85
|
+
"@sprucelabs/schema": "^25.6.72",
|
|
86
|
+
"@sprucelabs/spruce-core-schemas": "^22.8.41",
|
|
87
|
+
"@sprucelabs/spruce-event-plugin": "^23.0.1",
|
|
88
|
+
"@sprucelabs/spruce-event-utils": "^17.1.544",
|
|
89
|
+
"@sprucelabs/spruce-skill-booter": "^23.0.1",
|
|
90
|
+
"@sprucelabs/spruce-skill-utils": "^23.0.0",
|
|
91
|
+
"@sprucelabs/spruce-templates": "^14.30.7",
|
|
92
92
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
93
93
|
"@typescript-eslint/parser": "^5.10.0",
|
|
94
94
|
"cfonts": "^2.10.0",
|
|
@@ -119,16 +119,16 @@
|
|
|
119
119
|
"uuid": "^8.3.2"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@sprucelabs/data-stores": "^7.2.
|
|
123
|
-
"@sprucelabs/jest-sheets-reporter": "^1.2.
|
|
124
|
-
"@sprucelabs/mercury-core-events": "^1.7.
|
|
122
|
+
"@sprucelabs/data-stores": "^7.2.209",
|
|
123
|
+
"@sprucelabs/jest-sheets-reporter": "^1.2.313",
|
|
124
|
+
"@sprucelabs/mercury-core-events": "^1.7.131",
|
|
125
125
|
"@sprucelabs/resolve-path-aliases": "^1.0.253",
|
|
126
|
-
"@sprucelabs/spruce-conversation-plugin": "^
|
|
127
|
-
"@sprucelabs/spruce-deploy-plugin": "^
|
|
128
|
-
"@sprucelabs/spruce-store-plugin": "^
|
|
129
|
-
"@sprucelabs/spruce-test-fixtures": "^
|
|
126
|
+
"@sprucelabs/spruce-conversation-plugin": "^23.0.1",
|
|
127
|
+
"@sprucelabs/spruce-deploy-plugin": "^23.0.1",
|
|
128
|
+
"@sprucelabs/spruce-store-plugin": "^23.0.1",
|
|
129
|
+
"@sprucelabs/spruce-test-fixtures": "^23.0.1",
|
|
130
130
|
"@sprucelabs/test": "^7.7.274",
|
|
131
|
-
"@sprucelabs/test-utils": "^3.0.
|
|
131
|
+
"@sprucelabs/test-utils": "^3.0.381",
|
|
132
132
|
"@types/blessed": "^0.1.19",
|
|
133
133
|
"@types/eslint": "^8.2.2",
|
|
134
134
|
"@types/fs-extra": "^9.0.13",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"@types/lodash": "^4.14.178",
|
|
139
139
|
"@types/md5": "^2.3.1",
|
|
140
140
|
"@types/mkdirp": "^1.0.2",
|
|
141
|
-
"@types/node": "^17.0.
|
|
141
|
+
"@types/node": "^17.0.10",
|
|
142
142
|
"@types/promise.allsettled": "^1.0.3",
|
|
143
143
|
"@types/ps-node": "^0.1.1",
|
|
144
144
|
"@types/rimraf": "^3.0.2",
|
|
@@ -597,5 +597,5 @@
|
|
|
597
597
|
"ora"
|
|
598
598
|
]
|
|
599
599
|
},
|
|
600
|
-
"gitHead": "
|
|
600
|
+
"gitHead": "789a91acad109fbdbb20abc69cf7d0c295a4f888"
|
|
601
601
|
}
|
|
@@ -38,9 +38,13 @@ export default class CreatingAConversationTopicTest extends AbstractCliTest {
|
|
|
38
38
|
|
|
39
39
|
private static async assertHealthCheckResultsAreValid(cli: CliInterface) {
|
|
40
40
|
const health = await cli.checkHealth()
|
|
41
|
+
//@ts-ignore
|
|
41
42
|
assert.isTruthy(health.conversation)
|
|
43
|
+
//@ts-ignore
|
|
42
44
|
assert.isArray(health.conversation.topics)
|
|
45
|
+
//@ts-ignore
|
|
43
46
|
assert.isLength(health.conversation.topics, 1)
|
|
47
|
+
//@ts-ignore
|
|
44
48
|
assert.doesInclude(health.conversation.topics, 'bookAnAppointment')
|
|
45
49
|
}
|
|
46
50
|
}
|
|
@@ -19,9 +19,13 @@ export default class CreatingDataStoresTest extends AbstractSkillTest {
|
|
|
19
19
|
const health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })
|
|
20
20
|
|
|
21
21
|
assert.isFalsy(health.skill.errors)
|
|
22
|
+
//@ts-ignore
|
|
22
23
|
assert.isTruthy(health.store)
|
|
24
|
+
//@ts-ignore
|
|
23
25
|
assert.isFalsy(health.store.errors)
|
|
26
|
+
//@ts-ignore
|
|
24
27
|
assert.isArray(health.store.stores)
|
|
28
|
+
//@ts-ignore
|
|
25
29
|
assert.isLength(health.store.stores, 0)
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -53,9 +57,13 @@ export default class CreatingDataStoresTest extends AbstractSkillTest {
|
|
|
53
57
|
@test()
|
|
54
58
|
protected static async getsOneStoresBackFromHealthCheck() {
|
|
55
59
|
const health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })
|
|
60
|
+
//@ts-ignore
|
|
56
61
|
assert.isTruthy(health.store)
|
|
62
|
+
//@ts-ignore
|
|
57
63
|
assert.isFalsy(health.store.errors)
|
|
64
|
+
//@ts-ignore
|
|
58
65
|
assert.isLength(health.store.stores, 1)
|
|
66
|
+
//@ts-ignore
|
|
59
67
|
assert.isEqual(health.store.stores[0].name, 'People')
|
|
60
68
|
}
|
|
61
69
|
|
|
@@ -81,10 +89,15 @@ export default class CreatingDataStoresTest extends AbstractSkillTest {
|
|
|
81
89
|
protected static async getsSecondStoresBackFromHealthCheck() {
|
|
82
90
|
const health = await this.cli.checkHealth({ shouldRunOnSourceFiles: true })
|
|
83
91
|
|
|
92
|
+
//@ts-ignore
|
|
84
93
|
assert.isTruthy(health.store)
|
|
94
|
+
//@ts-ignore
|
|
85
95
|
assert.isFalsy(health.store.errors)
|
|
96
|
+
//@ts-ignore
|
|
86
97
|
assert.isLength(health.store.stores, 2)
|
|
98
|
+
//@ts-ignore
|
|
87
99
|
assert.isEqual(health.store.stores[0].name, 'Bids')
|
|
100
|
+
//@ts-ignore
|
|
88
101
|
assert.isEqual(health.store.stores[1].name, 'People')
|
|
89
102
|
}
|
|
90
103
|
|