Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b6ee69a
feat: add 'replace_output' props to plugin, allowing plugins to modif…
zxypro1 Apr 7, 2025
55ce65f
pub: engine@0.1.6-beta.4, parse-spec@0.0.30-beta.1
zxypro1 Apr 7, 2025
6e5ae63
rm replaceOutput
zxypro1 Apr 7, 2025
4840471
pub: engine@0.1.6-beta.5
zxypro1 Apr 21, 2025
1a5b82d
publish: registry@0.0.12-beta.6
zxypro1 May 19, 2025
4b6f9de
feat: resources.info support plugins
zxypro1 May 21, 2025
0663cdd
fix: s.yaml not found when info
zxypro1 May 23, 2025
46ff797
build(engine|parse-spec): update dependencies and fix env variable pa…
zxypro1 May 28, 2025
41a1157
build(deps): update @serverless-devs/art-template to 4.13.16-beta.39
zxypro1 Jun 11, 2025
f5fe096
feat(load-application): add support for number type prompts
zxypro1 Jun 18, 2025
a54c20c
feat(engine): enhance error handling and hook context in action execu…
zxypro1 Nov 26, 2025
d58c51c
chore(deps): downgrade pnpm lockfile version and update package depen…
zxypro1 Nov 26, 2025
43bff3c
chore(engine): bump version to 0.1.6-beta.11 and enhance app name han…
zxypro1 Nov 26, 2025
e84029c
fix(engine): downgrade version to 0.1.6-beta.10 and update error hand…
zxypro1 Nov 26, 2025
3140cfc
chore(engine): bump version to 0.1.6-beta.11 in package.json
zxypro1 Nov 27, 2025
437086b
chore(engine): bump version to 0.1.6-beta.12 in package.json
zxypro1 Nov 28, 2025
12ff9e9
fix(load-component): improve error handling in getEntryFile function
zxypro1 Jan 1, 2026
d11d7fc
fix(load-component): throw error if no valid entry file found
zxypro1 Jan 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/engine/src/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IAction, IActionLevel, IActionType, IAllowFailure, IComponentAction, IHookType, IPluginAction, IRunAction, getInputs } from '@serverless-devs/parse-spec';
import { isEmpty, filter, includes, set, get } from 'lodash';
import { isEmpty, filter, includes, set, get, cloneDeep } from 'lodash';
import * as utils from '@serverless-devs/utils';
import { DevsError, ETrackerType } from '@serverless-devs/utils';
import fs from 'fs-extra';
Expand All @@ -23,6 +23,7 @@ interface IRecord {
allowFailure: boolean | IAllowFailure; // step allow_failure > action allow_failure
command: string; // 记录当前执行的command
startTime: number; // 记录开始时间
replaceOutput: boolean;
}

interface IOptions {
Expand Down Expand Up @@ -248,6 +249,10 @@ You can still use them now, but we suggest to modify them.`)
const inputs = isEmpty(this.record.pluginOutput) ? this.inputs : this.record.pluginOutput;
// Execute the plugin with the determined inputs and provided arguments.
this.record.pluginOutput = await instance(inputs, hook.args, this.logger);
// If prop 'replace_output' is true, replace the record's step output with the plugin output.
if (hook.replace_output) {
this.record.step.output = cloneDeep(this.record.pluginOutput);
}
} catch (e) {
const error = e as Error;
// Check if the failure is allowed based on the record's allowFailure setting.
Expand Down
1 change: 1 addition & 0 deletions packages/parse-spec/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface IPluginAction {
level: `${IActionLevel}`;
projectName: string;
allow_failure?: boolean | IAllowFailure;
replace_output?: boolean;
}
export interface IComponentAction {
hookType: `${IHookType}`;
Expand Down
Loading