Skip to content

Commit

Permalink
adding back types
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoMartins51 committed Feb 7, 2024
1 parent 3d55eb2 commit 42db6b8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ import jsonata from 'jsonata';
import { resolveSafeChildPath } from '@backstage/backend-common';
import fs from 'fs-extra';
import YAML from 'yaml';
import { yamlOptionsSchema } from '../../types';
import { stringifyOptions, yamlOptionsSchema } from '../../types';

export function createYamlJSONataTransformAction() {
return createTemplateAction<{
path: string;
expression: string;
options?: any;
options?: stringifyOptions;
loadAll?: boolean;
as?: 'string' | 'object';
}>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import fs from 'fs-extra';
import { extname } from 'path';
import { isArray, isNull, mergeWith } from 'lodash';
import YAML from 'yaml';
import { yamlOptionsSchema } from '../../types';
import { stringifyOptions, yamlOptionsSchema } from '../../types';
import detectIndent from 'detect-indent';

function mergeArrayCustomiser(objValue: string | any[], srcValue: any) {
Expand Down Expand Up @@ -139,7 +139,7 @@ export function createMergeAction() {
path: string;
content: any;
mergeArrays?: boolean;
options?: any;
options?: stringifyOptions;
}>({
id: 'roadiehq:utils:merge',
description: 'Merges data into an existing structured file.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/
import { createTemplateAction } from '@backstage/plugin-scaffolder-node';
import YAML from 'yaml';
import { yamlOptionsSchema } from '../../types';
import { stringifyOptions, yamlOptionsSchema } from '../../types';

export function createSerializeYamlAction() {
return createTemplateAction<{
data: any;
options?: any;
options?: stringifyOptions;
}>({
id: 'roadiehq:utils:serialize:yaml',
description: 'Allows performing serialization on an object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* limitations under the License.
*/

import { ToStringOptions } from 'yaml';

export type stringifyOptions = Omit<ToStringOptions, 'commentString'>;

export const yamlOptionsSchema = {
title: 'Options',
description: 'YAML stringify options',
Expand Down

0 comments on commit 42db6b8

Please sign in to comment.