@sprucelabs/spruce-cli 14.26.1 → 14.26.2
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
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [14.26.2](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.26.1...v14.26.2) (2021-11-09)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [14.26.1](https://github.com/sprucelabsai/spruce-cli-workspace/compare/v14.26.0...v14.26.1) (2021-11-08)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @sprucelabs/spruce-cli
|
|
@@ -64,7 +64,7 @@ var BootAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
64
64
|
var _execute = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(options) {
|
|
65
65
|
var _this2 = this;
|
|
66
66
|
|
|
67
|
-
var command, script, runningPromise, bootPromise, meta;
|
|
67
|
+
var command, script, runningPromise, bootPromise, hints, meta;
|
|
68
68
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
69
69
|
while (1) {
|
|
70
70
|
switch (_context.prev = _context.next) {
|
|
@@ -81,6 +81,7 @@ var BootAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
81
81
|
bootPromise = new Promise(function (resolve, reject) {
|
|
82
82
|
runningPromise = _this2.boot(command, script, resolve, reject);
|
|
83
83
|
});
|
|
84
|
+
hints = ['Skill booted succesfully!', 'Skill torn down cleanly!'];
|
|
84
85
|
meta = {
|
|
85
86
|
isBooted: false,
|
|
86
87
|
kill: command.kill.bind(command),
|
|
@@ -92,7 +93,8 @@ var BootAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
92
93
|
bootPromise = bootPromise.then(function () {
|
|
93
94
|
meta.isBooted = true;
|
|
94
95
|
return {
|
|
95
|
-
meta: meta
|
|
96
|
+
meta: meta,
|
|
97
|
+
hints: hints
|
|
96
98
|
};
|
|
97
99
|
})["catch"](function (err) {
|
|
98
100
|
reject(err);
|
|
@@ -102,18 +104,20 @@ var BootAction = /*#__PURE__*/function (_AbstractAction) {
|
|
|
102
104
|
if (!options.shouldReturnImmediately) {
|
|
103
105
|
void bootPromise.then(function () {
|
|
104
106
|
return resolve({
|
|
105
|
-
meta: meta
|
|
107
|
+
meta: meta,
|
|
108
|
+
hints: hints
|
|
106
109
|
});
|
|
107
110
|
});
|
|
108
111
|
} else {
|
|
109
112
|
meta.bootPromise = bootPromise;
|
|
110
113
|
resolve({
|
|
111
|
-
meta: meta
|
|
114
|
+
meta: meta,
|
|
115
|
+
hints: hints
|
|
112
116
|
});
|
|
113
117
|
}
|
|
114
118
|
}));
|
|
115
119
|
|
|
116
|
-
case
|
|
120
|
+
case 9:
|
|
117
121
|
case "end":
|
|
118
122
|
return _context.stop();
|
|
119
123
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/features/skill/actions/BootAction.ts"],"names":["BootAction","bootSkillOptionsSchema","options","command","Service","script","onDataHandler","onData","onErrorHandler","onError","local","bootPromise","Promise","resolve","reject","runningPromise","boot","meta","isBooted","kill","bind","pid","promise","then","err","shouldReturnImmediately","execute","data","search","undefined","results","mappedErr","message","SpruceError","code","friendlyMessage","AbstractAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;;;;;IAcqBA,U;;;;;;;;;;;;;;;sGACkBC,4B;uGACd,CAAC,MAAD,C;0GACG,qB;;;;;;;;;mGAI3B,iBAAqBC,OAArB;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AACOC,gBAAAA,OADP,GACiB,KAAKC,OAAL,CAAa,SAAb,CADjB;AAGKC,gBAAAA,MAHL,GAGc,MAHd;AAIC,qBAAKC,aAAL,GAAqBJ,OAAO,CAACK,MAA7B;AACA,qBAAKC,cAAL,GAAsBN,OAAO,CAACO,OAA9B;;AAEA,oBAAIP,OAAO,CAACQ,KAAZ,EAAmB;AAClBL,kBAAAA,MAAM,IAAI,QAAV;AACA;;AAIGM,gBAAAA,WAbL,GAamB,IAAIC,OAAJ,CAAY,UAACC,OAAD,EAAUC,MAAV,EAAqB;AAClDC,kBAAAA,cAAc,GAAG,MAAI,CAACC,IAAL,CAAUb,OAAV,EAAmBE,MAAnB,EAA2BQ,OAA3B,EAAoCC,MAApC,CAAjB;AACA,iBAFiB,CAbnB;AAiBOG,gBAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../../src/features/skill/actions/BootAction.ts"],"names":["BootAction","bootSkillOptionsSchema","options","command","Service","script","onDataHandler","onData","onErrorHandler","onError","local","bootPromise","Promise","resolve","reject","runningPromise","boot","hints","meta","isBooted","kill","bind","pid","promise","then","err","shouldReturnImmediately","execute","data","search","undefined","results","mappedErr","message","SpruceError","code","friendlyMessage","AbstractAction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AAEA;;;;;;IAcqBA,U;;;;;;;;;;;;;;;sGACkBC,4B;uGACd,CAAC,MAAD,C;0GACG,qB;;;;;;;;;mGAI3B,iBAAqBC,OAArB;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AACOC,gBAAAA,OADP,GACiB,KAAKC,OAAL,CAAa,SAAb,CADjB;AAGKC,gBAAAA,MAHL,GAGc,MAHd;AAIC,qBAAKC,aAAL,GAAqBJ,OAAO,CAACK,MAA7B;AACA,qBAAKC,cAAL,GAAsBN,OAAO,CAACO,OAA9B;;AAEA,oBAAIP,OAAO,CAACQ,KAAZ,EAAmB;AAClBL,kBAAAA,MAAM,IAAI,QAAV;AACA;;AAIGM,gBAAAA,WAbL,GAamB,IAAIC,OA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hB,CAAZ;AAIA;;AArCH,oBAuCOjB,QAvCP;AAAA;AAAA;AAAA;;AAwCGL,gBAAAA,MAAM,CAACkB,SAAD,CAAN;AAxCH;AAAA;;AAAA;AAAA,sBA0CSA,SA1CT;;AAAA;AAAA,kDA8CQ,IA9CR;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,O;;;;;;;;;;EA1DuCK,2B","sourcesContent":["import { SpruceSchemas } from '#spruce/schemas/schemas.types'\nimport bootSkillOptionsSchema from '#spruce/schemas/spruceCli/v2020_07_22/bootSkillOptions.schema'\nimport SpruceError from '../../../errors/SpruceError'\nimport CommandService from '../../../services/CommandService'\nimport AbstractAction from '../../AbstractAction'\nimport { FeatureActionResponse } from '../../features.types'\n\ntype OptionsSchema = SpruceSchemas.SpruceCli.v2020_07_22.BootSkillOptionsSchema\ntype Options = SpruceSchemas.SpruceCli.v2020_07_22.BootSkillOptions\n\nexport interface BootMeta {\n\tkill: () => void\n\tpid: number\n\tpromise: Promise<void>\n\tisBooted: boolean\n\tbootPromise: Promise<void>\n}\n\nexport default class BootAction extends AbstractAction<OptionsSchema> {\n\tpublic optionsSchema: OptionsSchema = bootSkillOptionsSchema\n\tpublic commandAliases = ['boot']\n\tpublic invocationMessage = 'Booting skill... ⚡️'\n\tprivate onDataHandler: ((msg: string) => void) | null | undefined\n\tprivate onErrorHandler: ((msg: string) => void) | null | undefined\n\n\tpublic async execute(options: Options): Promise<FeatureActionResponse> {\n\t\tconst command = this.Service('command')\n\n\t\tlet script = 'boot'\n\t\tthis.onDataHandler = options.onData\n\t\tthis.onErrorHandler = options.onError\n\n\t\tif (options.local) {\n\t\t\tscript += '.local'\n\t\t}\n\n\t\tlet runningPromise: any\n\n\t\tlet bootPromise = new Promise((resolve, reject) => {\n\t\t\trunningPromise = this.boot(command, script, resolve, reject)\n\t\t})\n\n\t\tconst hints = ['Skill booted succesfully!', 'Skill torn down cleanly!']\n\n\t\tconst meta = {\n\t\t\tisBooted: false,\n\t\t\tkill: command.kill.bind(command),\n\t\t\tpid: command.pid() as number,\n\t\t\tpromise: runningPromise,\n\t\t\tbootPromise,\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tbootPromise = bootPromise\n\t\t\t\t.then(() => {\n\t\t\t\t\tmeta.isBooted = true\n\t\t\t\t\treturn { meta, hints }\n\t\t\t\t})\n\t\t\t\t.catch((err) => {\n\t\t\t\t\treject(err)\n\t\t\t\t\treturn err\n\t\t\t\t})\n\n\t\t\tif (!options.shouldReturnImmediately) {\n\t\t\t\tvoid bootPromise.then(() => resolve({ meta, hints }))\n\t\t\t} else {\n\t\t\t\tmeta.bootPromise = bootPromise\n\n\t\t\t\tresolve({\n\t\t\t\t\tmeta,\n\t\t\t\t\thints,\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n\n\tprivate async boot(\n\t\tcommand: CommandService,\n\t\tscript: string,\n\t\tresolve: (value: unknown) => void,\n\t\treject: (reason?: any) => void\n\t) {\n\t\tlet isBooted = false\n\t\ttry {\n\t\t\tconst results = await command.execute(`yarn ${script}`, {\n\t\t\t\tonData: (data) => {\n\t\t\t\t\tthis.onDataHandler?.(data)\n\t\t\t\t\tif (!isBooted && data.search(':: Skill booted') > -1) {\n\t\t\t\t\t\tisBooted = true\n\t\t\t\t\t\tresolve(undefined)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonError: (data) => {\n\t\t\t\t\tthis.onErrorHandler?.(data)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\tif (!isBooted) {\n\t\t\t\tisBooted = true\n\t\t\t\tresolve(undefined)\n\t\t\t}\n\n\t\t\treturn results\n\t\t} catch (err: any) {\n\t\t\tlet mappedErr = err\n\t\t\tif (\n\t\t\t\tmappedErr.message.search(/Error: cannot find module.*?build\\/index/gi) >\n\t\t\t\t-1\n\t\t\t) {\n\t\t\t\tmappedErr = new SpruceError({\n\t\t\t\t\tcode: 'BOOT_ERROR',\n\t\t\t\t\tfriendlyMessage: 'You must build your skill before you can boot it!',\n\t\t\t\t})\n\t\t\t}\n\n\t\t\tif (!isBooted) {\n\t\t\t\treject(mappedErr)\n\t\t\t} else {\n\t\t\t\tthrow mappedErr\n\t\t\t}\n\t\t}\n\n\t\treturn null\n\t}\n}\n"],"file":"BootAction.js"}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
]
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
|
-
"version": "14.26.
|
|
20
|
+
"version": "14.26.2",
|
|
21
21
|
"bin": {
|
|
22
22
|
"spruce": "./build/index.js"
|
|
23
23
|
},
|
|
@@ -75,19 +75,19 @@
|
|
|
75
75
|
"@babel/plugin-proposal-decorators": "^7.16.0",
|
|
76
76
|
"@babel/runtime": "^7.16.0",
|
|
77
77
|
"@jest/reporters": "^27.3.1",
|
|
78
|
-
"@sprucelabs/error": "^5.0.
|
|
79
|
-
"@sprucelabs/heartwood-view-controllers": "^41.2.
|
|
80
|
-
"@sprucelabs/jest-json-reporter": "^6.0.
|
|
81
|
-
"@sprucelabs/mercury-client": "^16.13.
|
|
82
|
-
"@sprucelabs/mercury-event-emitter": "^16.13.
|
|
83
|
-
"@sprucelabs/mercury-types": "^26.1.
|
|
84
|
-
"@sprucelabs/schema": "^25.3.
|
|
85
|
-
"@sprucelabs/spruce-core-schemas": "^22.6.
|
|
78
|
+
"@sprucelabs/error": "^5.0.274",
|
|
79
|
+
"@sprucelabs/heartwood-view-controllers": "^41.2.19",
|
|
80
|
+
"@sprucelabs/jest-json-reporter": "^6.0.234",
|
|
81
|
+
"@sprucelabs/mercury-client": "^16.13.283",
|
|
82
|
+
"@sprucelabs/mercury-event-emitter": "^16.13.283",
|
|
83
|
+
"@sprucelabs/mercury-types": "^26.1.745",
|
|
84
|
+
"@sprucelabs/schema": "^25.3.472",
|
|
85
|
+
"@sprucelabs/spruce-core-schemas": "^22.6.50",
|
|
86
86
|
"@sprucelabs/spruce-event-plugin": "^9.0.1",
|
|
87
|
-
"@sprucelabs/spruce-event-utils": "^17.0.
|
|
87
|
+
"@sprucelabs/spruce-event-utils": "^17.0.26",
|
|
88
88
|
"@sprucelabs/spruce-skill-booter": "^9.0.1",
|
|
89
|
-
"@sprucelabs/spruce-skill-utils": "^22.0.
|
|
90
|
-
"@sprucelabs/spruce-templates": "^14.26.
|
|
89
|
+
"@sprucelabs/spruce-skill-utils": "^22.0.45",
|
|
90
|
+
"@sprucelabs/spruce-templates": "^14.26.2",
|
|
91
91
|
"cfonts": "^2.10.0",
|
|
92
92
|
"chalk": "^4.1.2",
|
|
93
93
|
"chokidar": "^3.5.2",
|
|
@@ -117,15 +117,15 @@
|
|
|
117
117
|
},
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@sprucelabs/data-stores": "^7.0.12",
|
|
120
|
-
"@sprucelabs/jest-sheets-reporter": "^1.2.
|
|
121
|
-
"@sprucelabs/mercury-core-events": "^1.4.
|
|
120
|
+
"@sprucelabs/jest-sheets-reporter": "^1.2.239",
|
|
121
|
+
"@sprucelabs/mercury-core-events": "^1.4.57",
|
|
122
122
|
"@sprucelabs/resolve-path-aliases": "^1.0.223",
|
|
123
123
|
"@sprucelabs/spruce-conversation-plugin": "^9.0.1",
|
|
124
124
|
"@sprucelabs/spruce-deploy-plugin": "^9.0.1",
|
|
125
125
|
"@sprucelabs/spruce-store-plugin": "^9.0.1",
|
|
126
126
|
"@sprucelabs/spruce-test-fixtures": "^9.0.1",
|
|
127
|
-
"@sprucelabs/test": "^7.7.
|
|
128
|
-
"@sprucelabs/test-utils": "^3.0.
|
|
127
|
+
"@sprucelabs/test": "^7.7.219",
|
|
128
|
+
"@sprucelabs/test-utils": "^3.0.251",
|
|
129
129
|
"@types/blessed": "^0.1.19",
|
|
130
130
|
"@types/eslint": "^7.28.2",
|
|
131
131
|
"@types/fs-extra": "^9.0.13",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"@types/lodash": "^4.14.176",
|
|
136
136
|
"@types/md5": "^2.3.1",
|
|
137
137
|
"@types/mkdirp": "^1.0.2",
|
|
138
|
-
"@types/node": "^16.11.
|
|
138
|
+
"@types/node": "^16.11.7",
|
|
139
139
|
"@types/promise.allsettled": "^1.0.3",
|
|
140
140
|
"@types/ps-node": "^0.1.1",
|
|
141
141
|
"@types/rimraf": "^3.0.2",
|
|
@@ -593,5 +593,5 @@
|
|
|
593
593
|
"ora"
|
|
594
594
|
]
|
|
595
595
|
},
|
|
596
|
-
"gitHead": "
|
|
596
|
+
"gitHead": "828ab7810c4f5759797087b17a4786efd310a865"
|
|
597
597
|
}
|
|
@@ -40,6 +40,8 @@ export default class BootAction extends AbstractAction<OptionsSchema> {
|
|
|
40
40
|
runningPromise = this.boot(command, script, resolve, reject)
|
|
41
41
|
})
|
|
42
42
|
|
|
43
|
+
const hints = ['Skill booted succesfully!', 'Skill torn down cleanly!']
|
|
44
|
+
|
|
43
45
|
const meta = {
|
|
44
46
|
isBooted: false,
|
|
45
47
|
kill: command.kill.bind(command),
|
|
@@ -52,7 +54,7 @@ export default class BootAction extends AbstractAction<OptionsSchema> {
|
|
|
52
54
|
bootPromise = bootPromise
|
|
53
55
|
.then(() => {
|
|
54
56
|
meta.isBooted = true
|
|
55
|
-
return { meta }
|
|
57
|
+
return { meta, hints }
|
|
56
58
|
})
|
|
57
59
|
.catch((err) => {
|
|
58
60
|
reject(err)
|
|
@@ -60,12 +62,13 @@ export default class BootAction extends AbstractAction<OptionsSchema> {
|
|
|
60
62
|
})
|
|
61
63
|
|
|
62
64
|
if (!options.shouldReturnImmediately) {
|
|
63
|
-
void bootPromise.then(() => resolve({ meta }))
|
|
65
|
+
void bootPromise.then(() => resolve({ meta, hints }))
|
|
64
66
|
} else {
|
|
65
67
|
meta.bootPromise = bootPromise
|
|
66
68
|
|
|
67
69
|
resolve({
|
|
68
70
|
meta,
|
|
71
|
+
hints,
|
|
69
72
|
})
|
|
70
73
|
}
|
|
71
74
|
})
|