@sprucelabs/spruce-cli 15.4.10 → 16.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (456) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/build/.spruce/errors/spruceCli/actionCancelled.schema.js.map +1 -1
  3. package/build/.spruce/errors/spruceCli/bootError.schema.js.map +1 -1
  4. package/build/.spruce/errors/spruceCli/buildFailed.schema.js.map +1 -1
  5. package/build/.spruce/errors/spruceCli/cacheNotEnabled.schema.js.map +1 -1
  6. package/build/.spruce/errors/spruceCli/commandAborted.schema.js.map +1 -1
  7. package/build/.spruce/errors/spruceCli/commandBlocked.schema.js.map +1 -1
  8. package/build/.spruce/errors/spruceCli/commandNotImplemented.schema.js.map +1 -1
  9. package/build/.spruce/errors/spruceCli/createAutoloaderFailed.schema.js.map +1 -1
  10. package/build/.spruce/errors/spruceCli/dependencyExists.schema.js.map +1 -1
  11. package/build/.spruce/errors/spruceCli/deployFailed.schema.js.map +1 -1
  12. package/build/.spruce/errors/spruceCli/directoryEmpty.schema.js.map +1 -1
  13. package/build/.spruce/errors/spruceCli/directoryNotSkill.schema.js.map +1 -1
  14. package/build/.spruce/errors/spruceCli/dockerNotStarted.schema.js.map +1 -1
  15. package/build/.spruce/errors/spruceCli/executingCommandFailed.schema.js.map +1 -1
  16. package/build/.spruce/errors/spruceCli/failedToImport.schema.js.map +1 -1
  17. package/build/.spruce/errors/spruceCli/featureNotInstalled.schema.js.map +1 -1
  18. package/build/.spruce/errors/spruceCli/fileExists.schema.js.map +1 -1
  19. package/build/.spruce/errors/spruceCli/generic.schema.js.map +1 -1
  20. package/build/.spruce/errors/spruceCli/invalidCommand.schema.js.map +1 -1
  21. package/build/.spruce/errors/spruceCli/invalidEventContract.schema.js.map +1 -1
  22. package/build/.spruce/errors/spruceCli/invalidFeatureCode.schema.js.map +1 -1
  23. package/build/.spruce/errors/spruceCli/invalidTestDirectory.schema.js.map +1 -1
  24. package/build/.spruce/errors/spruceCli/lintFailed.schema.js.map +1 -1
  25. package/build/.spruce/errors/spruceCli/mercuryResponseError.schema.js.map +1 -1
  26. package/build/.spruce/errors/spruceCli/missingDependencies.schema.js.map +1 -1
  27. package/build/.spruce/errors/spruceCli/missingDependenciesDependency.schema.js.map +1 -1
  28. package/build/.spruce/errors/spruceCli/noOrganizationsFound.schema.js.map +1 -1
  29. package/build/.spruce/errors/spruceCli/noSkillsRegistered.schema.js.map +1 -1
  30. package/build/.spruce/errors/spruceCli/notImplemented.schema.js.map +1 -1
  31. package/build/.spruce/errors/spruceCli/notLoggedIn.schema.js.map +1 -1
  32. package/build/.spruce/errors/spruceCli/schemaExists.schema.js.map +1 -1
  33. package/build/.spruce/errors/spruceCli/schemaFailedToImport.schema.js.map +1 -1
  34. package/build/.spruce/errors/spruceCli/schemaTemplateItemBuildingFailed.schema.js.map +1 -1
  35. package/build/.spruce/errors/spruceCli/skillNotFound.schema.js.map +1 -1
  36. package/build/.spruce/errors/spruceCli/skillNotRegistered.schema.js.map +1 -1
  37. package/build/.spruce/errors/spruceCli/skillViewExists.schema.js.map +1 -1
  38. package/build/.spruce/errors/spruceCli/storeExists.schema.js.map +1 -1
  39. package/build/.spruce/errors/spruceCli/testFailed.schema.js.map +1 -1
  40. package/build/.spruce/errors/spruceCli/themeExists.schema.js.map +1 -1
  41. package/build/.spruce/errors/spruceCli/transportAlreadyExists.schema.js.map +1 -1
  42. package/build/.spruce/errors/spruceCli/vscodeNotInstalled.schema.js.map +1 -1
  43. package/build/.spruce/events/heartwood/didRegisterSkillViews.v2021_02_11.contract.js.map +1 -1
  44. package/build/.spruce/events/heartwood/generateUrl.v2021_02_11.contract.js.map +1 -1
  45. package/build/.spruce/events/heartwood/getSkillViews.v2021_02_11.contract.js.map +1 -1
  46. package/build/.spruce/events/heartwood/listViews.v2021_02_11.contract.js.map +1 -1
  47. package/build/.spruce/events/heartwood/registerSkillViews.v2021_02_11.contract.js.map +1 -1
  48. package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitPayload.schema.js.map +1 -1
  49. package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitTarget.schema.js.map +1 -1
  50. package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
  51. package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitPayload.schema.js.map +1 -1
  52. package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitTarget.schema.js.map +1 -1
  53. package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitTargetAndPayload.schema.js.map +1 -1
  54. package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlResponsePayload.schema.js.map +1 -1
  55. package/build/.spruce/schemas/heartwood/v2021_02_11/getSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
  56. package/build/.spruce/schemas/heartwood/v2021_02_11/getSkillViewsResponsePayload.schema.js.map +1 -1
  57. package/build/.spruce/schemas/heartwood/v2021_02_11/getViewControllersEmitTarget.schema.js.map +1 -1
  58. package/build/.spruce/schemas/heartwood/v2021_02_11/listViewsResponsePayload.schema.js.map +1 -1
  59. package/build/.spruce/schemas/heartwood/v2021_02_11/listViewsResult.schema.js.map +1 -1
  60. package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsEmitPayload.schema.js.map +1 -1
  61. package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
  62. package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsResponsePayload.schema.js.map +1 -1
  63. package/build/.spruce/schemas/spruceCli/v2020_07_22/bootSkillOptions.schema.js.map +1 -1
  64. package/build/.spruce/schemas/spruceCli/v2020_07_22/createConversationTopicOptions.schema.js.map +1 -1
  65. package/build/.spruce/schemas/spruceCli/v2020_07_22/createErrorOptions.schema.js.map +1 -1
  66. package/build/.spruce/schemas/spruceCli/v2020_07_22/createOrganizationOptions.schema.js.map +1 -1
  67. package/build/.spruce/schemas/spruceCli/v2020_07_22/createSchemaOptions.schema.js.map +1 -1
  68. package/build/.spruce/schemas/spruceCli/v2020_07_22/createTestOptions.schema.js.map +1 -1
  69. package/build/.spruce/schemas/spruceCli/v2020_07_22/generatedDir.schema.js.map +1 -1
  70. package/build/.spruce/schemas/spruceCli/v2020_07_22/generatedFile.schema.js.map +1 -1
  71. package/build/.spruce/schemas/spruceCli/v2020_07_22/installSkillAtOrganizationOptions.schema.js.map +1 -1
  72. package/build/.spruce/schemas/spruceCli/v2020_07_22/listenEventOptions.schema.js.map +1 -1
  73. package/build/.spruce/schemas/spruceCli/v2020_07_22/namedTemplateItem.schema.js.map +1 -1
  74. package/build/.spruce/schemas/spruceCli/v2020_07_22/nodeFeatureOptions.schema.js.map +1 -1
  75. package/build/.spruce/schemas/spruceCli/v2020_07_22/onboardOptions.schema.js.map +1 -1
  76. package/build/.spruce/schemas/spruceCli/v2020_07_22/onboarding.schema.js.map +1 -1
  77. package/build/.spruce/schemas/spruceCli/v2020_07_22/personWithToken.schema.js.map +1 -1
  78. package/build/.spruce/schemas/spruceCli/v2020_07_22/registerDashboardWidgetsEmitPayloadSchema.schema.js.map +1 -1
  79. package/build/.spruce/schemas/spruceCli/v2020_07_22/setupTestsOptions.schema.js.map +1 -1
  80. package/build/.spruce/schemas/spruceCli/v2020_07_22/setupVscodeOptions.schema.js.map +1 -1
  81. package/build/.spruce/schemas/spruceCli/v2020_07_22/skillFeature.schema.js.map +1 -1
  82. package/build/.spruce/schemas/spruceCli/v2020_07_22/syncErrorOptions.schema.js.map +1 -1
  83. package/build/.spruce/schemas/spruceCli/v2020_07_22/syncEventOptions.schema.js.map +1 -1
  84. package/build/.spruce/schemas/spruceCli/v2020_07_22/syncSchemaFieldsOptions.schema.js.map +1 -1
  85. package/build/.spruce/schemas/spruceCli/v2020_07_22/syncSchemasOptions.schema.js.map +1 -1
  86. package/build/.spruce/schemas/spruceCli/v2020_07_22/testOptions.schema.js.map +1 -1
  87. package/build/.spruce/schemas/spruceCli/v2020_07_22/upgradeSkillOptions.schema.js.map +1 -1
  88. package/build/.spruce/schemas/spruceCli/v2020_07_22/watcherDidDetectChangesEmitPayload.schema.js.map +1 -1
  89. package/build/GlobalEmitter.js.map +1 -1
  90. package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
  91. package/build/__tests__/behavioral/BlockingCommands.test.js.map +1 -1
  92. package/build/__tests__/behavioral/BootingTheCli.test.js.map +1 -1
  93. package/build/__tests__/behavioral/BootingWithBadFiles.test.js.map +1 -1
  94. package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
  95. package/build/__tests__/behavioral/CreatingSchemasWithGenerics.test.js.map +1 -1
  96. package/build/__tests__/behavioral/DeployingASkill.test.js.map +1 -1
  97. package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
  98. package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js.map +1 -1
  99. package/build/__tests__/behavioral/GettingCliVersion.test.js.map +1 -1
  100. package/build/__tests__/behavioral/InstallingASkillAtAnOrg.test.js.map +1 -1
  101. package/build/__tests__/behavioral/ListeningToCoreEvents.test.js.map +1 -1
  102. package/build/__tests__/behavioral/LoggingInAsASkill.test.js.map +1 -1
  103. package/build/__tests__/behavioral/ManagingDependencies.test.js.map +1 -1
  104. package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js.map +1 -1
  105. package/build/__tests__/behavioral/RebuildingASkill.test.js.map +1 -1
  106. package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js.map +1 -1
  107. package/build/__tests__/behavioral/RegisteringEventsOnBoot.test.js.map +1 -1
  108. package/build/__tests__/behavioral/RegisteringGlobalEvents.test.js.map +1 -1
  109. package/build/__tests__/behavioral/RegisteringSkillViewOnBoot.test.js.map +1 -1
  110. package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js.map +1 -1
  111. package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
  112. package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
  113. package/build/__tests__/behavioral/SettingUpASkillForTesting.test.js.map +1 -1
  114. package/build/__tests__/behavioral/SettingUpSchemasForModuleDistribution.test.js.map +1 -1
  115. package/build/__tests__/behavioral/SettingUpVscode.test.js.map +1 -1
  116. package/build/__tests__/behavioral/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
  117. package/build/__tests__/behavioral/TestReporterSettingsRemembered.test.js.map +1 -1
  118. package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
  119. package/build/__tests__/behavioral/TestingDataStores.test.js.map +1 -1
  120. package/build/__tests__/behavioral/WatchingSkillViews.test.js.map +1 -1
  121. package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js.map +1 -1
  122. package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js.map +1 -1
  123. package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js.map +1 -1
  124. package/build/__tests__/behavioral/errors/SettingUpErrors.test.js.map +1 -1
  125. package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
  126. package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
  127. package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
  128. package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js.map +1 -1
  129. package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js.map +1 -1
  130. package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -1
  131. package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -1
  132. package/build/__tests__/behavioral/events/SettingUpEvents.test.js.map +1 -1
  133. package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
  134. package/build/__tests__/behavioral/node/CreatingANodeModule.test.js.map +1 -1
  135. package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
  136. package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
  137. package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js.map +1 -1
  138. package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
  139. package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js.map +1 -1
  140. package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js.map +1 -1
  141. package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
  142. package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js.map +1 -1
  143. package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js.map +1 -1
  144. package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js.map +1 -1
  145. package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js.map +1 -1
  146. package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js.map +1 -1
  147. package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js.map +1 -1
  148. package/build/__tests__/behavioral/skill/BootingASkill.test.js.map +1 -1
  149. package/build/__tests__/behavioral/skill/CreatingASkill.test.js.map +1 -1
  150. package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
  151. package/build/__tests__/behavioral/skill/SettingUpASkill.test.js.map +1 -1
  152. package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
  153. package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
  154. package/build/__tests__/behavioral/tests/CreatingATest.test.js +3 -3
  155. package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
  156. package/build/__tests__/behavioral/tests/RunningTests.test.js.map +1 -1
  157. package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
  158. package/build/__tests__/behavioral/tests/SettingUpTests.test.js.map +1 -1
  159. package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js.map +1 -1
  160. package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js.map +1 -1
  161. package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
  162. package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js.map +1 -1
  163. package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js.map +1 -1
  164. package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
  165. package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
  166. package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
  167. package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js.map +1 -1
  168. package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js.map +1 -1
  169. package/build/__tests__/behavioral/views/CreatingASkillView.test.js +1 -1
  170. package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
  171. package/build/__tests__/behavioral/views/CreatingATheme.test.js.map +1 -1
  172. package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
  173. package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
  174. package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
  175. package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js.map +1 -1
  176. package/build/__tests__/implementation/ActionExecuter.test.js.map +1 -1
  177. package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
  178. package/build/__tests__/implementation/ActionExecuter3.test.js.map +1 -1
  179. package/build/__tests__/implementation/ActionExecuter4.test.js.map +1 -1
  180. package/build/__tests__/implementation/ArgParser.test.js.map +1 -1
  181. package/build/__tests__/implementation/BuildService.test.js.map +1 -1
  182. package/build/__tests__/implementation/BulkImporting.test.js.map +1 -1
  183. package/build/__tests__/implementation/CachingImports.test.js.map +1 -1
  184. package/build/__tests__/implementation/CommandOptionBuilder.test.js.map +1 -1
  185. package/build/__tests__/implementation/CommanderCommandResultMapper.test.js.map +1 -1
  186. package/build/__tests__/implementation/DataStoreStore.test.js.map +1 -1
  187. package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js.map +1 -1
  188. package/build/__tests__/implementation/EventContractCleanerUtil.test.js.map +1 -1
  189. package/build/__tests__/implementation/EventStore.test.js.map +1 -1
  190. package/build/__tests__/implementation/EventTemplateItemBuilder.test.js.map +1 -1
  191. package/build/__tests__/implementation/FeatureCommandAttacher.test.js.map +1 -1
  192. package/build/__tests__/implementation/FeatureFixture.test.js.map +1 -1
  193. package/build/__tests__/implementation/FeatureInstaller.test.js.map +1 -1
  194. package/build/__tests__/implementation/FeaturesUtil.test.js.map +1 -1
  195. package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js.map +1 -1
  196. package/build/__tests__/implementation/GlobalEmitter.js.map +1 -1
  197. package/build/__tests__/implementation/Introspection.test.js.map +1 -1
  198. package/build/__tests__/implementation/JestJsonParser.test.js.map +1 -1
  199. package/build/__tests__/implementation/LintService.test.js.map +1 -1
  200. package/build/__tests__/implementation/ListenerStore.test.js.map +1 -1
  201. package/build/__tests__/implementation/OnboardingScriptLoader.test.js.map +1 -1
  202. package/build/__tests__/implementation/OnboardingScriptPlayer.test.js.map +1 -1
  203. package/build/__tests__/implementation/OnboardingStore.test.js.map +1 -1
  204. package/build/__tests__/implementation/OrganizationStore.test.js.map +1 -1
  205. package/build/__tests__/implementation/ParentTestFinder.test.js.map +1 -1
  206. package/build/__tests__/implementation/PkgService.test.js.map +1 -1
  207. package/build/__tests__/implementation/SchemaStore.test.js.map +1 -1
  208. package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js.map +1 -1
  209. package/build/__tests__/implementation/SchemaValueTypeWriter.test.js.map +1 -1
  210. package/build/__tests__/implementation/ServiceFactory.test.js.map +1 -1
  211. package/build/__tests__/implementation/SettingUpANodeModule.test.js.map +1 -1
  212. package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
  213. package/build/__tests__/implementation/StoreFeature.test.js.map +1 -1
  214. package/build/__tests__/implementation/TestReporter.test.js.map +1 -1
  215. package/build/__tests__/implementation/TestRunner.test.js.map +1 -1
  216. package/build/__tests__/implementation/ValueTypeMapping.test.js.map +1 -1
  217. package/build/__tests__/implementation/Widgets.test.js.map +1 -1
  218. package/build/__tests__/support/scripts/first.script.js.map +1 -1
  219. package/build/addons/filePrompt.addon.js.map +1 -1
  220. package/build/cli.js.map +1 -1
  221. package/build/components/FormComponent.js.map +1 -1
  222. package/build/components/QuizComponent.js.map +1 -1
  223. package/build/errors/SpruceError.js.map +1 -1
  224. package/build/errors/actionCancelled.builder.js.map +1 -1
  225. package/build/errors/bootError.builder.js.map +1 -1
  226. package/build/errors/buildFailed.builder.js.map +1 -1
  227. package/build/errors/cacheNotEnabled.builder.js.map +1 -1
  228. package/build/errors/commandAborted.builder.js.map +1 -1
  229. package/build/errors/commandBlocked.builder.js.map +1 -1
  230. package/build/errors/commandNotImplemented.builder.js.map +1 -1
  231. package/build/errors/createAutoloaderFailed.builder.js.map +1 -1
  232. package/build/errors/dependencyExists.builder.js.map +1 -1
  233. package/build/errors/deployFailed.builder.js.map +1 -1
  234. package/build/errors/directoryEmpty.builder.js.map +1 -1
  235. package/build/errors/directoryNotSkill.builder.js.map +1 -1
  236. package/build/errors/dockerNotStarted.builder.js.map +1 -1
  237. package/build/errors/executingCommandFailed.builder.js.map +1 -1
  238. package/build/errors/failedToImport.builder.js.map +1 -1
  239. package/build/errors/featureNotInstalled.builder.js.map +1 -1
  240. package/build/errors/fileExists.builder.js.map +1 -1
  241. package/build/errors/generic.builder.js.map +1 -1
  242. package/build/errors/invalidCommand.builder.js.map +1 -1
  243. package/build/errors/invalidEventContract.builder.js.map +1 -1
  244. package/build/errors/invalidFeatureCode.builder.js.map +1 -1
  245. package/build/errors/invalidTestDirectory.builder.js.map +1 -1
  246. package/build/errors/lintFailed.builder.js.map +1 -1
  247. package/build/errors/mercuryResponseError.builder.js.map +1 -1
  248. package/build/errors/missingDependencies.builder.js.map +1 -1
  249. package/build/errors/noOrganizationsFound.builder.js.map +1 -1
  250. package/build/errors/noSkillsRegistered.builder.js.map +1 -1
  251. package/build/errors/notImplemented.builder.js.map +1 -1
  252. package/build/errors/notLoggedIn.builder.js.map +1 -1
  253. package/build/errors/schemaExists.builder.js.map +1 -1
  254. package/build/errors/schemaFailedToImport.builder.js.map +1 -1
  255. package/build/errors/schemaTemplateItemBuildingFailed.builder.js.map +1 -1
  256. package/build/errors/skillNotFound.builder.js.map +1 -1
  257. package/build/errors/skillNotRegistered.builder.js.map +1 -1
  258. package/build/errors/skillViewExists.builder.js.map +1 -1
  259. package/build/errors/storeExists.builder.js.map +1 -1
  260. package/build/errors/testFailed.builder.js.map +1 -1
  261. package/build/errors/themeExists.builder.js.map +1 -1
  262. package/build/errors/transportAlreadyExists.builder.js.map +1 -1
  263. package/build/errors/vscodeNotInstalled.builder.js.map +1 -1
  264. package/build/features/AbstractAction.js.map +1 -1
  265. package/build/features/AbstractFeature.js.map +1 -1
  266. package/build/features/ActionExecuter.js.map +1 -1
  267. package/build/features/ActionFactory.js.map +1 -1
  268. package/build/features/ActionQuestionAsker.js.map +1 -1
  269. package/build/features/FeatureCommandAttacher.js.map +1 -1
  270. package/build/features/FeatureInstaller.js.map +1 -1
  271. package/build/features/OverrideActionDecorator.js.map +1 -1
  272. package/build/features/cache/CacheFeature.js.map +1 -1
  273. package/build/features/cache/actions/DisableAction.js.map +1 -1
  274. package/build/features/cache/actions/EnableAction.js.map +1 -1
  275. package/build/features/conversation/ConversationFeature.js.map +1 -1
  276. package/build/features/conversation/actions/TestAction.js.map +1 -1
  277. package/build/features/conversation/stores/ConversationStore.js.map +1 -1
  278. package/build/features/conversation/writers/ConversationWriter.js.map +1 -1
  279. package/build/features/dependencies/DependencyFeature.js.map +1 -1
  280. package/build/features/dependencies/actions/AddAction.js.map +1 -1
  281. package/build/features/dependencies/actions/ManageAction.js.map +1 -1
  282. package/build/features/deploy/DeployFeature.js.map +1 -1
  283. package/build/features/deploy/actions/HerokuAction.js.map +1 -1
  284. package/build/features/deploy/writers/DeployWriter.js.map +1 -1
  285. package/build/features/error/ErrorFeature.js.map +1 -1
  286. package/build/features/error/ParentTestFinder.js.map +1 -1
  287. package/build/features/error/actions/CreateAction.js.map +1 -1
  288. package/build/features/error/actions/SyncAction.js.map +1 -1
  289. package/build/features/error/writers/ErrorWriter.js.map +1 -1
  290. package/build/features/event/EventFeature.js.map +1 -1
  291. package/build/features/event/actions/CreateAction.js.map +1 -1
  292. package/build/features/event/actions/ListenAction.js.map +1 -1
  293. package/build/features/event/actions/SetRemoteAction.js.map +1 -1
  294. package/build/features/event/actions/SyncAction.js.map +1 -1
  295. package/build/features/event/actions/SyncListenersAction.js.map +1 -1
  296. package/build/features/event/builders/EventContractBuilder.js.map +1 -1
  297. package/build/features/event/builders/ListenerTemplateItemBuilder.js.map +1 -1
  298. package/build/features/event/stores/EventStore.js.map +1 -1
  299. package/build/features/event/stores/ListenerStore.js.map +1 -1
  300. package/build/features/event/writers/EventWriter.js.map +1 -1
  301. package/build/features/eventContract/EventContractFeature.js.map +1 -1
  302. package/build/features/eventContract/actions/PullAction.js.map +1 -1
  303. package/build/features/feature.utilities.js.map +1 -1
  304. package/build/features/features.types.js.map +1 -1
  305. package/build/features/log/LogFeature.js.map +1 -1
  306. package/build/features/log/actions/CreateTransportAction.js.map +1 -1
  307. package/build/features/log/writers/LogWriter.js.map +1 -1
  308. package/build/features/node/NodeFeature.js.map +1 -1
  309. package/build/features/node/actions/UpdateDependenciesAction.js.map +1 -1
  310. package/build/features/node/actions/UpgradeAction.js.map +1 -1
  311. package/build/features/node/writers/NodeWriter.js.map +1 -1
  312. package/build/features/onboard/OnboardFeature.js.map +1 -1
  313. package/build/features/onboard/ScriptLoader.js.map +1 -1
  314. package/build/features/onboard/scripts/onboarding.first.script.js.map +1 -1
  315. package/build/features/onboard/scripts/onboarding.immersive.script.js.map +1 -1
  316. package/build/features/onboard/scripts/onboarding.returning.script.js.map +1 -1
  317. package/build/features/onboard/scripts/onboarding.short.script.js.map +1 -1
  318. package/build/features/onboard/scripts/wrongCommand.script.js.map +1 -1
  319. package/build/features/onboard/stores/OnboardingStore.js.map +1 -1
  320. package/build/features/organization/OrganizationFeature.js.map +1 -1
  321. package/build/features/organization/stores/OrganizationStore.js.map +1 -1
  322. package/build/features/person/PersonFeature.js.map +1 -1
  323. package/build/features/person/actions/LoginAction.js.map +1 -1
  324. package/build/features/person/actions/LogoutAction.js.map +1 -1
  325. package/build/features/person/actions/WhoamiAction.js.map +1 -1
  326. package/build/features/sandbox/SandboxFeature.js.map +1 -1
  327. package/build/features/sandbox/actions/SetupAction.js.map +1 -1
  328. package/build/features/sandbox/writers/SandboxWriter.js.map +1 -1
  329. package/build/features/schema/SchemaFeature.js.map +1 -1
  330. package/build/features/schema/ValueTypeBuilder.js.map +1 -1
  331. package/build/features/schema/actions/CreateAction.js.map +1 -1
  332. package/build/features/schema/actions/SyncAction.js.map +1 -1
  333. package/build/features/schema/actions/SyncFieldsAction.js.map +1 -1
  334. package/build/features/schema/services/SchemaService.js.map +1 -1
  335. package/build/features/schema/stores/SchemaStore.d.ts +2 -1
  336. package/build/features/schema/stores/SchemaStore.js +2 -1
  337. package/build/features/schema/stores/SchemaStore.js.map +1 -1
  338. package/build/features/schema/utilities/schema.utility.js.map +1 -1
  339. package/build/features/schema/utilities/schemaDisk.utility.js.map +1 -1
  340. package/build/features/schema/utilities/schemaGenerator.utility.js.map +1 -1
  341. package/build/features/schema/writers/SchemaWriter.js.map +1 -1
  342. package/build/features/skill/SkillFeature.js.map +1 -1
  343. package/build/features/skill/actions/BootAction.js.map +1 -1
  344. package/build/features/skill/actions/CreateAction.js.map +1 -1
  345. package/build/features/skill/actions/DashboardAction.js.map +1 -1
  346. package/build/features/skill/actions/LoginAction.js.map +1 -1
  347. package/build/features/skill/actions/RebuildAction.js.map +1 -1
  348. package/build/features/skill/actions/RegisterAction.js.map +1 -1
  349. package/build/features/skill/stores/SkillStore.js.map +1 -1
  350. package/build/features/skill/updaters/Updater.js.map +1 -1
  351. package/build/features/skill/writers/SkillWriter.js.map +1 -1
  352. package/build/features/store/StoreFeature.js.map +1 -1
  353. package/build/features/store/actions/CreateAction.js.map +1 -1
  354. package/build/features/store/actions/SyncAction.js.map +1 -1
  355. package/build/features/store/stores/StoreStore.js.map +1 -1
  356. package/build/features/store/templateItemBuilders/StoreTemplateItemBuilder.js.map +1 -1
  357. package/build/features/store/writers/StoreWriter.js.map +1 -1
  358. package/build/features/test/TestFeature.js.map +1 -1
  359. package/build/features/test/TestLogItemGenerator.js.map +1 -1
  360. package/build/features/test/TestReporter.js.map +1 -1
  361. package/build/features/test/TestRunner.js.map +1 -1
  362. package/build/features/test/actions/CreateAction.js.map +1 -1
  363. package/build/features/test/actions/SetupAction.js.map +1 -1
  364. package/build/features/test/actions/TestAction.js.map +1 -1
  365. package/build/features/test/writers/TestWriter.js.map +1 -1
  366. package/build/features/validateAndNormalize.utility.js.map +1 -1
  367. package/build/features/view/ViewFeature.js.map +1 -1
  368. package/build/features/view/actions/CreateAction.js.map +1 -1
  369. package/build/features/view/actions/CreateThemeAction.js.map +1 -1
  370. package/build/features/view/actions/SyncAction.js.map +1 -1
  371. package/build/features/view/actions/WatchAction.js.map +1 -1
  372. package/build/features/view/stores/ViewStore.js.map +1 -1
  373. package/build/features/view/writers/ViewWriter.js.map +1 -1
  374. package/build/features/vscode/VsCodeFeature.js.map +1 -1
  375. package/build/features/vscode/services/VsCodeService.js.map +1 -1
  376. package/build/features/vscode/writers/VsCodeWriter.js.map +1 -1
  377. package/build/features/watch/WatchFeature.js.map +1 -1
  378. package/build/index.js.map +1 -1
  379. package/build/interfaces/SpyInterface.js +0 -1
  380. package/build/interfaces/SpyInterface.js.map +1 -1
  381. package/build/interfaces/TerminalInterface.js.map +1 -1
  382. package/build/schemas/v2020_07_22/bootSkillOptions.builder.js.map +1 -1
  383. package/build/schemas/v2020_07_22/createConversationTopicOptions.builder.js.map +1 -1
  384. package/build/schemas/v2020_07_22/createErrorOptions.builder.js.map +1 -1
  385. package/build/schemas/v2020_07_22/createOrganizationOptions.builder.js.map +1 -1
  386. package/build/schemas/v2020_07_22/createSchemaOptions.builder.js.map +1 -1
  387. package/build/schemas/v2020_07_22/createTestOptions.builder.js.map +1 -1
  388. package/build/schemas/v2020_07_22/installSkillAtOrganizationOptions.builder.js.map +1 -1
  389. package/build/schemas/v2020_07_22/listenEventOptions.builder.js.map +1 -1
  390. package/build/schemas/v2020_07_22/namedTemplateItem.builder.js.map +1 -1
  391. package/build/schemas/v2020_07_22/nodeFeatureOptions.builder.js.map +1 -1
  392. package/build/schemas/v2020_07_22/onboardOptions.builder.js.map +1 -1
  393. package/build/schemas/v2020_07_22/onboarding.builder.js.map +1 -1
  394. package/build/schemas/v2020_07_22/personWithToken.builder.js.map +1 -1
  395. package/build/schemas/v2020_07_22/registerDashboardWidgetsEmitPayloadSchema.builder.js.map +1 -1
  396. package/build/schemas/v2020_07_22/setupTestsOptions.builder.js.map +1 -1
  397. package/build/schemas/v2020_07_22/setupVscodeOptions.builder.js.map +1 -1
  398. package/build/schemas/v2020_07_22/skillFeature.builder.js.map +1 -1
  399. package/build/schemas/v2020_07_22/syncErrorOptions.builder.js.map +1 -1
  400. package/build/schemas/v2020_07_22/syncEventOptions.builder.js.map +1 -1
  401. package/build/schemas/v2020_07_22/syncSchemaFieldsOptions.builder.js.map +1 -1
  402. package/build/schemas/v2020_07_22/syncSchemasOptions.builder.js.map +1 -1
  403. package/build/schemas/v2020_07_22/testOptions.builder.js.map +1 -1
  404. package/build/schemas/v2020_07_22/upgradeSkillOptions.builder.js.map +1 -1
  405. package/build/schemas/v2020_07_22/watcherDidDetectChangesEmitPayload.builder.js.map +1 -1
  406. package/build/services/CommandService.js.map +1 -1
  407. package/build/services/GameService.js.map +1 -1
  408. package/build/services/ImportService.js.map +1 -1
  409. package/build/services/LintService.js.map +1 -1
  410. package/build/services/PkgService.js.map +1 -1
  411. package/build/services/ServiceFactory.js.map +1 -1
  412. package/build/templateItemBuilders/EventTemplateItemBuilder.js.map +1 -1
  413. package/build/templateItemBuilders/FieldTemplateItemBuilder.js.map +1 -1
  414. package/build/templateItemBuilders/SchemaTemplateItemBuilder.js.map +1 -1
  415. package/build/tests/AbstractCliTest.js.map +1 -1
  416. package/build/tests/AbstractEventTest.js.map +1 -1
  417. package/build/tests/AbstractSchemaTest.js.map +1 -1
  418. package/build/tests/AbstractTestTest.js.map +1 -1
  419. package/build/tests/CommandFaker.js.map +1 -1
  420. package/build/tests/JestJsonParser.js.map +1 -1
  421. package/build/tests/buildTestCache.js.map +1 -1
  422. package/build/tests/cleanTestCache.js.map +1 -1
  423. package/build/tests/cleanTestData.js.map +1 -1
  424. package/build/tests/fixtures/FeatureFixture.js.map +1 -1
  425. package/build/tests/fixtures/MercuryFixture.js.map +1 -1
  426. package/build/tests/fixtures/PersonFixture.js.map +1 -1
  427. package/build/tests/fixtures/SkillFixture.js.map +1 -1
  428. package/build/tests/utilities/test.utility.js.map +1 -1
  429. package/build/tests/utilities/uiAssert.utility.js.map +1 -1
  430. package/build/utilities/action.utility.js.map +1 -1
  431. package/build/utilities/commander.utility.js.map +1 -1
  432. package/build/utilities/eventContractCleaner.utility.js.map +1 -1
  433. package/build/utilities/form.utility.js.map +1 -1
  434. package/build/utilities/introspection.utility.js.map +1 -1
  435. package/build/utilities/tsConfig.utility.js.map +1 -1
  436. package/build/widgets/Theme.js.map +1 -1
  437. package/build/widgets/WidgetFactory.js.map +1 -1
  438. package/build/widgets/terminalKit/TKButtonWidget.js.map +1 -1
  439. package/build/widgets/terminalKit/TkInputWidget.js.map +1 -1
  440. package/build/widgets/terminalKit/TkLayoutWidget.js.map +1 -1
  441. package/build/widgets/terminalKit/TkMenuBarWidget.js.map +1 -1
  442. package/build/widgets/terminalKit/TkPopupWidget.js.map +1 -1
  443. package/build/widgets/terminalKit/TkTextWidget.js.map +1 -1
  444. package/build/widgets/terminalKit/termKit.utility.js.map +1 -1
  445. package/build/widgets/types/input.types.js.map +1 -1
  446. package/build/widgets/types/menuBar.types.js.map +1 -1
  447. package/build/widgets/types/text.types.js.map +1 -1
  448. package/build/widgets/types/window.types.js.map +1 -1
  449. package/build/writers/AbstractWriter.js.map +1 -1
  450. package/package.json +35 -35
  451. package/src/__tests__/behavioral/views/CreatingASkillView.test.ts +3 -2
  452. package/src/features/schema/stores/SchemaStore.ts +4 -2
  453. package/build/.spruce/schemas/spruce/v2020_07_22/fullMessageChoices.schema.d.ts +0 -1
  454. package/build/.spruce/schemas/spruce/v2020_07_22/fullMessageChoices.schema.js +0 -14
  455. package/build/.spruce/schemas/spruce/v2020_07_22/fullMessageChoices.schema.js.map +0 -1
  456. package/src/.spruce/schemas/spruce/v2020_07_22/fullMessageChoices.schema.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EventWriter.js","names":["CONTRACT_FILE_NAME","EventWriter","destinationDir","options","eventContractTemplateItems","shouldImportCoreEvents","generated","item","push","writeContract","eventContractTemplateItem","writeCombinedEvents","templateItems","Promise","all","lint","schemaTemplateItems","destinationFile","diskUtil","resolvePath","namespaceCamel","generateEventContractFileName","eventsContractContents","templates","eventContract","writeFileIfChangedMixinResults","Object","keys","eventSignatures","results","cwd","doesHashSprucePathExist","path","resolveHashSprucePath","doesFileExist","contents","combinedEventsContract","schemaTypesLookupDir","fullyQualifiedEventName","event","eventNameUtil","split","resolvedDestination","eventDiskUtil","resolveListenerPath","relativeTypesFile","resolveSchemaTypesFile","namespace","eventNamespace","listenerContents","listener","schemaTypesFile","destination","listeners","version","nameKebab","nameCamel","nameReadable","isGlobal","templateMethod","name","action","description","context","files","file","resolveEventPath","fileName","eventName","writeFile","pathUtil","join","DEFAULT_SCHEMA_TYPES_FILENAME","resolveRelativePath","dirname","replace","extname","AbstractWriter"],"sources":["../../../../src/features/event/writers/EventWriter.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { SchemaTemplateItem } from '@sprucelabs/schema'\nimport { eventDiskUtil, eventNameUtil } from '@sprucelabs/spruce-event-utils'\nimport {\n\tdiskUtil,\n\tDEFAULT_SCHEMA_TYPES_FILENAME,\n} from '@sprucelabs/spruce-skill-utils'\nimport {\n\tEventContractTemplateItem,\n\tEventListenerOptions,\n\tListenerTemplateItem,\n} from '@sprucelabs/spruce-templates'\nimport { GeneratedFile } from '../../../types/cli.types'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nconst CONTRACT_FILE_NAME = `events.contract.ts`\nexport default class EventWriter extends AbstractWriter {\n\tpublic async writeContracts(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\teventContractTemplateItems: EventContractTemplateItem[]\n\t\t\tschemaTemplateItems: SchemaTemplateItem[]\n\t\t\tshouldImportCoreEvents?: boolean\n\t\t\tskillEventContractTypesFile: string\n\t\t\teventBuilderFile: string\n\t\t}\n\t) {\n\t\tconst { eventContractTemplateItems, shouldImportCoreEvents = true } =\n\t\t\toptions\n\n\t\tconst generated: Promise<GeneratedFile>[] = []\n\n\t\tfor (const item of eventContractTemplateItems) {\n\t\t\tgenerated.push(\n\t\t\t\tthis.writeContract({\n\t\t\t\t\t...options,\n\t\t\t\t\tdestinationDir,\n\t\t\t\t\teventContractTemplateItem: item,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tgenerated.push(\n\t\t\tthis.writeCombinedEvents({\n\t\t\t\t...options,\n\t\t\t\tshouldImportCoreEvents,\n\t\t\t\tdestinationDir,\n\t\t\t\ttemplateItems: eventContractTemplateItems,\n\t\t\t})\n\t\t)\n\n\t\tconst all = await Promise.all(generated)\n\n\t\tawait this.lint(destinationDir)\n\n\t\treturn all\n\t}\n\n\tprivate async writeContract(options: {\n\t\tdestinationDir: string\n\t\teventContractTemplateItem: EventContractTemplateItem\n\t\tschemaTemplateItems: SchemaTemplateItem[]\n\t\teventBuilderFile: string\n\t}): Promise<GeneratedFile> {\n\t\tconst { destinationDir, eventContractTemplateItem, schemaTemplateItems } =\n\t\t\toptions\n\n\t\tconst destinationFile = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\teventContractTemplateItem.namespaceCamel,\n\t\t\tgenerateEventContractFileName(eventContractTemplateItem)\n\t\t)\n\n\t\tconst eventsContractContents = this.templates.eventContract({\n\t\t\t...options,\n\t\t\t...eventContractTemplateItem,\n\t\t\tschemaTemplateItems,\n\t\t})\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestinationFile,\n\t\t\teventsContractContents,\n\t\t\t`The event contract for ${\n\t\t\t\tObject.keys(eventContractTemplateItem.eventSignatures)[0]\n\t\t\t}`\n\t\t)\n\n\t\treturn results[0]\n\t}\n\n\tpublic hasCombinedContractBeenWritten(cwd: string) {\n\t\tif (diskUtil.doesHashSprucePathExist(cwd)) {\n\t\t\tconst path = diskUtil.resolveHashSprucePath(\n\t\t\t\tcwd,\n\t\t\t\t'events',\n\t\t\t\tCONTRACT_FILE_NAME\n\t\t\t)\n\n\t\t\treturn diskUtil.doesFileExist(path)\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprivate async writeCombinedEvents(options: {\n\t\tdestinationDir: string\n\t\ttemplateItems: EventContractTemplateItem[]\n\t\tshouldImportCoreEvents?: boolean\n\t\tskillEventContractTypesFile: string\n\t}): Promise<GeneratedFile> {\n\t\tconst { destinationDir } = options\n\n\t\tconst destinationFile = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\tCONTRACT_FILE_NAME\n\t\t)\n\n\t\tconst contents = this.templates.combinedEventsContract(options)\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestinationFile,\n\t\t\tcontents,\n\t\t\t'All event contracts combined to a single export.'\n\t\t)\n\n\t\treturn results[0]\n\t}\n\n\tpublic async writeListener(\n\t\tdestinationDir: string,\n\t\toptions: Omit<EventListenerOptions, 'schemaTypesFile'> & {\n\t\t\tschemaTypesLookupDir: string\n\t\t}\n\t) {\n\t\tconst { schemaTypesLookupDir, fullyQualifiedEventName } = options\n\n\t\tconst event = eventNameUtil.split(fullyQualifiedEventName)\n\t\tconst resolvedDestination = eventDiskUtil.resolveListenerPath(\n\t\t\tdestinationDir,\n\t\t\tevent as any\n\t\t)\n\n\t\tconst relativeTypesFile = this.resolveSchemaTypesFile({\n\t\t\tnamespace: event.eventNamespace,\n\t\t\tschemaTypesLookupDir,\n\t\t\tresolvedDestination,\n\t\t})\n\n\t\tconst listenerContents = this.templates.listener({\n\t\t\t...options,\n\t\t\tschemaTypesFile: relativeTypesFile,\n\t\t})\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tresolvedDestination,\n\t\t\tlistenerContents,\n\t\t\t`Listener for ${fullyQualifiedEventName}.`\n\t\t)\n\n\t\tawait this.lint(resolvedDestination)\n\n\t\treturn results\n\t}\n\n\tpublic async writeListenerMap(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\tlisteners: ListenerTemplateItem[]\n\t\t}\n\t) {\n\t\tconst destination = diskUtil.resolvePath(destinationDir, 'listeners.ts')\n\t\tconst contents = this.templates.listeners({ listeners: options.listeners })\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tcontents,\n\t\t\t'All your listeners imported to one place for your skill to use when booting!'\n\t\t)\n\n\t\treturn results\n\t}\n\n\tpublic async writeEvent(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\tnameCamel: string\n\t\t\tnameKebab: string\n\t\t\tversion: string\n\t\t\tnameReadable: string\n\t\t\tisGlobal?: boolean\n\t\t}\n\t) {\n\t\tconst {\n\t\t\tversion,\n\t\t\tnameKebab,\n\t\t\tnameCamel,\n\t\t\tnameReadable,\n\t\t\tisGlobal = false,\n\t\t} = options\n\n\t\tconst templates: ({\n\t\t\tcontext?: any\n\t\t\ttemplateMethod:\n\t\t\t\t| 'eventEmitPayload'\n\t\t\t\t| 'eventEmitTarget'\n\t\t\t\t| 'eventResponsePayload'\n\t\t\t\t| 'permissionContractBuilder'\n\t\t\t\t| 'eventOptions'\n\t\t} & Omit<GeneratedFile, 'path'>)[] = [\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventEmitPayload',\n\t\t\t\tname: 'emitPayload.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'The payload that will be sent when you emit this event.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventEmitTarget',\n\t\t\t\tname: 'emitTarget.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'The target that will be sent when you emit this event.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventResponsePayload',\n\t\t\t\tname: 'responsePayload.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription:\n\t\t\t\t\t'The payload that every listener will need to respond with. Delete this file for events that are fire and forget.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'permissionContractBuilder',\n\t\t\t\tname: 'emitPermissions.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'Permissions someone else will need to emit your event.',\n\t\t\t\tcontext: {\n\t\t\t\t\tnameCamel: nameCamel + 'Emit',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'permissionContractBuilder',\n\t\t\t\tname: 'listenPermissions.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription:\n\t\t\t\t\t'Permissions someone else will need to listen to your event.',\n\t\t\t\tcontext: {\n\t\t\t\t\tnameCamel: nameCamel + 'Listen',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventOptions',\n\t\t\t\tname: 'event.options.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'Extra options that can be set for your event',\n\t\t\t\tcontext: {\n\t\t\t\t\tisGlobal,\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\n\t\tconst files: GeneratedFile[] = []\n\n\t\tfor (const file of templates) {\n\t\t\tconst destination = eventDiskUtil.resolveEventPath(destinationDir, {\n\t\t\t\tfileName: file.name as any,\n\t\t\t\teventName: nameKebab,\n\t\t\t\tversion,\n\t\t\t})\n\n\t\t\tconst contents = this.templates[file.templateMethod]({\n\t\t\t\tnameCamel,\n\t\t\t\tnameReadable,\n\t\t\t\tversion,\n\t\t\t\t...file.context,\n\t\t\t})\n\n\t\t\tdiskUtil.writeFile(destination, contents)\n\n\t\t\tfiles.push({\n\t\t\t\t...file,\n\t\t\t\tpath: destination,\n\t\t\t})\n\t\t}\n\n\t\tawait this.lint(destinationDir)\n\n\t\treturn files\n\t}\n\n\tprivate resolveSchemaTypesFile(options: {\n\t\tnamespace?: string\n\t\tschemaTypesLookupDir: string\n\t\tresolvedDestination: string\n\t}) {\n\t\tconst { schemaTypesLookupDir, resolvedDestination, namespace } = options\n\n\t\tif (!namespace) {\n\t\t\treturn '@sprucelabs/mercury-types'\n\t\t}\n\n\t\tconst schemaTypesFile = pathUtil.join(\n\t\t\tschemaTypesLookupDir,\n\t\t\tDEFAULT_SCHEMA_TYPES_FILENAME\n\t\t)\n\n\t\tlet relativeTypesFile = diskUtil.resolveRelativePath(\n\t\t\tpathUtil.dirname(resolvedDestination),\n\t\t\tschemaTypesFile\n\t\t)\n\n\t\trelativeTypesFile = relativeTypesFile.replace(\n\t\t\tpathUtil.extname(relativeTypesFile),\n\t\t\t''\n\t\t)\n\n\t\treturn relativeTypesFile\n\t}\n}\n\nexport function generateEventContractFileName(options: {\n\tnameCamel: string\n\tversion: string\n}): string {\n\treturn `${options.nameCamel}.${options.version}.contract.ts`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAUA;;;;;;;;;;;;;;;;AAEA,IAAMA,kBAAkB,uBAAxB;;IACqBC,W;;;;;;;;;;;;;0GACpB,iBACCC,cADD,EAECC,OAFD;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAUSC,0BAVT,GAWED,OAXF,CAUSC,0BAVT,0BAWED,OAXF,CAUqCE,sBAVrC,EAUqCA,sBAVrC,sCAU8D,IAV9D;gBAaOC,SAbP,GAa6C,EAb7C;gBAAA,uCAeoBF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H,OAAO,EAAPA;kBAHgB,GAIbW,IAAI,CAACF,OAJQ,EAPY;;kBAc7B7C,2BAASmD,SAAT,CAAmBjB,WAAnB,EAAgCjB,QAAhC;;kBAEA6B,KAAK,CAACxD,IAAN,iCACIyD,IADJ;oBAECjC,IAAI,EAAEoB;kBAFP;gBAIA;;gBAlGF;gBAAA,OAoGO,KAAKrC,IAAL,CAAUb,cAAV,CApGP;;cAAA;gBAAA,kCAsGQ8D,KAtGR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAyGA,gCAA+B7D,OAA/B,EAIG;MACF,IAAQkC,oBAAR,GAAiElC,OAAjE,CAAQkC,oBAAR;MAAA,IAA8BK,mBAA9B,GAAiEvC,OAAjE,CAA8BuC,mBAA9B;MAAA,IAAmDK,SAAnD,GAAiE5C,OAAjE,CAAmD4C,SAAnD;;MAEA,IAAI,CAACA,SAAL,EAAgB;QACf,OAAO,2BAAP;MACA;;MAED,IAAMI,eAAe,GAAGmB,iBAASC,IAAT,CACvBlC,oBADuB,EAEvBmC,+CAFuB,CAAxB;;MAKA,IAAI3B,iBAAiB,GAAG3B,2BAASuD,mBAAT,CACvBH,iBAASI,OAAT,CAAiBhC,mBAAjB,CADuB,EAEvBS,eAFuB,CAAxB;;MAKAN,iBAAiB,GAAGA,iBAAiB,CAAC8B,OAAlB,CACnBL,iBAASM,OAAT,CAAiB/B,iBAAjB,CADmB,EAEnB,EAFmB,CAApB;MAKA,OAAOA,iBAAP;IACA;;;EA1SuCgC,2B;;;;AA6SlC,SAASxD,6BAAT,CAAuClB,OAAvC,EAGI;EACV,iBAAUA,OAAO,CAACqD,SAAlB,cAA+BrD,OAAO,CAACmD,OAAvC;AACA"}
1
+ {"version":3,"file":"EventWriter.js","names":["CONTRACT_FILE_NAME","EventWriter","destinationDir","options","eventContractTemplateItems","shouldImportCoreEvents","generated","item","push","writeContract","eventContractTemplateItem","writeCombinedEvents","templateItems","Promise","all","lint","schemaTemplateItems","destinationFile","diskUtil","resolvePath","namespaceCamel","generateEventContractFileName","eventsContractContents","templates","eventContract","writeFileIfChangedMixinResults","Object","keys","eventSignatures","results","cwd","doesHashSprucePathExist","path","resolveHashSprucePath","doesFileExist","contents","combinedEventsContract","schemaTypesLookupDir","fullyQualifiedEventName","event","eventNameUtil","split","resolvedDestination","eventDiskUtil","resolveListenerPath","relativeTypesFile","resolveSchemaTypesFile","namespace","eventNamespace","listenerContents","listener","schemaTypesFile","destination","listeners","version","nameKebab","nameCamel","nameReadable","isGlobal","templateMethod","name","action","description","context","files","file","resolveEventPath","fileName","eventName","writeFile","pathUtil","join","DEFAULT_SCHEMA_TYPES_FILENAME","resolveRelativePath","dirname","replace","extname","AbstractWriter"],"sources":["../../../../src/features/event/writers/EventWriter.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { SchemaTemplateItem } from '@sprucelabs/schema'\nimport { eventDiskUtil, eventNameUtil } from '@sprucelabs/spruce-event-utils'\nimport {\n\tdiskUtil,\n\tDEFAULT_SCHEMA_TYPES_FILENAME,\n} from '@sprucelabs/spruce-skill-utils'\nimport {\n\tEventContractTemplateItem,\n\tEventListenerOptions,\n\tListenerTemplateItem,\n} from '@sprucelabs/spruce-templates'\nimport { GeneratedFile } from '../../../types/cli.types'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nconst CONTRACT_FILE_NAME = `events.contract.ts`\nexport default class EventWriter extends AbstractWriter {\n\tpublic async writeContracts(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\teventContractTemplateItems: EventContractTemplateItem[]\n\t\t\tschemaTemplateItems: SchemaTemplateItem[]\n\t\t\tshouldImportCoreEvents?: boolean\n\t\t\tskillEventContractTypesFile: string\n\t\t\teventBuilderFile: string\n\t\t}\n\t) {\n\t\tconst { eventContractTemplateItems, shouldImportCoreEvents = true } =\n\t\t\toptions\n\n\t\tconst generated: Promise<GeneratedFile>[] = []\n\n\t\tfor (const item of eventContractTemplateItems) {\n\t\t\tgenerated.push(\n\t\t\t\tthis.writeContract({\n\t\t\t\t\t...options,\n\t\t\t\t\tdestinationDir,\n\t\t\t\t\teventContractTemplateItem: item,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\n\t\tgenerated.push(\n\t\t\tthis.writeCombinedEvents({\n\t\t\t\t...options,\n\t\t\t\tshouldImportCoreEvents,\n\t\t\t\tdestinationDir,\n\t\t\t\ttemplateItems: eventContractTemplateItems,\n\t\t\t})\n\t\t)\n\n\t\tconst all = await Promise.all(generated)\n\n\t\tawait this.lint(destinationDir)\n\n\t\treturn all\n\t}\n\n\tprivate async writeContract(options: {\n\t\tdestinationDir: string\n\t\teventContractTemplateItem: EventContractTemplateItem\n\t\tschemaTemplateItems: SchemaTemplateItem[]\n\t\teventBuilderFile: string\n\t}): Promise<GeneratedFile> {\n\t\tconst { destinationDir, eventContractTemplateItem, schemaTemplateItems } =\n\t\t\toptions\n\n\t\tconst destinationFile = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\teventContractTemplateItem.namespaceCamel,\n\t\t\tgenerateEventContractFileName(eventContractTemplateItem)\n\t\t)\n\n\t\tconst eventsContractContents = this.templates.eventContract({\n\t\t\t...options,\n\t\t\t...eventContractTemplateItem,\n\t\t\tschemaTemplateItems,\n\t\t})\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestinationFile,\n\t\t\teventsContractContents,\n\t\t\t`The event contract for ${\n\t\t\t\tObject.keys(eventContractTemplateItem.eventSignatures)[0]\n\t\t\t}`\n\t\t)\n\n\t\treturn results[0]\n\t}\n\n\tpublic hasCombinedContractBeenWritten(cwd: string) {\n\t\tif (diskUtil.doesHashSprucePathExist(cwd)) {\n\t\t\tconst path = diskUtil.resolveHashSprucePath(\n\t\t\t\tcwd,\n\t\t\t\t'events',\n\t\t\t\tCONTRACT_FILE_NAME\n\t\t\t)\n\n\t\t\treturn diskUtil.doesFileExist(path)\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprivate async writeCombinedEvents(options: {\n\t\tdestinationDir: string\n\t\ttemplateItems: EventContractTemplateItem[]\n\t\tshouldImportCoreEvents?: boolean\n\t\tskillEventContractTypesFile: string\n\t}): Promise<GeneratedFile> {\n\t\tconst { destinationDir } = options\n\n\t\tconst destinationFile = diskUtil.resolvePath(\n\t\t\tdestinationDir,\n\t\t\tCONTRACT_FILE_NAME\n\t\t)\n\n\t\tconst contents = this.templates.combinedEventsContract(options)\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestinationFile,\n\t\t\tcontents,\n\t\t\t'All event contracts combined to a single export.'\n\t\t)\n\n\t\treturn results[0]\n\t}\n\n\tpublic async writeListener(\n\t\tdestinationDir: string,\n\t\toptions: Omit<EventListenerOptions, 'schemaTypesFile'> & {\n\t\t\tschemaTypesLookupDir: string\n\t\t}\n\t) {\n\t\tconst { schemaTypesLookupDir, fullyQualifiedEventName } = options\n\n\t\tconst event = eventNameUtil.split(fullyQualifiedEventName)\n\t\tconst resolvedDestination = eventDiskUtil.resolveListenerPath(\n\t\t\tdestinationDir,\n\t\t\tevent as any\n\t\t)\n\n\t\tconst relativeTypesFile = this.resolveSchemaTypesFile({\n\t\t\tnamespace: event.eventNamespace,\n\t\t\tschemaTypesLookupDir,\n\t\t\tresolvedDestination,\n\t\t})\n\n\t\tconst listenerContents = this.templates.listener({\n\t\t\t...options,\n\t\t\tschemaTypesFile: relativeTypesFile,\n\t\t})\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tresolvedDestination,\n\t\t\tlistenerContents,\n\t\t\t`Listener for ${fullyQualifiedEventName}.`\n\t\t)\n\n\t\tawait this.lint(resolvedDestination)\n\n\t\treturn results\n\t}\n\n\tpublic async writeListenerMap(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\tlisteners: ListenerTemplateItem[]\n\t\t}\n\t) {\n\t\tconst destination = diskUtil.resolvePath(destinationDir, 'listeners.ts')\n\t\tconst contents = this.templates.listeners({ listeners: options.listeners })\n\n\t\tconst results = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tcontents,\n\t\t\t'All your listeners imported to one place for your skill to use when booting!'\n\t\t)\n\n\t\treturn results\n\t}\n\n\tpublic async writeEvent(\n\t\tdestinationDir: string,\n\t\toptions: {\n\t\t\tnameCamel: string\n\t\t\tnameKebab: string\n\t\t\tversion: string\n\t\t\tnameReadable: string\n\t\t\tisGlobal?: boolean\n\t\t}\n\t) {\n\t\tconst {\n\t\t\tversion,\n\t\t\tnameKebab,\n\t\t\tnameCamel,\n\t\t\tnameReadable,\n\t\t\tisGlobal = false,\n\t\t} = options\n\n\t\tconst templates: ({\n\t\t\tcontext?: any\n\t\t\ttemplateMethod:\n\t\t\t\t| 'eventEmitPayload'\n\t\t\t\t| 'eventEmitTarget'\n\t\t\t\t| 'eventResponsePayload'\n\t\t\t\t| 'permissionContractBuilder'\n\t\t\t\t| 'eventOptions'\n\t\t} & Omit<GeneratedFile, 'path'>)[] = [\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventEmitPayload',\n\t\t\t\tname: 'emitPayload.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'The payload that will be sent when you emit this event.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventEmitTarget',\n\t\t\t\tname: 'emitTarget.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'The target that will be sent when you emit this event.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventResponsePayload',\n\t\t\t\tname: 'responsePayload.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription:\n\t\t\t\t\t'The payload that every listener will need to respond with. Delete this file for events that are fire and forget.',\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'permissionContractBuilder',\n\t\t\t\tname: 'emitPermissions.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'Permissions someone else will need to emit your event.',\n\t\t\t\tcontext: {\n\t\t\t\t\tnameCamel: nameCamel + 'Emit',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'permissionContractBuilder',\n\t\t\t\tname: 'listenPermissions.builder.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription:\n\t\t\t\t\t'Permissions someone else will need to listen to your event.',\n\t\t\t\tcontext: {\n\t\t\t\t\tnameCamel: nameCamel + 'Listen',\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttemplateMethod: 'eventOptions',\n\t\t\t\tname: 'event.options.ts',\n\t\t\t\taction: 'generated',\n\t\t\t\tdescription: 'Extra options that can be set for your event',\n\t\t\t\tcontext: {\n\t\t\t\t\tisGlobal,\n\t\t\t\t},\n\t\t\t},\n\t\t]\n\n\t\tconst files: GeneratedFile[] = []\n\n\t\tfor (const file of templates) {\n\t\t\tconst destination = eventDiskUtil.resolveEventPath(destinationDir, {\n\t\t\t\tfileName: file.name as any,\n\t\t\t\teventName: nameKebab,\n\t\t\t\tversion,\n\t\t\t})\n\n\t\t\tconst contents = this.templates[file.templateMethod]({\n\t\t\t\tnameCamel,\n\t\t\t\tnameReadable,\n\t\t\t\tversion,\n\t\t\t\t...file.context,\n\t\t\t})\n\n\t\t\tdiskUtil.writeFile(destination, contents)\n\n\t\t\tfiles.push({\n\t\t\t\t...file,\n\t\t\t\tpath: destination,\n\t\t\t})\n\t\t}\n\n\t\tawait this.lint(destinationDir)\n\n\t\treturn files\n\t}\n\n\tprivate resolveSchemaTypesFile(options: {\n\t\tnamespace?: string\n\t\tschemaTypesLookupDir: string\n\t\tresolvedDestination: string\n\t}) {\n\t\tconst { schemaTypesLookupDir, resolvedDestination, namespace } = options\n\n\t\tif (!namespace) {\n\t\t\treturn '@sprucelabs/mercury-types'\n\t\t}\n\n\t\tconst schemaTypesFile = pathUtil.join(\n\t\t\tschemaTypesLookupDir,\n\t\t\tDEFAULT_SCHEMA_TYPES_FILENAME\n\t\t)\n\n\t\tlet relativeTypesFile = diskUtil.resolveRelativePath(\n\t\t\tpathUtil.dirname(resolvedDestination),\n\t\t\tschemaTypesFile\n\t\t)\n\n\t\trelativeTypesFile = relativeTypesFile.replace(\n\t\t\tpathUtil.extname(relativeTypesFile),\n\t\t\t''\n\t\t)\n\n\t\treturn relativeTypesFile\n\t}\n}\n\nexport function generateEventContractFileName(options: {\n\tnameCamel: string\n\tversion: string\n}): string {\n\treturn `${options.nameCamel}.${options.version}.contract.ts`\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAUA;;;;;;;;;;;;;;;;AAEA,IAAMA,kBAAkB,uBAAxB;;IACqBC,W;;;;;;;;;;;;;0GACpB,iBACCC,cADD,EAECC,OAFD;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAUSC,0BAVT,GAWED,OAXF,CAUSC,0BAVT,0BAWED,OAXF,CAUqCE,sBAVrC,EAUqCA,sBAVrC,sCAU8D,IAV9D;gBAaOC,SAbP,GAa6C,EAb7C;gBAAA,uCAeoBF,0BAfpB;;gBAAA;kBAeC,oDAA+C;oBAApCG,IAAoC;oBAC9CD,SAAS,CAACE,IAAV,CACC,KAAKC,aAAL,iCACIN,OADJ;sBAECD,cAAc,EAAdA,cAFD;sBAGCQ,yBAAyB,EAAEH;oBAH5B,GADD;kBAOA;gBAvBF;kBAAA;gBAAA;kBAAA;gBAAA;;gBAyBCD,SAAS,CAACE,IAAV,CACC,KAAKG,mBAAL,iCACIR,OADJ;kBAECE,sBAAsB,EAAtBA,sBAFD;kBAGCH,cAAc,EAAdA,cAHD;kBAICU,aAAa,EAAER;gBAJhB,GADD;gBAzBD;gBAAA,OAkCmBS,OAAO,CAACC,GAAR,CAAYR,SAAZ,CAlCnB;;cAAA;gBAkCOQ,GAlCP;gBAAA;gBAAA,OAoCO,KAAKC,IAAL,CAAUb,cAAV,CApCP;;cAAA;gBAAA,iCAsCQY,GAtCR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;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C,SAAnD;;MAEA,IAAI,CAACA,SAAL,EAAgB;QACf,OAAO,2BAAP;MACA;;MAED,IAAMI,eAAe,GAAGmB,gBAAA,CAASC,IAAT,CACvBlC,oBADuB,EAEvBmC,+CAFuB,CAAxB;;MAKA,IAAI3B,iBAAiB,GAAG3B,0BAAA,CAASuD,mBAAT,CACvBH,gBAAA,CAASI,OAAT,CAAiBhC,mBAAjB,CADuB,EAEvBS,eAFuB,CAAxB;;MAKAN,iBAAiB,GAAGA,iBAAiB,CAAC8B,OAAlB,CACnBL,gBAAA,CAASM,OAAT,CAAiB/B,iBAAjB,CADmB,EAEnB,EAFmB,CAApB;MAKA,OAAOA,iBAAP;IACA;;;EA1SuCgC,2B;;;;AA6SlC,SAASxD,6BAAT,CAAuClB,OAAvC,EAGI;EACV,iBAAUA,OAAO,CAACqD,SAAlB,cAA+BrD,OAAO,CAACmD,OAAvC;AACA"}
@@ -1 +1 @@
1
- {"version":3,"file":"EventContractFeature.js","names":["EventContractFeature","diskUtil","resolvePath","__dirname","AbstractFeature"],"sources":["../../../src/features/eventContract/EventContractFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { FileDescription } from '../../types/cli.types'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\teventContract: EventContractFeature\n\t}\n}\n\nexport default class EventContractFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'eventContract'\n\tpublic nameReadable = 'Event Contract'\n\tpublic description =\n\t\t'Pull core Mercury events down and write to single, portable, dependency-free, strongly typed contract.'\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\tpublic readonly fileDescriptions: FileDescription[] = []\n\n\tpublic isInstalled = async () => true\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;IASqBA,oB;;;;;;;;;;;;;;;6FACO,e;qGACL,gB;oGAErB,wG;qGAC0C,E;4GACd,E;mGAETC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;yGACkC,E;+LAEjC;MAAA;QAAA;UAAA;YAAA;cAAA,iCAAY,IAAZ;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,C;;;;;EAX4BC,4B"}
1
+ {"version":3,"file":"EventContractFeature.js","names":["EventContractFeature","diskUtil","resolvePath","__dirname","AbstractFeature"],"sources":["../../../src/features/eventContract/EventContractFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { FileDescription } from '../../types/cli.types'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport { FeatureCode } from '../features.types'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\teventContract: EventContractFeature\n\t}\n}\n\nexport default class EventContractFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'eventContract'\n\tpublic nameReadable = 'Event Contract'\n\tpublic description =\n\t\t'Pull core Mercury events down and write to single, portable, dependency-free, strongly typed contract.'\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\tpublic readonly fileDescriptions: FileDescription[] = []\n\n\tpublic isInstalled = async () => true\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA;;;;;;IASqBA,oB;;;;;;;;;;;;;;;6FACO,e;qGACL,gB;oGAErB,wG;qGAC0C,E;4GACd,E;mGAETC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;yGACkC,E;+LAEjC;MAAA;QAAA;UAAA;YAAA;cAAA,iCAAY,IAAZ;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,C;;;;;EAX4BC,4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"PullAction.js","names":["pullOptionsSchema","id","description","fields","destination","type","label","hint","PullAction","options","validateAndNormalizeOptions","filename","diskUtil","resolvePath","cwd","Store","fetchEventContracts","contracts","buildEventContractImport","contents","map","c","JSON","stringify","join","_","idx","action","doesFileExist","writeFile","files","name","path","AbstractAction"],"sources":["../../../../src/features/eventContract/actions/PullAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst pullOptionsSchema = buildSchema({\n\tid: 'pullActionSchema',\n\tdescription:\n\t\t'Pulls the event contracts from Mercury down to a single file for easy distribution.',\n\tfields: {\n\t\tdestination: {\n\t\t\ttype: 'text',\n\t\t\tlabel: 'Destination',\n\t\t\thint: 'File is always named `events.contract.ts`.',\n\t\t},\n\t},\n})\ntype PullOptionsSchema = typeof pullOptionsSchema\ntype Options = SchemaValues<PullOptionsSchema>\n\nexport default class PullAction extends AbstractAction<PullOptionsSchema> {\n\tpublic commandAliases = ['pull.event.contracts']\n\tpublic optionsSchema = pullOptionsSchema\n\tpublic invocationMessage = 'Pulling combined event contract... 🜒'\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tlet { destination = '.' } = this.validateAndNormalizeOptions(options)\n\n\t\tconst filename = 'events.contract.ts'\n\t\tdestination = diskUtil.resolvePath(this.cwd, destination, filename)\n\n\t\tconst { contracts } = await this.Store('event').fetchEventContracts()\n\t\tlet buildEventContractImport = `import { buildEventContract } from '@sprucelabs/mercury-types'`\n\n\t\tconst contents = `${buildEventContractImport}\nconst eventContracts = [${contracts\n\t\t\t.map((c) => `buildEventContract(${JSON.stringify(c, null, 2)})`)\n\t\t\t.join(',\\n')}] as const\n\n\nexport default eventContracts\nexport type CoreEventContract = ${contracts\n\t\t\t.map((_, idx) => `typeof eventContracts[${idx}]`)\n\t\t\t.join(' & ')}\n`\n\n\t\tconst action = diskUtil.doesFileExist(destination) ? 'updated' : 'generated'\n\n\t\tdiskUtil.writeFile(destination, contents)\n\n\t\treturn {\n\t\t\tfiles: [\n\t\t\t\t{\n\t\t\t\t\tname: filename,\n\t\t\t\t\tpath: destination,\n\t\t\t\t\taction,\n\t\t\t\t\tdescription: 'All your Mercury core events ready for testing!',\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAGA,IAAMA,iBAAiB,GAAG,yBAAY;EACrCC,EAAE,EAAE,kBADiC;EAErCC,WAAW,EACV,qFAHoC;EAIrCC,MAAM,EAAE;IACPC,WAAW,EAAE;MACZC,IAAI,EAAE,MADM;MAEZC,KAAK,EAAE,aAFK;MAGZC,IAAI,EAAE;IAHM;EADN;AAJ6B,CAAZ,CAA1B;;IAeqBC,U;;;;;;;;;;;;;;;uGACI,CAAC,sBAAD,C;sGACDR,iB;0GACI,uC;;;;;;;mGAE3B,iBAAqBS,OAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA,wBAC6B,KAAKC,2BAAL,CAAiCD,OAAjC,CAD7B,iDACOL,WADP,EACOA,WADP,uCACqB,GADrB;gBAGOO,QAHP,GAGkB,oBAHlB;gBAICP,WAAW,GAAGQ,2BAASC,WAAT,CAAqB,KAAKC,GAA1B,EAA+BV,WAA/B,EAA4CO,QAA5C,CAAd;gBAJD;gBAAA,OAM6B,KAAKI,KAAL,CAAW,OAAX,EAAoBC,mBAApB,EAN7B;;cAAA;gBAAA;gBAMSC,SANT,yBAMSA,SANT;gBAOKC,wBAPL;gBASOC,QATP,aASqBD,wBATrB,uCAUyBD,SAAS,CAC/BG,GADsB,CAClB,UAACC,CAAD;kBAAA,oCAA6BC,IAAI,CAACC,SAAL,CAAeF,CAAf,EAAkB,IAAlB,EAAwB,CAAxB,CAA7B;gBAAA,CADkB,EAEtBG,IAFsB,CAEjB,KAFiB,CAVzB,4FAgBiCP,SAAS,CACvCG,GAD8B,CAC1B,UAACK,CAAD,EAAIC,GAAJ;kBAAA,uCAAqCA,GAArC;gBAAA,CAD0B,EAE9BF,IAF8B,CAEzB,KAFyB,CAhBjC;gBAqBOG,MArBP,GAqBgBf,2BAASgB,aAAT,CAAuBxB,WAAvB,IAAsC,SAAtC,GAAkD,WArBlE;;gBAuBCQ,2BAASiB,SAAT,CAAmBzB,WAAnB,EAAgCe,QAAhC;;gBAvBD,iCAyBQ;kBACNW,KAAK,EAAE,CACN;oBACCC,IAAI,EAAEpB,QADP;oBAECqB,IAAI,EAAE5B,WAFP;oBAGCuB,MAAM,EAANA,MAHD;oBAICzB,WAAW,EAAE;kBAJd,CADM;gBADD,CAzBR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EALuC+B,2B"}
1
+ {"version":3,"file":"PullAction.js","names":["pullOptionsSchema","buildSchema","id","description","fields","destination","type","label","hint","PullAction","options","validateAndNormalizeOptions","filename","diskUtil","resolvePath","cwd","Store","fetchEventContracts","contracts","buildEventContractImport","contents","map","c","JSON","stringify","join","_","idx","action","doesFileExist","writeFile","files","name","path","AbstractAction"],"sources":["../../../../src/features/eventContract/actions/PullAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst pullOptionsSchema = buildSchema({\n\tid: 'pullActionSchema',\n\tdescription:\n\t\t'Pulls the event contracts from Mercury down to a single file for easy distribution.',\n\tfields: {\n\t\tdestination: {\n\t\t\ttype: 'text',\n\t\t\tlabel: 'Destination',\n\t\t\thint: 'File is always named `events.contract.ts`.',\n\t\t},\n\t},\n})\ntype PullOptionsSchema = typeof pullOptionsSchema\ntype Options = SchemaValues<PullOptionsSchema>\n\nexport default class PullAction extends AbstractAction<PullOptionsSchema> {\n\tpublic commandAliases = ['pull.event.contracts']\n\tpublic optionsSchema = pullOptionsSchema\n\tpublic invocationMessage = 'Pulling combined event contract... 🜒'\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tlet { destination = '.' } = this.validateAndNormalizeOptions(options)\n\n\t\tconst filename = 'events.contract.ts'\n\t\tdestination = diskUtil.resolvePath(this.cwd, destination, filename)\n\n\t\tconst { contracts } = await this.Store('event').fetchEventContracts()\n\t\tlet buildEventContractImport = `import { buildEventContract } from '@sprucelabs/mercury-types'`\n\n\t\tconst contents = `${buildEventContractImport}\nconst eventContracts = [${contracts\n\t\t\t.map((c) => `buildEventContract(${JSON.stringify(c, null, 2)})`)\n\t\t\t.join(',\\n')}] as const\n\n\nexport default eventContracts\nexport type CoreEventContract = ${contracts\n\t\t\t.map((_, idx) => `typeof eventContracts[${idx}]`)\n\t\t\t.join(' & ')}\n`\n\n\t\tconst action = diskUtil.doesFileExist(destination) ? 'updated' : 'generated'\n\n\t\tdiskUtil.writeFile(destination, contents)\n\n\t\treturn {\n\t\t\tfiles: [\n\t\t\t\t{\n\t\t\t\t\tname: filename,\n\t\t\t\t\tpath: destination,\n\t\t\t\t\taction,\n\t\t\t\t\tdescription: 'All your Mercury core events ready for testing!',\n\t\t\t\t},\n\t\t\t],\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAGA,IAAMA,iBAAiB,GAAG,IAAAC,mBAAA,EAAY;EACrCC,EAAE,EAAE,kBADiC;EAErCC,WAAW,EACV,qFAHoC;EAIrCC,MAAM,EAAE;IACPC,WAAW,EAAE;MACZC,IAAI,EAAE,MADM;MAEZC,KAAK,EAAE,aAFK;MAGZC,IAAI,EAAE;IAHM;EADN;AAJ6B,CAAZ,CAA1B;;IAeqBC,U;;;;;;;;;;;;;;;uGACI,CAAC,sBAAD,C;sGACDT,iB;0GACI,uC;;;;;;;mGAE3B,iBAAqBU,OAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA,wBAC6B,KAAKC,2BAAL,CAAiCD,OAAjC,CAD7B,iDACOL,WADP,EACOA,WADP,uCACqB,GADrB;gBAGOO,QAHP,GAGkB,oBAHlB;gBAICP,WAAW,GAAGQ,0BAAA,CAASC,WAAT,CAAqB,KAAKC,GAA1B,EAA+BV,WAA/B,EAA4CO,QAA5C,CAAd;gBAJD;gBAAA,OAM6B,KAAKI,KAAL,CAAW,OAAX,EAAoBC,mBAApB,EAN7B;;cAAA;gBAAA;gBAMSC,SANT,yBAMSA,SANT;gBAOKC,wBAPL;gBASOC,QATP,aASqBD,wBATrB,uCAUyBD,SAAS,CAC/BG,GADsB,CAClB,UAACC,CAAD;kBAAA,oCAA6BC,IAAI,CAACC,SAAL,CAAeF,CAAf,EAAkB,IAAlB,EAAwB,CAAxB,CAA7B;gBAAA,CADkB,EAEtBG,IAFsB,CAEjB,KAFiB,CAVzB,4FAgBiCP,SAAS,CACvCG,GAD8B,CAC1B,UAACK,CAAD,EAAIC,GAAJ;kBAAA,uCAAqCA,GAArC;gBAAA,CAD0B,EAE9BF,IAF8B,CAEzB,KAFyB,CAhBjC;gBAqBOG,MArBP,GAqBgBf,0BAAA,CAASgB,aAAT,CAAuBxB,WAAvB,IAAsC,SAAtC,GAAkD,WArBlE;;gBAuBCQ,0BAAA,CAASiB,SAAT,CAAmBzB,WAAnB,EAAgCe,QAAhC;;gBAvBD,iCAyBQ;kBACNW,KAAK,EAAE,CACN;oBACCC,IAAI,EAAEpB,QADP;oBAECqB,IAAI,EAAE5B,WAFP;oBAGCuB,MAAM,EAANA,MAHD;oBAICzB,WAAW,EAAE;kBAJd,CADM;gBADD,CAzBR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EALuC+B,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.utilities.js","names":["featuresUtil","filePathToActionCode","path","parts","split","pathUtil","sep","name","pop","ext","extname","nameNoExt","substr","length","code","replace","namesUtil","toCamel","generateCommand","featureCode","actionCode","generateCommandsIncludingAliases","action","baseCommand","aliases","commandAliases","generateOptionAliases","schema","fields","Object","keys","forEach","fieldName","fullName","placeholder","field","type","fullNameWithPlaceholder"],"sources":["../../src/features/feature.utilities.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { Schema } from '@sprucelabs/schema'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport { FeatureAction } from './features.types'\n\nconst featuresUtil = {\n\tfilePathToActionCode(path: string): string {\n\t\tconst parts = path.split(pathUtil.sep)\n\t\tconst name = parts.pop() ?? ''\n\t\tconst ext = pathUtil.extname(name)\n\t\tconst nameNoExt = name.substr(0, name.length - ext.length)\n\t\tconst code = nameNoExt.replace('Action', '')\n\n\t\treturn namesUtil.toCamel(code)\n\t},\n\n\tgenerateCommand(featureCode: string, actionCode: string) {\n\t\tif (featureCode === actionCode) {\n\t\t\treturn featureCode\n\t\t}\n\n\t\treturn `${actionCode}.${featureCode}`\n\t},\n\n\tgenerateCommandsIncludingAliases(\n\t\tfeatureCode: string,\n\t\tactionCode: string,\n\t\taction: FeatureAction\n\t) {\n\t\tconst baseCommand = this.generateCommand(featureCode, actionCode)\n\t\tconst aliases = action.commandAliases ?? []\n\n\t\treturn [baseCommand, ...aliases]\n\t},\n\n\tgenerateOptionAliases(schema: Schema): Record<string, string> {\n\t\tconst fields = schema.fields || {}\n\t\tconst aliases: Record<string, string> = {}\n\n\t\tObject.keys(fields).forEach((fieldName: string) => {\n\t\t\tconst fullName = `${fieldName}`\n\n\t\t\tlet placeholder = ''\n\t\t\tconst field = fields[fieldName]\n\t\t\tconst type = field.type\n\t\t\tif (type !== 'boolean') {\n\t\t\t\tplaceholder = ` <${fullName}>`\n\t\t\t} else {\n\t\t\t\tplaceholder = ` [true|false]`\n\t\t\t}\n\n\t\t\tconst fullNameWithPlaceholder = `--${fullName}${placeholder}`\n\n\t\t\taliases[fieldName] = fullNameWithPlaceholder\n\t\t})\n\n\t\treturn aliases\n\t},\n}\n\nexport default featuresUtil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,QAAQ,aAAMD,SAAN,CAAd;MAEA,IAAIE,WAAW,GAAG,EAAlB;MACA,IAAMC,KAAK,GAAGP,MAAM,CAACI,SAAD,CAApB;MACA,IAAMI,IAAI,GAAGD,KAAK,CAACC,IAAnB;;MACA,IAAIA,IAAI,KAAK,SAAb,EAAwB;QACvBF,WAAW,eAAQD,QAAR,MAAX;MACA,CAFD,MAEO;QACNC,WAAW,kBAAX;MACA;;MAED,IAAMG,uBAAuB,eAAQJ,QAAR,SAAmBC,WAAnB,CAA7B;MAEAV,OAAO,CAACQ,SAAD,CAAP,GAAqBK,uBAArB;IACA,CAfD;IAiBA,OAAOb,OAAP;EACA;AApDmB,CAArB;eAuDexB,Y"}
1
+ {"version":3,"file":"feature.utilities.js","names":["featuresUtil","filePathToActionCode","path","parts","split","pathUtil","sep","name","pop","ext","extname","nameNoExt","substr","length","code","replace","namesUtil","toCamel","generateCommand","featureCode","actionCode","generateCommandsIncludingAliases","action","baseCommand","aliases","commandAliases","generateOptionAliases","schema","fields","Object","keys","forEach","fieldName","fullName","placeholder","field","type","fullNameWithPlaceholder"],"sources":["../../src/features/feature.utilities.ts"],"sourcesContent":["import pathUtil from 'path'\nimport { Schema } from '@sprucelabs/schema'\nimport { namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport { FeatureAction } from './features.types'\n\nconst featuresUtil = {\n\tfilePathToActionCode(path: string): string {\n\t\tconst parts = path.split(pathUtil.sep)\n\t\tconst name = parts.pop() ?? ''\n\t\tconst ext = pathUtil.extname(name)\n\t\tconst nameNoExt = name.substr(0, name.length - ext.length)\n\t\tconst code = nameNoExt.replace('Action', '')\n\n\t\treturn namesUtil.toCamel(code)\n\t},\n\n\tgenerateCommand(featureCode: string, actionCode: string) {\n\t\tif (featureCode === actionCode) {\n\t\t\treturn featureCode\n\t\t}\n\n\t\treturn `${actionCode}.${featureCode}`\n\t},\n\n\tgenerateCommandsIncludingAliases(\n\t\tfeatureCode: string,\n\t\tactionCode: string,\n\t\taction: FeatureAction\n\t) {\n\t\tconst baseCommand = this.generateCommand(featureCode, actionCode)\n\t\tconst aliases = action.commandAliases ?? []\n\n\t\treturn [baseCommand, ...aliases]\n\t},\n\n\tgenerateOptionAliases(schema: Schema): Record<string, string> {\n\t\tconst fields = schema.fields || {}\n\t\tconst aliases: Record<string, string> = {}\n\n\t\tObject.keys(fields).forEach((fieldName: string) => {\n\t\t\tconst fullName = `${fieldName}`\n\n\t\t\tlet placeholder = ''\n\t\t\tconst field = fields[fieldName]\n\t\t\tconst type = field.type\n\t\t\tif (type !== 'boolean') {\n\t\t\t\tplaceholder = ` <${fullName}>`\n\t\t\t} else {\n\t\t\t\tplaceholder = ` [true|false]`\n\t\t\t}\n\n\t\t\tconst fullNameWithPlaceholder = `--${fullName}${placeholder}`\n\n\t\t\taliases[fieldName] = fullNameWithPlaceholder\n\t\t})\n\n\t\treturn aliases\n\t},\n}\n\nexport default featuresUtil\n"],"mappings":";;;;;;;;;;;AAAA;;AAEA;;AAGA,IAAMA,YAAY,GAAG;EACpBC,oBADoB,gCACCC,IADD,EACuB;IAAA;;IAC1C,IAAMC,KAAK,GAAGD,IAAI,CAACE,KAAL,CAAWC,gBAAA,CAASC,GAApB,CAAd;IACA,IAAMC,IAAI,iBAAGJ,KAAK,CAACK,GAAN,EAAH,mDAAkB,EAA5B;;IACA,IAAMC,GAAG,GAAGJ,gBAAA,CAASK,OAAT,CAAiBH,IAAjB,CAAZ;;IACA,IAAMI,SAAS,GAAGJ,IAAI,CAACK,MAAL,CAAY,CAAZ,EAAeL,IAAI,CAACM,MAAL,GAAcJ,GAAG,CAACI,MAAjC,CAAlB;IACA,IAAMC,IAAI,GAAGH,SAAS,CAACI,OAAV,CAAkB,QAAlB,EAA4B,EAA5B,CAAb;IAEA,OAAOC,2BAAA,CAAUC,OAAV,CAAkBH,IAAlB,CAAP;EACA,CATmB;EAWpBI,eAXoB,2BAWJC,WAXI,EAWiBC,UAXjB,EAWqC;IACxD,IAAID,WAAW,KAAKC,UAApB,EAAgC;MAC/B,OAAOD,WAAP;IACA;;IAED,iBAAUC,UAAV,cAAwBD,WAAxB;EACA,CAjBmB;EAmBpBE,gCAnBoB,4CAoBnBF,WApBmB,EAqBnBC,UArBmB,EAsBnBE,MAtBmB,EAuBlB;IAAA;;IACD,IAAMC,WAAW,GAAG,KAAKL,eAAL,CAAqBC,WAArB,EAAkCC,UAAlC,CAApB;IACA,IAAMI,OAAO,4BAAGF,MAAM,CAACG,cAAV,yEAA4B,EAAzC;IAEA,QAAQF,WAAR,6CAAwBC,OAAxB;EACA,CA5BmB;EA8BpBE,qBA9BoB,iCA8BEC,MA9BF,EA8B0C;IAC7D,IAAMC,MAAM,GAAGD,MAAM,CAACC,MAAP,IAAiB,EAAhC;IACA,IAAMJ,OAA+B,GAAG,EAAxC;IAEAK,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBG,OAApB,CAA4B,UAACC,SAAD,EAAuB;MAClD,IAAMC,QAAQ,aAAMD,SAAN,CAAd;MAEA,IAAIE,WAAW,GAAG,EAAlB;MACA,IAAMC,KAAK,GAAGP,MAAM,CAACI,SAAD,CAApB;MACA,IAAMI,IAAI,GAAGD,KAAK,CAACC,IAAnB;;MACA,IAAIA,IAAI,KAAK,SAAb,EAAwB;QACvBF,WAAW,eAAQD,QAAR,MAAX;MACA,CAFD,MAEO;QACNC,WAAW,kBAAX;MACA;;MAED,IAAMG,uBAAuB,eAAQJ,QAAR,SAAmBC,WAAnB,CAA7B;MAEAV,OAAO,CAACQ,SAAD,CAAP,GAAqBK,uBAArB;IACA,CAfD;IAiBA,OAAOb,OAAP;EACA;AApDmB,CAArB;eAuDexB,Y"}
@@ -1 +1 @@
1
- {"version":3,"file":"features.types.js","names":["actionResponseSchema","id","fields","files","type","isArray","options","schema","generatedFileSchema","headline","hints","summaryLines","errors","valueType","meta"],"sources":["../../src/features/features.types.ts"],"sourcesContent":["import { buildSchema, Schema, SchemaValues } from '@sprucelabs/schema'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport generatedFileSchema from '#spruce/schemas/spruceCli/v2020_07_22/generatedFile.schema'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\nimport {\n\tGeneratedFile,\n\tNpmPackage,\n\tInternalUpdateHandler,\n} from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport WriterFactory from '../writers/WriterFactory'\nimport AbstractFeature from './AbstractFeature'\nimport ActionExecuter from './ActionExecuter'\nimport FeatureInstaller from './FeatureInstaller'\n\nexport interface FeatureMap {}\nexport interface FeatureOptionsMap {}\n\nexport type InstallFeature<\n\tKeys extends keyof FeatureOptionsMap = keyof FeatureOptionsMap\n> = {\n\t[Key in Keys]: Omit<\n\t\t{\n\t\t\tcode: Key\n\t\t\toptions: FeatureOptionsMap[Key]\n\t\t},\n\t\tFeatureOptionsMap[Key] extends Record<string, any> ? never : 'options'\n\t>\n}[Keys]\n\nexport interface ActionOptions {\n\ttemplates: Templates\n\tserviceFactory: ServiceFactory\n\tcwd: string\n\tparent: AbstractFeature\n\tstoreFactory: StoreFactory\n\tfeatureInstaller: FeatureInstaller\n\tui: GraphicsInterface\n\twriterFactory: WriterFactory\n\temitter: GlobalEmitter\n\tactionExecuter: ActionExecuter\n\tapiClientFactory: ApiClientFactory\n}\n\nexport type FeatureCode = keyof FeatureMap\n\nexport type FeatureExecuteOptions<F extends FeatureCode> =\n\tFeatureMap[F]['optionsSchema'] extends Schema\n\t\t? SchemaValues<FeatureMap[F]['optionsSchema']>\n\t\t: undefined\n\nexport interface InstallFeatureOptions {\n\tfeatures: InstallFeature[]\n\tinstallFeatureDependencies?: boolean\n\tdidUpdateHandler?: InternalUpdateHandler\n}\n\nexport const actionResponseSchema = buildSchema({\n\tid: 'actionResponse',\n\tfields: {\n\t\tfiles: {\n\t\t\ttype: 'schema',\n\t\t\tisArray: true,\n\t\t\toptions: {\n\t\t\t\tschema: generatedFileSchema,\n\t\t\t},\n\t\t},\n\t\theadline: {\n\t\t\ttype: 'text',\n\t\t},\n\t\thints: {\n\t\t\ttype: 'text',\n\t\t\tisArray: true,\n\t\t},\n\t\tsummaryLines: {\n\t\t\ttype: 'text',\n\t\t\tisArray: true,\n\t\t},\n\t\terrors: {\n\t\t\ttype: 'raw',\n\t\t\tisArray: true,\n\t\t\toptions: {\n\t\t\t\tvalueType: 'SpruceError<any>',\n\t\t\t},\n\t\t},\n\t\tmeta: {\n\t\t\ttype: 'raw',\n\t\t\toptions: {\n\t\t\t\tvalueType: 'Record<string, any>',\n\t\t\t},\n\t\t},\n\t},\n})\n\nexport interface FeatureInstallResponse {\n\tfiles?: GeneratedFile[]\n\tpackagesInstalled?: NpmPackage[]\n}\n\nexport type FeatureActionResponse = SchemaValues<typeof actionResponseSchema> &\n\tFeatureInstallResponse\n\nexport interface FeatureAction<S extends Schema = Schema> {\n\toptionsSchema?: S\n\tcommandAliases: string[]\n\tinvocationMessage: string\n\texecute: (options: SchemaValues<S>) => Promise<FeatureActionResponse>\n}\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AA0DO,IAAMA,oBAAoB,GAAG,yBAAY;EAC/CC,EAAE,EAAE,gBAD2C;EAE/CC,MAAM,EAAE;IACPC,KAAK,EAAE;MACNC,IAAI,EAAE,QADA;MAENC,OAAO,EAAE,IAFH;MAGNC,OAAO,EAAE;QACRC,MAAM,EAAEC;MADA;IAHH,CADA;IAQPC,QAAQ,EAAE;MACTL,IAAI,EAAE;IADG,CARH;IAWPM,KAAK,EAAE;MACNN,IAAI,EAAE,MADA;MAENC,OAAO,EAAE;IAFH,CAXA;IAePM,YAAY,EAAE;MACbP,IAAI,EAAE,MADO;MAEbC,OAAO,EAAE;IAFI,CAfP;IAmBPO,MAAM,EAAE;MACPR,IAAI,EAAE,KADC;MAEPC,OAAO,EAAE,IAFF;MAGPC,OAAO,EAAE;QACRO,SAAS,EAAE;MADH;IAHF,CAnBD;IA0BPC,IAAI,EAAE;MACLV,IAAI,EAAE,KADD;MAELE,OAAO,EAAE;QACRO,SAAS,EAAE;MADH;IAFJ;EA1BC;AAFuC,CAAZ,CAA7B"}
1
+ {"version":3,"file":"features.types.js","names":["actionResponseSchema","buildSchema","id","fields","files","type","isArray","options","schema","generatedFileSchema","headline","hints","summaryLines","errors","valueType","meta"],"sources":["../../src/features/features.types.ts"],"sourcesContent":["import { buildSchema, Schema, SchemaValues } from '@sprucelabs/schema'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport generatedFileSchema from '#spruce/schemas/spruceCli/v2020_07_22/generatedFile.schema'\nimport { GlobalEmitter } from '../GlobalEmitter'\nimport ServiceFactory from '../services/ServiceFactory'\nimport StoreFactory from '../stores/StoreFactory'\nimport { ApiClientFactory } from '../types/apiClient.types'\nimport {\n\tGeneratedFile,\n\tNpmPackage,\n\tInternalUpdateHandler,\n} from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport WriterFactory from '../writers/WriterFactory'\nimport AbstractFeature from './AbstractFeature'\nimport ActionExecuter from './ActionExecuter'\nimport FeatureInstaller from './FeatureInstaller'\n\nexport interface FeatureMap {}\nexport interface FeatureOptionsMap {}\n\nexport type InstallFeature<\n\tKeys extends keyof FeatureOptionsMap = keyof FeatureOptionsMap\n> = {\n\t[Key in Keys]: Omit<\n\t\t{\n\t\t\tcode: Key\n\t\t\toptions: FeatureOptionsMap[Key]\n\t\t},\n\t\tFeatureOptionsMap[Key] extends Record<string, any> ? never : 'options'\n\t>\n}[Keys]\n\nexport interface ActionOptions {\n\ttemplates: Templates\n\tserviceFactory: ServiceFactory\n\tcwd: string\n\tparent: AbstractFeature\n\tstoreFactory: StoreFactory\n\tfeatureInstaller: FeatureInstaller\n\tui: GraphicsInterface\n\twriterFactory: WriterFactory\n\temitter: GlobalEmitter\n\tactionExecuter: ActionExecuter\n\tapiClientFactory: ApiClientFactory\n}\n\nexport type FeatureCode = keyof FeatureMap\n\nexport type FeatureExecuteOptions<F extends FeatureCode> =\n\tFeatureMap[F]['optionsSchema'] extends Schema\n\t\t? SchemaValues<FeatureMap[F]['optionsSchema']>\n\t\t: undefined\n\nexport interface InstallFeatureOptions {\n\tfeatures: InstallFeature[]\n\tinstallFeatureDependencies?: boolean\n\tdidUpdateHandler?: InternalUpdateHandler\n}\n\nexport const actionResponseSchema = buildSchema({\n\tid: 'actionResponse',\n\tfields: {\n\t\tfiles: {\n\t\t\ttype: 'schema',\n\t\t\tisArray: true,\n\t\t\toptions: {\n\t\t\t\tschema: generatedFileSchema,\n\t\t\t},\n\t\t},\n\t\theadline: {\n\t\t\ttype: 'text',\n\t\t},\n\t\thints: {\n\t\t\ttype: 'text',\n\t\t\tisArray: true,\n\t\t},\n\t\tsummaryLines: {\n\t\t\ttype: 'text',\n\t\t\tisArray: true,\n\t\t},\n\t\terrors: {\n\t\t\ttype: 'raw',\n\t\t\tisArray: true,\n\t\t\toptions: {\n\t\t\t\tvalueType: 'SpruceError<any>',\n\t\t\t},\n\t\t},\n\t\tmeta: {\n\t\t\ttype: 'raw',\n\t\t\toptions: {\n\t\t\t\tvalueType: 'Record<string, any>',\n\t\t\t},\n\t\t},\n\t},\n})\n\nexport interface FeatureInstallResponse {\n\tfiles?: GeneratedFile[]\n\tpackagesInstalled?: NpmPackage[]\n}\n\nexport type FeatureActionResponse = SchemaValues<typeof actionResponseSchema> &\n\tFeatureInstallResponse\n\nexport interface FeatureAction<S extends Schema = Schema> {\n\toptionsSchema?: S\n\tcommandAliases: string[]\n\tinvocationMessage: string\n\texecute: (options: SchemaValues<S>) => Promise<FeatureActionResponse>\n}\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;AA0DO,IAAMA,oBAAoB,GAAG,IAAAC,mBAAA,EAAY;EAC/CC,EAAE,EAAE,gBAD2C;EAE/CC,MAAM,EAAE;IACPC,KAAK,EAAE;MACNC,IAAI,EAAE,QADA;MAENC,OAAO,EAAE,IAFH;MAGNC,OAAO,EAAE;QACRC,MAAM,EAAEC;MADA;IAHH,CADA;IAQPC,QAAQ,EAAE;MACTL,IAAI,EAAE;IADG,CARH;IAWPM,KAAK,EAAE;MACNN,IAAI,EAAE,MADA;MAENC,OAAO,EAAE;IAFH,CAXA;IAePM,YAAY,EAAE;MACbP,IAAI,EAAE,MADO;MAEbC,OAAO,EAAE;IAFI,CAfP;IAmBPO,MAAM,EAAE;MACPR,IAAI,EAAE,KADC;MAEPC,OAAO,EAAE,IAFF;MAGPC,OAAO,EAAE;QACRO,SAAS,EAAE;MADH;IAHF,CAnBD;IA0BPC,IAAI,EAAE;MACLV,IAAI,EAAE,KADD;MAELE,OAAO,EAAE;QACRO,SAAS,EAAE;MADH;IAFJ;EA1BC;AAFuC,CAAZ,CAA7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"LogFeature.js","names":["LogFeature","code","isRequired","diskUtil","resolvePath","__dirname","featureInstaller","isInstalled","AbstractFeature"],"sources":["../../../src/features/log/LogFeature.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\tlog: LogFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tlog: undefined\n\t}\n}\n\nexport default class LogFeature extends AbstractFeature {\n\tpublic nameReadable = 'Logging support'\n\tpublic description = 'Logs: Configure how your skill logs and to where.'\n\tpublic code: FeatureCode = 'log'\n\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{ code: 'skill', isRequired: true },\n\t]\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;;;;;;IAaqBA,U;;;;;;;;;;;;;;;qGACE,iB;oGACD,mD;6FACM,K;qGAEgB,CAC1C;MAAEC,IAAI,EAAE,OAAR;MAAiBC,UAAU,EAAE;IAA7B,CAD0C,C;mGAGvBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;;;;;;WAEpB,uBAAqB;MACpB,OAAO,KAAKC,gBAAL,CAAsBC,WAAtB,CAAkC,OAAlC,CAAP;IACA;;;EAZsCC,4B"}
1
+ {"version":3,"file":"LogFeature.js","names":["LogFeature","code","isRequired","diskUtil","resolvePath","__dirname","featureInstaller","isInstalled","AbstractFeature"],"sources":["../../../src/features/log/LogFeature.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\tlog: LogFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tlog: undefined\n\t}\n}\n\nexport default class LogFeature extends AbstractFeature {\n\tpublic nameReadable = 'Logging support'\n\tpublic description = 'Logs: Configure how your skill logs and to where.'\n\tpublic code: FeatureCode = 'log'\n\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{ code: 'skill', isRequired: true },\n\t]\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;;;;;;IAaqBA,U;;;;;;;;;;;;;;;qGACE,iB;oGACD,mD;6FACM,K;qGAEgB,CAC1C;MAAEC,IAAI,EAAE,OAAR;MAAiBC,UAAU,EAAE;IAA7B,CAD0C,C;mGAGvBC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;;;;;;WAEpB,uBAAqB;MACpB,OAAO,KAAKC,gBAAL,CAAsBC,WAAtB,CAAkC,OAAlC,CAAP;IACA;;;EAZsCC,4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"CreateTransportAction.js","names":["optionsSchema","id","description","fields","nameReadable","type","label","isRequired","hint","nameCamel","namedTemplateItemBuilder","CreateLogTransportAction","options","validateAndNormalizeOptions","Writer","writeTransportPlugin","cwd","file","files","AbstractAction"],"sources":["../../../../src/features/log/actions/CreateTransportAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport namedTemplateItemBuilder from '../../../schemas/v2020_07_22/namedTemplateItem.builder'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'createLogTransportOptions',\n\tdescription:\n\t\t'Send logs wherever you want based on their severity. We like to send console.error to a Slack channel the team uses.',\n\tfields: {\n\t\tnameReadable: {\n\t\t\ttype: 'text',\n\t\t\tlabel: 'What is the name of your transport?',\n\t\t\tisRequired: true,\n\t\t\thint: 'E.g. Slack or Email',\n\t\t},\n\t\tnameCamel: namedTemplateItemBuilder.fields.nameCamel,\n\t},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class CreateLogTransportAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic invocationMessage = 'Creating a new log transport... ✍️'\n\tpublic commandAliases = ['create.log.transport']\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst { nameCamel, nameReadable } =\n\t\t\tthis.validateAndNormalizeOptions(options)\n\n\t\tconst file = await this.Writer('log').writeTransportPlugin(this.cwd, {\n\t\t\tnameCamel,\n\t\t\tnameReadable,\n\t\t})\n\n\t\treturn {\n\t\t\tfiles: [file],\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAGA,IAAMA,aAAa,GAAG,yBAAY;EACjCC,EAAE,EAAE,2BAD6B;EAEjCC,WAAW,EACV,sHAHgC;EAIjCC,MAAM,EAAE;IACPC,YAAY,EAAE;MACbC,IAAI,EAAE,MADO;MAEbC,KAAK,EAAE,qCAFM;MAGbC,UAAU,EAAE,IAHC;MAIbC,IAAI,EAAE;IAJO,CADP;IAOPC,SAAS,EAAEC,8BAAyBP,MAAzB,CAAgCM;EAPpC;AAJyB,CAAZ,CAAtB;;IAkBqBE,wB;;;;;;;;;;;;;;;sGACGX,a;0GACI,oC;uGACH,CAAC,sBAAD,C;;;;;;;mGAExB,iBAAqBY,OAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA,wBAEE,KAAKC,2BAAL,CAAiCD,OAAjC,CAFF,EACSH,SADT,yBACSA,SADT,EACoBL,YADpB,yBACoBA,YADpB;gBAAA;gBAAA,OAIoB,KAAKU,MAAL,CAAY,KAAZ,EAAmBC,oBAAnB,CAAwC,KAAKC,GAA7C,EAAkD;kBACpEP,SAAS,EAATA,SADoE;kBAEpEL,YAAY,EAAZA;gBAFoE,CAAlD,CAJpB;;cAAA;gBAIOa,IAJP;gBAAA,iCASQ;kBACNC,KAAK,EAAE,CAACD,IAAD;gBADD,CATR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EALqDE,2B"}
1
+ {"version":3,"file":"CreateTransportAction.js","names":["optionsSchema","buildSchema","id","description","fields","nameReadable","type","label","isRequired","hint","nameCamel","namedTemplateItemBuilder","CreateLogTransportAction","options","validateAndNormalizeOptions","Writer","writeTransportPlugin","cwd","file","files","AbstractAction"],"sources":["../../../../src/features/log/actions/CreateTransportAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport namedTemplateItemBuilder from '../../../schemas/v2020_07_22/namedTemplateItem.builder'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'createLogTransportOptions',\n\tdescription:\n\t\t'Send logs wherever you want based on their severity. We like to send console.error to a Slack channel the team uses.',\n\tfields: {\n\t\tnameReadable: {\n\t\t\ttype: 'text',\n\t\t\tlabel: 'What is the name of your transport?',\n\t\t\tisRequired: true,\n\t\t\thint: 'E.g. Slack or Email',\n\t\t},\n\t\tnameCamel: namedTemplateItemBuilder.fields.nameCamel,\n\t},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class CreateLogTransportAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema = optionsSchema\n\tpublic invocationMessage = 'Creating a new log transport... ✍️'\n\tpublic commandAliases = ['create.log.transport']\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst { nameCamel, nameReadable } =\n\t\t\tthis.validateAndNormalizeOptions(options)\n\n\t\tconst file = await this.Writer('log').writeTransportPlugin(this.cwd, {\n\t\t\tnameCamel,\n\t\t\tnameReadable,\n\t\t})\n\n\t\treturn {\n\t\t\tfiles: [file],\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;AAGA,IAAMA,aAAa,GAAG,IAAAC,mBAAA,EAAY;EACjCC,EAAE,EAAE,2BAD6B;EAEjCC,WAAW,EACV,sHAHgC;EAIjCC,MAAM,EAAE;IACPC,YAAY,EAAE;MACbC,IAAI,EAAE,MADO;MAEbC,KAAK,EAAE,qCAFM;MAGbC,UAAU,EAAE,IAHC;MAIbC,IAAI,EAAE;IAJO,CADP;IAOPC,SAAS,EAAEC,6BAAA,CAAyBP,MAAzB,CAAgCM;EAPpC;AAJyB,CAAZ,CAAtB;;IAkBqBE,wB;;;;;;;;;;;;;;;sGACGZ,a;0GACI,oC;uGACH,CAAC,sBAAD,C;;;;;;;mGAExB,iBAAqBa,OAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA,wBAEE,KAAKC,2BAAL,CAAiCD,OAAjC,CAFF,EACSH,SADT,yBACSA,SADT,EACoBL,YADpB,yBACoBA,YADpB;gBAAA;gBAAA,OAIoB,KAAKU,MAAL,CAAY,KAAZ,EAAmBC,oBAAnB,CAAwC,KAAKC,GAA7C,EAAkD;kBACpEP,SAAS,EAATA,SADoE;kBAEpEL,YAAY,EAAZA;gBAFoE,CAAlD,CAJpB;;cAAA;gBAIOa,IAJP;gBAAA,iCASQ;kBACNC,KAAK,EAAE,CAACD,IAAD;gBADD,CATR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EALqDE,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"LogWriter.js","names":["LogWriter","cwd","options","nameCamel","nameReadable","name","destination","diskUtil","resolvePath","doesFileExist","SpruceError","code","contents","templates","logTransport","writeFileIfChangedMixinResults","files","AbstractWriter"],"sources":["../../../../src/features/log/writers/LogWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nexport default class LogWriter extends AbstractWriter {\n\tpublic async writeTransportPlugin(\n\t\tcwd: string,\n\t\toptions: { nameCamel: string; nameReadable: string }\n\t) {\n\t\tconst { nameCamel, nameReadable } = options\n\n\t\tconst name = `${nameCamel}Transport.plugin.ts`\n\t\tconst destination = diskUtil.resolvePath(cwd, 'src', 'logTransports', name)\n\n\t\tif (diskUtil.doesFileExist(destination)) {\n\t\t\tthrow new SpruceError({\n\t\t\t\tcode: 'TRANSPORT_ALREADY_EXISTS',\n\t\t\t\tname: nameReadable,\n\t\t\t})\n\t\t}\n\n\t\tconst contents = this.templates.logTransport()\n\n\t\tconst files = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tcontents,\n\t\t\t'Your new log transport hot off the press!'\n\t\t)\n\n\t\treturn files[0]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;IAEqBA,S;;;;;;;;;;;;;gHACpB,iBACCC,GADD,EAECC,OAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAISC,SAJT,GAIqCD,OAJrC,CAISC,SAJT,EAIoBC,YAJpB,GAIqCF,OAJrC,CAIoBE,YAJpB;gBAMOC,IANP,aAMiBF,SANjB;gBAOOG,WAPP,GAOqBC,2BAASC,WAAT,CAAqBP,GAArB,EAA0B,KAA1B,EAAiC,eAAjC,EAAkDI,IAAlD,CAPrB;;gBAAA,KASKE,2BAASE,aAAT,CAAuBH,WAAvB,CATL;kBAAA;kBAAA;gBAAA;;gBAAA,MAUQ,IAAII,uBAAJ,CAAgB;kBACrBC,IAAI,EAAE,0BADe;kBAErBN,IAAI,EAAED;gBAFe,CAAhB,CAVR;;cAAA;gBAgBOQ,QAhBP,GAgBkB,KAAKC,SAAL,CAAeC,YAAf,EAhBlB;gBAAA;gBAAA,OAkBqB,KAAKC,8BAAL,CACnBT,WADmB,EAEnBM,QAFmB,EAGnB,2CAHmB,CAlBrB;;cAAA;gBAkBOI,KAlBP;gBAAA,iCAwBQA,KAAK,CAAC,CAAD,CAxBb;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EADsCC,2B"}
1
+ {"version":3,"file":"LogWriter.js","names":["LogWriter","cwd","options","nameCamel","nameReadable","name","destination","diskUtil","resolvePath","doesFileExist","SpruceError","code","contents","templates","logTransport","writeFileIfChangedMixinResults","files","AbstractWriter"],"sources":["../../../../src/features/log/writers/LogWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport SpruceError from '../../../errors/SpruceError'\nimport AbstractWriter from '../../../writers/AbstractWriter'\n\nexport default class LogWriter extends AbstractWriter {\n\tpublic async writeTransportPlugin(\n\t\tcwd: string,\n\t\toptions: { nameCamel: string; nameReadable: string }\n\t) {\n\t\tconst { nameCamel, nameReadable } = options\n\n\t\tconst name = `${nameCamel}Transport.plugin.ts`\n\t\tconst destination = diskUtil.resolvePath(cwd, 'src', 'logTransports', name)\n\n\t\tif (diskUtil.doesFileExist(destination)) {\n\t\t\tthrow new SpruceError({\n\t\t\t\tcode: 'TRANSPORT_ALREADY_EXISTS',\n\t\t\t\tname: nameReadable,\n\t\t\t})\n\t\t}\n\n\t\tconst contents = this.templates.logTransport()\n\n\t\tconst files = await this.writeFileIfChangedMixinResults(\n\t\t\tdestination,\n\t\t\tcontents,\n\t\t\t'Your new log transport hot off the press!'\n\t\t)\n\n\t\treturn files[0]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;;;IAEqBA,S;;;;;;;;;;;;;gHACpB,iBACCC,GADD,EAECC,OAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAISC,SAJT,GAIqCD,OAJrC,CAISC,SAJT,EAIoBC,YAJpB,GAIqCF,OAJrC,CAIoBE,YAJpB;gBAMOC,IANP,aAMiBF,SANjB;gBAOOG,WAPP,GAOqBC,0BAAA,CAASC,WAAT,CAAqBP,GAArB,EAA0B,KAA1B,EAAiC,eAAjC,EAAkDI,IAAlD,CAPrB;;gBAAA,KASKE,0BAAA,CAASE,aAAT,CAAuBH,WAAvB,CATL;kBAAA;kBAAA;gBAAA;;gBAAA,MAUQ,IAAII,uBAAJ,CAAgB;kBACrBC,IAAI,EAAE,0BADe;kBAErBN,IAAI,EAAED;gBAFe,CAAhB,CAVR;;cAAA;gBAgBOQ,QAhBP,GAgBkB,KAAKC,SAAL,CAAeC,YAAf,EAhBlB;gBAAA;gBAAA,OAkBqB,KAAKC,8BAAL,CACnBT,WADmB,EAEnBM,QAFmB,EAGnB,2CAHmB,CAlBrB;;cAAA;gBAkBOI,KAlBP;gBAAA,iCAwBQA,KAAK,CAAC,CAAD,CAxBb;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EADsCC,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"NodeFeature.js","names":["NodeFeature","options","nodeFeatureOptionsSchema","universalDevDependencies","universalScripts","universalFileDescriptions","diskUtil","resolvePath","__dirname","doesFileExist","cwd","emitter","on","payload","featureCode","actionCode","handleUpgrade","ui","clear","renderHero","startLoading","Service","execute","summaryLines","errors","destination","resolveDestination","doesDirExist","createDir","files","name","path","action","Writer","writeNodeModule","written","push","installScripts","pkg","set","value","namesUtil","toKebab","description","unset","Store","setCurrentSkillsNamespace","scriptUpdater","ScriptUpdater","FromFeature","update","AbstractFeature"],"sources":["../../../src/features/node/NodeFeature.ts"],"sourcesContent":["import { Schema, SchemaValues } from '@sprucelabs/schema'\nimport { SpruceSchemas } from '@sprucelabs/spruce-core-schemas'\nimport { diskUtil, namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport nodeFeatureOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/nodeFeatureOptions.schema'\nimport { FileDescription, GeneratedFile } from '../../types/cli.types'\nimport ScriptUpdater from '../../updaters/ScriptUpdater'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport {\n\tActionOptions,\n\tFeatureActionResponse,\n\tFeatureCode,\n} from '../features.types'\nimport universalDevDependencies from '../universalDevDependencies'\nimport universalFileDescriptions from '../universalFileDescriptions'\nimport universalScripts from '../universalScripts'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema\ntype Options = SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptions\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tnode: NodeFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tnode: SchemaValues<OptionsSchema>\n\t}\n}\n\nexport default class NodeFeature<\n\tS extends OptionsSchema = OptionsSchema\n> extends AbstractFeature<S> {\n\tpublic code: FeatureCode = 'node'\n\tpublic nameReadable = 'nodejs support'\n\tpublic description = ''\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic optionsSchema = nodeFeatureOptionsSchema as S\n\tpublic packageDependencies = [...universalDevDependencies]\n\n\tpublic scripts = {\n\t\t...universalScripts,\n\t}\n\n\tpublic readonly fileDescriptions: FileDescription[] = [\n\t\t...universalFileDescriptions,\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic constructor(options: ActionOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on('feature.did-execute', async (payload) => {\n\t\t\tif (payload.featureCode === 'node' && payload.actionCode === 'upgrade') {\n\t\t\t\treturn this.handleUpgrade()\n\t\t\t}\n\n\t\t\treturn {}\n\t\t})\n\t}\n\n\tprivate async handleUpgrade(): Promise<FeatureActionResponse> {\n\t\ttry {\n\t\t\tthis.ui.clear()\n\t\t\tthis.ui.renderHero('Upgrade')\n\n\t\t\tthis.ui.startLoading('Cleaning build...')\n\t\t\tawait this.Service('command').execute('yarn clean.build')\n\n\t\t\tthis.ui.startLoading('Building for development...')\n\t\t\tawait this.Service('command').execute('yarn build.dev')\n\n\t\t\treturn {\n\t\t\t\tsummaryLines: [\n\t\t\t\t\t'Build cleared.',\n\t\t\t\t\t'Lint rules applied to source.',\n\t\t\t\t\t'Code rebuilt successfully.',\n\t\t\t\t],\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\terrors: [err],\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async beforePackageInstall(options: Options) {\n\t\tconst destination = this.resolveDestination(options)\n\n\t\tif (!diskUtil.doesDirExist(destination)) {\n\t\t\tdiskUtil.createDir(destination)\n\t\t}\n\n\t\tconst files: GeneratedFile[] = [\n\t\t\t{\n\t\t\t\tname: 'package.json',\n\t\t\t\tpath: diskUtil.resolvePath(destination, 'package.json'),\n\t\t\t\taction: 'generated',\n\t\t\t},\n\t\t]\n\n\t\tawait this.Service('command', destination).execute('yarn init -y')\n\n\t\tconst written = await this.Writer('node').writeNodeModule(destination)\n\n\t\tfiles.push(...written)\n\n\t\tawait this.installScripts(destination)\n\n\t\treturn { files, cwd: destination }\n\t}\n\n\tprivate resolveDestination(options: Options) {\n\t\treturn diskUtil.resolvePath(this.cwd, options.destination ?? '')\n\t}\n\n\tpublic async afterPackageInstall(\n\t\toptions: S extends Schema ? SchemaValues<S> : undefined\n\t) {\n\t\tconst cwd = this.resolveDestination(options)\n\t\tconst pkg = this.Service('pkg', cwd)\n\n\t\tpkg.set({ path: 'name', value: namesUtil.toKebab(options.name) })\n\t\tpkg.set({ path: 'description', value: options.description })\n\t\tpkg.set({ path: 'version', value: '0.0.1' })\n\n\t\tpkg.unset('main')\n\t\tpkg.unset('license')\n\n\t\tawait this.Store('skill', { cwd }).setCurrentSkillsNamespace(options.name)\n\n\t\treturn {}\n\t}\n\n\tprivate async installScripts(destination = this.cwd) {\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this, {\n\t\t\tcwd: destination,\n\t\t})\n\n\t\tawait scriptUpdater.update()\n\t}\n\n\tpublic isInstalled = async (): Promise<boolean> => {\n\t\treturn diskUtil.doesFileExist(\n\t\t\tdiskUtil.resolvePath(this.cwd, 'package.json')\n\t\t)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AACA;;AAEA;;AACA;;AAMA;;AACA;;AACA;;;;;;;;;;IAgBqBA,W;;;;;EAoBpB,qBAAmBC,OAAnB,EAA2C;IAAA;;IAAA;IAC1C,0BAAMA,OAAN;IAD0C,yFAjBhB,MAiBgB;IAAA,iGAhBrB,gBAgBqB;IAAA,gGAftB,EAesB;IAAA,iGAdA,EAcA;IAAA,kGAbpBC,8BAaoB;IAAA,4IAZVC,oCAYU;IAAA,8GATvCC,4BASuC;IAAA,yIALvCC,qCAKuC;IAAA,+FAFvBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAEuB;IAAA,2LA6FtB;MAAA;QAAA;UAAA;YAAA;cAAA,iCACbF,2BAASG,aAAT,CACNH,2BAASC,WAAT,CAAqB,MAAKG,GAA1B,EAA+B,cAA/B,CADM,CADa;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,CA7FsB;IAG1C,KAAK,MAAKC,OAAL,CAAaC,EAAb,CAAgB,qBAAhB;MAAA,0FAAuC,kBAAOC,OAAP;QA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M,KAAJ,CAAU,MAAV;gBACAN,GAAG,CAACM,KAAJ,CAAU,SAAV;gBAXD;gBAAA,OAaO,KAAKC,KAAL,CAAW,OAAX,EAAoB;kBAAEnC,GAAG,EAAHA;gBAAF,CAApB,EAA6BoC,yBAA7B,CAAuD7C,OAAO,CAAC6B,IAA/D,CAbP;;cAAA;gBAAA,kCAeQ,EAfR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;0GAkBA;QAAA;QAAA;QAAA;QAAA;UAAA;YAAA;cAAA;gBAA6BL,WAA7B,8DAA2C,KAAKf,GAAhD;gBACOqC,aADP,GACuBC,0BAAcC,WAAd,CAA0B,IAA1B,EAAgC;kBACrDvC,GAAG,EAAEe;gBADgD,CAAhC,CADvB;gBAAA;gBAAA,OAKOsB,aAAa,CAACG,MAAd,EALP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAvGSC,4B"}
1
+ {"version":3,"file":"NodeFeature.js","names":["NodeFeature","options","nodeFeatureOptionsSchema","universalDevDependencies","universalScripts","universalFileDescriptions","diskUtil","resolvePath","__dirname","doesFileExist","cwd","emitter","on","payload","featureCode","actionCode","handleUpgrade","ui","clear","renderHero","startLoading","Service","execute","summaryLines","errors","destination","resolveDestination","doesDirExist","createDir","files","name","path","action","Writer","writeNodeModule","written","push","installScripts","pkg","set","value","namesUtil","toKebab","description","unset","Store","setCurrentSkillsNamespace","scriptUpdater","ScriptUpdater","FromFeature","update","AbstractFeature"],"sources":["../../../src/features/node/NodeFeature.ts"],"sourcesContent":["import { Schema, SchemaValues } from '@sprucelabs/schema'\nimport { SpruceSchemas } from '@sprucelabs/spruce-core-schemas'\nimport { diskUtil, namesUtil } from '@sprucelabs/spruce-skill-utils'\nimport nodeFeatureOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/nodeFeatureOptions.schema'\nimport { FileDescription, GeneratedFile } from '../../types/cli.types'\nimport ScriptUpdater from '../../updaters/ScriptUpdater'\nimport AbstractFeature, { FeatureDependency } from '../AbstractFeature'\nimport {\n\tActionOptions,\n\tFeatureActionResponse,\n\tFeatureCode,\n} from '../features.types'\nimport universalDevDependencies from '../universalDevDependencies'\nimport universalFileDescriptions from '../universalFileDescriptions'\nimport universalScripts from '../universalScripts'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptionsSchema\ntype Options = SpruceSchemas.SpruceCli.v2020_07_22.NodeFeatureOptions\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tnode: NodeFeature\n\t}\n\n\tinterface FeatureOptionsMap {\n\t\tnode: SchemaValues<OptionsSchema>\n\t}\n}\n\nexport default class NodeFeature<\n\tS extends OptionsSchema = OptionsSchema\n> extends AbstractFeature<S> {\n\tpublic code: FeatureCode = 'node'\n\tpublic nameReadable = 'nodejs support'\n\tpublic description = ''\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic optionsSchema = nodeFeatureOptionsSchema as S\n\tpublic packageDependencies = [...universalDevDependencies]\n\n\tpublic scripts = {\n\t\t...universalScripts,\n\t}\n\n\tpublic readonly fileDescriptions: FileDescription[] = [\n\t\t...universalFileDescriptions,\n\t]\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tpublic constructor(options: ActionOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on('feature.did-execute', async (payload) => {\n\t\t\tif (payload.featureCode === 'node' && payload.actionCode === 'upgrade') {\n\t\t\t\treturn this.handleUpgrade()\n\t\t\t}\n\n\t\t\treturn {}\n\t\t})\n\t}\n\n\tprivate async handleUpgrade(): Promise<FeatureActionResponse> {\n\t\ttry {\n\t\t\tthis.ui.clear()\n\t\t\tthis.ui.renderHero('Upgrade')\n\n\t\t\tthis.ui.startLoading('Cleaning build...')\n\t\t\tawait this.Service('command').execute('yarn clean.build')\n\n\t\t\tthis.ui.startLoading('Building for development...')\n\t\t\tawait this.Service('command').execute('yarn build.dev')\n\n\t\t\treturn {\n\t\t\t\tsummaryLines: [\n\t\t\t\t\t'Build cleared.',\n\t\t\t\t\t'Lint rules applied to source.',\n\t\t\t\t\t'Code rebuilt successfully.',\n\t\t\t\t],\n\t\t\t}\n\t\t} catch (err) {\n\t\t\treturn {\n\t\t\t\terrors: [err],\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic async beforePackageInstall(options: Options) {\n\t\tconst destination = this.resolveDestination(options)\n\n\t\tif (!diskUtil.doesDirExist(destination)) {\n\t\t\tdiskUtil.createDir(destination)\n\t\t}\n\n\t\tconst files: GeneratedFile[] = [\n\t\t\t{\n\t\t\t\tname: 'package.json',\n\t\t\t\tpath: diskUtil.resolvePath(destination, 'package.json'),\n\t\t\t\taction: 'generated',\n\t\t\t},\n\t\t]\n\n\t\tawait this.Service('command', destination).execute('yarn init -y')\n\n\t\tconst written = await this.Writer('node').writeNodeModule(destination)\n\n\t\tfiles.push(...written)\n\n\t\tawait this.installScripts(destination)\n\n\t\treturn { files, cwd: destination }\n\t}\n\n\tprivate resolveDestination(options: Options) {\n\t\treturn diskUtil.resolvePath(this.cwd, options.destination ?? '')\n\t}\n\n\tpublic async afterPackageInstall(\n\t\toptions: S extends Schema ? SchemaValues<S> : undefined\n\t) {\n\t\tconst cwd = this.resolveDestination(options)\n\t\tconst pkg = this.Service('pkg', cwd)\n\n\t\tpkg.set({ path: 'name', value: namesUtil.toKebab(options.name) })\n\t\tpkg.set({ path: 'description', value: options.description })\n\t\tpkg.set({ path: 'version', value: '0.0.1' })\n\n\t\tpkg.unset('main')\n\t\tpkg.unset('license')\n\n\t\tawait this.Store('skill', { cwd }).setCurrentSkillsNamespace(options.name)\n\n\t\treturn {}\n\t}\n\n\tprivate async installScripts(destination = this.cwd) {\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this, {\n\t\t\tcwd: destination,\n\t\t})\n\n\t\tawait scriptUpdater.update()\n\t}\n\n\tpublic isInstalled = async (): Promise<boolean> => {\n\t\treturn diskUt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,WAAd,CAA0B,IAA1B,EAAgC;kBACrDvC,GAAG,EAAEe;gBADgD,CAAhC,CADvB;gBAAA;gBAAA,OAKOsB,aAAa,CAACG,MAAd,EALP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EAvGSC,4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateDependenciesAction.js","names":["optionsSchema","id","description","fields","UpdateDependenciesAction","_options","files","file","diskUtil","deleteFile","resolvePath","cwd","InFlightEntertainment","start","installDependencies","totalDependencies","totalDevDependencies","headline","summaryLines","stop","featureInstaller","getInstalledFeatures","features","pkg","Service","pkgContents","readPackage","dependencies","Object","keys","map","d","stripped","name","devDependencies","feature","packageDependencies","dep","stripLatest","buildPackageName","isDev","find","unshift","filter","isBlockedFromUpgrade","deleteLockFile","length","writeStatus","install","shouldForceInstall","shouldCleanupLockFiles","content","get","push","set","path","value","isBlocked","indexOf","AbstractAction"],"sources":["../../../../src/features/node/actions/UpdateDependenciesAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { uniqBy } from 'lodash'\nimport InFlightEntertainment from '../../../InFlightEntertainment'\nimport PkgService from '../../../services/PkgService'\nimport { NpmPackage } from '../../../types/cli.types'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'updateDependenciesAction',\n\tdescription:\n\t\t'Clear lock files and node_modules and then reinstalls all modules.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\nexport default class UpdateDependenciesAction extends AbstractAction<OptionsSchema> {\n\tpublic code = 'updateDependencies'\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = ['update.dependencies', 'upgrade.dependencies']\n\tpublic invocationMessage = 'Updating dependencies... 💪'\n\n\tpublic async execute(_options: Options): Promise<FeatureActionResponse> {\n\t\tconst files = ['package-lock.json', 'yarn.lock', 'node_modules']\n\n\t\tfor (const file of files) {\n\t\t\tdiskUtil.deleteFile(diskUtil.resolvePath(this.cwd, file))\n\t\t}\n\n\t\ttry {\n\t\t\tInFlightEntertainment.start(['Here we go!', 'Good luck!'])\n\n\t\t\tconst { totalDependencies, totalDevDependencies } =\n\t\t\t\tawait this.installDependencies()\n\n\t\t\treturn {\n\t\t\t\theadline: 'Update Complete!',\n\t\t\t\tsummaryLines: [\n\t\t\t\t\t`${totalDependencies} dependencie${\n\t\t\t\t\t\ttotalDependencies === 1 ? '' : 's'\n\t\t\t\t\t} updated! 💪`,\n\t\t\t\t\t`${totalDevDependencies} dev dependencie${\n\t\t\t\t\t\ttotalDevDependencies === 1 ? '' : 's'\n\t\t\t\t\t} updated! 💪`,\n\t\t\t\t],\n\t\t\t}\n\t\t} finally {\n\t\t\tInFlightEntertainment.stop()\n\t\t}\n\t}\n\n\tprivate async installDependencies() {\n\t\tconst features = await this.featureInstaller.getInstalledFeatures()\n\n\t\tconst pkg = this.Service('pkg')\n\t\tconst pkgContents = pkg.readPackage()\n\n\t\tlet dependencies: { stripped: string; name: string }[] =\n\t\t\tObject.keys(pkgContents.dependencies ?? {}).map((d) => ({\n\t\t\t\tstripped: d,\n\t\t\t\tname: d,\n\t\t\t})) ?? []\n\n\t\tlet devDependencies: { stripped: string; name: string }[] =\n\t\t\tObject.keys(pkgContents.devDependencies ?? {}).map((d) => ({\n\t\t\t\tstripped: d,\n\t\t\t\tname: d,\n\t\t\t})) ?? []\n\n\t\tfor (const feature of features) {\n\t\t\tfor (const dep of feature.packageDependencies as NpmPackage[]) {\n\t\t\t\tconst stripped = pkg.stripLatest(dep.name)\n\t\t\t\tconst name = pkg.buildPackageName(dep)\n\t\t\t\tconst isDev =\n\t\t\t\t\t(dep.isDev || devDependencies.find((d) => d.stripped === stripped)) &&\n\t\t\t\t\t!dependencies.find((d) => d.stripped === stripped)\n\n\t\t\t\tif (isDev) {\n\t\t\t\t\tdevDependencies.unshift({\n\t\t\t\t\t\tstripped,\n\t\t\t\t\t\tname,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tdependencies.unshift({\n\t\t\t\t\t\tstripped,\n\t\t\t\t\t\tname,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdependencies = uniqBy(dependencies, 'stripped').filter(\n\t\t\t(d) => !this.isBlockedFromUpgrade(d.stripped, pkg)\n\t\t)\n\t\tdevDependencies = uniqBy(devDependencies, 'stripped').filter(\n\t\t\t(d) => !this.isBlockedFromUpgrade(d.stripped, pkg)\n\t\t)\n\n\t\tpkg.deleteLockFile()\n\n\t\tif (dependencies.length > 0) {\n\t\t\tInFlightEntertainment.writeStatus(\n\t\t\t\t`Installing ${dependencies.length} dependenc${\n\t\t\t\t\tdependencies.length === 1 ? 'y' : 'ies'\n\t\t\t\t}.`\n\t\t\t)\n\t\t\tawait pkg.install(\n\t\t\t\tdependencies.map((d) => d.name),\n\t\t\t\t{\n\t\t\t\t\tshouldForceInstall: true,\n\t\t\t\t\tshouldCleanupLockFiles: false,\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\n\t\tif (devDependencies.length > 0) {\n\t\t\tInFlightEntertainment.writeStatus(\n\t\t\t\t`Installing ${devDependencies.length} dev dependenc${\n\t\t\t\t\tdependencies.length === 1 ? 'y' : 'ies'\n\t\t\t\t}.`\n\t\t\t)\n\t\t\tawait pkg.install(\n\t\t\t\tdevDependencies.map((d) => d.name),\n\t\t\t\t{\n\t\t\t\t\tshouldForceInstall: true,\n\t\t\t\t\tisDev: true,\n\t\t\t\t\tshouldCleanupLockFiles: false,\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\n\t\tpkg.deleteLockFile()\n\n\t\treturn {\n\t\t\ttotalDependencies: dependencies.length,\n\t\t\ttotalDevDependencies: devDependencies.length,\n\t\t}\n\t}\n\n\tpublic blockUpgrade(name: string, pkg: PkgService) {\n\t\tconst content = pkg.get('skill.upgradeIgnoreList') ?? []\n\t\tcontent.push(name)\n\t\tpkg.set({ path: 'skill.upgradeIgnoreList', value: content })\n\t}\n\n\tpublic isBlockedFromUpgrade(name: string, pkg: PkgService) {\n\t\tconst content = pkg.get('skill.upgradeIgnoreList') ?? []\n\t\tconst isBlocked = content.indexOf(name) > -1\n\t\treturn isBlocked\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;;;AAGA,IAAMA,aAAa,GAAG,yBAAY;EACjCC,EAAE,EAAE,0BAD6B;EAEjCC,WAAW,EACV,oEAHgC;EAIjCC,MAAM,EAAE;AAJyB,CAAZ,CAAtB;;IASqBC,wB;;;;;;;;;;;;;;;6FACN,oB;sGACSJ,a;uGACC,CAAC,qBAAD,EAAwB,sBAAxB,C;0GACG,6B;;;;;;;mGAE3B,iBAAqBK,QAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBACOC,KADP,GACe,CAAC,mBAAD,EAAsB,WAAtB,EAAmC,cAAnC,CADf;;gBAGC,sBAAmBA,KAAnB,4BAA0B;kBAAfC,IAAe;;kBACzBC,2BAASC,UAAT,CAAoBD,2BAASE,WAAT,CAAqB,KAAKC,GAA1B,EAA+BJ,IAA/B,CAApB;gBACA;;gBALF;;gBAQEK,kCAAsBC,KAAtB,CAA4B,CAAC,aAAD,EAAgB,YAAhB,CAA5B;;gBARF;gBAAA,OAWS,KAAKC,mBAAL,EAXT;;cAAA;gBAAA;gBAUUC,iBAVV,yBAUUA,iBAVV;gBAU6BC,oBAV7B,yBAU6BA,oBAV7B;gBAAA,iCAaS;kBACNC,QAAQ,EAAE,kBADJ;kBAENC,YAAY,EAAE,WACVH,iBADU,yBAEZA,iBAAiB,KAAK,CAAtB,GAA0B,EAA1B,GAA+B,GAFnB,uCAIVC,oBAJU,6BAKZA,oBAAoB,KAAK,CAAzB,GAA6B,EAA7B,GAAkC,GALtB;gBAFR,CAbT;;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AAyC,EAAtD;MACA,IAAMK,SAAS,GAAGN,OAAO,CAACO,OAAR,CAAgBzB,IAAhB,IAAwB,CAAC,CAA3C;MACA,OAAOwB,SAAP;IACA;;;EArIoDE,2B"}
1
+ {"version":3,"file":"UpdateDependenciesAction.js","names":["optionsSchema","buildSchema","id","description","fields","UpdateDependenciesAction","_options","files","file","diskUtil","deleteFile","resolvePath","cwd","InFlightEntertainment","start","installDependencies","totalDependencies","totalDevDependencies","headline","summaryLines","stop","featureInstaller","getInstalledFeatures","features","pkg","Service","pkgContents","readPackage","dependencies","Object","keys","map","d","stripped","name","devDependencies","feature","packageDependencies","dep","stripLatest","buildPackageName","isDev","find","unshift","uniqBy","filter","isBlockedFromUpgrade","deleteLockFile","length","writeStatus","install","shouldForceInstall","shouldCleanupLockFiles","content","get","push","set","path","value","isBlocked","indexOf","AbstractAction"],"sources":["../../../../src/features/node/actions/UpdateDependenciesAction.ts"],"sourcesContent":["import { buildSchema, SchemaValues } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { uniqBy } from 'lodash'\nimport InFlightEntertainment from '../../../InFlightEntertainment'\nimport PkgService from '../../../services/PkgService'\nimport { NpmPackage } from '../../../types/cli.types'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\nconst optionsSchema = buildSchema({\n\tid: 'updateDependenciesAction',\n\tdescription:\n\t\t'Clear lock files and node_modules and then reinstalls all modules.',\n\tfields: {},\n})\n\ntype OptionsSchema = typeof optionsSchema\ntype Options = SchemaValues<OptionsSchema>\nexport default class UpdateDependenciesAction extends AbstractAction<OptionsSchema> {\n\tpublic code = 'updateDependencies'\n\tpublic optionsSchema = optionsSchema\n\tpublic commandAliases = ['update.dependencies', 'upgrade.dependencies']\n\tpublic invocationMessage = 'Updating dependencies... 💪'\n\n\tpublic async execute(_options: Options): Promise<FeatureActionResponse> {\n\t\tconst files = ['package-lock.json', 'yarn.lock', 'node_modules']\n\n\t\tfor (const file of files) {\n\t\t\tdiskUtil.deleteFile(diskUtil.resolvePath(this.cwd, file))\n\t\t}\n\n\t\ttry {\n\t\t\tInFlightEntertainment.start(['Here we go!', 'Good luck!'])\n\n\t\t\tconst { totalDependencies, totalDevDependencies } =\n\t\t\t\tawait this.installDependencies()\n\n\t\t\treturn {\n\t\t\t\theadline: 'Update Complete!',\n\t\t\t\tsummaryLines: [\n\t\t\t\t\t`${totalDependencies} dependencie${\n\t\t\t\t\t\ttotalDependencies === 1 ? '' : 's'\n\t\t\t\t\t} updated! 💪`,\n\t\t\t\t\t`${totalDevDependencies} dev dependencie${\n\t\t\t\t\t\ttotalDevDependencies === 1 ? '' : 's'\n\t\t\t\t\t} updated! 💪`,\n\t\t\t\t],\n\t\t\t}\n\t\t} finally {\n\t\t\tInFlightEntertainment.stop()\n\t\t}\n\t}\n\n\tprivate async installDependencies() {\n\t\tconst features = await this.featureInstaller.getInstalledFeatures()\n\n\t\tconst pkg = this.Service('pkg')\n\t\tconst pkgContents = pkg.readPackage()\n\n\t\tlet dependencies: { stripped: string; name: string }[] =\n\t\t\tObject.keys(pkgContents.dependencies ?? {}).map((d) => ({\n\t\t\t\tstripped: d,\n\t\t\t\tname: d,\n\t\t\t})) ?? []\n\n\t\tlet devDependencies: { stripped: string; name: string }[] =\n\t\t\tObject.keys(pkgContents.devDependencies ?? {}).map((d) => ({\n\t\t\t\tstripped: d,\n\t\t\t\tname: d,\n\t\t\t})) ?? []\n\n\t\tfor (const feature of features) {\n\t\t\tfor (const dep of feature.packageDependencies as NpmPackage[]) {\n\t\t\t\tconst stripped = pkg.stripLatest(dep.name)\n\t\t\t\tconst name = pkg.buildPackageName(dep)\n\t\t\t\tconst isDev =\n\t\t\t\t\t(dep.isDev || devDependencies.find((d) => d.stripped === stripped)) &&\n\t\t\t\t\t!dependencies.find((d) => d.stripped === stripped)\n\n\t\t\t\tif (isDev) {\n\t\t\t\t\tdevDependencies.unshift({\n\t\t\t\t\t\tstripped,\n\t\t\t\t\t\tname,\n\t\t\t\t\t})\n\t\t\t\t} else {\n\t\t\t\t\tdependencies.unshift({\n\t\t\t\t\t\tstripped,\n\t\t\t\t\t\tname,\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdependencies = uniqBy(dependencies, 'stripped').filter(\n\t\t\t(d) => !this.isBlockedFromUpgrade(d.stripped, pkg)\n\t\t)\n\t\tdevDependencies = uniqBy(devDependencies, 'stripped').filter(\n\t\t\t(d) => !this.isBlockedFromUpgrade(d.stripped, pkg)\n\t\t)\n\n\t\tpkg.deleteLockFile()\n\n\t\tif (dependencies.length > 0) {\n\t\t\tInFlightEntertainment.writeStatus(\n\t\t\t\t`Installing ${dependencies.length} dependenc${\n\t\t\t\t\tdependencies.length === 1 ? 'y' : 'ies'\n\t\t\t\t}.`\n\t\t\t)\n\t\t\tawait pkg.install(\n\t\t\t\tdependencies.map((d) => d.name),\n\t\t\t\t{\n\t\t\t\t\tshouldForceInstall: true,\n\t\t\t\t\tshouldCleanupLockFiles: false,\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\n\t\tif (devDependencies.length > 0) {\n\t\t\tInFlightEntertainment.writeStatus(\n\t\t\t\t`Installing ${devDependencies.length} dev dependenc${\n\t\t\t\t\tdependencies.length === 1 ? 'y' : 'ies'\n\t\t\t\t}.`\n\t\t\t)\n\t\t\tawait pkg.install(\n\t\t\t\tdevDependencies.map((d) => d.name),\n\t\t\t\t{\n\t\t\t\t\tshouldForceInstall: true,\n\t\t\t\t\tisDev: true,\n\t\t\t\t\tshouldCleanupLockFiles: false,\n\t\t\t\t}\n\t\t\t)\n\t\t}\n\n\t\tpkg.deleteLockFile()\n\n\t\treturn {\n\t\t\ttotalDependencies: dependencies.length,\n\t\t\ttotalDevDependencies: devDependencies.length,\n\t\t}\n\t}\n\n\tpublic blockUpgrade(name: string, pkg: PkgService) {\n\t\tconst content = pkg.get('skill.upgradeIgnoreList') ?? []\n\t\tcontent.push(name)\n\t\tpkg.set({ path: 'skill.upgradeIgnoreList', value: content })\n\t}\n\n\tpublic isBlockedFromUpgrade(name: string, pkg: PkgService) {\n\t\tconst content = pkg.get('skill.upgradeIgnoreList') ?? []\n\t\tconst isBlocked = content.indexOf(name) > -1\n\t\treturn isBlocked\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAGA;;;;;;;;;;;;AAGA,IAAMA,aAAa,GAAG,IAAAC,mBAAA,EAAY;EACjCC,EAAE,EAAE,0BAD6B;EAEjCC,WAAW,EACV,oEAHgC;EAIjCC,MAAM,EAAE;AAJyB,CAAZ,CAAtB;;IASqBC,wB;;;;;;;;;;;;;;;6FACN,oB;sGACSL,a;uGACC,CAAC,qBAAD,EAAwB,sBAAxB,C;0GACG,6B;;;;;;;mGAE3B,iBAAqBM,QAArB;QAAA;;QAAA;UAAA;YAAA;cAAA;gBACOC,KADP,GACe,CAAC,mBAAD,EAAsB,WAAtB,EAAmC,cAAnC,CADf;;gBAGC,sBAAmBA,KAAnB,4BAA0B;kBAAfC,IAAe;;kBACzBC,0BAAA,CAASC,UAAT,CAAoBD,0BAAA,CAASE,WAAT,CAAqB,KAAKC,GAA1B,EAA+BJ,IAA/B,CAApB;gBACA;;gBALF;;gBAQEK,iCAAA,CAAsBC,KAAtB,CAA4B,CAAC,aAAD,EAAgB,YAAhB,CAA5B;;gBARF;gBAAA,OAWS,KAAKC,mBAAL,EAXT;;cAAA;gBAAA;gBAUUC,iBAVV,yBAUUA,iBAVV;gBAU6BC,oBAV7B,yBAU6BA,oBAV7B;gBAAA,iCAaS;kBACNC,QAAQ,EAAE,kBADJ;kBAENC,YAAY,EAAE,WACVH,iBADU,yBAEZA,iBAAiB,KAAK,CAAtB,GAA0B,EAA1B,GAA+B,GAFnB,uCAIVC,oBAJU,6BAKZA,oBAAoB,KAAK,CAAzB,GAA6B,EAA7B,GAAkC,GALtB;gBAFR,CAbT;;cAAA;gBAAA;;gBAyBEJ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AQ,yBAAR,CAAH,iDAAyC,EAAtD;MACA,IAAMK,SAAS,GAAGN,OAAO,CAACO,OAAR,CAAgB1B,IAAhB,IAAwB,CAAC,CAA3C;MACA,OAAOyB,SAAP;IACA;;;EArIoDE,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"UpgradeAction.js","names":["UpgradeAction","upgradeSkillActionSchema","options","normalizedOptions","validateAndNormalizeOptions","updateScripts","shouldConfirm","upgradeMode","Writer","writeNodeModule","cwd","shouldConfirmBeforeWriting","shouldWriteIndex","files","ui","clear","InFlightEntertainment","start","reInstallPackageDependencies","dependencyResults","actionUtil","mergeActionResults","headline","stop","renderHero","Action","execute","featureInstaller","getInstalledFeatures","features","scripts","feature","scriptUpdater","ScriptUpdater","FromFeature","parent","latestScripts","update","shouldConfirmIfScriptExistsButIsDifferent","AbstractAction"],"sources":["../../../../src/features/node/actions/UpgradeAction.ts"],"sourcesContent":["import { SchemaValues } from '@sprucelabs/schema'\nimport { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport upgradeSkillActionSchema from '#spruce/schemas/spruceCli/v2020_07_22/upgradeSkillOptions.schema'\nimport InFlightEntertainment from '../../../InFlightEntertainment'\nimport ScriptUpdater from '../../../updaters/ScriptUpdater'\nimport actionUtil from '../../../utilities/action.utility'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.UpgradeSkillOptionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class UpgradeAction extends AbstractAction<OptionsSchema> {\n\tpublic invocationMessage = 'Upgrading your skill... 💪'\n\tpublic optionsSchema = upgradeSkillActionSchema\n\tpublic commandAliases = ['upgrade', 'update']\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst normalizedOptions = this.validateAndNormalizeOptions(options)\n\n\t\tawait this.updateScripts({\n\t\t\tshouldConfirm: normalizedOptions.upgradeMode !== 'forceEverything',\n\t\t})\n\n\t\ttry {\n\t\t\tconst files = await this.Writer('node', {\n\t\t\t\tupgradeMode: normalizedOptions.upgradeMode,\n\t\t\t}).writeNodeModule(this.cwd, {\n\t\t\t\tshouldConfirmBeforeWriting: true,\n\t\t\t\tshouldWriteIndex: false,\n\t\t\t})\n\n\t\t\tthis.ui.clear()\n\t\t\tInFlightEntertainment.start([\n\t\t\t\t\"Let's start the upgrade!\",\n\t\t\t\t'While things are going, see if you can beat 1k points!',\n\t\t\t\t'Go!!!!',\n\t\t\t])\n\n\t\t\tconst dependencyResults = await this.reInstallPackageDependencies()\n\n\t\t\treturn actionUtil.mergeActionResults(dependencyResults, {\n\t\t\t\theadline: 'Upgrade',\n\t\t\t\tfiles,\n\t\t\t})\n\t\t} finally {\n\t\t\tInFlightEntertainment.stop()\n\t\t\tthis.ui.renderHero('Upgrade')\n\t\t}\n\t}\n\n\tprivate async reInstallPackageDependencies() {\n\t\treturn this.Action('node', 'updateDependencies').execute({})\n\t}\n\n\tprivate async updateScripts(options: { shouldConfirm: boolean }) {\n\t\tconst features = await this.featureInstaller.getInstalledFeatures()\n\n\t\tlet scripts: Record<string, any> = {}\n\n\t\tfor (const feature of features) {\n\t\t\tscripts = {\n\t\t\t\t...scripts,\n\t\t\t\t...feature.scripts,\n\t\t\t}\n\t\t}\n\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this.parent, {\n\t\t\tlatestScripts: scripts,\n\t\t})\n\n\t\tawait scriptUpdater.update({\n\t\t\tshouldConfirmIfScriptExistsButIsDifferent: options.shouldConfirm,\n\t\t})\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;IAOqBA,a;;;;;;;;;;;;;;;0GACO,4B;sGACJC,+B;uGACC,CAAC,SAAD,EAAY,QAAZ,C;;;;;;;mGAExB,iBAAqBC,OAArB;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOC,iBADP,GAC2B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AA,uCAKuBD,QALvB;;gBAAA;kBAKC,oDAAgC;oBAArBE,OAAqB;oBAC/BD,OAAO,mCACHA,OADG,GAEHC,OAAO,CAACD,OAFL,CAAP;kBAIA;gBAVF;kBAAA;gBAAA;kBAAA;gBAAA;;gBAYOE,aAZP,GAYuBC,0BAAcC,WAAd,CAA0B,KAAKC,MAA/B,EAAuC;kBAC5DC,aAAa,EAAEN;gBAD6C,CAAvC,CAZvB;gBAAA;gBAAA,OAgBOE,aAAa,CAACK,MAAd,CAAqB;kBAC1BC,yCAAyC,EAAEpC,OAAO,CAACI;gBADzB,CAArB,CAhBP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EA3C0CiC,2B"}
1
+ {"version":3,"file":"UpgradeAction.js","names":["UpgradeAction","upgradeSkillActionSchema","options","normalizedOptions","validateAndNormalizeOptions","updateScripts","shouldConfirm","upgradeMode","Writer","writeNodeModule","cwd","shouldConfirmBeforeWriting","shouldWriteIndex","files","ui","clear","InFlightEntertainment","start","reInstallPackageDependencies","dependencyResults","actionUtil","mergeActionResults","headline","stop","renderHero","Action","execute","featureInstaller","getInstalledFeatures","features","scripts","feature","scriptUpdater","ScriptUpdater","FromFeature","parent","latestScripts","update","shouldConfirmIfScriptExistsButIsDifferent","AbstractAction"],"sources":["../../../../src/features/node/actions/UpgradeAction.ts"],"sourcesContent":["import { SchemaValues } from '@sprucelabs/schema'\nimport { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport upgradeSkillActionSchema from '#spruce/schemas/spruceCli/v2020_07_22/upgradeSkillOptions.schema'\nimport InFlightEntertainment from '../../../InFlightEntertainment'\nimport ScriptUpdater from '../../../updaters/ScriptUpdater'\nimport actionUtil from '../../../utilities/action.utility'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\ntype OptionsSchema =\n\tSpruceSchemas.SpruceCli.v2020_07_22.UpgradeSkillOptionsSchema\ntype Options = SchemaValues<OptionsSchema>\n\nexport default class UpgradeAction extends AbstractAction<OptionsSchema> {\n\tpublic invocationMessage = 'Upgrading your skill... 💪'\n\tpublic optionsSchema = upgradeSkillActionSchema\n\tpublic commandAliases = ['upgrade', 'update']\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst normalizedOptions = this.validateAndNormalizeOptions(options)\n\n\t\tawait this.updateScripts({\n\t\t\tshouldConfirm: normalizedOptions.upgradeMode !== 'forceEverything',\n\t\t})\n\n\t\ttry {\n\t\t\tconst files = await this.Writer('node', {\n\t\t\t\tupgradeMode: normalizedOptions.upgradeMode,\n\t\t\t}).writeNodeModule(this.cwd, {\n\t\t\t\tshouldConfirmBeforeWriting: true,\n\t\t\t\tshouldWriteIndex: false,\n\t\t\t})\n\n\t\t\tthis.ui.clear()\n\t\t\tInFlightEntertainment.start([\n\t\t\t\t\"Let's start the upgrade!\",\n\t\t\t\t'While things are going, see if you can beat 1k points!',\n\t\t\t\t'Go!!!!',\n\t\t\t])\n\n\t\t\tconst dependencyResults = await this.reInstallPackageDependencies()\n\n\t\t\treturn actionUtil.mergeActionResults(dependencyResults, {\n\t\t\t\theadline: 'Upgrade',\n\t\t\t\tfiles,\n\t\t\t})\n\t\t} finally {\n\t\t\tInFlightEntertainment.stop()\n\t\t\tthis.ui.renderHero('Upgrade')\n\t\t}\n\t}\n\n\tprivate async reInstallPackageDependencies() {\n\t\treturn this.Action('node', 'updateDependencies').execute({})\n\t}\n\n\tprivate async updateScripts(options: { shouldConfirm: boolean }) {\n\t\tconst features = await this.featureInstaller.getInstalledFeatures()\n\n\t\tlet scripts: Record<string, any> = {}\n\n\t\tfor (const feature of features) {\n\t\t\tscripts = {\n\t\t\t\t...scripts,\n\t\t\t\t...feature.scripts,\n\t\t\t}\n\t\t}\n\n\t\tconst scriptUpdater = ScriptUpdater.FromFeature(this.parent, {\n\t\t\tlatestScripts: scripts,\n\t\t})\n\n\t\tawait scriptUpdater.update({\n\t\t\tshouldConfirmIfScriptExistsButIsD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Q,KAAKC,MAAL,CAAY,MAAZ,EAAoB,oBAApB,EAA0CC,OAA1C,CAAkD,EAAlD,CADR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;yGAIA,kBAA4BxB,OAA5B;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAAA;gBAAA,OACwB,KAAKyB,gBAAL,CAAsBC,oBAAtB,EADxB;;cAAA;gBACOC,QADP;gBAGKC,OAHL,GAGoC,EAHpC;gBAAA,uCAKuBD,QALvB;;gBAAA;kBAKC,oDAAgC;oBAArBE,OAAqB;oBAC/BD,OAAO,mCACHA,OADG,GAEHC,OAAO,CAACD,OAFL,CAAP;kBAIA;gBAVF;kBAAA;gBAAA;kBAAA;gBAAA;;gBAYOE,aAZP,GAYuBC,yBAAA,CAAcC,WAAd,CAA0B,KAAKC,MAA/B,EAAuC;kBAC5DC,aAAa,EAAEN;gBAD6C,CAAvC,CAZvB;gBAAA;gBAAA,OAgBOE,aAAa,CAACK,MAAd,CAAqB;kBAC1BC,yCAAyC,EAAEpC,OAAO,CAACI;gBADzB,CAArB,CAhBP;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EA3C0CiC,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"NodeWriter.js","names":["NODE_FILES_TO_UPGRADE","NodeWriter","destinationDir","options","files","shouldWriteIndex","contents","destination","diskUtil","resolvePath","writeFile","push","name","description","action","path","writeDirectoryTemplate","code","DirectoryTemplateCode","Skill","filesToWrite","context","directoryTemplateFiles","AbstractWriter"],"sources":["../../../../src/features/node/writers/NodeWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { DirectoryTemplateCode } from '@sprucelabs/spruce-templates'\nimport { GeneratedFile } from '../../../types/cli.types'\nimport AbstractWriter, {\n\tWriteDirectoryTemplateOptions,\n\tWriteResults,\n} from '../../../writers/AbstractWriter'\n\nexport const NODE_FILES_TO_UPGRADE = [\n\t'tsconfig.json',\n\t'.eslintrc.js',\n\t'.eslintignore',\n\t'.gitignore',\n\t'.nvmrc',\n]\nexport default class NodeWriter extends AbstractWriter {\n\tpublic async writeNodeModule(\n\t\tdestinationDir: string,\n\t\toptions?: Partial<WriteDirectoryTemplateOptions> & {\n\t\t\tshouldWriteIndex?: boolean\n\t\t}\n\t): Promise<WriteResults> {\n\t\tlet files: GeneratedFile[] = []\n\t\tif (options?.shouldWriteIndex !== false) {\n\t\t\tconst contents = '//exports go here\\n'\n\t\t\tconst destination = diskUtil.resolvePath(\n\t\t\t\tdestinationDir,\n\t\t\t\t'src',\n\t\t\t\t'index.ts'\n\t\t\t)\n\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\tfiles.push({\n\t\t\t\tname: 'src/index.ts',\n\t\t\t\tdescription: 'Placeholder entry file!',\n\t\t\t\taction: 'generated',\n\t\t\t\tpath: destination,\n\t\t\t})\n\t\t}\n\n\t\tconst directoryTemplateFiles = await this.writeDirectoryTemplate({\n\t\t\tdestinationDir,\n\t\t\tcode: DirectoryTemplateCode.Skill,\n\t\t\tfilesToWrite: NODE_FILES_TO_UPGRADE,\n\t\t\tcontext: { name: 'ignored', description: 'ignored' },\n\t\t\t...options,\n\t\t})\n\n\t\treturn [...files, ...directoryTemplateFiles]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;AAKO,IAAMA,qBAAqB,GAAG,CACpC,eADoC,EAEpC,cAFoC,EAGpC,eAHoC,EAIpC,YAJoC,EAKpC,QALoC,CAA9B;;;IAOcC,U;;;;;;;;;;;;;2GACpB,iBACCC,cADD,EAECC,OAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAMKC,KANL,GAM8B,EAN9B;;gBAOC,IAAI,CAAAD,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEE,gBAAT,MAA8B,KAAlC,EAAyC;kBAClCC,QADkC,GACvB,qBADuB;kBAElCC,WAFkC,GAEpBC,2BAASC,WAAT,CACnBP,cADmB,EAEnB,KAFmB,EAGnB,UAHmB,CAFoB;;kBAOxCM,2BAASE,SAAT,CAAmBH,WAAnB,EAAgCD,QAAhC;;kBACAF,KAAK,CAACO,IAAN,CAAW;oBACVC,IAAI,EAAE,cADI;oBAEVC,WAAW,EAAE,yBAFH;oBAGVC,MAAM,EAAE,WAHE;oBAIVC,IAAI,EAAER;kBAJI,CAAX;gBAMA;;gBArBF;gBAAA,OAuBsC,KAAKS,sBAAL;kBACpCd,cAAc,EAAdA,cADoC;kBAEpCe,IAAI,EAAEC,uCAAsBC,KAFQ;kBAGpCC,YAAY,EAAEpB,qBAHsB;kBAIpCqB,OAAO,EAAE;oBAAET,IAAI,EAAE,SAAR;oBAAmBC,WAAW,EAAE;kBAAhC;gBAJ2B,GAKjCV,OALiC,EAvBtC;;cAAA;gBAuBOmB,sBAvBP;gBAAA,2CA+BYlB,KA/BZ,sCA+BsBkB,sBA/BtB;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EADuCC,2B"}
1
+ {"version":3,"file":"NodeWriter.js","names":["NODE_FILES_TO_UPGRADE","NodeWriter","destinationDir","options","files","shouldWriteIndex","contents","destination","diskUtil","resolvePath","writeFile","push","name","description","action","path","writeDirectoryTemplate","code","DirectoryTemplateCode","Skill","filesToWrite","context","directoryTemplateFiles","AbstractWriter"],"sources":["../../../../src/features/node/writers/NodeWriter.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { DirectoryTemplateCode } from '@sprucelabs/spruce-templates'\nimport { GeneratedFile } from '../../../types/cli.types'\nimport AbstractWriter, {\n\tWriteDirectoryTemplateOptions,\n\tWriteResults,\n} from '../../../writers/AbstractWriter'\n\nexport const NODE_FILES_TO_UPGRADE = [\n\t'tsconfig.json',\n\t'.eslintrc.js',\n\t'.eslintignore',\n\t'.gitignore',\n\t'.nvmrc',\n]\nexport default class NodeWriter extends AbstractWriter {\n\tpublic async writeNodeModule(\n\t\tdestinationDir: string,\n\t\toptions?: Partial<WriteDirectoryTemplateOptions> & {\n\t\t\tshouldWriteIndex?: boolean\n\t\t}\n\t): Promise<WriteResults> {\n\t\tlet files: GeneratedFile[] = []\n\t\tif (options?.shouldWriteIndex !== false) {\n\t\t\tconst contents = '//exports go here\\n'\n\t\t\tconst destination = diskUtil.resolvePath(\n\t\t\t\tdestinationDir,\n\t\t\t\t'src',\n\t\t\t\t'index.ts'\n\t\t\t)\n\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\tfiles.push({\n\t\t\t\tname: 'src/index.ts',\n\t\t\t\tdescription: 'Placeholder entry file!',\n\t\t\t\taction: 'generated',\n\t\t\t\tpath: destination,\n\t\t\t})\n\t\t}\n\n\t\tconst directoryTemplateFiles = await this.writeDirectoryTemplate({\n\t\t\tdestinationDir,\n\t\t\tcode: DirectoryTemplateCode.Skill,\n\t\t\tfilesToWrite: NODE_FILES_TO_UPGRADE,\n\t\t\tcontext: { name: 'ignored', description: 'ignored' },\n\t\t\t...options,\n\t\t})\n\n\t\treturn [...files, ...directoryTemplateFiles]\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;;;;;AAKO,IAAMA,qBAAqB,GAAG,CACpC,eADoC,EAEpC,cAFoC,EAGpC,eAHoC,EAIpC,YAJoC,EAKpC,QALoC,CAA9B;;;IAOcC,U;;;;;;;;;;;;;2GACpB,iBACCC,cADD,EAECC,OAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAMKC,KANL,GAM8B,EAN9B;;gBAOC,IAAI,CAAAD,OAAO,SAAP,IAAAA,OAAO,WAAP,YAAAA,OAAO,CAAEE,gBAAT,MAA8B,KAAlC,EAAyC;kBAClCC,QADkC,GACvB,qBADuB;kBAElCC,WAFkC,GAEpBC,0BAAA,CAASC,WAAT,CACnBP,cADmB,EAEnB,KAFmB,EAGnB,UAHmB,CAFoB;;kBAOxCM,0BAAA,CAASE,SAAT,CAAmBH,WAAnB,EAAgCD,QAAhC;;kBACAF,KAAK,CAACO,IAAN,CAAW;oBACVC,IAAI,EAAE,cADI;oBAEVC,WAAW,EAAE,yBAFH;oBAGVC,MAAM,EAAE,WAHE;oBAIVC,IAAI,EAAER;kBAJI,CAAX;gBAMA;;gBArBF;gBAAA,OAuBsC,KAAKS,sBAAL;kBACpCd,cAAc,EAAdA,cADoC;kBAEpCe,IAAI,EAAEC,sCAAA,CAAsBC,KAFQ;kBAGpCC,YAAY,EAAEpB,qBAHsB;kBAIpCqB,OAAO,EAAE;oBAAET,IAAI,EAAE,SAAR;oBAAmBC,WAAW,EAAE;kBAAhC;gBAJ2B,GAKjCV,OALiC,EAvBtC;;cAAA;gBAuBOmB,sBAvBP;gBAAA,2CA+BYlB,KA/BZ,sCA+BsBkB,sBA/BtB;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;EADuCC,2B"}
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardFeature.js","names":["OnboardFeature","options","diskUtil","resolvePath","__dirname","emitter","on","handleWillExecuteCommand","bind","handleTestReporterDidBoot","onboardingStore","Store","store","OnboardingStore","ScriptLoader","LoadScripts","ui","dir","scriptsDir","commandExecuter","_command","Error","player","payload","onboarding","getMode","command","generateCommandFromPayload","confirmExpectedCommand","isExpectedCommand","ScriptPlayer","playScriptWithKey","source","contents","readFile","destination","cwd","createTestOptionsSchema","fields","testDestinationDir","defaultValue","writeFile","reset","featuresUtil","generateCommand","featureCode","actionCode","stage","getStage","AbstractFeature"],"sources":["../../../src/features/onboard/OnboardFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport createTestOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/createTestOptions.schema'\nimport AbstractFeature, {\n\tFeatureDependency,\n\tFeatureOptions,\n} from '../AbstractFeature'\nimport featuresUtil from '../feature.utilities'\nimport { FeatureCode } from '../features.types'\nimport ScriptLoader from './ScriptLoader'\nimport OnboardingStore from './stores/OnboardingStore'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tonboard: OnboardFeature\n\t}\n}\n\nexport default class OnboardFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'onboard'\n\tpublic nameReadable = 'Onboard'\n\tpublic description = 'Get building your first skill already!'\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tprivate onboardingStore?: OnboardingStore\n\tprivate scriptsDir = diskUtil.resolvePath(__dirname, 'scripts')\n\n\tpublic constructor(options: FeatureOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on(\n\t\t\t'feature.will-execute',\n\t\t\tthis.handleWillExecuteCommand.bind(this)\n\t\t)\n\n\t\tvoid this.emitter.on(\n\t\t\t'test.reporter-did-boot',\n\t\t\tthis.handleTestReporterDidBoot.bind(this)\n\t\t)\n\t}\n\n\tpublic OnboardingStore() {\n\t\tif (!this.onboardingStore) {\n\t\t\tthis.onboardingStore = this.Store('onboarding')\n\t\t}\n\t\treturn this.onboardingStore\n\t}\n\n\tpublic async ScriptPlayer() {\n\t\tconst store = this.OnboardingStore()\n\n\t\tconst player = await ScriptLoader.LoadScripts({\n\t\t\tui: this.ui,\n\t\t\tdir: this.scriptsDir,\n\t\t\tonboardingStore: store,\n\t\t\tcommandExecuter: async (_command: string) => {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"I can't run commands for you yet, but will be able to soon. For now run `\" +\n\t\t\t\t\t\t_command +\n\t\t\t\t\t\t'` manually.'\n\t\t\t\t)\n\t\t\t},\n\t\t})\n\n\t\treturn player\n\t}\n\n\tprivate async handleWillExecuteCommand(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\tconst onboarding = this.Store('onboarding')\n\n\t\tif (onboarding.getMode() !== 'off') {\n\t\t\tconst command = this.generateCommandFromPayload(payload)\n\t\t\tawait this.confirmExpectedCommand(payload, onboarding)\n\n\t\t\tif (\n\t\t\t\tonboarding.getMode() !== 'off' &&\n\t\t\t\tthis.isExpectedCommand(command, onboarding)\n\t\t\t) {\n\t\t\t\tconst player = await this.ScriptPlayer()\n\t\t\t\tawait player.playScriptWithKey(`todo.${command}`)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate handleTestReporterDidBoot() {\n\t\tconst onboarding = this.Store('onboarding')\n\n\t\tif (onboarding.getMode() !== 'off') {\n\t\t\tconst source = diskUtil.resolvePath(\n\t\t\t\t__dirname,\n\t\t\t\t'templates',\n\t\t\t\t'ManagingTodos.test.ts.hbs'\n\t\t\t)\n\n\t\t\tconst contents = diskUtil.readFile(source)\n\n\t\t\tconst destination = diskUtil.resolvePath(\n\t\t\t\tthis.cwd,\n\t\t\t\tcreateTestOptionsSchema.fields.testDestinationDir.defaultValue,\n\t\t\t\t'behavioral',\n\t\t\t\t'ManagingTodos.test.ts'\n\t\t\t)\n\n\t\t\tdiskUtil.writeFile(destination, contents)\n\n\t\t\tthis.Store('onboarding').reset()\n\t\t}\n\t}\n\n\tprivate generateCommandFromPayload(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\treturn featuresUtil.generateCommand(payload.featureCode, payload.actionCode)\n\t}\n\n\tpublic isInstalled = async (): Promise<boolean> => {\n\t\treturn true\n\t}\n\n\tprivate async confirmExpectedCommand(\n\t\tpayload: { featureCode: string; actionCode: string },\n\t\tstore: OnboardingStore\n\t) {\n\t\tconst command = this.generateCommandFromPayload(payload)\n\t\tconst isExpectedCommand = this.isExpectedCommand(command, store)\n\n\t\tif (\n\t\t\tcommand !== 'setup.vscode' &&\n\t\t\tpayload.featureCode !== 'onboard' &&\n\t\t\t!isExpectedCommand\n\t\t) {\n\t\t\tconst player = await this.ScriptPlayer()\n\t\t\tawait player.playScriptWithKey('wrongCommand')\n\t\t}\n\t}\n\n\tprivate isExpectedCommand(command: string, store: OnboardingStore) {\n\t\tconst stage = store.getStage()\n\n\t\tconst isExpectedCommand = command === stage\n\t\treturn isExpectedCommand\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAIA;;AAEA;;;;;;IASqBA,c;;;;;EAYpB,wBAAmBC,OAAnB,EAA4C;IAAA;;IAAA;IAC3C,0BAAMA,OAAN;IAD2C,yFAXjB,SAWiB;IAAA,iGAVtB,SAUsB;IAAA,gGATvB,wCASuB;IAAA,iGARD,EAQC;IAAA,wGAPf,EAOe;IAAA,+FALxBC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAKwB;IAAA;IAAA,+FAFvBF,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAEuB;IAAA,2LA4FvB;MAAA;QAAA;UAAA;YAAA;cAAA,iCACb,IADa;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,CA5FuB;IAG3C,KAAK,MAAKC,OAAL,CAAaC,EAAb,CACJ,sBADI,EAEJ,MAAKC,wBAAL,CAA8BC,IAA9B,gDAFI,CAAL;IAKA,KAAK,MAAKH,OAAL,CAAaC,EAAb,CACJ,wBADI,EAEJ,MAAKG,yBAAL,CAA+BD,IAA/B,gDAFI,CAAL;IAR2C;EAY3C;;;;WAED,2BAAyB;MACxB,IAAI,CAAC,KAAKE,eAAV,EAA2B;QAC1B,KAAKA,eAAL,GAAuB,KAAKC,KAAL,CAAW,YAAX,CAAvB;MACA;;MACD,OAAO,KAAKD,eAAZ;IACA;;;;wGAED;QAAA;QAAA;UAAA;YAAA;cAAA;gBACOE,KADP,GACe,KAAKC,eAAL,EADf;gBAAA;gBAAA,OAGsBC,yBAAaC,WAAb,CAAyB;kBAC7CC,EAAE,EAAE,KAAKA,EADoC;kBAE7CC,GAAG,EAAE,KAAKC,UAFmC;kBAG7CR,eAAe,EAAEE,KAH4B;kBAI7CO,eAAe;oBAAA,qGAAE,kBAAOC,QAAP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IAAMG,WAAW,GAAGjC,2BAASC,WAAT,CACnB,KAAKiC,GADc,EAEnBC,8BAAwBC,MAAxB,CAA+BC,kBAA/B,CAAkDC,YAF/B,EAGnB,YAHmB,EAInB,uBAJmB,CAApB;;QAOAtC,2BAASuC,SAAT,CAAmBN,WAAnB,EAAgCF,QAAhC;;QAEA,KAAKtB,KAAL,CAAW,YAAX,EAAyB+B,KAAzB;MACA;IACD;;;WAED,oCAAmCnB,OAAnC,EAGG;MACF,OAAOoB,oBAAaC,eAAb,CAA6BrB,OAAO,CAACsB,WAArC,EAAkDtB,OAAO,CAACuB,UAA1D,CAAP;IACA;;;;kHAMD,kBACCvB,OADD,EAECX,KAFD;QAAA;QAAA;UAAA;YAAA;cAAA;gBAIOc,OAJP,GAIiB,KAAKC,0BAAL,CAAgCJ,OAAhC,CAJjB;gBAKOM,iBALP,GAK2B,KAAKA,iBAAL,CAAuBH,OAAvB,EAAgCd,KAAhC,CAL3B;;gBAAA,MAQEc,OAAO,KAAK,cAAZ,IACAH,OAAO,CAACsB,WAAR,KAAwB,SADxB,IAEA,CAAChB,iBAVH;kBAAA;kBAAA;gBAAA;;gBAAA;gBAAA,OAYuB,KAAKC,YAAL,EAZvB;;cAAA;gBAYQR,MAZR;gBAAA;gBAAA,OAaQA,MAAM,CAACS,iBAAP,CAAyB,cAAzB,CAbR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAiBA,2BAA0BL,OAA1B,EAA2Cd,KAA3C,EAAmE;MAClE,IAAMmC,KAAK,GAAGnC,KAAK,CAACoC,QAAN,EAAd;MAEA,IAAMnB,iBAAiB,GAAGH,OAAO,KAAKqB,KAAtC;MACA,OAAOlB,iBAAP;IACA;;;EAlI0CoB,4B"}
1
+ {"version":3,"file":"OnboardFeature.js","names":["OnboardFeature","options","diskUtil","resolvePath","__dirname","emitter","on","handleWillExecuteCommand","bind","handleTestReporterDidBoot","onboardingStore","Store","store","OnboardingStore","ScriptLoader","LoadScripts","ui","dir","scriptsDir","commandExecuter","_command","Error","player","payload","onboarding","getMode","command","generateCommandFromPayload","confirmExpectedCommand","isExpectedCommand","ScriptPlayer","playScriptWithKey","source","contents","readFile","destination","cwd","createTestOptionsSchema","fields","testDestinationDir","defaultValue","writeFile","reset","featuresUtil","generateCommand","featureCode","actionCode","stage","getStage","AbstractFeature"],"sources":["../../../src/features/onboard/OnboardFeature.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport createTestOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/createTestOptions.schema'\nimport AbstractFeature, {\n\tFeatureDependency,\n\tFeatureOptions,\n} from '../AbstractFeature'\nimport featuresUtil from '../feature.utilities'\nimport { FeatureCode } from '../features.types'\nimport ScriptLoader from './ScriptLoader'\nimport OnboardingStore from './stores/OnboardingStore'\n\ndeclare module '../../features/features.types' {\n\tinterface FeatureMap {\n\t\tonboard: OnboardFeature\n\t}\n}\n\nexport default class OnboardFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'onboard'\n\tpublic nameReadable = 'Onboard'\n\tpublic description = 'Get building your first skill already!'\n\tpublic dependencies: FeatureDependency[] = []\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n\n\tprivate onboardingStore?: OnboardingStore\n\tprivate scriptsDir = diskUtil.resolvePath(__dirname, 'scripts')\n\n\tpublic constructor(options: FeatureOptions) {\n\t\tsuper(options)\n\n\t\tvoid this.emitter.on(\n\t\t\t'feature.will-execute',\n\t\t\tthis.handleWillExecuteCommand.bind(this)\n\t\t)\n\n\t\tvoid this.emitter.on(\n\t\t\t'test.reporter-did-boot',\n\t\t\tthis.handleTestReporterDidBoot.bind(this)\n\t\t)\n\t}\n\n\tpublic OnboardingStore() {\n\t\tif (!this.onboardingStore) {\n\t\t\tthis.onboardingStore = this.Store('onboarding')\n\t\t}\n\t\treturn this.onboardingStore\n\t}\n\n\tpublic async ScriptPlayer() {\n\t\tconst store = this.OnboardingStore()\n\n\t\tconst player = await ScriptLoader.LoadScripts({\n\t\t\tui: this.ui,\n\t\t\tdir: this.scriptsDir,\n\t\t\tonboardingStore: store,\n\t\t\tcommandExecuter: async (_command: string) => {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"I can't run commands for you yet, but will be able to soon. For now run `\" +\n\t\t\t\t\t\t_command +\n\t\t\t\t\t\t'` manually.'\n\t\t\t\t)\n\t\t\t},\n\t\t})\n\n\t\treturn player\n\t}\n\n\tprivate async handleWillExecuteCommand(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\tconst onboarding = this.Store('onboarding')\n\n\t\tif (onboarding.getMode() !== 'off') {\n\t\t\tconst command = this.generateCommandFromPayload(payload)\n\t\t\tawait this.confirmExpectedCommand(payload, onboarding)\n\n\t\t\tif (\n\t\t\t\tonboarding.getMode() !== 'off' &&\n\t\t\t\tthis.isExpectedCommand(command, onboarding)\n\t\t\t) {\n\t\t\t\tconst player = await this.ScriptPlayer()\n\t\t\t\tawait player.playScriptWithKey(`todo.${command}`)\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate handleTestReporterDidBoot() {\n\t\tconst onboarding = this.Store('onboarding')\n\n\t\tif (onboarding.getMode() !== 'off') {\n\t\t\tconst source = diskUtil.resolvePath(\n\t\t\t\t__dirname,\n\t\t\t\t'templates',\n\t\t\t\t'ManagingTodos.test.ts.hbs'\n\t\t\t)\n\n\t\t\tconst contents = diskUtil.readFile(source)\n\n\t\t\tconst destination = diskUtil.resolvePath(\n\t\t\t\tthis.cwd,\n\t\t\t\tcreateTestOptionsSchema.fields.testDestinationDir.defaultValue,\n\t\t\t\t'behavioral',\n\t\t\t\t'ManagingTodos.test.ts'\n\t\t\t)\n\n\t\t\tdiskUtil.writeFile(destination, contents)\n\n\t\t\tthis.Store('onboarding').reset()\n\t\t}\n\t}\n\n\tprivate generateCommandFromPayload(payload: {\n\t\tfeatureCode: string\n\t\tactionCode: string\n\t}) {\n\t\treturn featuresUtil.generateCommand(payload.featureCode, payload.actionCode)\n\t}\n\n\tpublic isInstalled = async (): Promise<boolean> => {\n\t\treturn true\n\t}\n\n\tprivate async confirmExpectedCommand(\n\t\tpayload: { featureCode: string; actionCode: string },\n\t\tstore: OnboardingStore\n\t) {\n\t\tconst command = this.generateCommandFromPayload(payload)\n\t\tconst isExpectedCommand = this.isExpectedCommand(command, store)\n\n\t\tif (\n\t\t\tcommand !== 'setup.vscode' &&\n\t\t\tpayload.featureCode !== 'onboard' &&\n\t\t\t!isExpectedCommand\n\t\t) {\n\t\t\tconst player = await this.ScriptPlayer()\n\t\t\tawait player.playScriptWithKey('wrongCommand')\n\t\t}\n\t}\n\n\tprivate isExpectedCommand(command: string, store: OnboardingStore) {\n\t\tconst stage = store.getStage()\n\n\t\tconst isExpectedCommand = command === stage\n\t\treturn isExpectedCommand\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAIA;;AAEA;;;;;;IASqBA,c;;;;;EAYpB,wBAAmBC,OAAnB,EAA4C;IAAA;;IAAA;IAC3C,0BAAMA,OAAN;IAD2C,yFAXjB,SAWiB;IAAA,iGAVtB,SAUsB;IAAA,gGATvB,wCASuB;IAAA,iGARD,EAQC;IAAA,wGAPf,EAOe;IAAA,+FALxBC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAKwB;IAAA;IAAA,+FAFvBF,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,CAEuB;IAAA,2LA4FvB;MAAA;QAAA;UAAA;YAAA;cAAA,iCACb,IADa;;YAAA;YAAA;cAAA;UAAA;QAAA;MAAA;IAAA,CA5FuB;IAG3C,KAAK,MAAKC,OAAL,CAAaC,EAAb,CACJ,sBADI,EAEJ,MAAKC,wBAAL,CAA8BC,IAA9B,gDAFI,CAAL;IAKA,KAAK,MAAKH,OAAL,CAAaC,EAAb,CACJ,wBADI,EAEJ,MAAK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,OAYuB,KAAKC,YAAL,EAZvB;;cAAA;gBAYQR,MAZR;gBAAA;gBAAA,OAaQA,MAAM,CAACS,iBAAP,CAAyB,cAAzB,CAbR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;WAiBA,2BAA0BL,OAA1B,EAA2Cd,KAA3C,EAAmE;MAClE,IAAMmC,KAAK,GAAGnC,KAAK,CAACoC,QAAN,EAAd;MAEA,IAAMnB,iBAAiB,GAAGH,OAAO,KAAKqB,KAAtC;MACA,OAAOlB,iBAAP;IACA;;;EAlI0CoB,4B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScriptLoader.js","names":["ScriptLoader","options","player","ScriptPlayer","ui","onboardingStore","commandExecuter","dir","scripts","file","name","pathUtil","basename","search","extname","key","replace","script","require","loadScript"],"sources":["../../../src/features/onboard/ScriptLoader.ts"],"sourcesContent":["import pathUtil from 'path'\nimport globby from 'globby'\nimport { GraphicsInterface } from '../../types/cli.types'\nimport ScriptPlayer, { CommandExecuter } from './ScriptPlayer'\nimport OnboardingStore from './stores/OnboardingStore'\n\nexport default class ScriptLoader {\n\tpublic static async LoadScripts(options: {\n\t\tdir: string\n\t\tui: GraphicsInterface\n\t\tonboardingStore: OnboardingStore\n\t\tcommandExecuter: CommandExecuter\n\t}) {\n\t\tconst player = new ScriptPlayer({\n\t\t\tui: options.ui,\n\t\t\tonboardingStore: options.onboardingStore,\n\t\t\tcommandExecuter: options.commandExecuter,\n\t\t})\n\n\t\tconst scripts = await globby(options.dir + '/**/*.script.js')\n\n\t\tfor (const file of scripts) {\n\t\t\tconst name = pathUtil.basename(file)\n\t\t\tconst search = '.script' + pathUtil.extname(name)\n\t\t\tconst key = name.replace(search, '')\n\t\t\tconst script = require(file).default\n\n\t\t\tplayer.loadScript(key, script)\n\t\t}\n\n\t\treturn player\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;;;IAGqBA,Y;;;;;;;;uGACpB,iBAAgCC,OAAhC;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAMOC,MANP,GAMgB,IAAIC,wBAAJ,CAAiB;kBAC/BC,EAAE,EAAEH,OAAO,CAACG,EADmB;kBAE/BC,eAAe,EAAEJ,OAAO,CAACI,eAFM;kBAG/BC,eAAe,EAAEL,OAAO,CAACK;gBAHM,CAAjB,CANhB;gBAAA;gBAAA,OAYuB,wBAAOL,OAAO,CAACM,GAAR,GAAc,iBAArB,CAZvB;;cAAA;gBAYOC,OAZP;gBAAA,uCAcoBA,OAdpB;;gBAAA;kBAcC,oDAA4B;oBAAjBC,IAAiB;oBACrBC,IADqB,GACdC,iBAASC,QAAT,CAAkBH,IAAlB,CADc;oBAErBI,MAFqB,GAEZ,YAAYF,iBAASG,OAAT,CAAiBJ,IAAjB,CAFA;oBAGrBK,GAHqB,GAGfL,IAAI,CAACM,OAAL,CAAaH,MAAb,EAAqB,EAArB,CAHe;oBAIrBI,MAJqB,GAIZC,OAAO,CAACT,IAAD,CAAP,WAJY;oBAM3BP,MAAM,CAACiB,UAAP,CAAkBJ,GAAlB,EAAuBE,MAAvB;kBACA;gBArBF;kBAAA;gBAAA;kBAAA;gBAAA;;gBAAA,iCAuBQf,MAvBR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C"}
1
+ {"version":3,"file":"ScriptLoader.js","names":["ScriptLoader","options","player","ScriptPlayer","ui","onboardingStore","commandExecuter","globby","dir","scripts","file","name","pathUtil","basename","search","extname","key","replace","script","require","loadScript"],"sources":["../../../src/features/onboard/ScriptLoader.ts"],"sourcesContent":["import pathUtil from 'path'\nimport globby from 'globby'\nimport { GraphicsInterface } from '../../types/cli.types'\nimport ScriptPlayer, { CommandExecuter } from './ScriptPlayer'\nimport OnboardingStore from './stores/OnboardingStore'\n\nexport default class ScriptLoader {\n\tpublic static async LoadScripts(options: {\n\t\tdir: string\n\t\tui: GraphicsInterface\n\t\tonboardingStore: OnboardingStore\n\t\tcommandExecuter: CommandExecuter\n\t}) {\n\t\tconst player = new ScriptPlayer({\n\t\t\tui: options.ui,\n\t\t\tonboardingStore: options.onboardingStore,\n\t\t\tcommandExecuter: options.commandExecuter,\n\t\t})\n\n\t\tconst scripts = await globby(options.dir + '/**/*.script.js')\n\n\t\tfor (const file of scripts) {\n\t\t\tconst name = pathUtil.basename(file)\n\t\t\tconst search = '.script' + pathUtil.extname(name)\n\t\t\tconst key = name.replace(search, '')\n\t\t\tconst script = require(file).default\n\n\t\t\tplayer.loadScript(key, script)\n\t\t}\n\n\t\treturn player\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;;;IAGqBA,Y;;;;;;;;uGACpB,iBAAgCC,OAAhC;QAAA;;QAAA;UAAA;YAAA;cAAA;gBAMOC,MANP,GAMgB,IAAIC,wBAAJ,CAAiB;kBAC/BC,EAAE,EAAEH,OAAO,CAACG,EADmB;kBAE/BC,eAAe,EAAEJ,OAAO,CAACI,eAFM;kBAG/BC,eAAe,EAAEL,OAAO,CAACK;gBAHM,CAAjB,CANhB;gBAAA;gBAAA,OAYuB,IAAAC,kBAAA,EAAON,OAAO,CAACO,GAAR,GAAc,iBAArB,CAZvB;;cAAA;gBAYOC,OAZP;gBAAA,uCAcoBA,OAdpB;;gBAAA;kBAcC,oDAA4B;oBAAjBC,IAAiB;oBACrBC,IADqB,GACdC,gBAAA,CAASC,QAAT,CAAkBH,IAAlB,CADc;oBAErBI,MAFqB,GAEZ,YAAYF,gBAAA,CAASG,OAAT,CAAiBJ,IAAjB,CAFA;oBAGrBK,GAHqB,GAGfL,IAAI,CAACM,OAAL,CAAaH,MAAb,EAAqB,EAArB,CAHe;oBAIrBI,MAJqB,GAIZC,OAAO,CAACT,IAAD,CAAP,WAJY;oBAM3BR,MAAM,CAACkB,UAAP,CAAkBJ,GAAlB,EAAuBE,MAAvB;kBACA;gBArBF;kBAAA;gBAAA;kBAAA;gBAAA;;gBAAA,iCAuBQhB,MAvBR;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C"}
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.first.script.js","names":["script","player","ui","waitForEnter","clear","renderDoors","chooseOnboardingAdventure","renderImage","diskUtil","resolvePath","__dirname","width","height","prompt","type","label","isRequired","options","choices","value","answer","redirect"],"sources":["../../../../src/features/onboard/scripts/onboarding.first.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { GraphicsInterface } from '../../../types/cli.types'\nimport { Script, CallbackPlayer } from '../ScriptPlayer'\n\nconst script: Script = [\n\t'Hey there! 👋',\n\t\"I'm Sprucebot. 🌲🤖\",\n\t\"I'll be your narrator on this journey to creating your first experience.\",\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter('Lets get started...')\n\t},\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t},\n\tasync (player) => {\n\t\tawait renderDoors(player.ui)\n\t},\n\t'You are strolling through the forest when you stumble onto a clearing.',\n\t'In the clearing there are two heavy, thick, doors.',\n\t'They are free standing. You walk around them a few times before...',\n\t'You see words scribed onto each.',\n\t'The door to the left says, \"Quick start. 30 minutes.\"',\n\t'The door to the right says, \"Immersive. 4-6 weeks.\"',\n\t'\"Four to six week onboarding!?\" You say out loud. \"What the actual sh**!?\"',\n\t\"You don't have 4-6 weeks to do onboarding. But, you take pride in your work and doing things the right way.\",\n\tasync (player) => {\n\t\treturn await chooseOnboardingAdventure(player)\n\t},\n]\n\nexport async function renderDoors(ui: GraphicsInterface) {\n\tawait ui.renderImage(\n\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/doors.jpg'),\n\t\t{\n\t\t\twidth: 100,\n\t\t\theight: 35,\n\t\t}\n\t)\n}\n\nexport async function chooseOnboardingAdventure(player: CallbackPlayer) {\n\tconst answer = await player.ui.prompt({\n\t\ttype: 'select',\n\t\tlabel: 'Which door do you choose?',\n\t\tisRequired: true,\n\t\toptions: {\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Left door (30 minutes)',\n\t\t\t\t\tvalue: 'short',\n\t\t\t\t} as const,\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Right door (4-6 weeks)',\n\t\t\t\t\tvalue: 'immersive',\n\t\t\t\t} as const,\n\t\t\t],\n\t\t},\n\t})\n\n\tswitch (answer) {\n\t\tcase 'immersive':\n\t\t\treturn player.redirect('onboarding.immersive')\n\t\tcase 'short':\n\t\t\treturn player.redirect('onboarding.short')\n\t}\n}\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAIA,IAAMA,MAAc,GAAG,CACtB,eADsB,EAEtB,qBAFsB,EAGtB,0EAHsB;EAAA,yFAItB,iBAAOC,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACOA,MAAM,CAACC,EAAP,CAAUC,YAAV,CAAuB,qBAAvB,CADP;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAJsB;;EAAA;IAAA;EAAA;AAAA;EAAA,0FAOtB,kBAAOF,MAAP;IAAA;MAAA;QAAA;UAAA;YACCA,MAAM,CAACC,EAAP,CAAUE,KAAV;;UADD;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAPsB;;EAAA;IAAA;EAAA;AAAA;EAAA,0FAUtB,kBAAOH,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACOI,WAAW,CAACJ,MAAM,CAACC,EAAR,CADlB;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAVsB;;EAAA;IAAA;EAAA;AAAA,KAatB,wEAbsB,EActB,oDAdsB,EAetB,oEAfsB,EAgBtB,kCAhBsB,EAiBtB,uDAjBsB,EAkBtB,qDAlBsB,EAmBtB,4EAnBsB,EAoBtB,6GApBsB;EAAA,0FAqBtB,kBAAOD,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACcK,yBAAyB,CAACL,MAAD,CADvC;;UAAA;YAAA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CArBsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;;SA0BsBI,W;;;;;+FAAf,kBAA2BH,EAA3B;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACAA,EAAE,CAACK,WAAH,CACLC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,mCAAhC,CADK,EAEL;cACCC,KAAK,EAAE,GADR;cAECC,MAAM,EAAE;YAFT,CAFK,CADA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;SAUeN,yB;;;;;6GAAf,kBAAyCL,MAAzC;IAAA;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACeA,MAAM,CAACC,EAAP,CAAUW,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,2BAF8B;cAGrCC,UAAU,EAAE,IAHyB;cAIrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCH,KAAK,EAAE,wBADR;kBAECI,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCJ,KAAK,EAAE,wBADR;kBAECI,KAAK,EAAE;gBAFR,CALQ;cADD;YAJ4B,CAAjB,CADf;;UAAA;YACAC,MADA;YAAA,eAmBEA,MAnBF;YAAA,kCAoBA,WApBA,wBAsBA,OAtBA;YAAA;;UAAA;YAAA,kCAqBGnB,MAAM,CAACoB,QAAP,CAAgB,sBAAhB,CArBH;;UAAA;YAAA,kCAuBGpB,MAAM,CAACoB,QAAP,CAAgB,kBAAhB,CAvBH;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;eA2BQrB,M"}
1
+ {"version":3,"file":"onboarding.first.script.js","names":["script","player","ui","waitForEnter","clear","renderDoors","chooseOnboardingAdventure","renderImage","diskUtil","resolvePath","__dirname","width","height","prompt","type","label","isRequired","options","choices","value","answer","redirect"],"sources":["../../../../src/features/onboard/scripts/onboarding.first.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { GraphicsInterface } from '../../../types/cli.types'\nimport { Script, CallbackPlayer } from '../ScriptPlayer'\n\nconst script: Script = [\n\t'Hey there! 👋',\n\t\"I'm Sprucebot. 🌲🤖\",\n\t\"I'll be your narrator on this journey to creating your first experience.\",\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter('Lets get started...')\n\t},\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t},\n\tasync (player) => {\n\t\tawait renderDoors(player.ui)\n\t},\n\t'You are strolling through the forest when you stumble onto a clearing.',\n\t'In the clearing there are two heavy, thick, doors.',\n\t'They are free standing. You walk around them a few times before...',\n\t'You see words scribed onto each.',\n\t'The door to the left says, \"Quick start. 30 minutes.\"',\n\t'The door to the right says, \"Immersive. 4-6 weeks.\"',\n\t'\"Four to six week onboarding!?\" You say out loud. \"What the actual sh**!?\"',\n\t\"You don't have 4-6 weeks to do onboarding. But, you take pride in your work and doing things the right way.\",\n\tasync (player) => {\n\t\treturn await chooseOnboardingAdventure(player)\n\t},\n]\n\nexport async function renderDoors(ui: GraphicsInterface) {\n\tawait ui.renderImage(\n\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/doors.jpg'),\n\t\t{\n\t\t\twidth: 100,\n\t\t\theight: 35,\n\t\t}\n\t)\n}\n\nexport async function chooseOnboardingAdventure(player: CallbackPlayer) {\n\tconst answer = await player.ui.prompt({\n\t\ttype: 'select',\n\t\tlabel: 'Which door do you choose?',\n\t\tisRequired: true,\n\t\toptions: {\n\t\t\tchoices: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Left door (30 minutes)',\n\t\t\t\t\tvalue: 'short',\n\t\t\t\t} as const,\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Right door (4-6 weeks)',\n\t\t\t\t\tvalue: 'immersive',\n\t\t\t\t} as const,\n\t\t\t],\n\t\t},\n\t})\n\n\tswitch (answer) {\n\t\tcase 'immersive':\n\t\t\treturn player.redirect('onboarding.immersive')\n\t\tcase 'short':\n\t\t\tre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FK,CADA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;SAUeN,yB;;;;;6GAAf,kBAAyCL,MAAzC;IAAA;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACeA,MAAM,CAACC,EAAP,CAAUW,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,2BAF8B;cAGrCC,UAAU,EAAE,IAHyB;cAIrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCH,KAAK,EAAE,wBADR;kBAECI,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCJ,KAAK,EAAE,wBADR;kBAECI,KAAK,EAAE;gBAFR,CALQ;cADD;YAJ4B,CAAjB,CADf;;UAAA;YACAC,MADA;YAAA,eAmBEA,MAnBF;YAAA,kCAoBA,WApBA,wBAsBA,OAtBA;YAAA;;UAAA;YAAA,kCAqBGnB,MAAM,CAACoB,QAAP,CAAgB,sBAAhB,CArBH;;UAAA;YAAA,kCAuBGpB,MAAM,CAACoB,QAAP,CAAgB,kBAAhB,CAvBH;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,C;;;;eA2BQrB,M"}
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.immersive.script.js","names":["script","player","ui","clear","renderImage","diskUtil","resolvePath","__dirname","width","height","waitForEnter"],"sources":["../../../../src/features/onboard/scripts/onboarding.immersive.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { Script } from '../ScriptPlayer'\nimport {\n\trenderDoors,\n\tchooseOnboardingAdventure,\n} from './onboarding.first.script'\n\nconst script: Script = [\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t\tawait player.ui.renderImage(\n\t\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/listen.jpg'),\n\t\t\t{\n\t\t\t\twidth: 100,\n\t\t\t\theight: 23,\n\t\t\t}\n\t\t)\n\t},\n\t'You approach the \"Immersive\" door and grab the handle...',\n\t\"It won't budge no matter how hard you try.\",\n\t'You hear a sound, so you put your ear to the door.',\n\t'From the other side, someone yells, \"Work in progress. Try the door on the left! Thaaaaaanks!!\"',\n\t'You back away...',\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter()\n\t\tplayer.ui.clear()\n\t\tawait renderDoors(player.ui)\n\t\treturn chooseOnboardingAdventure(player)\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA;;AAKA,IAAMA,MAAc,GAAG;EAAA,yFACtB,iBAAOC,MAAP;IAAA;MAAA;QAAA;UAAA;YACCA,MAAM,CAACC,EAAP,CAAUC,KAAV;YADD;YAAA,OAEOF,MAAM,CAACC,EAAP,CAAUE,WAAV,CACLC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,oCAAhC,CADK,EAEL;cACCC,KAAK,EAAE,GADR;cAECC,MAAM,EAAE;YAFT,CAFK,CAFP;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CADsB;;EAAA;IAAA;EAAA;AAAA,KAWtB,0DAXsB,EAYtB,4CAZsB,EAatB,oDAbsB,EActB,iGAdsB,EAetB,kBAfsB;EAAA,0FAgBtB,kBAAOR,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACOA,MAAM,CAACC,EAAP,CAAUQ,YAAV,EADP;;UAAA;YAECT,MAAM,CAACC,EAAP,CAAUC,KAAV;YAFD;YAAA,OAGO,kCAAYF,MAAM,CAACC,EAAnB,CAHP;;UAAA;YAAA,kCAIQ,gDAA0BD,MAA1B,CAJR;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAhBsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAwBeD,M"}
1
+ {"version":3,"file":"onboarding.immersive.script.js","names":["script","player","ui","clear","renderImage","diskUtil","resolvePath","__dirname","width","height","waitForEnter","renderDoors","chooseOnboardingAdventure"],"sources":["../../../../src/features/onboard/scripts/onboarding.immersive.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { Script } from '../ScriptPlayer'\nimport {\n\trenderDoors,\n\tchooseOnboardingAdventure,\n} from './onboarding.first.script'\n\nconst script: Script = [\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t\tawait player.ui.renderImage(\n\t\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/listen.jpg'),\n\t\t\t{\n\t\t\t\twidth: 100,\n\t\t\t\theight: 23,\n\t\t\t}\n\t\t)\n\t},\n\t'You approach the \"Immersive\" door and grab the handle...',\n\t\"It won't budge no matter how hard you try.\",\n\t'You hear a sound, so you put your ear to the door.',\n\t'From the other side, someone yells, \"Work in progress. Try the door on the left! Thaaaaaanks!!\"',\n\t'You back away...',\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter()\n\t\tplayer.ui.clear()\n\t\tawait renderDoors(player.ui)\n\t\treturn chooseOnboardingAdventure(player)\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AAAA;;AAEA;;AAKA,IAAMA,MAAc,GAAG;EAAA,yFACtB,iBAAOC,MAAP;IAAA;MAAA;QAAA;UAAA;YACCA,MAAM,CAACC,EAAP,CAAUC,KAAV;YADD;YAAA,OAEOF,MAAM,CAACC,EAAP,CAAUE,WAAV,CACLC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,oCAAhC,CADK,EAEL;cACCC,KAAK,EAAE,GADR;cAECC,MAAM,EAAE;YAFT,CAFK,CAFP;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CADsB;;EAAA;IAAA;EAAA;AAAA,KAWtB,0DAXsB,EAYtB,4CAZsB,EAatB,oDAbsB,EActB,iGAdsB,EAetB,kBAfsB;EAAA,0FAgBtB,kBAAOR,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACOA,MAAM,CAACC,EAAP,CAAUQ,YAAV,EADP;;UAAA;YAECT,MAAM,CAACC,EAAP,CAAUC,KAAV;YAFD;YAAA,OAGO,IAAAQ,4BAAA,EAAYV,MAAM,CAACC,EAAnB,CAHP;;UAAA;YAAA,kCAIQ,IAAAU,0CAAA,EAA0BX,MAA1B,CAJR;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAhBsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAwBeD,M"}
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.returning.script.js","names":["script","player","ui","clear","stage","onboardingStore","getStage","prompt","type","label","options","choices","value","answer","reset","redirect","executeCommand"],"sources":["../../../../src/features/onboard/scripts/onboarding.returning.script.ts"],"sourcesContent":["import { Script } from '../ScriptPlayer'\nimport { renderCommand, renderEnter } from './onboarding.short.script'\n\nconst script: Script = [\n\t(player) => player.ui.clear(),\n\t(player) => renderEnter(player),\n\t'You return to the doors in the forest and enter the one on the left.',\n\t'\"Welcome back!\", shouts Sprucebot.',\n\t'\"It looks like you\\'re supposed to be running\"',\n\t(player) => {\n\t\tconst stage = player.onboardingStore.getStage()\n\t\trenderCommand(player.ui, `spruce ${stage}`)\n\t},\n\tasync (player) => {\n\t\tconst stage = player.onboardingStore.getStage()\n\t\tconst answer = await player.ui.prompt({\n\t\t\ttype: 'select',\n\t\t\tlabel: \"Lemme know what you'd like to do\",\n\t\t\toptions: {\n\t\t\t\tchoices: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Run \\`spruce ${stage}\\` for me!`,\n\t\t\t\t\t\tvalue: 'run',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Start over`,\n\t\t\t\t\t\tvalue: 'startOver',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Stop onboarding`,\n\t\t\t\t\t\tvalue: 'stop',\n\t\t\t\t\t} as const,\n\t\t\t\t],\n\t\t\t},\n\t\t})\n\n\t\tswitch (answer) {\n\t\t\tcase 'startOver':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tplayer.ui.clear()\n\t\t\t\treturn player.redirect('onboarding.first')\n\t\t\tcase 'stop':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tbreak\n\t\t\tcase 'run':\n\t\t\t\tawait player.executeCommand(stage as string)\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA,IAAMA,MAAc,GAAG,CACtB,UAACC,MAAD;EAAA,OAAYA,MAAM,CAACC,EAAP,CAAUC,KAAV,EAAZ;AAAA,CADsB,EAEtB,UAACF,MAAD;EAAA,OAAY,kCAAYA,MAAZ,CAAZ;AAAA,CAFsB,EAGtB,sEAHsB,EAItB,oCAJsB,EAKtB,gDALsB,EAMtB,UAACA,MAAD,EAAY;EACX,IAAMG,KAAK,GAAGH,MAAM,CAACI,eAAP,CAAuBC,QAAvB,EAAd;EACA,oCAAcL,MAAM,CAACC,EAArB,mBAAmCE,KAAnC;AACA,CATqB;EAAA,yFAUtB,iBAAOH,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOG,KADP,GACeH,MAAM,CAACI,eAAP,CAAuBC,QAAvB,EADf;YAAA;YAAA,OAEsBL,MAAM,CAACC,EAAP,CAAUK,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,kCAF8B;cAGrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCF,KAAK,wBAAkBL,KAAlB,cADN;kBAECQ,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCH,KAAK,cADN;kBAECG,KAAK,EAAE;gBAFR,CALQ,EASR;kBACCH,KAAK,mBADN;kBAECG,KAAK,EAAE;gBAFR,CATQ;cADD;YAH4B,CAAjB,CAFtB;;UAAA;YAEOC,MAFP;YAAA,cAuBSA,MAvBT;YAAA,gCAwBO,WAxBP,uBA4BO,MA5BP,wBA+BO,KA/BP;YAAA;;UAAA;YAyBGZ,MAAM,CAACI,eAAP,CAAuBS,KAAvB;YACAb,MAAM,CAACC,EAAP,CAAUC,KAAV;YA1BH,iCA2BUF,MAAM,CAACc,QAAP,CAAgB,kBAAhB,CA3BV;;UAAA;YA6BGd,MAAM,CAACI,eAAP,CAAuBS,KAAvB;YA7BH;;UAAA;YAAA;YAAA,OAgCSb,MAAM,CAACe,cAAP,CAAsBZ,KAAtB,CAhCT;;UAAA;YAAA;;UAAA;YAAA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAVsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAkDeJ,M"}
1
+ {"version":3,"file":"onboarding.returning.script.js","names":["script","player","ui","clear","renderEnter","stage","onboardingStore","getStage","renderCommand","prompt","type","label","options","choices","value","answer","reset","redirect","executeCommand"],"sources":["../../../../src/features/onboard/scripts/onboarding.returning.script.ts"],"sourcesContent":["import { Script } from '../ScriptPlayer'\nimport { renderCommand, renderEnter } from './onboarding.short.script'\n\nconst script: Script = [\n\t(player) => player.ui.clear(),\n\t(player) => renderEnter(player),\n\t'You return to the doors in the forest and enter the one on the left.',\n\t'\"Welcome back!\", shouts Sprucebot.',\n\t'\"It looks like you\\'re supposed to be running\"',\n\t(player) => {\n\t\tconst stage = player.onboardingStore.getStage()\n\t\trenderCommand(player.ui, `spruce ${stage}`)\n\t},\n\tasync (player) => {\n\t\tconst stage = player.onboardingStore.getStage()\n\t\tconst answer = await player.ui.prompt({\n\t\t\ttype: 'select',\n\t\t\tlabel: \"Lemme know what you'd like to do\",\n\t\t\toptions: {\n\t\t\t\tchoices: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Run \\`spruce ${stage}\\` for me!`,\n\t\t\t\t\t\tvalue: 'run',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Start over`,\n\t\t\t\t\t\tvalue: 'startOver',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Stop onboarding`,\n\t\t\t\t\t\tvalue: 'stop',\n\t\t\t\t\t} as const,\n\t\t\t\t],\n\t\t\t},\n\t\t})\n\n\t\tswitch (answer) {\n\t\t\tcase 'startOver':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tplayer.ui.clear()\n\t\t\t\treturn player.redirect('onboarding.first')\n\t\t\tcase 'stop':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tbreak\n\t\t\tcase 'run':\n\t\t\t\tawait player.executeCommand(stage as string)\n\t\t\t\tbreak\n\t\t}\n\n\t\treturn\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA,IAAMA,MAAc,GAAG,CACtB,UAACC,MAAD;EAAA,OAAYA,MAAM,CAACC,EAAP,CAAUC,KAAV,EAAZ;AAAA,CADsB,EAEtB,UAACF,MAAD;EAAA,OAAY,IAAAG,4BAAA,EAAYH,MAAZ,CAAZ;AAAA,CAFsB,EAGtB,sEAHsB,EAItB,oCAJsB,EAKtB,gDALsB,EAMtB,UAACA,MAAD,EAAY;EACX,IAAMI,KAAK,GAAGJ,MAAM,CAACK,eAAP,CAAuBC,QAAvB,EAAd;EACA,IAAAC,8BAAA,EAAcP,MAAM,CAACC,EAArB,mBAAmCG,KAAnC;AACA,CATqB;EAAA,yFAUtB,iBAAOJ,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOI,KADP,GACeJ,MAAM,CAACK,eAAP,CAAuBC,QAAvB,EADf;YAAA;YAAA,OAEsBN,MAAM,CAACC,EAAP,CAAUO,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,kCAF8B;cAGrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCF,KAAK,wBAAkBN,KAAlB,cADN;kBAECS,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCH,KAAK,cADN;kBAECG,KAAK,EAAE;gBAFR,CALQ,EASR;kBACCH,KAAK,mBADN;kBAECG,KAAK,EAAE;gBAFR,CATQ;cADD;YAH4B,CAAjB,CAFtB;;UAAA;YAEOC,MAFP;YAAA,cAuBSA,MAvBT;YAAA,gCAwBO,WAxBP,uBA4BO,MA5BP,wBA+BO,KA/BP;YAAA;;UAAA;YAyBGd,MAAM,CAACK,eAAP,CAAuBU,KAAvB;YACAf,MAAM,CAACC,EAAP,CAAUC,KAAV;YA1BH,iCA2BUF,MAAM,CAACgB,QAAP,CAAgB,kBAAhB,CA3BV;;UAAA;YA6BGhB,MAAM,CAACK,eAAP,CAAuBU,KAAvB;YA7BH;;UAAA;YAAA;YAAA,OAgCSf,MAAM,CAACiB,cAAP,CAAsBb,KAAtB,CAhCT;;UAAA;YAAA;;UAAA;YAAA;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAVsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAkDeL,M"}
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.short.script.js","names":["script","player","ui","clear","renderEnter","line","renderLine","GraphicsTextEffect","Italic","renderCommand","waitForEnter","onboardingStore","setMode","setStage","featuresUtil","generateCommand","renderImage","diskUtil","resolvePath","__dirname","width","height","command","BgMagenta","White"],"sources":["../../../../src/features/onboard/scripts/onboarding.short.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { GraphicsInterface } from '../../../types/cli.types'\nimport { GraphicsTextEffect } from '../../../types/graphicsInterface.types'\nimport featuresUtil from '../../feature.utilities'\nimport { CallbackPlayer, Script } from '../ScriptPlayer'\n\nconst script: Script = [\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t\tawait renderEnter(player)\n\t},\n\t\"You push the door open and enter into the largest room you've ever seen.\",\n\t\"So big, in fact, you can't see where the floors end and the walls begin.\",\n\t'A familiar voice echos...',\n\t'\"Hey! It\\'s Sprucebot again! 🌲🤖\"',\n\tasync (player) => {\n\t\tconst line = `This is so much fun! I love playing both the narrator and a character!`\n\t\tplayer.ui.renderLine(line, [GraphicsTextEffect.Italic])\n\t\tplayer.ui.renderLine('')\n\t},\n\t'Anyway... \"How about we create a simple todo app.\"',\n\t'\"Go ahead and run\"',\n\tasync (player) => {\n\t\trenderCommand(player.ui, 'spruce create.skill todos')\n\t},\n\n\t'\"Tip! If you ever get lost, just run\"',\n\tasync (player) => {\n\t\trenderCommand(player.ui, `spruce onboard`)\n\t},\n\t'\"and I\\'ll get you back on track.\"',\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter('\"Lets do it!\"')\n\n\t\tplayer.onboardingStore.setMode('short')\n\t\tplayer.onboardingStore.setStage(\n\t\t\tfeaturesUtil.generateCommand('skill', 'create') as 'create.skill'\n\t\t)\n\t},\n]\n\nexport function renderEnter(player: CallbackPlayer) {\n\treturn player.ui.renderImage(\n\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/inside.jpg'),\n\t\t{\n\t\t\twidth: 100,\n\t\t\theight: 35,\n\t\t}\n\t)\n}\n\nexport function renderCommand(ui: GraphicsInterface, command: string) {\n\tui.renderLine(command, [\n\t\tGraphicsTextEffect.BgMagenta,\n\t\tGraphicsTextEffect.White,\n\t])\n\tui.renderLine('')\n}\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAGA,IAAMA,MAAc,GAAG;EAAA,yFACtB,iBAAOC,MAAP;IAAA;MAAA;QAAA;UAAA;YACCA,MAAM,CAACC,EAAP,CAAUC,KAAV;YADD;YAAA,OAEOC,WAAW,CAACH,MAAD,CAFlB;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CADsB;;EAAA;IAAA;EAAA;AAAA,KAKtB,0EALsB,EAMtB,0EANsB,EAOtB,2BAPsB,EAQtB,oCARsB;EAAA,0FAStB,kBAAOA,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOI,IADP;YAECJ,MAAM,CAACC,EAAP,CAAUI,UAAV,CAAqBD,IAArB,EAA2B,CAACE,sCAAmBC,MAApB,CAA3B;YACAP,MAAM,CAACC,EAAP,CAAUI,UAAV,CAAqB,EAArB;;UAHD;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EAIAtB,EAAE,CAACI,UAAH,CAAc,EAAd;AACA;;eAEcN,M"}
1
+ {"version":3,"file":"onboarding.short.script.js","names":["script","player","ui","clear","renderEnter","line","renderLine","GraphicsTextEffect","Italic","renderCommand","waitForEnter","onboardingStore","setMode","setStage","featuresUtil","generateCommand","renderImage","diskUtil","resolvePath","__dirname","width","height","command","BgMagenta","White"],"sources":["../../../../src/features/onboard/scripts/onboarding.short.script.ts"],"sourcesContent":["import { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { GraphicsInterface } from '../../../types/cli.types'\nimport { GraphicsTextEffect } from '../../../types/graphicsInterface.types'\nimport featuresUtil from '../../feature.utilities'\nimport { CallbackPlayer, Script } from '../ScriptPlayer'\n\nconst script: Script = [\n\tasync (player) => {\n\t\tplayer.ui.clear()\n\t\tawait renderEnter(player)\n\t},\n\t\"You push the door open and enter into the largest room you've ever seen.\",\n\t\"So big, in fact, you can't see where the floors end and the walls begin.\",\n\t'A familiar voice echos...',\n\t'\"Hey! It\\'s Sprucebot again! 🌲🤖\"',\n\tasync (player) => {\n\t\tconst line = `This is so much fun! I love playing both the narrator and a character!`\n\t\tplayer.ui.renderLine(line, [GraphicsTextEffect.Italic])\n\t\tplayer.ui.renderLine('')\n\t},\n\t'Anyway... \"How about we create a simple todo app.\"',\n\t'\"Go ahead and run\"',\n\tasync (player) => {\n\t\trenderCommand(player.ui, 'spruce create.skill todos')\n\t},\n\n\t'\"Tip! If you ever get lost, just run\"',\n\tasync (player) => {\n\t\trenderCommand(player.ui, `spruce onboard`)\n\t},\n\t'\"and I\\'ll get you back on track.\"',\n\tasync (player) => {\n\t\tawait player.ui.waitForEnter('\"Lets do it!\"')\n\n\t\tplayer.onboardingStore.setMode('short')\n\t\tplayer.onboardingStore.setStage(\n\t\t\tfeaturesUtil.generateCommand('skill', 'create') as 'create.skill'\n\t\t)\n\t},\n]\n\nexport function renderEnter(player: CallbackPlayer) {\n\treturn player.ui.renderImage(\n\t\tdiskUtil.resolvePath(__dirname, '../../../../docs/images/inside.jpg'),\n\t\t{\n\t\t\twidth: 100,\n\t\t\theight: 35,\n\t\t}\n\t)\n}\n\nexport function renderCommand(ui: GraphicsInterface, command: string) {\n\tui.renderLine(command, [\n\t\tGraphicsTextEffect.BgMagenta,\n\t\tGraphicsTextEffect.White,\n\t])\n\tui.renderLine('')\n}\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAEA;;AACA;;AAGA,IAAMA,MAAc,GAAG;EAAA,yFACtB,iBAAOC,MAAP;IAAA;MAAA;QAAA;UAAA;YACCA,MAAM,CAACC,EAAP,CAAUC,KAAV;YADD;YAAA,OAEOC,WAAW,CAACH,MAAD,CAFlB;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CADsB;;EAAA;IAAA;EAAA;AAAA,KAKtB,0EALsB,EAMtB,0EANsB,EAOtB,2BAPsB,EAQtB,oCARsB;EAAA,0FAStB,kBAAOA,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOI,IADP;YAECJ,MAAM,CAACC,EAAP,CAAUI,UAAV,CAAqBD,IAArB,EAA2B,CAACE,qCAAA,CAAmBC,MAApB,CAA3B;YACAP,MAAM,CAACC,EAAP,CAAUI,UAAV,CAAqB,EAArB;;UAHD;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CATsB;;EAAA;IAAA;EAAA;AAAA,KActB,oDAdsB,EAetB,oBAfsB;EAAA,0FAgBtB,kBAAOL,MAAP;IAAA;MAAA;QAAA;UAAA;YACCQ,aAAa,CAACR,MAAM,CAACC,EAAR,EAAY,2BAAZ,CAAb;;UADD;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAhBsB;;EAAA;IAAA;EAAA;AAAA,KAoBtB,uCApBsB;EAAA,0FAqBtB,kBAAOD,MAAP;IAAA;MAAA;QAAA;UAAA;YACCQ,aAAa,CAACR,MAAM,CAACC,EAAR,mBAAb;;UADD;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CArBsB;;EAAA;IAAA;EAAA;AAAA,KAwBtB,oCAxBsB;EAAA,0FAyBtB,kBAAOD,MAAP;IAAA;MAAA;QAAA;UAAA;YAAA;YAAA,OACOA,MAAM,CAACC,EAAP,CAAUQ,YAAV,CAAuB,eAAvB,CADP;;UAAA;YAGCT,MAAM,CAACU,eAAP,CAAuBC,OAAvB,CAA+B,OAA/B;YACAX,MAAM,CAACU,eAAP,CAAuBE,QAAvB,CACCC,mBAAA,CAAaC,eAAb,CAA6B,OAA7B,EAAsC,QAAtC,CADD;;UAJD;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CAzBsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;;AAmCO,SAASX,WAAT,CAAqBH,MAArB,EAA6C;EACnD,OAAOA,MAAM,CAACC,EAAP,CAAUc,WAAV,CACNC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,oCAAhC,CADM,EAEN;IACCC,KAAK,EAAE,GADR;IAECC,MAAM,EAAE;EAFT,CAFM,CAAP;AAOA;;AAEM,SAASZ,aAAT,CAAuBP,EAAvB,EAA8CoB,OAA9C,EAA+D;EACrEpB,EAAE,CAACI,UAAH,CAAcgB,OAAd,EAAuB,CACtBf,qCAAA,CAAmBgB,SADG,EAEtBhB,qCAAA,CAAmBiB,KAFG,CAAvB;EAIAtB,EAAE,CAACI,UAAH,CAAc,EAAd;AACA;;eAEcN,M"}
@@ -1 +1 @@
1
- {"version":3,"file":"wrongCommand.script.js","names":["script","player","ui","onboardingStore","getStage","stage","prompt","type","label","options","choices","value","answer","reset","renderLine","waitForEnter","Error"],"sources":["../../../../src/features/onboard/scripts/wrongCommand.script.ts"],"sourcesContent":["import { Script } from '../ScriptPlayer'\nimport { renderCommand } from './onboarding.short.script'\n\nconst script: Script = [\n\t'Hold on! ✋',\n\t\"I don't think you're supposed to be here!\",\n\t'I was really expecting you to run:',\n\t(player) => {\n\t\trenderCommand(player.ui, player.onboardingStore.getStage() as string)\n\t},\n\t'But you are in a completely different place.',\n\tasync (player) => {\n\t\tconst stage = player.onboardingStore.getStage() as string\n\t\tconst answer = await player.ui.prompt({\n\t\t\ttype: 'select',\n\t\t\tlabel: 'What should we do?',\n\t\t\toptions: {\n\t\t\t\tchoices: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Continue forward',\n\t\t\t\t\t\tvalue: 'letMePass',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Stop onboarding',\n\t\t\t\t\t\tvalue: 'disable',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Execute \\`${stage}\\``,\n\t\t\t\t\t\tvalue: 'executeCommand',\n\t\t\t\t\t} as const,\n\t\t\t\t],\n\t\t\t},\n\t\t})\n\n\t\tswitch (answer) {\n\t\t\tcase 'disable':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tplayer.ui.renderLine('')\n\t\t\t\tplayer.ui.renderLine(\n\t\t\t\t\t`Ok, I've disabled onboarding for now. Hope to see you again soon!`\n\t\t\t\t)\n\t\t\t\tplayer.ui.renderLine('')\n\t\t\t// eslint-disable-next-line no-fallthrough\n\t\t\tcase 'letMePass':\n\t\t\t\tawait player.ui.waitForEnter('As you were!')\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Coming soon! For now you have to manually run!')\n\t\t}\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA,IAAMA,MAAc,GAAG,CACtB,YADsB,EAEtB,2CAFsB,EAGtB,oCAHsB,EAItB,UAACC,MAAD,EAAY;EACX,oCAAcA,MAAM,CAACC,EAArB,EAAyBD,MAAM,CAACE,eAAP,CAAuBC,QAAvB,EAAzB;AACA,CANqB,EAOtB,8CAPsB;EAAA,yFAQtB,iBAAOH,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOI,KADP,GACeJ,MAAM,CAACE,eAAP,CAAuBC,QAAvB,EADf;YAAA;YAAA,OAEsBH,MAAM,CAACC,EAAP,CAAUI,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,oBAF8B;cAGrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCF,KAAK,EAAE,kBADR;kBAECG,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCH,KAAK,EAAE,iBADR;kBAECG,KAAK,EAAE;gBAFR,CALQ,EASR;kBACCH,KAAK,qBAAeH,KAAf,MADN;kBAECM,KAAK,EAAE;gBAFR,CATQ;cADD;YAH4B,CAAjB,CAFtB;;UAAA;YAEOC,MAFP;YAAA,cAuBSA,MAvBT;YAAA,gCAwBO,SAxBP,uBAgCO,WAhCP;YAAA;;UAAA;YAyBGX,MAAM,CAACE,eAAP,CAAuBU,KAAvB;YACAZ,MAAM,CAACC,EAAP,CAAUY,UAAV,CAAqB,EAArB;YACAb,MAAM,CAACC,EAAP,CAAUY,UAAV;YAGAb,MAAM,CAACC,EAAP,CAAUY,UAAV,CAAqB,EAArB;;UA9BH;YAAA;YAAA,OAiCSb,MAAM,CAACC,EAAP,CAAUa,YAAV,CAAuB,cAAvB,CAjCT;;UAAA;YAAA;;UAAA;YAAA,MAoCS,IAAIC,KAAJ,CAAU,gDAAV,CApCT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CARsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAiDehB,M"}
1
+ {"version":3,"file":"wrongCommand.script.js","names":["script","player","renderCommand","ui","onboardingStore","getStage","stage","prompt","type","label","options","choices","value","answer","reset","renderLine","waitForEnter","Error"],"sources":["../../../../src/features/onboard/scripts/wrongCommand.script.ts"],"sourcesContent":["import { Script } from '../ScriptPlayer'\nimport { renderCommand } from './onboarding.short.script'\n\nconst script: Script = [\n\t'Hold on! ✋',\n\t\"I don't think you're supposed to be here!\",\n\t'I was really expecting you to run:',\n\t(player) => {\n\t\trenderCommand(player.ui, player.onboardingStore.getStage() as string)\n\t},\n\t'But you are in a completely different place.',\n\tasync (player) => {\n\t\tconst stage = player.onboardingStore.getStage() as string\n\t\tconst answer = await player.ui.prompt({\n\t\t\ttype: 'select',\n\t\t\tlabel: 'What should we do?',\n\t\t\toptions: {\n\t\t\t\tchoices: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Continue forward',\n\t\t\t\t\t\tvalue: 'letMePass',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: 'Stop onboarding',\n\t\t\t\t\t\tvalue: 'disable',\n\t\t\t\t\t} as const,\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: `Execute \\`${stage}\\``,\n\t\t\t\t\t\tvalue: 'executeCommand',\n\t\t\t\t\t} as const,\n\t\t\t\t],\n\t\t\t},\n\t\t})\n\n\t\tswitch (answer) {\n\t\t\tcase 'disable':\n\t\t\t\tplayer.onboardingStore.reset()\n\t\t\t\tplayer.ui.renderLine('')\n\t\t\t\tplayer.ui.renderLine(\n\t\t\t\t\t`Ok, I've disabled onboarding for now. Hope to see you again soon!`\n\t\t\t\t)\n\t\t\t\tplayer.ui.renderLine('')\n\t\t\t// eslint-disable-next-line no-fallthrough\n\t\t\tcase 'letMePass':\n\t\t\t\tawait player.ui.waitForEnter('As you were!')\n\t\t\t\tbreak\n\t\t\tdefault:\n\t\t\t\tthrow new Error('Coming soon! For now you have to manually run!')\n\t\t}\n\t},\n]\n\nexport default script\n"],"mappings":";;;;;;;;;;;;;AACA;;AAEA,IAAMA,MAAc,GAAG,CACtB,YADsB,EAEtB,2CAFsB,EAGtB,oCAHsB,EAItB,UAACC,MAAD,EAAY;EACX,IAAAC,8BAAA,EAAcD,MAAM,CAACE,EAArB,EAAyBF,MAAM,CAACG,eAAP,CAAuBC,QAAvB,EAAzB;AACA,CANqB,EAOtB,8CAPsB;EAAA,yFAQtB,iBAAOJ,MAAP;IAAA;IAAA;MAAA;QAAA;UAAA;YACOK,KADP,GACeL,MAAM,CAACG,eAAP,CAAuBC,QAAvB,EADf;YAAA;YAAA,OAEsBJ,MAAM,CAACE,EAAP,CAAUI,MAAV,CAAiB;cACrCC,IAAI,EAAE,QAD+B;cAErCC,KAAK,EAAE,oBAF8B;cAGrCC,OAAO,EAAE;gBACRC,OAAO,EAAE,CACR;kBACCF,KAAK,EAAE,kBADR;kBAECG,KAAK,EAAE;gBAFR,CADQ,EAKR;kBACCH,KAAK,EAAE,iBADR;kBAECG,KAAK,EAAE;gBAFR,CALQ,EASR;kBACCH,KAAK,qBAAeH,KAAf,MADN;kBAECM,KAAK,EAAE;gBAFR,CATQ;cADD;YAH4B,CAAjB,CAFtB;;UAAA;YAEOC,MAFP;YAAA,cAuBSA,MAvBT;YAAA,gCAwBO,SAxBP,uBAgCO,WAhCP;YAAA;;UAAA;YAyBGZ,MAAM,CAACG,eAAP,CAAuBU,KAAvB;YACAb,MAAM,CAACE,EAAP,CAAUY,UAAV,CAAqB,EAArB;YACAd,MAAM,CAACE,EAAP,CAAUY,UAAV;YAGAd,MAAM,CAACE,EAAP,CAAUY,UAAV,CAAqB,EAArB;;UA9BH;YAAA;YAAA,OAiCSd,MAAM,CAACE,EAAP,CAAUa,YAAV,CAAuB,cAAvB,CAjCT;;UAAA;YAAA;;UAAA;YAAA,MAoCS,IAAIC,KAAJ,CAAU,gDAAV,CApCT;;UAAA;UAAA;YAAA;QAAA;MAAA;IAAA;EAAA,CARsB;;EAAA;IAAA;EAAA;AAAA,IAAvB;eAiDejB,M"}
@@ -1 +1 @@
1
- {"version":3,"file":"OnboardingStore.js","names":["OnboardingStore","options","cwd","generateCwd","load","schemasByHome","homeDir","SchemaEntityFactory","Entity","onboardingSchema","values","schema","getValues","writeValues","saved","readValues","setValues","stage","mode","get","set","validate","save","undefined","setMode","home","cwdOverride","diskUtil","createTempDir","AbstractLocalStore"],"sources":["../../../../src/features/onboard/stores/OnboardingStore.ts"],"sourcesContent":["import { SchemaEntityFactory, StaticSchemaEntity } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport onboardingSchema from '#spruce/schemas/spruceCli/v2020_07_22/onboarding.schema'\nimport AbstractLocalStore, {\n\tLocalStoreSettings,\n} from '../../../stores/AbstractLocalStore'\nimport { StoreOptions } from '../../../stores/AbstractStore'\n\nexport interface OnboardingStoreSettings\n\textends LocalStoreSettings,\n\t\tSpruceSchemas.SpruceCli.v2020_07_22.Onboarding {}\n\ntype OnboardingSchema = SpruceSchemas.SpruceCli.v2020_07_22.OnboardingSchema\nexport type OnboardingMode = OnboardingStoreSettings['mode']\nexport type OnboardingStage = OnboardingStoreSettings['stage']\n\nexport default class OnboardingStore extends AbstractLocalStore<OnboardingStoreSettings> {\n\tpublic readonly name = 'onboarding'\n\tprivate static cwdOverride: string\n\n\tprivate static schemasByHome: Record<\n\t\tstring,\n\t\tStaticSchemaEntity<OnboardingSchema>\n\t> = {}\n\n\tpublic constructor(options: StoreOptions) {\n\t\tsuper(options)\n\t\tthis.cwd = this.generateCwd()\n\t\tthis.load()\n\t}\n\n\tprivate get schema() {\n\t\tif (!OnboardingStore.schemasByHome[this.homeDir]) {\n\t\t\tOnboardingStore.schemasByHome[this.homeDir] =\n\t\t\t\tSchemaEntityFactory.Entity(onboardingSchema)\n\t\t}\n\n\t\treturn OnboardingStore.schemasByHome[this.homeDir]\n\t}\n\n\tprivate save() {\n\t\tconst values = this.schema.getValues()\n\t\tthis.writeValues(values)\n\t\treturn this\n\t}\n\n\tprivate load() {\n\t\tconst saved = this.readValues()\n\t\tthis.schema.setValues({\n\t\t\tstage: saved.stage ?? null,\n\t\t\tmode: saved.mode ?? 'off',\n\t\t})\n\t\treturn this\n\t}\n\n\tpublic getMode(): OnboardingMode {\n\t\treturn this.schema.get('mode')\n\t}\n\n\tpublic setMode(mode: OnboardingMode) {\n\t\tthis.schema.set('mode', mode)\n\t\tthis.schema.validate()\n\t\tthis.save()\n\t}\n\n\tpublic getStage() {\n\t\treturn this.schema.get('stage')\n\t}\n\n\tpublic setStage(stage: OnboardingStage) {\n\t\tthis.schema.set('stage', stage)\n\t\tthis.schema.validate()\n\t\tthis.save()\n\t}\n\n\tpublic reset() {\n\t\tthis.schema.set('stage', undefined)\n\t\tthis.setMode('off')\n\t}\n\n\tpublic static overrideCwd(cwd: string) {\n\t\tthis.cwdOverride = cwd\n\t}\n\n\tprotected generateCwd() {\n\t\tconst home =\n\t\t\tOnboardingStore.cwdOverride ?? diskUtil.createTempDir('spruce-cli')\n\t\treturn home\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;IAaqBA,e;;;;;EASpB,yBAAmBC,OAAnB,EAA0C;IAAA;;IAAA;IACzC,0BAAMA,OAAN;IADyC,yFARnB,YAQmB;IAEzC,MAAKC,GAAL,GAAW,MAAKC,WAAL,EAAX;;IACA,MAAKC,IAAL;;IAHyC;EAIzC;;;;SAED,eAAqB;MACpB,IAAI,CAACJ,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,CAAL,EAAkD;QACjDN,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,IACCC,4BAAoBC,MAApB,CAA2BC,sBAA3B,CADD;MAEA;;MAED,OAAOT,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,CAAP;IACA;;;WAED,gBAAe;MACd,IAAMI,MAAM,GAAG,KAAKC,MAAL,CAAYC,SAAZ,EAAf;MACA,KAAKC,WAAL,CAAiBH,MAAjB;MACA,OAAO,IAAP;IACA;;;WAED,gBAAe;MAAA;;MACd,IAAMI,KAAK,GAAG,KAAKC,UAAL,EAAd;MACA,KAAKJ,MAAL,CAAYK,SAAZ,CAAsB;QACrBC,KAAK,kBAAEH,KAAK,CAACG,KAAR,uDAAiB,IADD;QAErBC,IAAI,iBAAEJ,KAAK,CAACI,IAAR,qDAAgB;MAFC,CAAtB;MAIA,OAAO,IAAP;IACA;;;WAED,mBAAiC;MAChC,OAAO,KAAKP,MAAL,CAAYQ,GAAZ,CAAgB,MAAhB,CAAP;IACA;;;WAED,iBAAeD,IAAf,EAAqC;MACpC,KAAKP,MAAL,CAAYS,GAAZ,CAAgB,MAAhB,EAAwBF,IAAxB;MACA,KAAKP,MAAL,CAAYU,QAAZ;MACA,KAAKC,IAAL;IACA;;;WAED,oBAAkB;MACjB,OAAO,KAAKX,MAAL,CAAYQ,GAAZ,CAAgB,OAAhB,CAAP;IACA;;;WAED,kBAAgBF,KAAhB,EAAwC;MACvC,KAAKN,MAAL,CAAYS,GAAZ,CAAgB,OAAhB,EAAyBH,KAAzB;MACA,KAAKN,MAAL,CAAYU,QAAZ;MACA,KAAKC,IAAL;IACA;;;WAED,iBAAe;MACd,KAAKX,MAAL,CAAYS,GAAZ,CAAgB,OAAhB,EAAyBG,SAAzB;MACA,KAAKC,OAAL,CAAa,KAAb;IACA;;;WAMD,uBAAwB;MAAA;;MACvB,IAAMC,IAAI,4BACTzB,eAAe,CAAC0B,WADP,yEACsBC,2BAASC,aAAT,CAAuB,YAAvB,CADhC;MAEA,OAAOH,IAAP;IACA;;;WARD,qBAA0BvB,GAA1B,EAAuC;MACtC,KAAKwB,WAAL,GAAmBxB,GAAnB;IACA;;;EAlE2C2B,+B;;;iCAAxB7B,e;iCAAAA,e,mBAOhB,E"}
1
+ {"version":3,"file":"OnboardingStore.js","names":["OnboardingStore","options","cwd","generateCwd","load","schemasByHome","homeDir","SchemaEntityFactory","Entity","onboardingSchema","values","schema","getValues","writeValues","saved","readValues","setValues","stage","mode","get","set","validate","save","undefined","setMode","home","cwdOverride","diskUtil","createTempDir","AbstractLocalStore"],"sources":["../../../../src/features/onboard/stores/OnboardingStore.ts"],"sourcesContent":["import { SchemaEntityFactory, StaticSchemaEntity } from '@sprucelabs/schema'\nimport { diskUtil } from '@sprucelabs/spruce-skill-utils'\nimport { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport onboardingSchema from '#spruce/schemas/spruceCli/v2020_07_22/onboarding.schema'\nimport AbstractLocalStore, {\n\tLocalStoreSettings,\n} from '../../../stores/AbstractLocalStore'\nimport { StoreOptions } from '../../../stores/AbstractStore'\n\nexport interface OnboardingStoreSettings\n\textends LocalStoreSettings,\n\t\tSpruceSchemas.SpruceCli.v2020_07_22.Onboarding {}\n\ntype OnboardingSchema = SpruceSchemas.SpruceCli.v2020_07_22.OnboardingSchema\nexport type OnboardingMode = OnboardingStoreSettings['mode']\nexport type OnboardingStage = OnboardingStoreSettings['stage']\n\nexport default class OnboardingStore extends AbstractLocalStore<OnboardingStoreSettings> {\n\tpublic readonly name = 'onboarding'\n\tprivate static cwdOverride: string\n\n\tprivate static schemasByHome: Record<\n\t\tstring,\n\t\tStaticSchemaEntity<OnboardingSchema>\n\t> = {}\n\n\tpublic constructor(options: StoreOptions) {\n\t\tsuper(options)\n\t\tthis.cwd = this.generateCwd()\n\t\tthis.load()\n\t}\n\n\tprivate get schema() {\n\t\tif (!OnboardingStore.schemasByHome[this.homeDir]) {\n\t\t\tOnboardingStore.schemasByHome[this.homeDir] =\n\t\t\t\tSchemaEntityFactory.Entity(onboardingSchema)\n\t\t}\n\n\t\treturn OnboardingStore.schemasByHome[this.homeDir]\n\t}\n\n\tprivate save() {\n\t\tconst values = this.schema.getValues()\n\t\tthis.writeValues(values)\n\t\treturn this\n\t}\n\n\tprivate load() {\n\t\tconst saved = this.readValues()\n\t\tthis.schema.setValues({\n\t\t\tstage: saved.stage ?? null,\n\t\t\tmode: saved.mode ?? 'off',\n\t\t})\n\t\treturn this\n\t}\n\n\tpublic getMode(): OnboardingMode {\n\t\treturn this.schema.get('mode')\n\t}\n\n\tpublic setMode(mode: OnboardingMode) {\n\t\tthis.schema.set('mode', mode)\n\t\tthis.schema.validate()\n\t\tthis.save()\n\t}\n\n\tpublic getStage() {\n\t\treturn this.schema.get('stage')\n\t}\n\n\tpublic setStage(stage: OnboardingStage) {\n\t\tthis.schema.set('stage', stage)\n\t\tthis.schema.validate()\n\t\tthis.save()\n\t}\n\n\tpublic reset() {\n\t\tthis.schema.set('stage', undefined)\n\t\tthis.setMode('off')\n\t}\n\n\tpublic static overrideCwd(cwd: string) {\n\t\tthis.cwdOverride = cwd\n\t}\n\n\tprotected generateCwd() {\n\t\tconst home =\n\t\t\tOnboardingStore.cwdOverride ?? diskUtil.createTempDir('spruce-cli')\n\t\treturn home\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;AACA;;;;;;IAaqBA,e;;;;;EASpB,yBAAmBC,OAAnB,EAA0C;IAAA;;IAAA;IACzC,0BAAMA,OAAN;IADyC,yFARnB,YAQmB;IAEzC,MAAKC,GAAL,GAAW,MAAKC,WAAL,EAAX;;IACA,MAAKC,IAAL;;IAHyC;EAIzC;;;;SAED,eAAqB;MACpB,IAAI,CAACJ,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,CAAL,EAAkD;QACjDN,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,IACCC,2BAAA,CAAoBC,MAApB,CAA2BC,sBAA3B,CADD;MAEA;;MAED,OAAOT,eAAe,CAACK,aAAhB,CAA8B,KAAKC,OAAnC,CAAP;IACA;;;WAED,gBAAe;MACd,IAAMI,MAAM,GAAG,KAAKC,MAAL,CAAYC,SAAZ,EAAf;MACA,KAAKC,WAAL,CAAiBH,MAAjB;MACA,OAAO,IAAP;IACA;;;WAED,gBAAe;MAAA;;MACd,IAAMI,KAAK,GAAG,KAAKC,UAAL,EAAd;MACA,KAAKJ,MAAL,CAAYK,SAAZ,CAAsB;QACrBC,KAAK,kBAAEH,KAAK,CAACG,KAAR,uDAAiB,IADD;QAErBC,IAAI,iBAAEJ,KAAK,CAACI,IAAR,qDAAgB;MAFC,CAAtB;MAIA,OAAO,IAAP;IACA;;;WAED,mBAAiC;MAChC,OAAO,KAAKP,MAAL,CAAYQ,GAAZ,CAAgB,MAAhB,CAAP;IACA;;;WAED,iBAAeD,IAAf,EAAqC;MACpC,KAAKP,MAAL,CAAYS,GAAZ,CAAgB,MAAhB,EAAwBF,IAAxB;MACA,KAAKP,MAAL,CAAYU,QAAZ;MACA,KAAKC,IAAL;IACA;;;WAED,oBAAkB;MACjB,OAAO,KAAKX,MAAL,CAAYQ,GAAZ,CAAgB,OAAhB,CAAP;IACA;;;WAED,kBAAgBF,KAAhB,EAAwC;MACvC,KAAKN,MAAL,CAAYS,GAAZ,CAAgB,OAAhB,EAAyBH,KAAzB;MACA,KAAKN,MAAL,CAAYU,QAAZ;MACA,KAAKC,IAAL;IACA;;;WAED,iBAAe;MACd,KAAKX,MAAL,CAAYS,GAAZ,CAAgB,OAAhB,EAAyBG,SAAzB;MACA,KAAKC,OAAL,CAAa,KAAb;IACA;;;WAMD,uBAAwB;MAAA;;MACvB,IAAMC,IAAI,4BACTzB,eAAe,CAAC0B,WADP,yEACsBC,0BAAA,CAASC,aAAT,CAAuB,YAAvB,CADhC;MAEA,OAAOH,IAAP;IACA;;;WARD,qBAA0BvB,GAA1B,EAAuC;MACtC,KAAKwB,WAAL,GAAmBxB,GAAnB;IACA;;;EAlE2C2B,+B;;;iCAAxB7B,e;iCAAAA,e,mBAOhB,E"}
@@ -1 +1 @@
1
- {"version":3,"file":"OrganizationFeature.js","names":["OrganizationFeature","code","isRequired","diskUtil","resolvePath","__dirname","AbstractFeature"],"sources":["../../../src/features/organization/OrganizationFeature.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\torganization: OrganizationFeature\n\t}\n}\n\nexport default class OrganizationFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'organization'\n\tpublic nameReadable = 'Organization'\n\tpublic description = 'Manage the organizations you are part of'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t\t{\n\t\t\tcode: 'event',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IASqBA,mB;;;;;;;;;;;;;;;6FACO,c;qGACL,c;oGACD,0C;qGACsB,CAC1C;MACCC,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAD0C,EAK1C;MACCD,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAL0C,C;4GAUd,E;mGAETC,2BAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;;;;;EAhB4BC,4B"}
1
+ {"version":3,"file":"OrganizationFeature.js","names":["OrganizationFeature","code","isRequired","diskUtil","resolvePath","__dirname","AbstractFeature"],"sources":["../../../src/features/organization/OrganizationFeature.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\torganization: OrganizationFeature\n\t}\n}\n\nexport default class OrganizationFeature extends AbstractFeature {\n\tpublic code: FeatureCode = 'organization'\n\tpublic nameReadable = 'Organization'\n\tpublic description = 'Manage the organizations you are part of'\n\tpublic dependencies: FeatureDependency[] = [\n\t\t{\n\t\t\tcode: 'skill',\n\t\t\tisRequired: true,\n\t\t},\n\t\t{\n\t\t\tcode: 'event',\n\t\t\tisRequired: true,\n\t\t},\n\t]\n\tpublic packageDependencies = []\n\n\tpublic actionsDir = diskUtil.resolvePath(__dirname, 'actions')\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;IASqBA,mB;;;;;;;;;;;;;;;6FACO,c;qGACL,c;oGACD,0C;qGACsB,CAC1C;MACCC,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAD0C,EAK1C;MACCD,IAAI,EAAE,OADP;MAECC,UAAU,EAAE;IAFb,CAL0C,C;4GAUd,E;mGAETC,0BAAA,CAASC,WAAT,CAAqBC,SAArB,EAAgC,SAAhC,C;;;;;EAhB4BC,4B"}