@sprucelabs/spruce-cli 20.0.1 → 20.0.3
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 +16 -0
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js +1 -1
- package/build/__tests__/behavioral/upgrading/UpgradingASkill5.test.js.map +1 -1
- package/build/__tests__/implementation/EventCacheService.test.d.ts +4 -0
- package/build/__tests__/implementation/EventCacheService.test.js +84 -0
- package/build/__tests__/implementation/EventCacheService.test.js.map +1 -0
- package/build/features/event/EventFeature.js +2 -2
- package/build/features/event/EventFeature.js.map +1 -1
- package/build/features/event/actions/SyncAction.js +1 -1
- package/build/features/event/actions/SyncAction.js.map +1 -1
- package/build/features/event/services/{EventSettingsService.d.ts → EventCacheService.d.ts} +3 -3
- package/build/features/event/services/{EventSettingsService.js → EventCacheService.js} +8 -7
- package/build/features/event/services/EventCacheService.js.map +1 -0
- package/build/features/node/actions/UpgradeAction.d.ts +2 -2
- package/build/features/node/actions/UpgradeAction.js.map +1 -1
- package/build/features/universalFileDescriptions.js +1 -1
- package/build/features/universalFileDescriptions.js.map +1 -1
- package/build/interfaces/TerminalInterface.js +5 -1
- package/build/interfaces/TerminalInterface.js.map +1 -1
- package/build/services/ServiceFactory.d.ts +3 -2
- package/build/services/ServiceFactory.js +11 -7
- package/build/services/ServiceFactory.js.map +1 -1
- package/package.json +27 -27
- package/src/__tests__/behavioral/upgrading/UpgradingASkill5.test.ts +1 -1
- package/src/__tests__/implementation/EventCacheService.test.ts +38 -0
- package/src/features/event/EventFeature.ts +2 -2
- package/src/features/event/actions/SyncAction.ts +1 -1
- package/src/features/event/services/{EventSettingsService.ts → EventCacheService.ts} +5 -3
- package/src/features/node/actions/UpgradeAction.ts +4 -4
- package/src/features/universalFileDescriptions.ts +1 -1
- package/src/interfaces/TerminalInterface.ts +6 -1
- package/src/services/ServiceFactory.ts +11 -8
- package/build/features/event/services/EventSettingsService.js.map +0 -1
|
@@ -272,7 +272,7 @@ export default class TerminalInterface implements GraphicsInterface {
|
|
|
272
272
|
) {
|
|
273
273
|
const isSpruce = effects.indexOf(GraphicsTextEffect.SpruceHeader) > -1
|
|
274
274
|
|
|
275
|
-
if (isSpruce) {
|
|
275
|
+
if (isSpruce && TerminalInterface.doesSupportColor()) {
|
|
276
276
|
fonts.say(message, {
|
|
277
277
|
font: GraphicsTextEffect.SpruceHeader,
|
|
278
278
|
align: 'left',
|
|
@@ -292,6 +292,11 @@ export default class TerminalInterface implements GraphicsInterface {
|
|
|
292
292
|
}
|
|
293
293
|
|
|
294
294
|
public renderHero(message: string, effects?: GraphicsTextEffect[]) {
|
|
295
|
+
if (!TerminalInterface.doesSupportColor()) {
|
|
296
|
+
this.renderLine(message)
|
|
297
|
+
return
|
|
298
|
+
}
|
|
299
|
+
|
|
295
300
|
const shouldStripVowels = process.stdout.columns < 80
|
|
296
301
|
|
|
297
302
|
let stripped = shouldStripVowels
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
EnvService,
|
|
4
4
|
AuthService,
|
|
5
5
|
} from '@sprucelabs/spruce-skill-utils'
|
|
6
|
-
import
|
|
6
|
+
import EventCacheService from '../features/event/services/EventCacheService'
|
|
7
7
|
import RemoteService from '../features/event/services/RemoteService'
|
|
8
8
|
import { FeatureCode } from '../features/features.types'
|
|
9
9
|
import SchemaService from '../features/schema/services/SchemaService'
|
|
@@ -19,10 +19,12 @@ import TypeCheckerService from './TypeCheckerService'
|
|
|
19
19
|
export default class ServiceFactory {
|
|
20
20
|
public static serviceClassOverides: Record<string, any> = {}
|
|
21
21
|
|
|
22
|
+
public static setServiceClass(name: Service, Class: any) {
|
|
23
|
+
this.serviceClassOverides[name] = Class
|
|
24
|
+
}
|
|
25
|
+
|
|
22
26
|
public Service<S extends Service>(cwd: string, type: S): ServiceMap[S] {
|
|
23
|
-
|
|
24
|
-
return new ServiceFactory.serviceClassOverides[type](cwd) as ServiceMap[S]
|
|
25
|
-
}
|
|
27
|
+
const Class = ServiceFactory.serviceClassOverides[type] as any
|
|
26
28
|
|
|
27
29
|
switch (type) {
|
|
28
30
|
case 'auth':
|
|
@@ -55,7 +57,8 @@ export default class ServiceFactory {
|
|
|
55
57
|
this.buildImportService(cwd)
|
|
56
58
|
) as ServiceMap[S]
|
|
57
59
|
case 'settings':
|
|
58
|
-
|
|
60
|
+
//@ts-ignore
|
|
61
|
+
return new (Class ?? SettingsService)<FeatureCode>(cwd) as ServiceMap[S]
|
|
59
62
|
case 'dependency':
|
|
60
63
|
return new DependencyService(
|
|
61
64
|
new SettingsService<FeatureCode>(cwd)
|
|
@@ -69,8 +72,8 @@ export default class ServiceFactory {
|
|
|
69
72
|
new LintService(cwd, () => this.Service(cwd, 'command'))
|
|
70
73
|
) as ServiceMap[S]
|
|
71
74
|
}
|
|
72
|
-
case '
|
|
73
|
-
return new
|
|
75
|
+
case 'eventCache':
|
|
76
|
+
return new (Class ?? EventCacheService)(
|
|
74
77
|
new SettingsService(cwd)
|
|
75
78
|
) as ServiceMap[S]
|
|
76
79
|
default:
|
|
@@ -107,7 +110,7 @@ export interface ServiceMap {
|
|
|
107
110
|
env: EnvService
|
|
108
111
|
auth: AuthService
|
|
109
112
|
remote: RemoteService
|
|
110
|
-
|
|
113
|
+
eventCache: EventCacheService
|
|
111
114
|
dependency: DependencyService
|
|
112
115
|
}
|
|
113
116
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventSettingsService.js","names":["EventSettingsService","exports","settings","_classCallCheck2","_defineProperty2","_createClass2","key","value","getLastSyncOptions","get","setLastSyncOptions","options","set","setListenerCache","clearListenerCache","unset","getListenerCache"],"sources":["../../../../src/features/event/services/EventSettingsService.ts"],"sourcesContent":["import { SettingsService } from '@sprucelabs/spruce-skill-utils'\n\nexport default class EventSettingsService {\n\tprivate settings: SettingsService<string>\n\tpublic constructor(settings: SettingsService) {\n\t\tthis.settings = settings\n\t}\n\n\tpublic getLastSyncOptions() {\n\t\treturn this.settings.get('events.lastSync')\n\t}\n\n\tpublic setLastSyncOptions(options: {\n\t\tshouldSyncOnlyCoreEvents?: boolean | null\n\t}) {\n\t\tthis.settings.set('events.lastSync', options)\n\t}\n\n\tpublic setListenerCache(value: Record<string, any>) {\n\t\tthis.settings.set('events.listenerCacheKeys', value)\n\t}\n\n\tpublic clearListenerCache() {\n\t\tthis.settings.unset('events.listenerCacheKeys')\n\t}\n\n\tpublic getListenerCache() {\n\t\treturn this.settings.get('events.listenerCacheKeys')\n\t}\n}\n"],"mappings":";;;;;;;;;;IAEqBA,oBAAoB,GAAAC,OAAA;EAExC,SAAAD,qBAAmBE,QAAyB,EAAE;IAAA,IAAAC,gBAAA,mBAAAH,oBAAA;IAAA,IAAAI,gBAAA;IAC7C,IAAI,CAACF,QAAQ,GAAGA,QAAQ;EACzB;EAAC,WAAAG,aAAA,aAAAL,oBAAA;IAAAM,GAAA;IAAAC,KAAA,EAED,SAAAC,mBAAA,EAA4B;MAC3B,OAAO,IAAI,CAACN,QAAQ,CAACO,GAAG,CAAC,iBAAiB,CAAC;IAC5C;EAAC;IAAAH,GAAA;IAAAC,KAAA,EAED,SAAAG,mBAA0BC,OAEzB,EAAE;MACF,IAAI,CAACT,QAAQ,CAACU,GAAG,CAAC,iBAAiB,EAAED,OAAO,CAAC;IAC9C;EAAC;IAAAL,GAAA;IAAAC,KAAA,EAED,SAAAM,iBAAwBN,KAA0B,EAAE;MACnD,IAAI,CAACL,QAAQ,CAACU,GAAG,CAAC,0BAA0B,EAAEL,KAAK,CAAC;IACrD;EAAC;IAAAD,GAAA;IAAAC,KAAA,EAED,SAAAO,mBAAA,EAA4B;MAC3B,IAAI,CAACZ,QAAQ,CAACa,KAAK,CAAC,0BAA0B,CAAC;IAChD;EAAC;IAAAT,GAAA;IAAAC,KAAA,EAED,SAAAS,iBAAA,EAA0B;MACzB,OAAO,IAAI,CAACd,QAAQ,CAACO,GAAG,CAAC,0BAA0B,CAAC;IACrD;EAAC;AAAA","ignoreList":[]}
|