@sprucelabs/spruce-cli 19.1.41 → 19.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/build/.spruce/errors/errors.types.d.ts +19 -0
- package/build/.spruce/errors/errors.types.js.map +1 -1
- package/build/.spruce/errors/options.types.d.ts +4 -1
- package/build/.spruce/errors/options.types.js.map +1 -1
- package/build/.spruce/errors/spruceCli/actionCancelled.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/bootError.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/buildFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/cacheNotEnabled.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/commandAborted.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/commandBlocked.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/commandNotImplemented.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/createAutoloaderFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/dependencyExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/deployFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/directoryEmpty.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/directoryNotSkill.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/dockerNotStarted.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/executingCommandFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/failedToImport.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/featureNotInstalled.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/fileExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/generic.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/invalidCommand.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/invalidEventContract.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/invalidFeatureCode.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/invalidTestDirectory.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/lintFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/mercuryResponseError.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/missingDependencies.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/missingDependenciesDependency.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/noOrganizationsFound.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/noSkillsRegistered.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/notImplemented.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/notLoggedIn.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/schemaExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/schemaFailedToImport.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/schemaTemplateItemBuildingFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/skillNotFound.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/skillNotRegistered.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/skillViewExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/storeExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/testFailed.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/themeExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/transportAlreadyExists.schema.js.map +1 -1
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.d.ts +3 -0
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.js +23 -0
- package/build/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.js.map +1 -0
- package/build/.spruce/errors/spruceCli/vscodeNotInstalled.schema.js.map +1 -1
- package/build/.spruce/events/events.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/didRegisterSkillViews.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/generateUrl.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/getActiveTheme.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/getSkillViews.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/listViews.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/registerDashboardCards.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/registerSkillViews.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/heartwood/upsertTheme.v2021_02_11.contract.js.map +1 -1
- package/build/.spruce/events/spruceCli/registerSkillViews.v2021_04_11.contract.js.map +1 -1
- package/build/.spruce/schemas/fields/fieldClassMap.js.map +1 -1
- package/build/.spruce/schemas/fields/fields.types.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/didRegisterSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/generateUrlResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getActiveThemeEmitTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getActiveThemeEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getActiveThemeResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getSkillViewsResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/getViewControllersEmitTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/listViewsResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/listViewsResult.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/registerDashboardCardsResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsEmitPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/registerSkillViewsResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/theme.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/upsertThemeEmitPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/upsertThemeEmitTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/upsertThemeEmitTargetAndPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwood/v2021_02_11/upsertThemeResponsePayload.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/theme.schema.js.map +1 -1
- package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/themeProps.schema.js.map +1 -1
- package/build/.spruce/schemas/schemas.types.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/choice.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/link.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/location.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/message.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/messageSource.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/messageTarget.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/organization.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/person.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/personLocation.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/personOrganization.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/role.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/sendMessage.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/skill.schema.js.map +1 -1
- package/build/.spruce/schemas/spruce/v2020_07_22/skillCreator.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/actionResponse.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/bootSkillOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/createConversationTopicOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/createErrorOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/createOrganizationOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/createSchemaOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/createTestOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/generatedDir.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/generatedFile.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/installSkillAtOrganizationOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/listenEventOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/namedTemplateItem.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/nodeFeatureOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/npmPackage.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/onboardOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/onboarding.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/personWithToken.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/registerDashboardWidgetsEmitPayloadSchema.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/setupTestsOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/setupVscodeOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/skillFeature.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/syncErrorOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/syncEventOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/syncSchemaFieldsOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/syncSchemasOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/testOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/upgradeSkillOptions.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceCli/v2020_07_22/watcherDidDetectChangesEmitPayload.schema.js.map +1 -1
- package/build/.spruce/schemas/spruceEventUtils/v2021_09_13/eventSource.schema.js.map +1 -1
- package/build/.spruce/skill.types.js.map +1 -1
- package/build/GlobalEmitter.js.map +1 -1
- package/build/InFlightEntertainment.js.map +1 -1
- package/build/__tests__/behavioral/AddingADependency.test.js.map +1 -1
- package/build/__tests__/behavioral/BlockingCommands.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingTheCli.test.js.map +1 -1
- package/build/__tests__/behavioral/BootingWithBadFiles.test.js.map +1 -1
- package/build/__tests__/behavioral/CreatingAConversationTopic.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/DeployingToSandbox.test.js.map +1 -1
- package/build/__tests__/behavioral/EnablingAndDisablingCache.test.js.map +1 -1
- package/build/__tests__/behavioral/GettingCliVersion.test.js.map +1 -1
- package/build/__tests__/behavioral/ManagingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/OverridingCommandsInPackageJson.test.js.map +1 -1
- package/build/__tests__/behavioral/RegisteringConversationsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/RememberingUpgradeSelections.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingLogTransportsInASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingRemote.test.js.map +1 -1
- package/build/__tests__/behavioral/SettingUpVscode.test.js.map +1 -1
- package/build/__tests__/behavioral/TestingAConversation.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/CreatingANewErrorBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorClassInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/KeepingErrorsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/errors/SettingUpErrors.test.js.map +1 -1
- package/build/__tests__/behavioral/eventContract/PullingMercuryEventContract.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAListener.test.js.map +1 -1
- package/build/__tests__/behavioral/events/CreatingAnEvent.test.js.map +1 -1
- package/build/__tests__/behavioral/events/EventWriter.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingEventsInSync2.test.js.map +1 -1
- package/build/__tests__/behavioral/events/KeepingListenersInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToAnEventYouCreate.test.js.map +1 -1
- package/build/__tests__/behavioral/events/ListeningToCoreEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/RegisteringEventsOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/events/RegisteringGlobalEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SettingUpEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SkillEmitsBootEvents.test.js.map +1 -1
- package/build/__tests__/behavioral/events/SyncingEventsOnlyFromDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/node/CreatingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/onboard/StartingOnboarding.test.js.map +1 -1
- package/build/__tests__/behavioral/organization/CreatingAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/CreatingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionPlugin.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionStore.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/PermissionWriter.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/SyncingPermissions.test.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/AbstractPermissionsTest.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/generateShortAlphaId.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/renderPermissionTestFile.js.map +1 -1
- package/build/__tests__/behavioral/permissions/support/sortPermissionContracts.js.map +1 -1
- package/build/__tests__/behavioral/person/LoggingInAsPerson.test.js.map +1 -1
- package/build/__tests__/behavioral/person/SeeWhoIsLoggedIn.test.js.map +1 -1
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingANewSchemaBuilder.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/CreatingSchemasWithGenerics.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GeneratingFieldTypesOnly.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/GettingSchemasFromHealthCheck.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/HandlesRelatedSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/ImportingSchemaImports.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/KeepingSchemasInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemas.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SettingUpSchemasForModuleDistribution.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/SyncingBadSchemasProvidesHelpfulErrorMessages.test.js.map +1 -1
- package/build/__tests__/behavioral/schemas/UsingSchemasInCli.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/BootingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/CreatingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/InstallingASkillAtAnOrg.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/LoggingInAsASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RebuildingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/RegisteringASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/skill/SettingUpASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/CreatingADataStore.test.js.map +1 -1
- package/build/__tests__/behavioral/stores/KeepingDataStoresInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/CreatingATest.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/RunningTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpASkillForTesting.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/SettingUpTests.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/TestReporterSettingsRemembered.test.js.map +1 -1
- package/build/__tests__/behavioral/tests/TestingDataStores.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpdatingDependencies2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingANodeModule.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill2.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill3.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill4.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithListeners.test.js.map +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingWithSandboxFeatureInstalled.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.d.ts +1 -1
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js +6 -6
- package/build/__tests__/behavioral/views/CreatingASkillView.test.js.map +1 -1
- package/build/__tests__/behavioral/views/CreatingATheme.test.js.map +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.d.ts +1 -1
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js +6 -6
- package/build/__tests__/behavioral/views/KeepingViewsInSync.test.js.map +1 -1
- package/build/__tests__/behavioral/views/RegisteringSkillViewOnBoot.test.js.map +1 -1
- package/build/__tests__/behavioral/views/SettingUpViews.test.js.map +1 -1
- package/build/__tests__/behavioral/views/TestingViewControllers.test.js.map +1 -1
- package/build/__tests__/behavioral/views/WatchingSkillViews.test.js.map +1 -1
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.d.ts +23 -0
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.js +355 -0
- package/build/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.js.map +1 -0
- package/build/__tests__/behavioral/watchers/WatchingForChanges.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter2.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter3.test.js.map +1 -1
- package/build/__tests__/implementation/ActionExecuter4.test.js.map +1 -1
- package/build/__tests__/implementation/ArgParser.test.js.map +1 -1
- package/build/__tests__/implementation/BuildService.test.js.map +1 -1
- package/build/__tests__/implementation/BulkImporting.test.js.map +1 -1
- package/build/__tests__/implementation/CachingImports.test.js.map +1 -1
- package/build/__tests__/implementation/CommandOptionBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/CommanderCommandResultMapper.test.js.map +1 -1
- package/build/__tests__/implementation/DataStoreStore.test.js.map +1 -1
- package/build/__tests__/implementation/DeletingOrphanedSchemaDefinitions.test.js.map +1 -1
- package/build/__tests__/implementation/EventContractCleanerUtil.test.js.map +1 -1
- package/build/__tests__/implementation/EventStore.test.js.map +1 -1
- package/build/__tests__/implementation/EventTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureCommandAttacher.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureFixture.test.js.map +1 -1
- package/build/__tests__/implementation/FeatureInstaller.test.js.map +1 -1
- package/build/__tests__/implementation/FeaturesUtil.test.js.map +1 -1
- package/build/__tests__/implementation/FieldTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/GlobalEmitter.test.js.map +1 -1
- package/build/__tests__/implementation/Introspection.test.js.map +1 -1
- package/build/__tests__/implementation/JestJsonParser.test.js.map +1 -1
- package/build/__tests__/implementation/LintService.test.js.map +1 -1
- package/build/__tests__/implementation/ListenerStore.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptLoader.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingScriptPlayer.test.js.map +1 -1
- package/build/__tests__/implementation/OnboardingStore.test.js.map +1 -1
- package/build/__tests__/implementation/OrganizationStore.test.js.map +1 -1
- package/build/__tests__/implementation/ParentTestFinder.test.js.map +1 -1
- package/build/__tests__/implementation/PkgService.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaStore.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaTemplateItemBuilder.test.js.map +1 -1
- package/build/__tests__/implementation/SchemaValueTypeWriter.test.js.map +1 -1
- package/build/__tests__/implementation/ServiceFactory.test.js.map +1 -1
- package/build/__tests__/implementation/SettingUpANodeModule.test.js.map +1 -1
- package/build/__tests__/implementation/SkillStore.test.js.map +1 -1
- package/build/__tests__/implementation/StoreFeature.test.js.map +1 -1
- package/build/__tests__/implementation/TestReporter.test.js.map +1 -1
- package/build/__tests__/implementation/TestRunner.test.js.map +1 -1
- package/build/__tests__/implementation/ValueTypeMapping.test.js.map +1 -1
- package/build/__tests__/implementation/Widgets.test.js.map +1 -1
- package/build/__tests__/support/EventFaker.js.map +1 -1
- package/build/__tests__/support/onTestFileResult.js.map +1 -1
- package/build/__tests__/support/scripts/first.script.js.map +1 -1
- package/build/__tests__/support/scripts/second.script.js.map +1 -1
- package/build/__tests__/support/scripts/third.test.script.js.map +1 -1
- package/build/addons/filePrompt.addon.js.map +1 -1
- package/build/boot.js.map +1 -1
- package/build/cli/Cli.js.map +1 -1
- package/build/components/AbstractComponent.js.map +1 -1
- package/build/components/FormComponent.js.map +1 -1
- package/build/components/QuizComponent.js.map +1 -1
- package/build/constants.js.map +1 -1
- package/build/errors/SpruceError.js +3 -0
- package/build/errors/SpruceError.js.map +1 -1
- package/build/errors/actionCancelled.builder.js.map +1 -1
- package/build/errors/bootError.builder.js.map +1 -1
- package/build/errors/buildFailed.builder.js.map +1 -1
- package/build/errors/cacheNotEnabled.builder.js.map +1 -1
- package/build/errors/commandAborted.builder.js.map +1 -1
- package/build/errors/commandBlocked.builder.js.map +1 -1
- package/build/errors/commandNotImplemented.builder.js.map +1 -1
- package/build/errors/createAutoloaderFailed.builder.js.map +1 -1
- package/build/errors/dependencyExists.builder.js.map +1 -1
- package/build/errors/deployFailed.builder.js.map +1 -1
- package/build/errors/directoryEmpty.builder.js.map +1 -1
- package/build/errors/directoryNotSkill.builder.js.map +1 -1
- package/build/errors/dockerNotStarted.builder.js.map +1 -1
- package/build/errors/executingCommandFailed.builder.js.map +1 -1
- package/build/errors/failedToImport.builder.js.map +1 -1
- package/build/errors/featureNotInstalled.builder.js.map +1 -1
- package/build/errors/fileExists.builder.js.map +1 -1
- package/build/errors/generic.builder.js.map +1 -1
- package/build/errors/invalidCommand.builder.js.map +1 -1
- package/build/errors/invalidEventContract.builder.js.map +1 -1
- package/build/errors/invalidFeatureCode.builder.js.map +1 -1
- package/build/errors/invalidTestDirectory.builder.js.map +1 -1
- package/build/errors/lintFailed.builder.js.map +1 -1
- package/build/errors/mercuryResponseError.builder.js.map +1 -1
- package/build/errors/missingDependencies.builder.js.map +1 -1
- package/build/errors/noOrganizationsFound.builder.js.map +1 -1
- package/build/errors/noSkillsRegistered.builder.js.map +1 -1
- package/build/errors/notImplemented.builder.js.map +1 -1
- package/build/errors/notLoggedIn.builder.js.map +1 -1
- package/build/errors/schemaExists.builder.js.map +1 -1
- package/build/errors/schemaFailedToImport.builder.js.map +1 -1
- package/build/errors/schemaTemplateItemBuildingFailed.builder.js.map +1 -1
- package/build/errors/skillNotFound.builder.js.map +1 -1
- package/build/errors/skillNotRegistered.builder.js.map +1 -1
- package/build/errors/skillViewExists.builder.js.map +1 -1
- package/build/errors/storeExists.builder.js.map +1 -1
- package/build/errors/testFailed.builder.js.map +1 -1
- package/build/errors/themeExists.builder.js.map +1 -1
- package/build/errors/transportAlreadyExists.builder.js.map +1 -1
- package/build/errors/viewPluginAlreadyExists.builder.d.ts +11 -0
- package/build/errors/viewPluginAlreadyExists.builder.js +18 -0
- package/build/errors/viewPluginAlreadyExists.builder.js.map +1 -0
- package/build/errors/vscodeNotInstalled.builder.js.map +1 -1
- package/build/features/AbstractAction.js.map +1 -1
- package/build/features/AbstractFeature.js.map +1 -1
- package/build/features/ActionExecuter.js.map +1 -1
- package/build/features/ActionFactory.js.map +1 -1
- package/build/features/ActionQuestionAsker.js.map +1 -1
- package/build/features/FeatureCommandAttacher.js.map +1 -1
- package/build/features/FeatureInstaller.js.map +1 -1
- package/build/features/FeatureInstallerFactory.js.map +1 -1
- package/build/features/OverrideActionDecorator.js.map +1 -1
- package/build/features/cache/CacheFeature.js.map +1 -1
- package/build/features/cache/actions/DisableAction.js.map +1 -1
- package/build/features/cache/actions/EnableAction.js.map +1 -1
- package/build/features/cache/constants.js.map +1 -1
- package/build/features/conversation/ConversationFeature.js.map +1 -1
- package/build/features/conversation/actions/CreateAction.js.map +1 -1
- package/build/features/conversation/actions/TestAction.js.map +1 -1
- package/build/features/conversation/stores/ConversationStore.js.map +1 -1
- package/build/features/conversation/writers/ConversationWriter.js.map +1 -1
- package/build/features/dependencies/DependencyFeature.js.map +1 -1
- package/build/features/dependencies/actions/AddAction.js.map +1 -1
- package/build/features/dependencies/actions/ManageAction.js.map +1 -1
- package/build/features/deploy/DeployFeature.js.map +1 -1
- package/build/features/deploy/actions/HerokuAction.js.map +1 -1
- package/build/features/deploy/writers/DeployWriter.js.map +1 -1
- package/build/features/error/ErrorFeature.js.map +1 -1
- package/build/features/error/ParentTestFinder.js.map +1 -1
- package/build/features/error/actions/CreateAction.js.map +1 -1
- package/build/features/error/actions/SyncAction.js.map +1 -1
- package/build/features/error/writers/ErrorWriter.js.map +1 -1
- package/build/features/event/EventFeature.js.map +1 -1
- package/build/features/event/actions/CreateAction.js.map +1 -1
- package/build/features/event/actions/ListenAction.js.map +1 -1
- package/build/features/event/actions/SetRemoteAction.js.map +1 -1
- package/build/features/event/actions/SyncAction.js.map +1 -1
- package/build/features/event/actions/SyncListenersAction.js.map +1 -1
- package/build/features/event/builders/EventContractBuilder.js.map +1 -1
- package/build/features/event/builders/ListenerTemplateItemBuilder.js.map +1 -1
- package/build/features/event/services/EventSettingsService.js.map +1 -1
- package/build/features/event/services/RemoteService.js.map +1 -1
- package/build/features/event/stores/EventStore.js.map +1 -1
- package/build/features/event/stores/ListenerStore.js.map +1 -1
- package/build/features/event/writers/EventWriter.js.map +1 -1
- package/build/features/eventContract/EventContractFeature.js.map +1 -1
- package/build/features/eventContract/actions/PullAction.js.map +1 -1
- package/build/features/feature.utilities.js.map +1 -1
- package/build/features/features.types.js.map +1 -1
- package/build/features/log/LogFeature.js.map +1 -1
- package/build/features/log/actions/CreateTransportAction.js.map +1 -1
- package/build/features/log/writers/LogWriter.js.map +1 -1
- package/build/features/node/NodeFeature.js.map +1 -1
- package/build/features/node/actions/CreateAction.js.map +1 -1
- package/build/features/node/actions/UpdateDependenciesAction.js.map +1 -1
- package/build/features/node/actions/UpgradeAction.js.map +1 -1
- package/build/features/node/writers/NodeWriter.js.map +1 -1
- package/build/features/onboard/OnboardFeature.js.map +1 -1
- package/build/features/onboard/ScriptLoader.js.map +1 -1
- package/build/features/onboard/ScriptPlayer.js.map +1 -1
- package/build/features/onboard/actions/OnboardAction.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.first.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.immersive.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.returning.script.js.map +1 -1
- package/build/features/onboard/scripts/onboarding.short.script.js.map +1 -1
- package/build/features/onboard/scripts/todo/todo.create.skill.script.js.map +1 -1
- package/build/features/onboard/scripts/todo/todo.test.script.js.map +1 -1
- package/build/features/onboard/scripts/wrongCommand.script.js.map +1 -1
- package/build/features/onboard/stores/OnboardingStore.js.map +1 -1
- package/build/features/organization/OrganizationFeature.js.map +1 -1
- package/build/features/organization/actions/CreateAction.js.map +1 -1
- package/build/features/organization/actions/InstallAction.js.map +1 -1
- package/build/features/organization/stores/OrganizationStore.js.map +1 -1
- package/build/features/permission/PermissionFeature.js.map +1 -1
- package/build/features/permission/actions/CreateAction.js.map +1 -1
- package/build/features/permission/actions/SyncAction.js.map +1 -1
- package/build/features/permission/stores/PermissionStore.js.map +1 -1
- package/build/features/permission/writers/PermissionWriter.js.map +1 -1
- package/build/features/person/PersonFeature.js.map +1 -1
- package/build/features/person/actions/LoginAction.js.map +1 -1
- package/build/features/person/actions/LogoutAction.js.map +1 -1
- package/build/features/person/actions/WhoamiAction.js.map +1 -1
- package/build/features/polish/PolishFeature.js.map +1 -1
- package/build/features/polish/actions/SetupAction.js.map +1 -1
- package/build/features/polish/writers/PolishWriter.js.map +1 -1
- package/build/features/sandbox/SandboxFeature.js.map +1 -1
- package/build/features/sandbox/actions/SetupAction.js.map +1 -1
- package/build/features/sandbox/writers/SandboxWriter.js.map +1 -1
- package/build/features/schema/SchemaFeature.js.map +1 -1
- package/build/features/schema/ValueTypeBuilder.js.map +1 -1
- package/build/features/schema/actions/CreateAction.js.map +1 -1
- package/build/features/schema/actions/SyncAction.js.map +1 -1
- package/build/features/schema/actions/SyncFieldsAction.js.map +1 -1
- package/build/features/schema/services/SchemaService.js.map +1 -1
- package/build/features/schema/stores/SchemaStore.js.map +1 -1
- package/build/features/schema/utilities/schema.utility.js.map +1 -1
- package/build/features/schema/utilities/schemaDisk.utility.js.map +1 -1
- package/build/features/schema/utilities/schemaGenerator.utility.js.map +1 -1
- package/build/features/schema/writers/SchemaWriter.js.map +1 -1
- package/build/features/skill/SkillFeature.js.map +1 -1
- package/build/features/skill/actions/BootAction.js.map +1 -1
- package/build/features/skill/actions/CreateAction.js.map +1 -1
- package/build/features/skill/actions/DashboardAction.js.map +1 -1
- package/build/features/skill/actions/LoginAction.js.map +1 -1
- package/build/features/skill/actions/RebuildAction.js.map +1 -1
- package/build/features/skill/actions/RegisterAction.js.map +1 -1
- package/build/features/skill/stores/SkillStore.js.map +1 -1
- package/build/features/skill/updaters/Updater.js.map +1 -1
- package/build/features/skill/writers/SkillWriter.js.map +1 -1
- package/build/features/store/StoreFeature.js.map +1 -1
- package/build/features/store/actions/CreateAction.js.map +1 -1
- package/build/features/store/actions/SyncAction.js.map +1 -1
- package/build/features/store/stores/StoreStore.js.map +1 -1
- package/build/features/store/templateItemBuilders/StoreTemplateItemBuilder.js.map +1 -1
- package/build/features/store/writers/StoreWriter.js.map +1 -1
- package/build/features/test/TestFeature.js.map +1 -1
- package/build/features/test/TestLogItemGenerator.js.map +1 -1
- package/build/features/test/TestReporter.js.map +1 -1
- package/build/features/test/TestRunner.js.map +1 -1
- package/build/features/test/actions/CreateAction.js.map +1 -1
- package/build/features/test/actions/SetupAction.js.map +1 -1
- package/build/features/test/actions/TestAction.js.map +1 -1
- package/build/features/test/test.types.js.map +1 -1
- package/build/features/test/writers/TestWriter.js.map +1 -1
- package/build/features/universalDevDependencies.js.map +1 -1
- package/build/features/universalFileDescriptions.js.map +1 -1
- package/build/features/universalScripts.js.map +1 -1
- package/build/features/validateAndNormalize.utility.js.map +1 -1
- package/build/features/view/ViewFeature.js.map +1 -1
- package/build/features/view/actions/CreateAction.d.ts +6 -6
- package/build/features/view/actions/CreateAction.js +59 -59
- package/build/features/view/actions/CreateAction.js.map +1 -1
- package/build/features/view/actions/CreatePluginAction.d.ts +56 -0
- package/build/features/view/actions/CreatePluginAction.js +95 -0
- package/build/features/view/actions/CreatePluginAction.js.map +1 -0
- package/build/features/view/actions/CreateThemeAction.js.map +1 -1
- package/build/features/view/actions/SyncAction.d.ts +6 -6
- package/build/features/view/actions/SyncAction.js +29 -15
- package/build/features/view/actions/SyncAction.js.map +1 -1
- package/build/features/view/actions/WatchAction.js.map +1 -1
- package/build/features/view/stores/ViewStore.js.map +1 -1
- package/build/features/view/writers/ViewWriter.d.ts +5 -0
- package/build/features/view/writers/ViewWriter.js +44 -7
- package/build/features/view/writers/ViewWriter.js.map +1 -1
- package/build/features/vscode/VsCodeFeature.js.map +1 -1
- package/build/features/vscode/actions/SetupAction.js.map +1 -1
- package/build/features/vscode/services/VsCodeService.js.map +1 -1
- package/build/features/vscode/writers/VsCodeWriter.js.map +1 -1
- package/build/features/watch/WatchFeature.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/interfaces/SpyInterface.js.map +1 -1
- package/build/interfaces/TerminalInterface.js.map +1 -1
- package/build/schemas/v2020_07_22/actionResponse.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/bootSkillOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/createConversationTopicOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/createErrorOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/createOrganizationOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/createSchemaOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/createTestOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/generatedFile.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/installSkillAtOrganizationOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/listenEventOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/namedTemplateItem.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/nodeFeatureOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/onboardOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/onboarding.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/personWithToken.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/registerDashboardWidgetsEmitPayloadSchema.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/setupTestsOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/setupVscodeOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/skillFeature.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/syncErrorOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/syncEventOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/syncSchemaFieldsOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/syncSchemasOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/testOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/upgradeSkillOptions.builder.js.map +1 -1
- package/build/schemas/v2020_07_22/watcherDidDetectChangesEmitPayload.builder.js.map +1 -1
- package/build/services/BuildService.js.map +1 -1
- package/build/services/CommandService.js.map +1 -1
- package/build/services/DependencyService.js.map +1 -1
- package/build/services/GameService.js.map +1 -1
- package/build/services/ImportService.js.map +1 -1
- package/build/services/LintService.js.map +1 -1
- package/build/services/PkgService.js.map +1 -1
- package/build/services/ServiceFactory.js.map +1 -1
- package/build/services/TypeCheckerService.js.map +1 -1
- package/build/stores/AbstractLocalStore.js.map +1 -1
- package/build/stores/AbstractStore.js.map +1 -1
- package/build/stores/StoreFactory.js.map +1 -1
- package/build/templateItemBuilders/EventTemplateItemBuilder.js.map +1 -1
- package/build/templateItemBuilders/FieldTemplateItemBuilder.js.map +1 -1
- package/build/templateItemBuilders/SchemaTemplateItemBuilder.js.map +1 -1
- package/build/tests/AbstractCliTest.js.map +1 -1
- package/build/tests/AbstractErrorTest.js.map +1 -1
- package/build/tests/AbstractEventTest.js.map +1 -1
- package/build/tests/AbstractSchemaTest.js.map +1 -1
- package/build/tests/AbstractSkillTest.js.map +1 -1
- package/build/tests/AbstractTestTest.js.map +1 -1
- package/build/tests/CommandFaker.js.map +1 -1
- package/build/tests/JestJsonParser.js.map +1 -1
- package/build/tests/MockProgramFactory.js.map +1 -1
- package/build/tests/buildTestCache.js.map +1 -1
- package/build/tests/cleanTestCache.js.map +1 -1
- package/build/tests/cleanTestData.js.map +1 -1
- package/build/tests/constants.js.map +1 -1
- package/build/tests/fixtures/FeatureFixture.js.map +1 -1
- package/build/tests/fixtures/MercuryFixture.js.map +1 -1
- package/build/tests/fixtures/OrganizationFixture.js.map +1 -1
- package/build/tests/fixtures/PersonFixture.js.map +1 -1
- package/build/tests/fixtures/SkillFixture.js.map +1 -1
- package/build/tests/fixtures/ViewFixture.js.map +1 -1
- package/build/tests/utilities/test.utility.js.map +1 -1
- package/build/tests/utilities/uiAssert.utility.js.map +1 -1
- package/build/types/apiClient.types.js.map +1 -1
- package/build/types/cli.types.js.map +1 -1
- package/build/types/graphicsInterface.types.js.map +1 -1
- package/build/updaters/ScriptUpdater.js.map +1 -1
- package/build/utilities/action.utility.js.map +1 -1
- package/build/utilities/apiClient.utility.js.map +1 -1
- package/build/utilities/argParser.utility.js.map +1 -1
- package/build/utilities/commander.utility.js.map +1 -1
- package/build/utilities/duration.utility.js.map +1 -1
- package/build/utilities/eventContractCleaner.utility.js.map +1 -1
- package/build/utilities/form.utility.js.map +1 -1
- package/build/utilities/introspection.utility.js.map +1 -1
- package/build/utilities/isCi.js.map +1 -1
- package/build/utilities/tsConfig.utility.js.map +1 -1
- package/build/utilities/ui.utility.js.map +1 -1
- package/build/widgets/Theme.js.map +1 -1
- package/build/widgets/WidgetFactory.js.map +1 -1
- package/build/widgets/keySelectChoices.js.map +1 -1
- package/build/widgets/terminalKit/TKButtonWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkBaseWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkInputWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkLayoutCellWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkLayoutWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkMenuBarWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkPopupWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkProgressBarWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkTextWidget.js.map +1 -1
- package/build/widgets/terminalKit/TkWindowWidget.js.map +1 -1
- package/build/widgets/terminalKit/termKit.utility.js.map +1 -1
- package/build/widgets/types/button.types.js.map +1 -1
- package/build/widgets/types/factory.types.js.map +1 -1
- package/build/widgets/types/input.types.js.map +1 -1
- package/build/widgets/types/layout.types.js.map +1 -1
- package/build/widgets/types/menuBar.types.js.map +1 -1
- package/build/widgets/types/popup.types.js.map +1 -1
- package/build/widgets/types/progressBar.types.js.map +1 -1
- package/build/widgets/types/table.types.js.map +1 -1
- package/build/widgets/types/text.types.js.map +1 -1
- package/build/widgets/types/widgets.types.js.map +1 -1
- package/build/widgets/types/window.types.js.map +1 -1
- package/build/widgets/widget.utilities.js.map +1 -1
- package/build/writers/AbstractWriter.js.map +1 -1
- package/build/writers/WriterFactory.js.map +1 -1
- package/package.json +33 -33
- package/src/.spruce/errors/errors.types.ts +29 -0
- package/src/.spruce/errors/options.types.ts +4 -1
- package/src/.spruce/errors/spruceCli/viewPluginAlreadyExists.schema.ts +22 -0
- package/src/__tests__/behavioral/views/CreatingASkillView.test.ts +1 -1
- package/src/__tests__/behavioral/views/KeepingViewsInSync.test.ts +1 -1
- package/src/__tests__/behavioral/views/plugins/CreatingAViewPlugin.test.ts +161 -0
- package/src/errors/SpruceError.ts +4 -0
- package/src/errors/viewPluginAlreadyExists.builder.ts +12 -0
- package/src/features/view/actions/CreateAction.ts +72 -72
- package/src/features/view/actions/CreatePluginAction.ts +54 -0
- package/src/features/view/actions/SyncAction.ts +30 -14
- package/src/features/view/writers/ViewWriter.ts +45 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractWriter.js","names":["_fs","_interopRequireDefault","require","_path","_spruceSkillUtils","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_createForOfIteratorHelper","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","i","F","s","n","done","value","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","AbstractWriter","exports","options","_classCallCheck2","templates","ui","term","upgradeMode","fileDescriptions","linter","settings","_createClass2","key","_lint","_asyncToGenerator2","_regenerator","mark","_callee","file","_this$linter","wrap","_callee$","_context","prev","startLoading","concat","pathUtil","basename","fix","stop","lint","_x","_writeDirectoryTemplate","_callee2","context","destinationDir","filesToWrite","filesToSkip","_options$shouldConfir","shouldConfirmBeforeWriting","firstFileWriteMessage","files","results","_iterator","_step","generated","shouldWrite","shouldSkip","_callee2$","_context2","hasShownFirstWriteMessage","directoryTemplate","kind","code","sent","indexOf","filename","writeFileIfChangedMixinResults","join","relativePath","contents","t0","finish","abrupt","writeDirectoryTemplate","_x2","_writeFileIfChangedMixinResults","_callee3","destination","description","cwd","myResults","desc","action","fileDescription","write","cleanedName","isAlwaysSkipped","_write","answer","_args3","_callee3$","_context3","undefined","diskUtil","isDir","Error","getFileDescription","doesFileExist","confirmPromptOnFirstWrite","stopLoading","confirm","writeFile","isFileDifferent","shouldOverwriteIfChanged","cleanFilename","skipped","get","shouldAskForOverwrite","renderLine","prompt","type","label","choices","FILE_ACTION_OVERWRITE","FILE_ACTION_SKIP","FILE_ACTION_ALWAYS_SKIP","set","replace","path","_x3","_x4","_x5","_x6","relativeFile","sep","substr","_description$shouldOv","shouldOverwriteWhenChanged","_this$fileDescription","lower","toLowerCase","_iterator2","_step2","d","search","resolveFilenameWithFallback","dirOrFile","fallbackFileName","doesDirExist","fs","lstatSync","isDirectory","extname","resolvePath"],"sources":["../../src/writers/AbstractWriter.ts"],"sourcesContent":["import fs from 'fs'\nimport pathUtil from 'path'\nimport { diskUtil, SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { DirectoryTemplateCode, Templates } from '@sprucelabs/spruce-templates'\nimport {\n\tFILE_ACTION_ALWAYS_SKIP,\n\tFILE_ACTION_OVERWRITE,\n\tFILE_ACTION_SKIP,\n} from '../constants'\nimport LintService from '../services/LintService'\nimport { FileDescription, GeneratedFile, UpgradeMode } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\n\nexport type WriteResults = GeneratedFile[]\n\nexport interface WriterOptions {\n\ttemplates: Templates\n\tterm: GraphicsInterface\n\tupgradeMode?: UpgradeMode\n\tfileDescriptions: FileDescription[]\n\tlinter?: LintService\n\tsettings: SettingsService\n}\n\nexport interface WriteDirectoryTemplateOptions {\n\tdestinationDir: string\n\tcode: DirectoryTemplateCode\n\tfilesToWrite?: string[]\n\tfilesToSkip?: string[]\n\tcontext: any\n\tshouldConfirmBeforeWriting?: boolean\n\tfirstFileWriteMessage?: string\n}\n\nexport default abstract class AbstractWriter {\n\tprotected templates: Templates\n\tprotected ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate upgradeMode: UpgradeMode\n\tprivate fileDescriptions: FileDescription[] = []\n\tprivate shouldConfirmBeforeWriting = true\n\tprivate firstFileWriteMessage?: string\n\tprivate hasShownFirstWriteMessage = false\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: WriterOptions) {\n\t\tthis.templates = options.templates\n\t\tthis.ui = options.term\n\t\tthis.upgradeMode = options.upgradeMode\n\t\tthis.fileDescriptions = options.fileDescriptions\n\t\tthis.linter = options.linter\n\t\tthis.settings = options.settings\n\t}\n\n\tprotected async lint(file: string) {\n\t\tthis.ui.startLoading(`Linting ${pathUtil.basename(file)}...`)\n\t\tawait this.linter?.fix(file).catch(() => {})\n\t}\n\n\tprotected async writeDirectoryTemplate(\n\t\toptions: WriteDirectoryTemplateOptions\n\t) {\n\t\tconst {\n\t\t\tcontext,\n\t\t\tdestinationDir,\n\t\t\tfilesToWrite,\n\t\t\tfilesToSkip,\n\t\t\tshouldConfirmBeforeWriting = true,\n\t\t\tfirstFileWriteMessage,\n\t\t} = options\n\n\t\tthis.shouldConfirmBeforeWriting = shouldConfirmBeforeWriting\n\t\tthis.firstFileWriteMessage = firstFileWriteMessage\n\t\tthis.hasShownFirstWriteMessage = false\n\n\t\tconst files = await this.templates.directoryTemplate({\n\t\t\tkind: options.code,\n\t\t\tcontext: context ?? {},\n\t\t})\n\n\t\tlet results: WriteResults = []\n\n\t\tfor (const generated of files) {\n\t\t\tconst shouldWrite =\n\t\t\t\t!filesToWrite || filesToWrite.indexOf(generated.filename) > -1\n\t\t\tconst shouldSkip =\n\t\t\t\tfilesToSkip && filesToSkip.indexOf(generated.filename) > -1\n\n\t\t\tif (shouldWrite && !shouldSkip) {\n\t\t\t\tresults = await this.writeFileIfChangedMixinResults(\n\t\t\t\t\tpathUtil.join(destinationDir, generated.relativePath),\n\t\t\t\t\tgenerated.contents,\n\t\t\t\t\t'',\n\t\t\t\t\tresults,\n\t\t\t\t\tdestinationDir\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn results\n\t}\n\n\tprotected async writeFileIfChangedMixinResults(\n\t\tdestination: string,\n\t\tcontents: string,\n\t\tdescription: string,\n\t\tresults?: WriteResults,\n\t\tcwd = ''\n\t): Promise<WriteResults> {\n\t\tconst myResults: WriteResults = results ?? []\n\t\tlet desc: string | undefined = description\n\n\t\tconst name = pathUtil.basename(destination)\n\t\tlet action: GeneratedFile['action'] = 'skipped'\n\n\t\tif (diskUtil.isDir(destination)) {\n\t\t\tthrow new Error(`Can't write to a directory ${destination}.`)\n\t\t}\n\n\t\tconst fileDescription = this.getFileDescription(destination)\n\n\t\tif (!diskUtil.doesFileExist(destination)) {\n\t\t\tlet write = true\n\n\t\t\tif (\n\t\t\t\tthis.shouldConfirmBeforeWriting &&\n\t\t\t\tfileDescription?.confirmPromptOnFirstWrite\n\t\t\t) {\n\t\t\t\tthis.ui.stopLoading()\n\t\t\t\twrite = await this.ui.confirm(fileDescription.confirmPromptOnFirstWrite)\n\t\t\t}\n\n\t\t\tif (write) {\n\t\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\t\taction = 'generated'\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.isFileDifferent(destination, contents) &&\n\t\t\tthis.shouldOverwriteIfChanged(destination)\n\t\t) {\n\t\t\tconst cleanedName = this.cleanFilename(destination, cwd)\n\t\t\tconst settings = { skipped: [], ...this.settings.get('writer') }\n\t\t\tconst isAlwaysSkipped = settings.skipped.indexOf(cleanedName) > -1\n\t\t\tlet write = !isAlwaysSkipped\n\n\t\t\tif (!isAlwaysSkipped && this.shouldAskForOverwrite()) {\n\t\t\t\tif (!this.hasShownFirstWriteMessage && this.firstFileWriteMessage) {\n\t\t\t\t\tthis.hasShownFirstWriteMessage = true\n\t\t\t\t\tthis.ui.renderLine(this.firstFileWriteMessage)\n\t\t\t\t\tthis.ui.renderLine('')\n\t\t\t\t}\n\n\t\t\t\tconst answer = await this.ui.prompt({\n\t\t\t\t\ttype: 'select',\n\t\t\t\t\tlabel: `${cleanedName}`,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tchoices: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_OVERWRITE,\n\t\t\t\t\t\t\t\tlabel: 'Overwrite',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_SKIP,\n\t\t\t\t\t\t\t\tlabel: 'Skip',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_ALWAYS_SKIP,\n\t\t\t\t\t\t\t\tlabel: 'Always skip',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t})\n\n\t\t\t\tif (answer === FILE_ACTION_ALWAYS_SKIP) {\n\t\t\t\t\tsettings.skipped.push(cleanedName)\n\t\t\t\t\tthis.settings.set('writer', settings)\n\t\t\t\t}\n\n\t\t\t\twrite = answer === FILE_ACTION_OVERWRITE\n\t\t\t}\n\n\t\t\tif (write) {\n\t\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\t\taction = 'updated'\n\t\t\t}\n\t\t}\n\n\t\tif (!desc) {\n\t\t\tdesc = fileDescription?.description\n\t\t}\n\n\t\tif (!desc) {\n\t\t\tthrow new Error(\n\t\t\t\t`No FileDescription provided for ${destination.replace(\n\t\t\t\t\tcwd,\n\t\t\t\t\t''\n\t\t\t\t)}. Check your feature's fileDescriptions property.`\n\t\t\t)\n\t\t}\n\n\t\tmyResults.push({ name, description: desc, path: destination, action })\n\n\t\treturn myResults\n\t}\n\n\tprivate isFileDifferent(destination: string, contents: string) {\n\t\treturn diskUtil.isFileDifferent(destination, contents)\n\t}\n\n\tprivate cleanFilename(destination: string, cwd: string) {\n\t\tlet relativeFile = destination.replace(cwd, '')\n\t\tif (relativeFile[0] === pathUtil.sep) {\n\t\t\trelativeFile = relativeFile.substr(1)\n\t\t}\n\t\treturn relativeFile\n\t}\n\n\tprivate shouldOverwriteIfChanged(destination: string): boolean {\n\t\tif (!this.upgradeMode) {\n\t\t\treturn true\n\t\t}\n\n\t\tif (this.upgradeMode === 'forceEverything') {\n\t\t\treturn true\n\t\t}\n\n\t\tlet description: FileDescription | undefined =\n\t\t\tthis.getFileDescription(destination)\n\n\t\treturn description?.shouldOverwriteWhenChanged ?? false\n\t}\n\n\tprivate getFileDescription(destination: string): FileDescription | undefined {\n\t\tconst lower = destination.toLowerCase()\n\t\tfor (const d of this.fileDescriptions ?? []) {\n\t\t\tif (lower.search(d.path.toLowerCase()) > -1) {\n\t\t\t\treturn d\n\t\t\t}\n\t\t}\n\n\t\treturn undefined\n\t}\n\n\tprivate shouldAskForOverwrite() {\n\t\tif (\n\t\t\tthis.shouldConfirmBeforeWriting &&\n\t\t\tthis.upgradeMode === 'askForChanged'\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprotected resolveFilenameWithFallback(\n\t\tdirOrFile: string,\n\t\tfallbackFileName: string\n\t) {\n\t\tconst isDir =\n\t\t\tdiskUtil.doesDirExist(dirOrFile) &&\n\t\t\tfs.lstatSync(dirOrFile).isDirectory() &&\n\t\t\tpathUtil.extname(dirOrFile).length === 0\n\t\treturn isDir ? diskUtil.resolvePath(dirOrFile, fallbackFileName) : dirOrFile\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAIqB,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,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F,SAAS,CAAC,IAChCG,cAAE,CAACC,SAAS,CAACJ,SAAS,CAAC,CAACK,WAAW,CAAC,CAAC,IACrC1G,gBAAQ,CAAC2G,OAAO,CAACN,SAAS,CAAC,CAACzK,MAAM,KAAK,CAAC;MACzC,OAAO+H,KAAK,GAAGD,0BAAQ,CAACkD,WAAW,CAACP,SAAS,EAAEC,gBAAgB,CAAC,GAAGD,SAAS;IAC7E;EAAC;EAAA,OAAA/H,cAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"AbstractWriter.js","names":["_fs","_interopRequireDefault","require","_path","_spruceSkillUtils","_constants","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_createForOfIteratorHelper","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","i","F","s","n","done","value","_e","f","TypeError","normalCompletion","didErr","err","call","step","next","_e2","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","AbstractWriter","exports","options","_classCallCheck2","templates","ui","term","upgradeMode","fileDescriptions","linter","settings","_createClass2","key","_lint","_asyncToGenerator2","_regenerator","mark","_callee","file","_this$linter","wrap","_callee$","_context","prev","startLoading","concat","pathUtil","basename","fix","stop","lint","_x","_writeDirectoryTemplate","_callee2","context","destinationDir","filesToWrite","filesToSkip","_options$shouldConfir","shouldConfirmBeforeWriting","firstFileWriteMessage","files","results","_iterator","_step","generated","shouldWrite","shouldSkip","_callee2$","_context2","hasShownFirstWriteMessage","directoryTemplate","kind","code","sent","indexOf","filename","writeFileIfChangedMixinResults","join","relativePath","contents","t0","finish","abrupt","writeDirectoryTemplate","_x2","_writeFileIfChangedMixinResults","_callee3","destination","description","cwd","myResults","desc","action","fileDescription","write","cleanedName","isAlwaysSkipped","_write","answer","_args3","_callee3$","_context3","undefined","diskUtil","isDir","Error","getFileDescription","doesFileExist","confirmPromptOnFirstWrite","stopLoading","confirm","writeFile","isFileDifferent","shouldOverwriteIfChanged","cleanFilename","skipped","get","shouldAskForOverwrite","renderLine","prompt","type","label","choices","FILE_ACTION_OVERWRITE","FILE_ACTION_SKIP","FILE_ACTION_ALWAYS_SKIP","set","replace","path","_x3","_x4","_x5","_x6","relativeFile","sep","substr","_description$shouldOv","shouldOverwriteWhenChanged","_this$fileDescription","lower","toLowerCase","_iterator2","_step2","d","search","resolveFilenameWithFallback","dirOrFile","fallbackFileName","doesDirExist","fs","lstatSync","isDirectory","extname","resolvePath"],"sources":["../../src/writers/AbstractWriter.ts"],"sourcesContent":["import fs from 'fs'\nimport pathUtil from 'path'\nimport { diskUtil, SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { DirectoryTemplateCode, Templates } from '@sprucelabs/spruce-templates'\nimport {\n\tFILE_ACTION_ALWAYS_SKIP,\n\tFILE_ACTION_OVERWRITE,\n\tFILE_ACTION_SKIP,\n} from '../constants'\nimport LintService from '../services/LintService'\nimport { FileDescription, GeneratedFile, UpgradeMode } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\n\nexport type WriteResults = GeneratedFile[]\n\nexport interface WriterOptions {\n\ttemplates: Templates\n\tterm: GraphicsInterface\n\tupgradeMode?: UpgradeMode\n\tfileDescriptions: FileDescription[]\n\tlinter?: LintService\n\tsettings: SettingsService\n}\n\nexport interface WriteDirectoryTemplateOptions {\n\tdestinationDir: string\n\tcode: DirectoryTemplateCode\n\tfilesToWrite?: string[]\n\tfilesToSkip?: string[]\n\tcontext: any\n\tshouldConfirmBeforeWriting?: boolean\n\tfirstFileWriteMessage?: string\n}\n\nexport default abstract class AbstractWriter {\n\tprotected templates: Templates\n\tprotected ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate upgradeMode: UpgradeMode\n\tprivate fileDescriptions: FileDescription[] = []\n\tprivate shouldConfirmBeforeWriting = true\n\tprivate firstFileWriteMessage?: string\n\tprivate hasShownFirstWriteMessage = false\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: WriterOptions) {\n\t\tthis.templates = options.templates\n\t\tthis.ui = options.term\n\t\tthis.upgradeMode = options.upgradeMode\n\t\tthis.fileDescriptions = options.fileDescriptions\n\t\tthis.linter = options.linter\n\t\tthis.settings = options.settings\n\t}\n\n\tprotected async lint(file: string) {\n\t\tthis.ui.startLoading(`Linting ${pathUtil.basename(file)}...`)\n\t\tawait this.linter?.fix(file).catch(() => {})\n\t}\n\n\tprotected async writeDirectoryTemplate(\n\t\toptions: WriteDirectoryTemplateOptions\n\t) {\n\t\tconst {\n\t\t\tcontext,\n\t\t\tdestinationDir,\n\t\t\tfilesToWrite,\n\t\t\tfilesToSkip,\n\t\t\tshouldConfirmBeforeWriting = true,\n\t\t\tfirstFileWriteMessage,\n\t\t} = options\n\n\t\tthis.shouldConfirmBeforeWriting = shouldConfirmBeforeWriting\n\t\tthis.firstFileWriteMessage = firstFileWriteMessage\n\t\tthis.hasShownFirstWriteMessage = false\n\n\t\tconst files = await this.templates.directoryTemplate({\n\t\t\tkind: options.code,\n\t\t\tcontext: context ?? {},\n\t\t})\n\n\t\tlet results: WriteResults = []\n\n\t\tfor (const generated of files) {\n\t\t\tconst shouldWrite =\n\t\t\t\t!filesToWrite || filesToWrite.indexOf(generated.filename) > -1\n\t\t\tconst shouldSkip =\n\t\t\t\tfilesToSkip && filesToSkip.indexOf(generated.filename) > -1\n\n\t\t\tif (shouldWrite && !shouldSkip) {\n\t\t\t\tresults = await this.writeFileIfChangedMixinResults(\n\t\t\t\t\tpathUtil.join(destinationDir, generated.relativePath),\n\t\t\t\t\tgenerated.contents,\n\t\t\t\t\t'',\n\t\t\t\t\tresults,\n\t\t\t\t\tdestinationDir\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\n\t\treturn results\n\t}\n\n\tprotected async writeFileIfChangedMixinResults(\n\t\tdestination: string,\n\t\tcontents: string,\n\t\tdescription: string,\n\t\tresults?: WriteResults,\n\t\tcwd = ''\n\t): Promise<WriteResults> {\n\t\tconst myResults: WriteResults = results ?? []\n\t\tlet desc: string | undefined = description\n\n\t\tconst name = pathUtil.basename(destination)\n\t\tlet action: GeneratedFile['action'] = 'skipped'\n\n\t\tif (diskUtil.isDir(destination)) {\n\t\t\tthrow new Error(`Can't write to a directory ${destination}.`)\n\t\t}\n\n\t\tconst fileDescription = this.getFileDescription(destination)\n\n\t\tif (!diskUtil.doesFileExist(destination)) {\n\t\t\tlet write = true\n\n\t\t\tif (\n\t\t\t\tthis.shouldConfirmBeforeWriting &&\n\t\t\t\tfileDescription?.confirmPromptOnFirstWrite\n\t\t\t) {\n\t\t\t\tthis.ui.stopLoading()\n\t\t\t\twrite = await this.ui.confirm(fileDescription.confirmPromptOnFirstWrite)\n\t\t\t}\n\n\t\t\tif (write) {\n\t\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\t\taction = 'generated'\n\t\t\t}\n\t\t} else if (\n\t\t\tthis.isFileDifferent(destination, contents) &&\n\t\t\tthis.shouldOverwriteIfChanged(destination)\n\t\t) {\n\t\t\tconst cleanedName = this.cleanFilename(destination, cwd)\n\t\t\tconst settings = { skipped: [], ...this.settings.get('writer') }\n\t\t\tconst isAlwaysSkipped = settings.skipped.indexOf(cleanedName) > -1\n\t\t\tlet write = !isAlwaysSkipped\n\n\t\t\tif (!isAlwaysSkipped && this.shouldAskForOverwrite()) {\n\t\t\t\tif (!this.hasShownFirstWriteMessage && this.firstFileWriteMessage) {\n\t\t\t\t\tthis.hasShownFirstWriteMessage = true\n\t\t\t\t\tthis.ui.renderLine(this.firstFileWriteMessage)\n\t\t\t\t\tthis.ui.renderLine('')\n\t\t\t\t}\n\n\t\t\t\tconst answer = await this.ui.prompt({\n\t\t\t\t\ttype: 'select',\n\t\t\t\t\tlabel: `${cleanedName}`,\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tchoices: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_OVERWRITE,\n\t\t\t\t\t\t\t\tlabel: 'Overwrite',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_SKIP,\n\t\t\t\t\t\t\t\tlabel: 'Skip',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tvalue: FILE_ACTION_ALWAYS_SKIP,\n\t\t\t\t\t\t\t\tlabel: 'Always skip',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t})\n\n\t\t\t\tif (answer === FILE_ACTION_ALWAYS_SKIP) {\n\t\t\t\t\tsettings.skipped.push(cleanedName)\n\t\t\t\t\tthis.settings.set('writer', settings)\n\t\t\t\t}\n\n\t\t\t\twrite = answer === FILE_ACTION_OVERWRITE\n\t\t\t}\n\n\t\t\tif (write) {\n\t\t\t\tdiskUtil.writeFile(destination, contents)\n\t\t\t\taction = 'updated'\n\t\t\t}\n\t\t}\n\n\t\tif (!desc) {\n\t\t\tdesc = fileDescription?.description\n\t\t}\n\n\t\tif (!desc) {\n\t\t\tthrow new Error(\n\t\t\t\t`No FileDescription provided for ${destination.replace(\n\t\t\t\t\tcwd,\n\t\t\t\t\t''\n\t\t\t\t)}. Check your feature's fileDescriptions property.`\n\t\t\t)\n\t\t}\n\n\t\tmyResults.push({ name, description: desc, path: destination, action })\n\n\t\treturn myResults\n\t}\n\n\tprivate isFileDifferent(destination: string, contents: string) {\n\t\treturn diskUtil.isFileDifferent(destination, contents)\n\t}\n\n\tprivate cleanFilename(destination: string, cwd: string) {\n\t\tlet relativeFile = destination.replace(cwd, '')\n\t\tif (relativeFile[0] === pathUtil.sep) {\n\t\t\trelativeFile = relativeFile.substr(1)\n\t\t}\n\t\treturn relativeFile\n\t}\n\n\tprivate shouldOverwriteIfChanged(destination: string): boolean {\n\t\tif (!this.upgradeMode) {\n\t\t\treturn true\n\t\t}\n\n\t\tif (this.upgradeMode === 'forceEverything') {\n\t\t\treturn true\n\t\t}\n\n\t\tlet description: FileDescription | undefined =\n\t\t\tthis.getFileDescription(destination)\n\n\t\treturn description?.shouldOverwriteWhenChanged ?? false\n\t}\n\n\tprivate getFileDescription(destination: string): FileDescription | undefined {\n\t\tconst lower = destination.toLowerCase()\n\t\tfor (const d of this.fileDescriptions ?? []) {\n\t\t\tif (lower.search(d.path.toLowerCase()) > -1) {\n\t\t\t\treturn d\n\t\t\t}\n\t\t}\n\n\t\treturn undefined\n\t}\n\n\tprivate shouldAskForOverwrite() {\n\t\tif (\n\t\t\tthis.shouldConfirmBeforeWriting &&\n\t\t\tthis.upgradeMode === 'askForChanged'\n\t\t) {\n\t\t\treturn true\n\t\t}\n\n\t\treturn false\n\t}\n\n\tprotected resolveFilenameWithFallback(\n\t\tdirOrFile: string,\n\t\tfallbackFileName: string\n\t) {\n\t\tconst isDir =\n\t\t\tdiskUtil.doesDirExist(dirOrFile) &&\n\t\t\tfs.lstatSync(dirOrFile).isDirectory() &&\n\t\t\tpathUtil.extname(dirOrFile).length === 0\n\t\treturn isDir ? diskUtil.resolvePath(dirOrFile, fallbackFileName) : dirOrFile\n\t}\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AAIqB,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,C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4BACCC,SAAiB,EACjBC,gBAAwB,EACvB;MACD,IAAM3C,KAAK,GACVD,0BAAQ,CAAC6C,YAAY,CAACF,SAAS,CAAC,IAChCG,cAAE,CAACC,SAAS,CAACJ,SAAS,CAAC,CAACK,WAAW,CAAC,CAAC,IACrC1G,gBAAQ,CAAC2G,OAAO,CAACN,SAAS,CAAC,CAACzK,MAAM,KAAK,CAAC;MACzC,OAAO+H,KAAK,GAAGD,0BAAQ,CAACkD,WAAW,CAACP,SAAS,EAAEC,gBAAgB,CAAC,GAAGD,SAAS;IAC7E;EAAC;EAAA,OAAA/H,cAAA;AAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WriterFactory.js","names":["_ConversationWriter","_interopRequireDefault","require","_DeployWriter","_ErrorWriter","_EventWriter","_LogWriter","_NodeWriter","_PermissionWriter","_PolishWriter","_SandboxWriter","_SchemaWriter","_SkillWriter","_StoreWriter","_TestWriter","_ViewWriter","_VsCodeWriter","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","polish","PolishWriter","permission","PermissionWriter","WriterFactory","exports","options","_classCallCheck2","templates","ui","linter","settings","_createClass2","key","value","Writer","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport PermissionWriter from '../features/permission/writers/PermissionWriter'\nimport PolishWriter from '../features/polish/writers/PolishWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n\tpolish: PolishWriter,\n\tpermission: PermissionWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n\tpolish: PolishWriter\n\tpermission: PermissionWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,UAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,aAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,aAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,YAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,YAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,WAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,WAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,aAAA,GAAAf,sBAAA,CAAAC,OAAA;AAAkE,SAAAe,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAA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,IAAI,EAAEC,sBAAU;EAChBC,GAAG,EAAEC,qBAAS;EACdC,MAAM,EAAEC,wBAAY;EACpBC,UAAU,EAAEC;AACb,CAAC;AAAA,IAsBoBC,aAAa,GAAAC,OAAA;EAMjC,SAAAD,cAAmBE,OAKlB,EAAE;IAAA,IAAAC,gBAAA,mBAAAH,aAAA;IAAA,IAAAnC,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;IAAA,IAAAA,gBAAA;IACF,IAAQuC,SAAS,GAA2BF,OAAO,CAA3CE,SAAS;MAAEC,EAAE,GAAuBH,OAAO,CAAhCG,EAAE;MAAEC,MAAM,GAAeJ,OAAO,CAA5BI,MAAM;MAAEC,QAAQ,GAAKL,OAAO,CAApBK,QAAQ;IAEvC,IAAI,CAACH,SAAS,GAAGA,SAAS;IAC1B,IAAI,CAACC,EAAE,GAAGA,EAAE;IACZ,IAAI,CAACC,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;EACzB;EAAC,IAAAC,aAAA,aAAAR,aAAA;IAAAS,GAAA;IAAAC,KAAA,EAED,SAAAC,OACCC,IAAO,EACPV,OAAyE,EAC1D;MACf,IAAMW,KAAK,GAAG5C,QAAQ,CAAC2C,IAAI,CAAC;MAC5B,OAAO,IAAIC,KAAK,CAAApD,aAAA;QACf2C,SAAS,EAAE,IAAI,CAACA,SAAS;QACzBU,IAAI,EAAE,IAAI,CAACT,EAAE;QACbC,MAAM,EAAE,IAAI,CAACA,MAAM;QACnBC,QAAQ,EAAE,IAAI,CAACA;MAAQ,GACnBL,OAAO,IAAI,CAAC,CAAC,CACjB,CAAC;IACH;EAAC;EAAA,OAAAF,aAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"WriterFactory.js","names":["_ConversationWriter","_interopRequireDefault","require","_DeployWriter","_ErrorWriter","_EventWriter","_LogWriter","_NodeWriter","_PermissionWriter","_PolishWriter","_SandboxWriter","_SchemaWriter","_SkillWriter","_StoreWriter","_TestWriter","_ViewWriter","_VsCodeWriter","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","classMap","error","ErrorWriter","event","EventWriter","schema","SchemaWriter","skill","SkillGenerator","test","TestGenerator","node","NodeWriter","vscode","VsCodeWriter","conversation","ConversationWriter","deploy","DeployWriter","sandbox","SandboxWriter","store","StoreWriter","view","ViewWriter","log","LogWriter","polish","PolishWriter","permission","PermissionWriter","WriterFactory","exports","options","_classCallCheck2","templates","ui","linter","settings","_createClass2","key","value","Writer","code","Class","term"],"sources":["../../src/writers/WriterFactory.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\nimport { Templates } from '@sprucelabs/spruce-templates'\nimport ConversationWriter from '../features/conversation/writers/ConversationWriter'\nimport DeployWriter from '../features/deploy/writers/DeployWriter'\nimport ErrorWriter from '../features/error/writers/ErrorWriter'\nimport EventWriter from '../features/event/writers/EventWriter'\nimport LogWriter from '../features/log/writers/LogWriter'\nimport NodeWriter from '../features/node/writers/NodeWriter'\nimport PermissionWriter from '../features/permission/writers/PermissionWriter'\nimport PolishWriter from '../features/polish/writers/PolishWriter'\nimport SandboxWriter from '../features/sandbox/writers/SandboxWriter'\nimport SchemaWriter from '../features/schema/writers/SchemaWriter'\nimport SkillGenerator from '../features/skill/writers/SkillWriter'\nimport StoreWriter from '../features/store/writers/StoreWriter'\nimport TestGenerator from '../features/test/writers/TestWriter'\nimport ViewWriter from '../features/view/writers/ViewWriter'\nimport VsCodeWriter from '../features/vscode/writers/VsCodeWriter'\nimport LintService from '../services/LintService'\nimport { FileDescription } from '../types/cli.types'\nimport { GraphicsInterface } from '../types/cli.types'\nimport { WriterOptions } from './AbstractWriter'\n\nconst classMap = {\n\terror: ErrorWriter,\n\tevent: EventWriter,\n\tschema: SchemaWriter,\n\tskill: SkillGenerator,\n\ttest: TestGenerator,\n\tnode: NodeWriter,\n\tvscode: VsCodeWriter,\n\tconversation: ConversationWriter,\n\tdeploy: DeployWriter,\n\tsandbox: SandboxWriter,\n\tstore: StoreWriter,\n\tview: ViewWriter,\n\tlog: LogWriter,\n\tpolish: PolishWriter,\n\tpermission: PermissionWriter,\n}\n\nexport interface WriterMap {\n\terror: ErrorWriter\n\tevent: EventWriter\n\tschema: SchemaWriter\n\tskill: SkillGenerator\n\ttest: TestGenerator\n\tnode: NodeWriter\n\tvscode: VsCodeWriter\n\tconversation: ConversationWriter\n\tdeploy: DeployWriter\n\tsandbox: SandboxWriter\n\tstore: StoreWriter\n\tview: ViewWriter\n\tlog: LogWriter\n\tpolish: PolishWriter\n\tpermission: PermissionWriter\n}\n\nexport type WriterCode = keyof WriterMap\n\nexport default class WriterFactory {\n\tprivate templates: Templates\n\tprivate ui: GraphicsInterface\n\tprivate linter?: LintService\n\tprivate settings: SettingsService<string>\n\n\tpublic constructor(options: {\n\t\ttemplates: Templates\n\t\tui: GraphicsInterface\n\t\tlinter?: LintService\n\t\tsettings: SettingsService\n\t}) {\n\t\tconst { templates, ui, linter, settings } = options\n\n\t\tthis.templates = templates\n\t\tthis.ui = ui\n\t\tthis.linter = linter\n\t\tthis.settings = settings\n\t}\n\n\tpublic Writer<C extends WriterCode>(\n\t\tcode: C,\n\t\toptions: Partial<WriterOptions> & { fileDescriptions: FileDescription[] }\n\t): WriterMap[C] {\n\t\tconst Class = classMap[code]\n\t\treturn new Class({\n\t\t\ttemplates: this.templates,\n\t\t\tterm: this.ui,\n\t\t\tlinter: this.linter,\n\t\t\tsettings: this.settings,\n\t\t\t...(options || {}),\n\t\t}) as WriterMap[C]\n\t}\n}\n"],"mappings":";;;;;;;;;;AAEA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,YAAA,GAA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pB,IAAI,CAACC,QAAQ,GAAGA,QAAQ;EACzB;EAAC,IAAAC,aAAA,aAAAR,aAAA;IAAAS,GAAA;IAAAC,KAAA,EAED,SAAAC,OACCC,IAAO,EACPV,OAAyE,EAC1D;MACf,IAAMW,KAAK,GAAG5C,QAAQ,CAAC2C,IAAI,CAAC;MAC5B,OAAO,IAAIC,KAAK,CAAApD,aAAA;QACf2C,SAAS,EAAE,IAAI,CAACA,SAAS;QACzBU,IAAI,EAAE,IAAI,CAACT,EAAE;QACbC,MAAM,EAAE,IAAI,CAACA,MAAM;QACnBC,QAAQ,EAAE,IAAI,CAACA;MAAQ,GACnBL,OAAO,IAAI,CAAC,CAAC,CACjB,CAAC;IACH;EAAC;EAAA,OAAAF,aAAA;AAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"version": "19.
|
|
20
|
+
"version": "19.2.0",
|
|
21
21
|
"bin": {
|
|
22
22
|
"spruce": "./build/index.js"
|
|
23
23
|
},
|
|
@@ -72,21 +72,21 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@babel/cli": "^7.23.9",
|
|
75
|
-
"@babel/plugin-proposal-decorators": "^7.
|
|
76
|
-
"@babel/runtime": "^7.
|
|
75
|
+
"@babel/plugin-proposal-decorators": "^7.24.0",
|
|
76
|
+
"@babel/runtime": "^7.24.0",
|
|
77
77
|
"@jest/reporters": "^29.7.0",
|
|
78
|
-
"@sprucelabs/error": "^5.1.
|
|
79
|
-
"@sprucelabs/globby": "^1.0.
|
|
80
|
-
"@sprucelabs/heartwood-view-controllers": "^108.
|
|
81
|
-
"@sprucelabs/jest-json-reporter": "^7.0.
|
|
82
|
-
"@sprucelabs/mercury-client": "^41.0.
|
|
83
|
-
"@sprucelabs/mercury-event-emitter": "^41.0.
|
|
84
|
-
"@sprucelabs/mercury-types": "^46.0.
|
|
85
|
-
"@sprucelabs/schema": "^29.
|
|
86
|
-
"@sprucelabs/spruce-core-schemas": "^39.0.
|
|
87
|
-
"@sprucelabs/spruce-event-utils": "^38.0.
|
|
88
|
-
"@sprucelabs/spruce-skill-utils": "^30.
|
|
89
|
-
"@sprucelabs/spruce-templates": "^19.
|
|
78
|
+
"@sprucelabs/error": "^5.1.66",
|
|
79
|
+
"@sprucelabs/globby": "^1.0.16",
|
|
80
|
+
"@sprucelabs/heartwood-view-controllers": "^108.41.1",
|
|
81
|
+
"@sprucelabs/jest-json-reporter": "^7.0.175",
|
|
82
|
+
"@sprucelabs/mercury-client": "^41.0.321",
|
|
83
|
+
"@sprucelabs/mercury-event-emitter": "^41.0.321",
|
|
84
|
+
"@sprucelabs/mercury-types": "^46.0.246",
|
|
85
|
+
"@sprucelabs/schema": "^29.4.12",
|
|
86
|
+
"@sprucelabs/spruce-core-schemas": "^39.0.244",
|
|
87
|
+
"@sprucelabs/spruce-event-utils": "^38.0.289",
|
|
88
|
+
"@sprucelabs/spruce-skill-utils": "^30.3.3",
|
|
89
|
+
"@sprucelabs/spruce-templates": "^19.2.0",
|
|
90
90
|
"@typescript-eslint/eslint-plugin": "^5.27.1",
|
|
91
91
|
"@typescript-eslint/parser": "^5.27.1",
|
|
92
92
|
"cfonts": "^3.2.0",
|
|
@@ -109,40 +109,40 @@
|
|
|
109
109
|
"terminal-kit": "sprucelabsai/terminal-kit",
|
|
110
110
|
"tree-kill": "^1.2.2",
|
|
111
111
|
"tsutils": "^3.21.0",
|
|
112
|
-
"typescript": "^5.
|
|
112
|
+
"typescript": "^5.4.2",
|
|
113
113
|
"uuid": "^9.0.1"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@sprucelabs/data-stores": "^26.4.
|
|
116
|
+
"@sprucelabs/data-stores": "^26.4.38",
|
|
117
117
|
"@sprucelabs/jest-sheets-reporter": "^3.0.26",
|
|
118
|
-
"@sprucelabs/mercury-core-events": "^22.
|
|
119
|
-
"@sprucelabs/resolve-path-aliases": "^1.1.
|
|
120
|
-
"@sprucelabs/spruce-conversation-plugin": "^60.1.
|
|
121
|
-
"@sprucelabs/spruce-deploy-plugin": "^60.1.
|
|
122
|
-
"@sprucelabs/spruce-store-plugin": "^60.1.
|
|
123
|
-
"@sprucelabs/spruce-test-fixtures": "^60.1.
|
|
124
|
-
"@sprucelabs/test": "^8.0.
|
|
125
|
-
"@sprucelabs/test-utils": "^4.0.
|
|
118
|
+
"@sprucelabs/mercury-core-events": "^22.2.25",
|
|
119
|
+
"@sprucelabs/resolve-path-aliases": "^1.1.284",
|
|
120
|
+
"@sprucelabs/spruce-conversation-plugin": "^60.1.275",
|
|
121
|
+
"@sprucelabs/spruce-deploy-plugin": "^60.1.275",
|
|
122
|
+
"@sprucelabs/spruce-store-plugin": "^60.1.275",
|
|
123
|
+
"@sprucelabs/spruce-test-fixtures": "^60.1.275",
|
|
124
|
+
"@sprucelabs/test": "^8.0.42",
|
|
125
|
+
"@sprucelabs/test-utils": "^4.0.110",
|
|
126
126
|
"@types/blessed": "^0.1.25",
|
|
127
|
-
"@types/eslint": "^8.56.
|
|
127
|
+
"@types/eslint": "^8.56.5",
|
|
128
128
|
"@types/fs-extra": "^11.0.4",
|
|
129
129
|
"@types/inquirer": "^8.2.1",
|
|
130
130
|
"@types/lodash": "^4.14.202",
|
|
131
131
|
"@types/md5": "^2.3.5",
|
|
132
|
-
"@types/node": "^20.11.
|
|
132
|
+
"@types/node": "^20.11.25",
|
|
133
133
|
"@types/promise.allsettled": "^1.0.6",
|
|
134
134
|
"@types/ps-node": "^0.1.3",
|
|
135
|
-
"@types/semver": "^7.5.
|
|
135
|
+
"@types/semver": "^7.5.8",
|
|
136
136
|
"@types/sha1": "^1.1.5",
|
|
137
|
-
"@types/slug": "^5.0.
|
|
138
|
-
"@types/superagent": "^8.1.
|
|
137
|
+
"@types/slug": "^5.0.8",
|
|
138
|
+
"@types/superagent": "^8.1.4",
|
|
139
139
|
"@types/terminal-kit": "^2.5.6",
|
|
140
140
|
"@types/uuid": "^9.0.8",
|
|
141
141
|
"chokidar-cli": "^3.0.0",
|
|
142
142
|
"concurrently": "^8.2.2",
|
|
143
143
|
"conventional-changelog-sprucelabs": "^1.1.2",
|
|
144
|
-
"dotenv": "^16.4.
|
|
145
|
-
"eslint": "^8.
|
|
144
|
+
"dotenv": "^16.4.5",
|
|
145
|
+
"eslint": "^8.57.0",
|
|
146
146
|
"eslint-config-spruce": "^10.13.6",
|
|
147
147
|
"find-process": "^1.4.7",
|
|
148
148
|
"jest": "^29.7.0",
|
|
@@ -590,5 +590,5 @@
|
|
|
590
590
|
"terminal-kit"
|
|
591
591
|
]
|
|
592
592
|
},
|
|
593
|
-
"gitHead": "
|
|
593
|
+
"gitHead": "3b2eae17e9d551a1e0ebbc05f02bc7ccb2ed6d20"
|
|
594
594
|
}
|
|
@@ -29,6 +29,35 @@ export declare namespace SpruceErrors.SpruceCli {
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
export declare namespace SpruceErrors.SpruceCli {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export interface ViewPluginAlreadyExists {
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
'name': string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ViewPluginAlreadyExistsSchema extends SpruceSchema.Schema {
|
|
42
|
+
id: 'viewPluginAlreadyExists',
|
|
43
|
+
namespace: 'SpruceCli',
|
|
44
|
+
name: 'View plugin already exists',
|
|
45
|
+
fields: {
|
|
46
|
+
/** . */
|
|
47
|
+
'name': {
|
|
48
|
+
type: 'text',
|
|
49
|
+
isRequired: true,
|
|
50
|
+
options: undefined
|
|
51
|
+
},
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ViewPluginAlreadyExistsEntity = SchemaEntity<SpruceErrors.SpruceCli.ViewPluginAlreadyExistsSchema>
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
32
61
|
export declare namespace SpruceErrors.SpruceCli {
|
|
33
62
|
|
|
34
63
|
|
|
@@ -4,6 +4,9 @@ import { ErrorOptions as ISpruceErrorOptions} from "@sprucelabs/error"
|
|
|
4
4
|
export interface VscodeNotInstalledErrorOptions extends SpruceErrors.SpruceCli.VscodeNotInstalled, ISpruceErrorOptions {
|
|
5
5
|
code: 'VSCODE_NOT_INSTALLED'
|
|
6
6
|
}
|
|
7
|
+
export interface ViewPluginAlreadyExistsErrorOptions extends SpruceErrors.SpruceCli.ViewPluginAlreadyExists, ISpruceErrorOptions {
|
|
8
|
+
code: 'VIEW_PLUGIN_ALREADY_EXISTS'
|
|
9
|
+
}
|
|
7
10
|
export interface TransportAlreadyExistsErrorOptions extends SpruceErrors.SpruceCli.TransportAlreadyExists, ISpruceErrorOptions {
|
|
8
11
|
code: 'TRANSPORT_ALREADY_EXISTS'
|
|
9
12
|
}
|
|
@@ -122,6 +125,6 @@ export interface ActionCancelledErrorOptions extends SpruceErrors.SpruceCli.Acti
|
|
|
122
125
|
code: 'ACTION_CANCELLED'
|
|
123
126
|
}
|
|
124
127
|
|
|
125
|
-
type ErrorOptions = | VscodeNotInstalledErrorOptions | TransportAlreadyExistsErrorOptions | ThemeExistsErrorOptions | TestFailedErrorOptions | StoreExistsErrorOptions | SkillViewExistsErrorOptions | SkillNotRegisteredErrorOptions | SkillNotFoundErrorOptions | SchemaTemplateItemBuildingFailedErrorOptions | SchemaFailedToImportErrorOptions | SchemaExistsErrorOptions | NotLoggedInErrorOptions | NotImplementedErrorOptions | NoSkillsRegisteredErrorOptions | NoOrganizationsFoundErrorOptions | MissingDependenciesErrorOptions | MercuryResponseErrorErrorOptions | LintFailedErrorOptions | InvalidTestDirectoryErrorOptions | InvalidFeatureCodeErrorOptions | InvalidEventContractErrorOptions | InvalidCommandErrorOptions | GenericErrorOptions | FileExistsErrorOptions | FeatureNotInstalledErrorOptions | FailedToImportErrorOptions | ExecutingCommandFailedErrorOptions | DockerNotStartedErrorOptions | DirectoryNotSkillErrorOptions | DirectoryEmptyErrorOptions | DeployFailedErrorOptions | DependencyExistsErrorOptions | CreateAutoloaderFailedErrorOptions | CommandNotImplementedErrorOptions | CommandBlockedErrorOptions | CommandAbortedErrorOptions | CacheNotEnabledErrorOptions | BuildFailedErrorOptions | BootErrorErrorOptions | ActionCancelledErrorOptions
|
|
128
|
+
type ErrorOptions = | VscodeNotInstalledErrorOptions | ViewPluginAlreadyExistsErrorOptions | TransportAlreadyExistsErrorOptions | ThemeExistsErrorOptions | TestFailedErrorOptions | StoreExistsErrorOptions | SkillViewExistsErrorOptions | SkillNotRegisteredErrorOptions | SkillNotFoundErrorOptions | SchemaTemplateItemBuildingFailedErrorOptions | SchemaFailedToImportErrorOptions | SchemaExistsErrorOptions | NotLoggedInErrorOptions | NotImplementedErrorOptions | NoSkillsRegisteredErrorOptions | NoOrganizationsFoundErrorOptions | MissingDependenciesErrorOptions | MercuryResponseErrorErrorOptions | LintFailedErrorOptions | InvalidTestDirectoryErrorOptions | InvalidFeatureCodeErrorOptions | InvalidEventContractErrorOptions | InvalidCommandErrorOptions | GenericErrorOptions | FileExistsErrorOptions | FeatureNotInstalledErrorOptions | FailedToImportErrorOptions | ExecutingCommandFailedErrorOptions | DockerNotStartedErrorOptions | DirectoryNotSkillErrorOptions | DirectoryEmptyErrorOptions | DeployFailedErrorOptions | DependencyExistsErrorOptions | CreateAutoloaderFailedErrorOptions | CommandNotImplementedErrorOptions | CommandBlockedErrorOptions | CommandAbortedErrorOptions | CacheNotEnabledErrorOptions | BuildFailedErrorOptions | BootErrorErrorOptions | ActionCancelledErrorOptions
|
|
126
129
|
|
|
127
130
|
export default ErrorOptions
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SchemaRegistry } from '@sprucelabs/schema'
|
|
2
|
+
import { SpruceErrors } from '../errors.types'
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const viewPluginAlreadyExistsSchema: SpruceErrors.SpruceCli.ViewPluginAlreadyExistsSchema = {
|
|
7
|
+
id: 'viewPluginAlreadyExists',
|
|
8
|
+
namespace: 'SpruceCli',
|
|
9
|
+
name: 'View plugin already exists',
|
|
10
|
+
fields: {
|
|
11
|
+
/** . */
|
|
12
|
+
'name': {
|
|
13
|
+
type: 'text',
|
|
14
|
+
isRequired: true,
|
|
15
|
+
options: undefined
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
SchemaRegistry.getInstance().trackSchema(viewPluginAlreadyExistsSchema)
|
|
21
|
+
|
|
22
|
+
export default viewPluginAlreadyExistsSchema
|
|
@@ -23,7 +23,7 @@ export default class CreatingASkillViewTest extends AbstractSkillTest {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@test()
|
|
26
|
-
protected static async
|
|
26
|
+
protected static async viewFeatureHasExpectedDependencies() {
|
|
27
27
|
const features = await this.featureInstaller
|
|
28
28
|
const view = features.getFeature('view')
|
|
29
29
|
assert.isEqualDeep(view.dependencies, [
|
|
@@ -36,7 +36,7 @@ export default class KeepingViewsInSyncTest extends AbstractSkillTest {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
@test()
|
|
39
|
-
protected static async
|
|
39
|
+
protected static async generatesValidTypesFileWithNoSkillViews() {
|
|
40
40
|
const results = await this.Action('view', 'create').execute({
|
|
41
41
|
viewType: 'view',
|
|
42
42
|
nameReadable: 'test',
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { diskUtil } from '@sprucelabs/spruce-skill-utils'
|
|
2
|
+
import { test, assert, errorAssert } from '@sprucelabs/test-utils'
|
|
3
|
+
import { FeatureActionResponse } from '../../../../features/features.types'
|
|
4
|
+
import CreatePluginAction from '../../../../features/view/actions/CreatePluginAction'
|
|
5
|
+
import AbstractSkillTest from '../../../../tests/AbstractSkillTest'
|
|
6
|
+
|
|
7
|
+
export default class CreatingAViewPluginTest extends AbstractSkillTest {
|
|
8
|
+
protected static skillCacheKey = 'views'
|
|
9
|
+
private static action: CreatePluginAction
|
|
10
|
+
|
|
11
|
+
protected static async beforeEach(): Promise<void> {
|
|
12
|
+
await super.beforeEach()
|
|
13
|
+
this.action = this.Action('view', 'createPlugin')
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@test()
|
|
17
|
+
protected static async hasAction() {
|
|
18
|
+
assert.isFunction(this.action.execute)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@test('creates expected plugin file 1', 'test', 'test', 'updated')
|
|
22
|
+
@test('creates expected plugin file 2', 'another', 'another', 'updated')
|
|
23
|
+
@test('creates expected plugin file 3', 'a third', 'aThird', 'generated')
|
|
24
|
+
protected static async createsExpectedFile(
|
|
25
|
+
readable: string,
|
|
26
|
+
expected: string,
|
|
27
|
+
combinedViewAction: string
|
|
28
|
+
) {
|
|
29
|
+
const results = await this.execute({ nameReadable: readable })
|
|
30
|
+
this.assertExpectedFileCreated(results, expected, combinedViewAction)
|
|
31
|
+
assert.isFalsy(
|
|
32
|
+
results.errors,
|
|
33
|
+
'Errors were returned and none were expected!'
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@test()
|
|
38
|
+
protected static async usesCamelNameIfProvided() {
|
|
39
|
+
const results = await this.execute({
|
|
40
|
+
nameReadable: 'test',
|
|
41
|
+
nameCamel: 'testCamel',
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
this.assertExpectedFileCreated(results, 'testCamel', 'updated')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@test()
|
|
48
|
+
protected static async actuallyCreatesFile() {
|
|
49
|
+
this.assertViewPluginWritten('test')
|
|
50
|
+
this.assertViewPluginWritten('another')
|
|
51
|
+
this.assertViewPluginWritten('aThird')
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@test()
|
|
55
|
+
protected static async throwsIfPluginAlreadyExists() {
|
|
56
|
+
await this.assertThrowsAlreadyExists('test')
|
|
57
|
+
await this.assertThrowsAlreadyExists('another')
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@test()
|
|
61
|
+
protected static async contentsAreEqualToExpected() {
|
|
62
|
+
this.assertPluginContentsEqualExpected('test', 'Test')
|
|
63
|
+
this.assertPluginContentsEqualExpected('another', 'Another')
|
|
64
|
+
this.assertPluginContentsEqualExpected('aThird', 'AThird')
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@test()
|
|
68
|
+
protected static async combineViewsFileIsValid() {
|
|
69
|
+
const combined = this.getPathToCombinedViewsFile()
|
|
70
|
+
await this.Service('typeChecker').check(combined)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@test()
|
|
74
|
+
protected static async updatesViewCombinedFileWithTypesAsExpected() {
|
|
75
|
+
const expected = ` interface ViewControllerPlugins {
|
|
76
|
+
aThird: AThirdViewPlugin
|
|
77
|
+
another: AnotherViewPlugin
|
|
78
|
+
test: TestViewPlugin
|
|
79
|
+
testCamel: TestCamelViewPlugin
|
|
80
|
+
}`
|
|
81
|
+
this.assertCombinedFileIncludes(expected)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@test()
|
|
85
|
+
protected static async updatesViewCombinedWithPluginsAsExpected() {
|
|
86
|
+
const expected = `export const pluginClasses = {
|
|
87
|
+
aThird: AThirdViewPlugin,
|
|
88
|
+
another: AnotherViewPlugin,
|
|
89
|
+
test: TestViewPlugin,
|
|
90
|
+
testCamel: TestCamelViewPlugin,
|
|
91
|
+
}
|
|
92
|
+
`
|
|
93
|
+
|
|
94
|
+
this.assertCombinedFileIncludes(expected)
|
|
95
|
+
this.assertCombinedFileIncludes('heartwood(vcs, pluginClasses)')
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
private static assertCombinedFileIncludes(expected: string) {
|
|
99
|
+
const combined = this.getPathToCombinedViewsFile()
|
|
100
|
+
const contents = diskUtil.readFile(combined)
|
|
101
|
+
assert.doesInclude(contents, expected)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
private static assertPluginContentsEqualExpected(
|
|
105
|
+
nameCamel: string,
|
|
106
|
+
namePascal: string
|
|
107
|
+
) {
|
|
108
|
+
const contents = diskUtil.readFile(this.buildPathToViewPlugin(nameCamel))
|
|
109
|
+
const expected = `export default class ${namePascal}ViewPlugin {}`
|
|
110
|
+
|
|
111
|
+
assert.isEqual(contents.trim(), expected.trim())
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private static async assertThrowsAlreadyExists(name: string) {
|
|
115
|
+
const results = await this.execute({ nameReadable: name })
|
|
116
|
+
assert.isTruthy(results.errors)
|
|
117
|
+
errorAssert.assertError(results.errors[0], 'VIEW_PLUGIN_ALREADY_EXISTS', {
|
|
118
|
+
name,
|
|
119
|
+
})
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private static assertViewPluginWritten(name: string) {
|
|
123
|
+
const path = this.buildPathToViewPlugin(name)
|
|
124
|
+
assert.isTrue(diskUtil.doesFileExist(path), `File ${path} was not written!`)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
private static buildPathToViewPlugin(name: string) {
|
|
128
|
+
return this.resolvePath('src', 'viewPlugins', `${name}.view.plugin.ts`)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
private static async execute(options: {
|
|
132
|
+
nameReadable: string
|
|
133
|
+
nameCamel?: string
|
|
134
|
+
}) {
|
|
135
|
+
return await this.action.execute(options)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
private static assertExpectedFileCreated(
|
|
139
|
+
results: FeatureActionResponse,
|
|
140
|
+
expected: string,
|
|
141
|
+
combinedViewAction: string
|
|
142
|
+
) {
|
|
143
|
+
const expectedName = `${expected}.view.plugin.ts`
|
|
144
|
+
|
|
145
|
+
assert.doesInclude(results.files?.[0], {
|
|
146
|
+
action: 'generated',
|
|
147
|
+
name: expectedName,
|
|
148
|
+
path: this.resolvePath('src', 'viewPlugins', expectedName),
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
assert.doesInclude(results.files?.[1], {
|
|
152
|
+
action: combinedViewAction,
|
|
153
|
+
name: 'views.ts',
|
|
154
|
+
path: this.getPathToCombinedViewsFile(),
|
|
155
|
+
})
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
private static getPathToCombinedViewsFile() {
|
|
159
|
+
return this.resolveHashSprucePath('views', 'views.ts')
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -260,6 +260,10 @@ export default class SpruceError extends AbstractSpruceError<ErrorOptions> {
|
|
|
260
260
|
message = `You already have ${options.namespace} as a dependency!`
|
|
261
261
|
break
|
|
262
262
|
|
|
263
|
+
case 'VIEW_PLUGIN_ALREADY_EXISTS':
|
|
264
|
+
message = `A view plugin by the name ${options.name} already exists!`
|
|
265
|
+
break
|
|
266
|
+
|
|
263
267
|
default:
|
|
264
268
|
message = super.friendlyMessage()
|
|
265
269
|
}
|