@sprucelabs/spruce-cli 22.2.0 → 22.3.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/.env +1 -1
- package/.eslintcache +1 -1
- package/build/__tests__/behavioral/features/InstallingFeaturesDirectly.test.d.ts +17 -0
- package/build/__tests__/behavioral/features/InstallingFeaturesDirectly.test.js +142 -0
- package/build/__tests__/behavioral/features/InstallingFeaturesDirectly.test.js.map +1 -0
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js +1 -1
- package/build/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.js.map +1 -1
- package/build/features/cache/CacheFeature.d.ts +8 -5
- package/build/features/cache/CacheFeature.js.map +1 -1
- package/build/features/conversation/ConversationFeature.d.ts +8 -5
- package/build/features/conversation/ConversationFeature.js.map +1 -1
- package/build/features/dependencies/DependencyFeature.d.ts +8 -5
- package/build/features/dependencies/DependencyFeature.js.map +1 -1
- package/build/features/deploy/DeployFeature.d.ts +8 -5
- package/build/features/deploy/DeployFeature.js.map +1 -1
- package/build/features/error/ErrorFeature.d.ts +8 -8
- package/build/features/error/ErrorFeature.js.map +1 -1
- package/build/features/eventContract/EventContractFeature.d.ts +8 -5
- package/build/features/eventContract/EventContractFeature.js.map +1 -1
- package/build/features/onboard/OnboardFeature.d.ts +8 -5
- package/build/features/onboard/OnboardFeature.js.map +1 -1
- package/build/features/organization/OrganizationFeature.d.ts +3 -0
- package/build/features/permission/PermissionFeature.d.ts +3 -0
- package/build/features/person/PersonFeature.d.ts +3 -0
- package/build/features/polish/PolishFeature.d.ts +3 -0
- package/build/features/sandbox/SandboxFeature.d.ts +8 -5
- package/build/features/sandbox/SandboxFeature.js.map +1 -1
- package/build/features/skill/actions/BootAction.d.ts +9 -9
- package/build/features/skill/actions/BootAction.js.map +1 -1
- package/build/features/skill/actions/InstallFeature.d.ts +0 -0
- package/build/features/skill/actions/InstallFeature.js +2 -0
- package/build/features/skill/actions/InstallFeature.js.map +1 -0
- package/build/features/skill/actions/InstallFeatureAction.d.ts +37 -0
- package/build/features/skill/actions/InstallFeatureAction.js +79 -0
- package/build/features/skill/actions/InstallFeatureAction.js.map +1 -0
- package/build/features/store/StoreFeature.d.ts +8 -5
- package/build/features/store/StoreFeature.js.map +1 -1
- package/build/features/test/TestFeature.d.ts +8 -5
- package/build/features/test/TestFeature.js.map +1 -1
- package/build/features/view/ViewFeature.d.ts +8 -8
- package/build/features/view/ViewFeature.js.map +1 -1
- package/build/features/view/actions/CreateAppAction.d.ts +1 -0
- package/build/features/view/actions/CreateAppAction.js +1 -1
- package/build/features/view/actions/CreateAppAction.js.map +1 -1
- package/build/features/vscode/VsCodeFeature.d.ts +8 -5
- package/build/features/vscode/VsCodeFeature.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/behavioral/features/InstallingFeaturesDirectly.test.ts +149 -0
- package/src/__tests__/behavioral/tests/SelectingAnAbstractTestClass.test.ts +1 -1
- package/src/features/cache/CacheFeature.ts +10 -6
- package/src/features/conversation/ConversationFeature.ts +10 -6
- package/src/features/dependencies/DependencyFeature.ts +10 -6
- package/src/features/deploy/DeployFeature.ts +10 -6
- package/src/features/error/ErrorFeature.ts +10 -10
- package/src/features/eventContract/EventContractFeature.ts +10 -6
- package/src/features/onboard/OnboardFeature.ts +10 -6
- package/src/features/organization/OrganizationFeature.ts +4 -0
- package/src/features/permission/PermissionFeature.ts +4 -0
- package/src/features/person/PersonFeature.ts +4 -0
- package/src/features/polish/PolishFeature.ts +4 -0
- package/src/features/sandbox/SandboxFeature.ts +10 -6
- package/src/features/skill/actions/BootAction.ts +11 -11
- package/src/features/skill/actions/InstallFeatureAction.ts +93 -0
- package/src/features/store/StoreFeature.ts +10 -6
- package/src/features/test/TestFeature.ts +10 -6
- package/src/features/view/ViewFeature.ts +10 -10
- package/src/features/view/actions/CreateAppAction.ts +1 -2
- package/src/features/vscode/VsCodeFeature.ts +9 -6
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schema_1 = require("@sprucelabs/schema");
|
|
7
|
+
const AbstractAction_1 = __importDefault(require("../../AbstractAction"));
|
|
8
|
+
class InstallFeatureAction extends AbstractAction_1.default {
|
|
9
|
+
optionsSchema = optionsSchema;
|
|
10
|
+
invocationMessage = 'Installing a feature... 🚀';
|
|
11
|
+
commandAliases = ['install.feature'];
|
|
12
|
+
async execute(options) {
|
|
13
|
+
let { code } = options ?? {};
|
|
14
|
+
if (!code) {
|
|
15
|
+
const choices = await this.buildFeatureChoices();
|
|
16
|
+
if (!choices.length) {
|
|
17
|
+
return {
|
|
18
|
+
summaryLines: [
|
|
19
|
+
'Nothing to install, you have already installed everything!',
|
|
20
|
+
],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
code = await this.promptForFeature(choices);
|
|
24
|
+
}
|
|
25
|
+
const results = await this.features.install({
|
|
26
|
+
features: [{ code: code }],
|
|
27
|
+
});
|
|
28
|
+
return results;
|
|
29
|
+
}
|
|
30
|
+
async promptForFeature(choices) {
|
|
31
|
+
return await this.ui.prompt({
|
|
32
|
+
type: 'select',
|
|
33
|
+
label: 'Which feature do you want to install?',
|
|
34
|
+
isRequired: true,
|
|
35
|
+
options: {
|
|
36
|
+
choices,
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
async buildFeatureChoices() {
|
|
41
|
+
const choices = [];
|
|
42
|
+
for (const key in features) {
|
|
43
|
+
const isInstalled = await this.features.isInstalled(key);
|
|
44
|
+
if (!isInstalled) {
|
|
45
|
+
choices.push({
|
|
46
|
+
label: features[key],
|
|
47
|
+
value: key,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return choices;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.default = InstallFeatureAction;
|
|
55
|
+
const features = {
|
|
56
|
+
error: 'Errors',
|
|
57
|
+
event: 'Events',
|
|
58
|
+
schema: 'Schemas',
|
|
59
|
+
store: 'Stores (including database support)',
|
|
60
|
+
test: 'Tests',
|
|
61
|
+
view: 'Views',
|
|
62
|
+
};
|
|
63
|
+
const allFeatureChoices = Object.keys(features).map((key) => ({
|
|
64
|
+
label: features[key],
|
|
65
|
+
value: key,
|
|
66
|
+
}));
|
|
67
|
+
const optionsSchema = (0, schema_1.buildSchema)({
|
|
68
|
+
id: 'installFeature',
|
|
69
|
+
fields: {
|
|
70
|
+
code: {
|
|
71
|
+
type: 'select',
|
|
72
|
+
label: 'Feature to install',
|
|
73
|
+
options: {
|
|
74
|
+
choices: allFeatureChoices,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
//# sourceMappingURL=InstallFeatureAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstallFeatureAction.js","sourceRoot":"","sources":["../../../../src/features/skill/actions/InstallFeatureAction.ts"],"names":[],"mappings":";;;;;AAAA,+CAA8D;AAE9D,0EAAiD;AAGjD,MAAqB,oBAAqB,SAAQ,wBAA6B;IACpE,aAAa,GAAG,aAAa,CAAA;IAC7B,iBAAiB,GAAG,4BAA4B,CAAA;IAChD,cAAc,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAEpC,KAAK,CAAC,OAAO,CAChB,OAAoC;QAEpC,IAAI,EAAE,IAAI,EAAE,GAAG,OAAO,IAAI,EAAE,CAAA;QAE5B,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,MAAM,OAAO,GAAmB,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAA;YAEhE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;gBAClB,OAAO;oBACH,YAAY,EAAE;wBACV,4DAA4D;qBAC/D;iBACJ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AE,CAAC,CAAC;IAC1E,KAAK,EAAE,QAAQ,CAAC,GAA4B,CAAC;IAC7C,KAAK,EAAE,GAAG;CACb,CAAC,CAAC,CAAA;AAEH,MAAM,aAAa,GAAG,IAAA,oBAAW,EAAC;IAC9B,EAAE,EAAE,gBAAgB;IACpB,MAAM,EAAE;QACJ,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oBAAoB;YAC3B,OAAO,EAAE;gBACL,OAAO,EAAE,iBAAiB;aAC7B;SACJ;KACJ;CACJ,CAAC,CAAA"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import AbstractFeature, { FeatureDependency, FeatureOptions } from '../AbstractFeature';
|
|
2
2
|
import { FeatureCode } from '../features.types';
|
|
3
|
-
declare module '../../features/features.types' {
|
|
4
|
-
interface FeatureMap {
|
|
5
|
-
store: StoreFeature;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
3
|
export default class StoreFeature extends AbstractFeature {
|
|
9
4
|
nameReadable: string;
|
|
10
5
|
description: string;
|
|
@@ -22,3 +17,11 @@ export default class StoreFeature extends AbstractFeature {
|
|
|
22
17
|
files: import("../../writers/AbstractWriter").WriteResults;
|
|
23
18
|
}>;
|
|
24
19
|
}
|
|
20
|
+
declare module '../../features/features.types' {
|
|
21
|
+
interface FeatureMap {
|
|
22
|
+
store: StoreFeature;
|
|
23
|
+
}
|
|
24
|
+
interface FeatureOptionsMap {
|
|
25
|
+
store: undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StoreFeature.js","sourceRoot":"","sources":["../../../src/features/store/StoreFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAyD;AACzD,4EAA+C;AAC/C,yEAG2B;
|
|
1
|
+
{"version":3,"file":"StoreFeature.js","sourceRoot":"","sources":["../../../src/features/store/StoreFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAyD;AACzD,4EAA+C;AAC/C,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,SAAS,EAAE,CAAC;YACZ,oBAAM,CAAC,cAAc,CAAC;gBAClB,EAAE,EAAE,IAAI,CAAC,EAAE;gBACX,QAAQ,EAAE,2BAA2B;aACxC,CAAC,CAAA;YAEF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;YAE9D,OAAO,OAAO,CAAA;QAClB,CAAC;QAED,OAAO,EAAE,CAAA;IACb,CAAC;IAEM,KAAK,CAAC,mBAAmB;QAC5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC9D,OAAO;YACH,KAAK;SACR,CAAA;IACL,CAAC;CACJ;AA1ED,+BA0EC"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { NpmPackage } from '../../types/cli.types';
|
|
2
2
|
import AbstractFeature, { FeatureDependency } from '../AbstractFeature';
|
|
3
3
|
import { FeatureCode } from '../features.types';
|
|
4
|
-
declare module '../../features/features.types' {
|
|
5
|
-
interface FeatureMap {
|
|
6
|
-
test: TestFeature;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
export interface ParentClassCandidate {
|
|
10
5
|
name: string;
|
|
11
6
|
label: string;
|
|
@@ -27,3 +22,11 @@ export default class TestFeature extends AbstractFeature {
|
|
|
27
22
|
private configureJest;
|
|
28
23
|
buildParentClassCandidates(): Promise<ParentClassCandidate[]>;
|
|
29
24
|
}
|
|
25
|
+
declare module '../../features/features.types' {
|
|
26
|
+
interface FeatureMap {
|
|
27
|
+
test: TestFeature;
|
|
28
|
+
}
|
|
29
|
+
interface FeatureOptionsMap {
|
|
30
|
+
test: undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestFeature.js","sourceRoot":"","sources":["../../../src/features/test/TestFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAkE;AAClE,uEAAyD;AACzD,2EAAkD;AAGlD,wFAA2D;AAC3D,yEAAuE;AACvE,iFAAwD;
|
|
1
|
+
{"version":3,"file":"TestFeature.js","sourceRoot":"","sources":["../../../src/features/test/TestFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAkE;AAClE,uEAAyD;AACzD,2EAAkD;AAGlD,wFAA2D;AAC3D,yEAAuE;AACvE,iFAAwD;AAYxD,MAAqB,WAAY,SAAQ,yBAAe;IAC7C,YAAY,GAAG,SAAS,CAAA;IACxB,WAAW,GAAG,iCAAiC,CAAA;IAC/C,IAAI,GAAgB,MAAM,CAAA;IAC1B,YAAY,GAAwB;QACvC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE;QACpC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;KACrC,CAAA;IACM,mBAAmB,GAAiB;QACvC,EAAE,IAAI,EAAE,yBAAyB,EAAE,KAAK,EAAE,IAAI,EAAE;QAChD,EAAE,IAAI,EAAE,+BAA+B,EAAE,KAAK,EAAE,IAAI,EAAE;QACtD,EAAE,IAAI,EAAE,uCAAuC,EAAE,KAAK,EAAE,IAAI,EAAE;QAC9D,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,IAAI,EAAE;QACpC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;KAChC,CAAA;IACM,UAAU,GAAG,6BAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAEvD,KAAK,CAAC,mBAAmB;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAEnC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC3B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;QAC9B,IAAI,CAAC,iBAAiB,EAAE,CAAA;QA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AC,CAAA;YAC7B,CAAC;QACL,CAAC;QAED,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACrB,IAAI,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC;gBACpB,OAAO,CAAC,CAAA;YACZ,CAAC;iBAAM,CAAC;gBACJ,OAAO,CAAC,CAAC,CAAA;YACb,CAAC;QACL,CAAC,CAAC,CAAA;QAEF,OAAO,UAAU,CAAA;IACrB,CAAC;CACJ;AA7HD,8BA6HC"}
|
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { NpmPackage } from '../../types/cli.types';
|
|
2
2
|
import AbstractFeature, { FeatureDependency } from '../AbstractFeature';
|
|
3
3
|
import { ActionOptions, FeatureCode } from '../features.types';
|
|
4
|
-
declare module '../../features/features.types' {
|
|
5
|
-
interface FeatureMap {
|
|
6
|
-
view: ViewFeature;
|
|
7
|
-
}
|
|
8
|
-
interface FeatureOptionsMap {
|
|
9
|
-
view: undefined;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
4
|
export default class ViewFeature extends AbstractFeature {
|
|
13
5
|
nameReadable: string;
|
|
14
6
|
description: string;
|
|
@@ -22,3 +14,11 @@ export default class ViewFeature extends AbstractFeature {
|
|
|
22
14
|
files: import("../../writers/AbstractWriter").WriteResults;
|
|
23
15
|
}>;
|
|
24
16
|
}
|
|
17
|
+
declare module '../../features/features.types' {
|
|
18
|
+
interface FeatureMap {
|
|
19
|
+
view: ViewFeature;
|
|
20
|
+
}
|
|
21
|
+
interface FeatureOptionsMap {
|
|
22
|
+
view: undefined;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewFeature.js","sourceRoot":"","sources":["../../../src/features/view/ViewFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAyD;AAEzD,yEAAuE;
|
|
1
|
+
{"version":3,"file":"ViewFeature.js","sourceRoot":"","sources":["../../../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ACb;wBACI,IAAI,EAAE,4BAA4B;wBAClC,KAAK,EAAE,4BAA4B;wBACnC,MAAM,EAAE,gCAAgC;wBACxC,WAAW,EAAE,MAAM;qBACtB;iBACJ;aACJ,CAAA;QACL,CAAC,CACJ,CAAA;IACL,CAAC;IAEO,KAAK,CAAC,uBAAuB;QACjC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC7D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAE7D,OAAO,CAAC,GAAG,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAA;IAChD,CAAC;IAEM,KAAK,CAAC,mBAAmB;QAC5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE7D,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC;YAC3B,EAAE,EAAE,IAAI;YACR,SAAS,EAAE,WAAW;SACzB,CAAC,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,CAAA;IACpB,CAAC;CACJ;AApFD,8BAoFC"}
|
|
@@ -9,6 +9,7 @@ const AbstractAction_1 = __importDefault(require("../../AbstractAction"));
|
|
|
9
9
|
class CreateAppAction extends AbstractAction_1.default {
|
|
10
10
|
optionsSchema = optionsSchema;
|
|
11
11
|
invocationMessage = 'Creating new app view controller... ';
|
|
12
|
+
commandAliases = ['create.avc'];
|
|
12
13
|
async execute() {
|
|
13
14
|
const writer = this.Writer('view', {});
|
|
14
15
|
const files = await writer.writeAppViewController(this.cwd);
|
|
@@ -16,7 +17,6 @@ class CreateAppAction extends AbstractAction_1.default {
|
|
|
16
17
|
const merged = action_utility_1.default.mergeActionResults({
|
|
17
18
|
files,
|
|
18
19
|
}, results);
|
|
19
|
-
debugger;
|
|
20
20
|
return merged;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateAppAction.js","sourceRoot":"","sources":["../../../../src/features/view/actions/CreateAppAction.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgD;AAChD,uFAA0D;AAC1D,0EAAiD;AAGjD,MAAqB,eAAgB,SAAQ,wBAA6B;IAC/D,aAAa,GAAG,aAAa,CAAA;IAC7B,iBAAiB,GAAG,sCAAsC,CAAA;
|
|
1
|
+
{"version":3,"file":"CreateAppAction.js","sourceRoot":"","sources":["../../../../src/features/view/actions/CreateAppAction.ts"],"names":[],"mappings":";;;;;AAAA,+CAAgD;AAChD,uFAA0D;AAC1D,0EAAiD;AAGjD,MAAqB,eAAgB,SAAQ,wBAA6B;IAC/D,aAAa,GAAG,aAAa,CAAA;IAC7B,iBAAiB,GAAG,sCAAsC,CAAA;IACjD,cAAc,GAAG,CAAC,YAAY,CAAC,CAAA;IAExC,KAAK,CAAC,OAAO;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QACtC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAE3D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAC7D,MAAM,MAAM,GAAG,wBAAU,CAAC,kBAAkB,CACxC;YACI,KAAK;SACR,EACD,OAAO,CACV,CAAA;QAED,OAAO,MAAM,CAAA;IACjB,CAAC;CACJ;AAnBD,kCAmBC;AAED,MAAM,aAAa,GAAG,IAAA,oBAAW,EAAC;IAC9B,EAAE,EAAE,gCAAgC;IACpC,MAAM,EAAE,EAAE;CACb,CAAC,CAAA"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { FileDescription } from '../../types/cli.types';
|
|
2
2
|
import AbstractFeature from '../AbstractFeature';
|
|
3
3
|
import { FeatureCode } from '../features.types';
|
|
4
|
-
declare module '../../features/features.types' {
|
|
5
|
-
interface FeatureMap {
|
|
6
|
-
vscode: VsCodeFeature;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
4
|
export default class VsCodeFeature extends AbstractFeature {
|
|
10
5
|
nameReadable: string;
|
|
11
6
|
description: string;
|
|
@@ -14,3 +9,11 @@ export default class VsCodeFeature extends AbstractFeature {
|
|
|
14
9
|
readonly fileDescriptions: FileDescription[];
|
|
15
10
|
isInstalled: () => Promise<boolean>;
|
|
16
11
|
}
|
|
12
|
+
declare module '../../features/features.types' {
|
|
13
|
+
interface FeatureMap {
|
|
14
|
+
vscode: VsCodeFeature;
|
|
15
|
+
}
|
|
16
|
+
interface FeatureOptionsMap {
|
|
17
|
+
vscode: undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VsCodeFeature.js","sourceRoot":"","sources":["../../../src/features/vscode/VsCodeFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAyD;AAEzD,yEAAgD;
|
|
1
|
+
{"version":3,"file":"VsCodeFeature.js","sourceRoot":"","sources":["../../../src/features/vscode/VsCodeFeature.ts"],"names":[],"mappings":";;;;;AAAA,uEAAyD;AAEzD,yEAAgD;AAGhD,MAAqB,aAAc,SAAQ,yBAAe;IAC/C,YAAY,GAAG,QAAQ,CAAA;IACvB,WAAW,GAAG,+CAA+C,CAAA;IAC7D,IAAI,GAAgB,QAAQ,CAAA;IAC5B,UAAU,GAAG,6BAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;IAE9C,gBAAgB,GAAsB;QAClD;YACI,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,kDAAkD;YAC/D,0BAA0B,EAAE,IAAI;YAChC,yBAAyB,EAAE,qCAAqC;SACnE;QACD;YACI,IAAI,EAAE,uBAAuB;YAC7B,WAAW,EACP,yDAAyD;YAC7D,0BAA0B,EAAE,IAAI;YAChC,yBAAyB,EACrB,6EAA6E;SACpF;QACD;YACI,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EACP,sEAAsE;YAC1E,0BAA0B,EAAE,IAAI;YAChC,yBAAyB,EACrB,kDAAkD;SACzD;KACJ,CAAA;IAEM,WAAW,GAAG,KAAK,IAAI,EAAE;QAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAEvC,IAAI,CAAC;YACD,MAAM,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;QACvC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACX,OAAO,KAAK,CAAA;QAChB,CAAC;QAED,OAAO,IAAI,CAAA;IACf,CAAC,CAAA;CACJ;AA1CD,gCA0CC"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"version": "22.
|
|
20
|
+
"version": "22.3.0",
|
|
21
21
|
"bin": {
|
|
22
22
|
"spruce": "./build/index.js"
|
|
23
23
|
},
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@sprucelabs/spruce-core-schemas": "^40.1.540",
|
|
85
85
|
"@sprucelabs/spruce-event-utils": "^40.1.314",
|
|
86
86
|
"@sprucelabs/spruce-skill-utils": "^31.0.614",
|
|
87
|
-
"@sprucelabs/spruce-templates": "^22.
|
|
87
|
+
"@sprucelabs/spruce-templates": "^22.3.0",
|
|
88
88
|
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
89
89
|
"@typescript-eslint/parser": "^7.7.1",
|
|
90
90
|
"cfonts": "^3.3.0",
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { SelectChoice } from '@sprucelabs/spruce-core-schemas'
|
|
2
|
+
import { test, assert, generateId } from '@sprucelabs/test-utils'
|
|
3
|
+
import { InstallFeatureOptions } from '../../../features/features.types'
|
|
4
|
+
import InstallFeatureAction, {
|
|
5
|
+
InstallFeatureActionOptions,
|
|
6
|
+
} from '../../../features/skill/actions/InstallFeatureAction'
|
|
7
|
+
import AbstractSkillTest from '../../../tests/AbstractSkillTest'
|
|
8
|
+
|
|
9
|
+
export default class InstallingFeaturesDirectlyTest extends AbstractSkillTest {
|
|
10
|
+
private static action: InstallFeatureAction
|
|
11
|
+
protected static skillCacheKey = 'skills'
|
|
12
|
+
|
|
13
|
+
protected static async beforeEach() {
|
|
14
|
+
await super.beforeEach()
|
|
15
|
+
this.action = this.Action('skill', 'installFeature')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
protected static async afterEach() {
|
|
19
|
+
this.ui.reset()
|
|
20
|
+
await super.afterEach()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@test()
|
|
24
|
+
protected static async hasExpectedAliases() {
|
|
25
|
+
assert.isEqualDeep(this.action.commandAliases, ['install.feature'])
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@test()
|
|
29
|
+
protected static async promptsForWhichFeatureToInstall() {
|
|
30
|
+
await this.executeAndWaitForPrompt()
|
|
31
|
+
|
|
32
|
+
const features = {
|
|
33
|
+
error: 'Errors',
|
|
34
|
+
event: 'Events',
|
|
35
|
+
schema: 'Schemas',
|
|
36
|
+
store: 'Stores (including database support)',
|
|
37
|
+
test: 'Tests',
|
|
38
|
+
view: 'Views',
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const choices: SelectChoice[] = Object.keys(features).map((key) => ({
|
|
42
|
+
label: features[key as keyof typeof features],
|
|
43
|
+
value: key,
|
|
44
|
+
}))
|
|
45
|
+
|
|
46
|
+
const last = this.ui.getLastInvocation()
|
|
47
|
+
assert.isEqual(last.command, 'prompt')
|
|
48
|
+
assert.isEqualDeep(last.options, {
|
|
49
|
+
type: 'select',
|
|
50
|
+
label: 'Which feature do you want to install?',
|
|
51
|
+
isRequired: true,
|
|
52
|
+
options: {
|
|
53
|
+
choices,
|
|
54
|
+
},
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@test('can install store feature', 'store')
|
|
59
|
+
@test('can install view feature', 'view')
|
|
60
|
+
@test('can install test feature', 'test')
|
|
61
|
+
protected static async selectingAFeatureTriesToInstallIt(featureCode: any) {
|
|
62
|
+
let passedOption: InstallFeatureOptions | undefined
|
|
63
|
+
|
|
64
|
+
this.featureInstaller.install = async (options) => {
|
|
65
|
+
passedOption = options
|
|
66
|
+
return {}
|
|
67
|
+
}
|
|
68
|
+
await this.executeAndWaitForPrompt()
|
|
69
|
+
await this.sendInput(featureCode)
|
|
70
|
+
|
|
71
|
+
assert.isEqualDeep(passedOption, { features: [{ code: featureCode }] })
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@test()
|
|
75
|
+
protected static async returnsResultsFromFeatureInstall() {
|
|
76
|
+
const results = {
|
|
77
|
+
[generateId()]: generateId(),
|
|
78
|
+
[generateId()]: generateId(),
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
this.featureInstaller.install = async () => results
|
|
82
|
+
|
|
83
|
+
const { promise } = await this.executeAndWaitForPrompt()
|
|
84
|
+
|
|
85
|
+
await this.sendInput('store')
|
|
86
|
+
|
|
87
|
+
const actual = await promise
|
|
88
|
+
|
|
89
|
+
assert.isEqualDeep(actual, results)
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@test('skips view feature if already installed', 'view')
|
|
93
|
+
@test('skips store feature if already installed', 'store')
|
|
94
|
+
@test('skips test feature if already installed', 'test')
|
|
95
|
+
protected static async doesNotShowOptionForInstalledFeature(code: string) {
|
|
96
|
+
this.featureInstaller.install = async () => ({})
|
|
97
|
+
const installed = ['skill', code]
|
|
98
|
+
this.featureInstaller.isInstalled = async (code) =>
|
|
99
|
+
installed.includes(code)
|
|
100
|
+
await this.executeAndWaitForPrompt()
|
|
101
|
+
const { options } = this.ui.getLastInvocation()
|
|
102
|
+
const choices = options.options.choices as SelectChoice[]
|
|
103
|
+
assert.doesNotInclude(
|
|
104
|
+
choices.map((c) => c.value),
|
|
105
|
+
code
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@test()
|
|
110
|
+
protected static async ifThereAreNoFeaturesToInstallDonNotPrompt() {
|
|
111
|
+
this.featureInstaller.isInstalled = async () => true
|
|
112
|
+
const results = await this.execute()
|
|
113
|
+
assert.isEqualDeep(results, {
|
|
114
|
+
summaryLines: [
|
|
115
|
+
'Nothing to install, you have already installed everything!',
|
|
116
|
+
],
|
|
117
|
+
})
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@test('should install directly view', 'view')
|
|
121
|
+
@test('should install directly store', 'store')
|
|
122
|
+
@test('should install directly test', 'test')
|
|
123
|
+
protected static async passingFeatureCodeToActionSkipsPrompt(code: any) {
|
|
124
|
+
let passedOption: InstallFeatureOptions | undefined
|
|
125
|
+
this.featureInstaller.install = async (options) => {
|
|
126
|
+
passedOption = options
|
|
127
|
+
return {}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
this.ui.prompt = async () => assert.fail('Should not prompt')
|
|
131
|
+
|
|
132
|
+
await this.execute({ code })
|
|
133
|
+
assert.isEqualDeep(passedOption, { features: [{ code }] })
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
private static async sendInput(featureCode: string) {
|
|
137
|
+
await this.ui.sendInput(featureCode)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private static async executeAndWaitForPrompt() {
|
|
141
|
+
const promise = this.execute()
|
|
142
|
+
await this.ui.waitForInput()
|
|
143
|
+
return { promise }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
private static execute(options?: InstallFeatureActionOptions) {
|
|
147
|
+
return this.action.execute(options ?? {})
|
|
148
|
+
}
|
|
149
|
+
}
|
|
@@ -131,8 +131,8 @@ export default class SelectingAnAbstractTestClassTest extends AbstractTestTest {
|
|
|
131
131
|
for (const feat of featuresWithRegisteredTests) {
|
|
132
132
|
await this.featureInstaller.install({
|
|
133
133
|
features: [
|
|
134
|
+
//@ts-ignore
|
|
134
135
|
{
|
|
135
|
-
//@ts-ignore
|
|
136
136
|
code: feat.featureCode,
|
|
137
137
|
},
|
|
138
138
|
],
|
|
@@ -2,12 +2,6 @@ import { diskUtil } from '@sprucelabs/spruce-skill-utils'
|
|
|
2
2
|
import AbstractFeature from '../AbstractFeature'
|
|
3
3
|
import { FeatureCode } from '../features.types'
|
|
4
4
|
|
|
5
|
-
declare module '../../features/features.types' {
|
|
6
|
-
interface FeatureMap {
|
|
7
|
-
cache: CacheFeature
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
export default class CacheFeature extends AbstractFeature {
|
|
12
6
|
public description = 'Caching for all things Sprucebot.'
|
|
13
7
|
public code: FeatureCode = 'cache'
|
|
@@ -18,3 +12,13 @@ export default class CacheFeature extends AbstractFeature {
|
|
|
18
12
|
return true
|
|
19
13
|
}
|
|
20
14
|
}
|
|
15
|
+
|
|
16
|
+
declare module '../../features/features.types' {
|
|
17
|
+
interface FeatureMap {
|
|
18
|
+
cache: CacheFeature
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface FeatureOptionsMap {
|
|
22
|
+
cache: undefined
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -7,12 +7,6 @@ import AbstractFeature, {
|
|
|
7
7
|
} from '../AbstractFeature'
|
|
8
8
|
import { FeatureCode } from '../features.types'
|
|
9
9
|
|
|
10
|
-
declare module '../../features/features.types' {
|
|
11
|
-
interface FeatureMap {
|
|
12
|
-
conversation: ConversationFeature
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
10
|
export default class ConversationFeature extends AbstractFeature {
|
|
17
11
|
public nameReadable = 'Conversation'
|
|
18
12
|
public code: FeatureCode = 'conversation'
|
|
@@ -68,3 +62,13 @@ export default class ConversationFeature extends AbstractFeature {
|
|
|
68
62
|
return this.Writer('conversation').writePlugin(this.cwd)
|
|
69
63
|
}
|
|
70
64
|
}
|
|
65
|
+
|
|
66
|
+
declare module '../../features/features.types' {
|
|
67
|
+
interface FeatureMap {
|
|
68
|
+
conversation: ConversationFeature
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface FeatureOptionsMap {
|
|
72
|
+
conversation: undefined
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -2,12 +2,6 @@ import { diskUtil } from '@sprucelabs/spruce-skill-utils'
|
|
|
2
2
|
import AbstractFeature, { FeatureDependency } from '../AbstractFeature'
|
|
3
3
|
import { FeatureCode } from '../features.types'
|
|
4
4
|
|
|
5
|
-
declare module '../../features/features.types' {
|
|
6
|
-
interface FeatureMap {
|
|
7
|
-
dependency: DependencyFeature
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
5
|
export default class DependencyFeature extends AbstractFeature {
|
|
12
6
|
public description = 'Tell me which skills you depend on.'
|
|
13
7
|
public code: FeatureCode = 'dependency'
|
|
@@ -25,3 +19,13 @@ export default class DependencyFeature extends AbstractFeature {
|
|
|
25
19
|
return this.features.isInstalled('skill')
|
|
26
20
|
}
|
|
27
21
|
}
|
|
22
|
+
|
|
23
|
+
declare module '../../features/features.types' {
|
|
24
|
+
interface FeatureMap {
|
|
25
|
+
dependency: DependencyFeature
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface FeatureOptionsMap {
|
|
29
|
+
dependency: undefined
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -5,12 +5,6 @@ import AbstractFeature, {
|
|
|
5
5
|
} from '../AbstractFeature'
|
|
6
6
|
import { FeatureCode } from '../features.types'
|
|
7
7
|
|
|
8
|
-
declare module '../../features/features.types' {
|
|
9
|
-
interface FeatureMap {
|
|
10
|
-
deploy: DeployFeature
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
8
|
export default class DeployFeature extends AbstractFeature {
|
|
15
9
|
public description = 'Deploy your skill with ease.'
|
|
16
10
|
public code: FeatureCode = 'deploy'
|
|
@@ -35,3 +29,13 @@ export default class DeployFeature extends AbstractFeature {
|
|
|
35
29
|
}
|
|
36
30
|
}
|
|
37
31
|
}
|
|
32
|
+
|
|
33
|
+
declare module '../../features/features.types' {
|
|
34
|
+
interface FeatureMap {
|
|
35
|
+
deploy: DeployFeature
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface FeatureOptionsMap {
|
|
39
|
+
deploy: undefined
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -7,16 +7,6 @@ import AbstractFeature, {
|
|
|
7
7
|
} from '../AbstractFeature'
|
|
8
8
|
import { FeatureCode } from '../features.types'
|
|
9
9
|
|
|
10
|
-
declare module '../../features/features.types' {
|
|
11
|
-
interface FeatureMap {
|
|
12
|
-
error: ErrorFeature
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface FeatureOptionsMap {
|
|
16
|
-
error: undefined
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
10
|
export default class ErrorFeature extends AbstractFeature {
|
|
21
11
|
public nameReadable = 'error handling'
|
|
22
12
|
public description =
|
|
@@ -102,3 +92,13 @@ export default class ErrorFeature extends AbstractFeature {
|
|
|
102
92
|
return this.Writer('error').writePlugin(this.cwd)
|
|
103
93
|
}
|
|
104
94
|
}
|
|
95
|
+
|
|
96
|
+
declare module '../../features/features.types' {
|
|
97
|
+
interface FeatureMap {
|
|
98
|
+
error: ErrorFeature
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface FeatureOptionsMap {
|
|
102
|
+
error: undefined
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -3,12 +3,6 @@ import { FileDescription } from '../../types/cli.types'
|
|
|
3
3
|
import AbstractFeature, { FeatureDependency } from '../AbstractFeature'
|
|
4
4
|
import { FeatureCode } from '../features.types'
|
|
5
5
|
|
|
6
|
-
declare module '../../features/features.types' {
|
|
7
|
-
interface FeatureMap {
|
|
8
|
-
eventContract: EventContractFeature
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
|
|
12
6
|
export default class EventContractFeature extends AbstractFeature {
|
|
13
7
|
public code: FeatureCode = 'eventContract'
|
|
14
8
|
public nameReadable = 'Event Contract'
|
|
@@ -22,3 +16,13 @@ export default class EventContractFeature extends AbstractFeature {
|
|
|
22
16
|
|
|
23
17
|
public isInstalled = async () => true
|
|
24
18
|
}
|
|
19
|
+
|
|
20
|
+
declare module '../../features/features.types' {
|
|
21
|
+
interface FeatureMap {
|
|
22
|
+
eventContract: EventContractFeature
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface FeatureOptionsMap {
|
|
26
|
+
eventContract: undefined
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -9,12 +9,6 @@ import { FeatureCode } from '../features.types'
|
|
|
9
9
|
import ScriptLoader from './ScriptLoader'
|
|
10
10
|
import OnboardingStore from './stores/OnboardingStore'
|
|
11
11
|
|
|
12
|
-
declare module '../../features/features.types' {
|
|
13
|
-
interface FeatureMap {
|
|
14
|
-
onboard: OnboardFeature
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
12
|
export default class OnboardFeature extends AbstractFeature {
|
|
19
13
|
public code: FeatureCode = 'onboard'
|
|
20
14
|
public nameReadable = 'Onboard'
|
|
@@ -150,3 +144,13 @@ export default class OnboardFeature extends AbstractFeature {
|
|
|
150
144
|
return isExpectedCommand
|
|
151
145
|
}
|
|
152
146
|
}
|
|
147
|
+
|
|
148
|
+
declare module '../../features/features.types' {
|
|
149
|
+
interface FeatureMap {
|
|
150
|
+
onboard: OnboardFeature
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
interface FeatureOptionsMap {
|
|
154
|
+
onboard: undefined
|
|
155
|
+
}
|
|
156
|
+
}
|