@sprucelabs/spruce-cli 17.0.15 → 17.1.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 +27 -0
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.d.ts +10 -0
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js +305 -0
- package/build/__tests__/behavioral/polish/SettingUpPolish.test.js.map +1 -0
- package/build/__tests__/testDirsAndFiles/related_schemas/v2020_10_06/skillWithExtraField.builder.d.ts +5 -0
- package/build/features/FeatureInstaller.d.ts +1 -1
- package/build/features/FeatureInstallerFactory.js +4 -2
- package/build/features/FeatureInstallerFactory.js.map +1 -1
- package/build/features/person/PersonFeature.d.ts +5 -5
- package/build/features/person/PersonFeature.js.map +1 -1
- package/build/features/polish/PolishFeature.d.ts +19 -0
- package/build/features/polish/PolishFeature.js +69 -0
- package/build/features/polish/PolishFeature.js.map +1 -0
- package/build/features/polish/actions/SetupAction.d.ts +13 -0
- package/build/features/polish/actions/SetupAction.js +115 -0
- package/build/features/polish/actions/SetupAction.js.map +1 -0
- package/build/features/polish/writers/PolishWriter.d.ts +4 -0
- package/build/features/polish/writers/PolishWriter.js +84 -0
- package/build/features/polish/writers/PolishWriter.js.map +1 -0
- package/build/widgets/terminalKit/TkBaseWidget.js +2 -2
- package/build/writers/WriterFactory.d.ts +2 -0
- package/build/writers/WriterFactory.js +4 -1
- package/build/writers/WriterFactory.js.map +1 -1
- package/package.json +46 -31
- package/src/__tests__/behavioral/polish/SettingUpPolish.test.ts +71 -0
- package/src/features/FeatureInstallerFactory.ts +3 -0
- package/src/features/person/PersonFeature.ts +6 -6
- package/src/features/polish/PolishFeature.ts +33 -0
- package/src/features/polish/actions/SetupAction.ts +36 -0
- package/src/features/polish/writers/PolishWriter.ts +23 -0
- package/src/writers/WriterFactory.ts +3 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import pathUtil from 'path'
|
|
2
|
+
import AbstractWriter from '../../../writers/AbstractWriter'
|
|
3
|
+
|
|
4
|
+
export default class PolishWriter extends AbstractWriter {
|
|
5
|
+
public async writePolishScript(
|
|
6
|
+
destinationDir: string,
|
|
7
|
+
skillNamespace: string
|
|
8
|
+
) {
|
|
9
|
+
const filename = `${skillNamespace}.polish.ts`
|
|
10
|
+
const resolvedDestination = pathUtil.join(destinationDir, filename)
|
|
11
|
+
const content = this.templates.polish()
|
|
12
|
+
|
|
13
|
+
const results = await this.writeFileIfChangedMixinResults(
|
|
14
|
+
resolvedDestination,
|
|
15
|
+
content,
|
|
16
|
+
`Polish script at ${filename}!`
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
await this.lint(resolvedDestination)
|
|
20
|
+
|
|
21
|
+
return results
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -6,6 +6,7 @@ import ErrorWriter from '../features/error/writers/ErrorWriter'
|
|
|
6
6
|
import EventWriter from '../features/event/writers/EventWriter'
|
|
7
7
|
import LogWriter from '../features/log/writers/LogWriter'
|
|
8
8
|
import NodeWriter from '../features/node/writers/NodeWriter'
|
|
9
|
+
import PolishWriter from '../features/polish/writers/PolishWriter'
|
|
9
10
|
import SandboxWriter from '../features/sandbox/writers/SandboxWriter'
|
|
10
11
|
import SchemaWriter from '../features/schema/writers/SchemaWriter'
|
|
11
12
|
import SkillGenerator from '../features/skill/writers/SkillWriter'
|
|
@@ -32,6 +33,7 @@ const classMap = {
|
|
|
32
33
|
store: StoreWriter,
|
|
33
34
|
view: ViewWriter,
|
|
34
35
|
log: LogWriter,
|
|
36
|
+
polish: PolishWriter,
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
export interface WriterMap {
|
|
@@ -48,6 +50,7 @@ export interface WriterMap {
|
|
|
48
50
|
store: StoreWriter
|
|
49
51
|
view: ViewWriter
|
|
50
52
|
log: LogWriter
|
|
53
|
+
polish: PolishWriter
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
export type WriterCode = keyof WriterMap
|