@roadiehq/scaffolder-backend-module-utils 1.3.1 → 1.4.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/dist/index.cjs.js +14 -9
- package/dist/index.cjs.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -159,9 +159,9 @@ function createMergeJSONAction({ actionId }) {
|
|
|
159
159
|
type: "string"
|
|
160
160
|
},
|
|
161
161
|
content: {
|
|
162
|
+
description: "This will be merged into to the file. Can be either an object or a string.",
|
|
162
163
|
title: "Content",
|
|
163
|
-
|
|
164
|
-
type: "object"
|
|
164
|
+
type: ["string", "object"]
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
},
|
|
@@ -184,7 +184,8 @@ function createMergeJSONAction({ actionId }) {
|
|
|
184
184
|
ctx.logger.info(`The file ${sourceFilepath} does not exist, creating it.`);
|
|
185
185
|
existingContent = {};
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
const content = typeof ctx.input.content === "string" ? JSON.parse(ctx.input.content) : ctx.input.content;
|
|
188
|
+
fs__default["default"].writeFileSync(sourceFilepath, JSON.stringify(lodash.merge(existingContent, content), null, 2));
|
|
188
189
|
ctx.output("path", sourceFilepath);
|
|
189
190
|
}
|
|
190
191
|
});
|
|
@@ -204,9 +205,9 @@ function createMergeAction() {
|
|
|
204
205
|
type: "string"
|
|
205
206
|
},
|
|
206
207
|
content: {
|
|
208
|
+
description: "This will be merged into to the file. Can be either an object or a string.",
|
|
207
209
|
title: "Content",
|
|
208
|
-
|
|
209
|
-
type: "object"
|
|
210
|
+
type: ["string", "object"]
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
},
|
|
@@ -229,13 +230,17 @@ function createMergeAction() {
|
|
|
229
230
|
const originalContent = fs__default["default"].readFileSync(sourceFilepath).toString();
|
|
230
231
|
let mergedContent;
|
|
231
232
|
switch (path.extname(sourceFilepath)) {
|
|
232
|
-
case ".json":
|
|
233
|
-
|
|
233
|
+
case ".json": {
|
|
234
|
+
const newContent = typeof ctx.input.content === "string" ? JSON.parse(ctx.input.content) : ctx.input.content;
|
|
235
|
+
mergedContent = JSON.stringify(lodash.merge(JSON.parse(originalContent), newContent), null, 2);
|
|
234
236
|
break;
|
|
235
|
-
|
|
237
|
+
}
|
|
236
238
|
case ".yml":
|
|
237
|
-
|
|
239
|
+
case ".yaml": {
|
|
240
|
+
const newContent = typeof ctx.input.content === "string" ? YAML__default["default"].parse(ctx.input.content) : ctx.input.content;
|
|
241
|
+
mergedContent = YAML__default["default"].stringify(lodash.merge(YAML__default["default"].parse(originalContent), newContent));
|
|
238
242
|
break;
|
|
243
|
+
}
|
|
239
244
|
}
|
|
240
245
|
if (!mergedContent) {
|
|
241
246
|
return;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/actions/zip.ts","../src/actions/fs/writeFile.ts","../src/actions/fs/appendFile.ts","../src/actions/merge/merge.ts","../src/actions/sleep.ts"],"sourcesContent":["/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\nimport AdmZip from 'adm-zip';\nimport fs from 'fs-extra';\n\nexport function createZipAction() {\n return createTemplateAction<{ path: string; outputPath: string }>({\n id: 'roadiehq:utils:zip',\n description: 'Zips the content of the path',\n schema: {\n input: {\n required: ['path'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path you would like to zip',\n type: 'string',\n },\n\n outputPath: {\n title: 'Output Path',\n description: 'The name of the result of the zip command',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n outputPath: {\n title: 'Zip Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const zip = new AdmZip();\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.outputPath,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n throw new InputError(\n `File ${ctx.input.path} does not exist. Can't zip it.`,\n );\n }\n if (fs.lstatSync(sourceFilepath).isDirectory()) {\n zip.addLocalFolder(sourceFilepath);\n } else if (fs.lstatSync(sourceFilepath).isFile()) {\n zip.addLocalFile(sourceFilepath);\n }\n zip.writeZip(destFilepath);\n ctx.output('outputPath', ctx.input.outputPath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createWriteFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:write',\n description: 'Creates a file with the content on the given path',\n schema: {\n input: {\n required: ['path', 'content'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be the content of the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.outputFileSync(destFilepath, ctx.input.content);\n ctx.output('path', destFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createAppendFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:append',\n description:\n 'Append content to the end of the given file, it will create the file if it does not exist.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be appended to the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.appendFileSync(sourceFilepath, ctx.input.content);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport { extname } from 'path';\nimport { merge } from 'lodash';\nimport YAML from 'yaml';\n\nexport function createMergeJSONAction({ actionId }: { actionId?: string }) {\n return createTemplateAction<{ path: string; content: any }>({\n id: actionId || 'roadiehq:utils:json:merge',\n description: 'Merge new data into an existing JSON file.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be merged into to the file',\n type: 'object',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n let existingContent;\n\n if (fs.existsSync(sourceFilepath)) {\n existingContent = JSON.parse(\n fs.readFileSync(sourceFilepath).toString(),\n );\n } else {\n ctx.logger.info(\n `The file ${sourceFilepath} does not exist, creating it.`,\n );\n existingContent = {};\n }\n\n fs.writeFileSync(\n sourceFilepath,\n JSON.stringify(merge(existingContent, ctx.input.content), null, 2),\n );\n ctx.output('path', sourceFilepath);\n },\n });\n}\n\nexport function createMergeAction() {\n return createTemplateAction<{ path: string; content: any }>({\n id: 'roadiehq:utils:merge',\n description: 'Merges data into an existing structured file.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be merged into to the file',\n type: 'object',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n ctx.logger.error(`The file ${sourceFilepath} does not exist.`);\n throw new Error(`The file ${sourceFilepath} does not exist.`);\n }\n const originalContent = fs.readFileSync(sourceFilepath).toString();\n let mergedContent;\n\n switch (extname(sourceFilepath)) {\n case '.json':\n mergedContent = JSON.stringify(\n merge(JSON.parse(originalContent), ctx.input.content),\n null,\n 2,\n );\n break;\n case '.yaml':\n case '.yml':\n mergedContent = YAML.stringify(\n merge(YAML.parse(originalContent), ctx.input.content),\n );\n break;\n default:\n break;\n }\n if (!mergedContent) {\n return;\n }\n fs.writeFileSync(sourceFilepath, mergedContent);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\n\nexport function createSleepAction(options?: { maxSleep?: number }) {\n return createTemplateAction<{ amount: number }>({\n id: 'roadiehq:utils:sleep',\n description: 'Halts the scaffolding for the given amount of seconds',\n schema: {\n input: {\n type: 'object',\n required: ['amount'],\n properties: {\n amount: {\n title: 'Sleep Amount',\n description: 'How much seconds should this step take.',\n type: 'number',\n },\n },\n },\n },\n async handler(ctx) {\n if (isNaN(ctx.input?.amount)) {\n throw new InputError('amount must be a number');\n } else if (options?.maxSleep && ctx.input.amount > options.maxSleep) {\n throw new InputError(\n `sleep amount can not be greater than maxSleep. amount: ${ctx.input.amount}, maxSleep: ${options.maxSleep}`,\n );\n }\n ctx.logger.info(`Waiting ${ctx.input.amount} seconds`);\n\n await new Promise(resolve => {\n setTimeout(resolve, ctx.input.amount * 1000);\n });\n },\n });\n}\n"],"names":["createTemplateAction","AdmZip","resolveSafeChildPath","fs","InputError","merge","extname","YAML"],"mappings":";;;;;;;;;;;;;;;;;;;AAKO,SAAS,eAAe,GAAG;AAClC,EAAE,OAAOA,4CAAoB,CAAC;AAC9B,IAAI,EAAE,EAAE,oBAAoB;AAC5B,IAAI,WAAW,EAAE,8BAA8B;AAC/C,IAAI,MAAM,EAAE;AACZ,MAAM,KAAK,EAAE;AACb,QAAQ,QAAQ,EAAE,CAAC,MAAM,CAAC;AAC1B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,IAAI,EAAE;AAChB,YAAY,KAAK,EAAE,MAAM;AACzB,YAAY,WAAW,EAAE,qCAAqC;AAC9D,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,aAAa;AAChC,YAAY,WAAW,EAAE,2CAA2C;AACpE,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,MAAM,MAAM,EAAE;AACd,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,UAAU;AAC7B,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,MAAM,MAAM,GAAG,GAAG,IAAIC,0BAAM,EAAE,CAAC;AAC/B,MAAM,MAAM,cAAc,GAAGC,kCAAoB,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACrF,MAAM,MAAM,YAAY,GAAGA,kCAAoB,CAAC,GAAG,CAAC,aAAa,EAAE,GAAG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AQ,MAAM,IAAII,iBAAU,CAAC,yBAAyB,CAAC,CAAC;AACxD,OAAO,MAAM,IAAI,CAAC,OAAO,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,QAAQ,KAAK,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE;AACvG,QAAQ,MAAM,IAAIA,iBAAU,CAAC,CAAC,uDAAuD,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC1I,OAAO;AACP,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7D,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;AACrC,QAAQ,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACpD,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/actions/zip.ts","../src/actions/fs/writeFile.ts","../src/actions/fs/appendFile.ts","../src/actions/merge/merge.ts","../src/actions/sleep.ts"],"sourcesContent":["/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\nimport AdmZip from 'adm-zip';\nimport fs from 'fs-extra';\n\nexport function createZipAction() {\n return createTemplateAction<{ path: string; outputPath: string }>({\n id: 'roadiehq:utils:zip',\n description: 'Zips the content of the path',\n schema: {\n input: {\n required: ['path'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path you would like to zip',\n type: 'string',\n },\n\n outputPath: {\n title: 'Output Path',\n description: 'The name of the result of the zip command',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n outputPath: {\n title: 'Zip Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const zip = new AdmZip();\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.outputPath,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n throw new InputError(\n `File ${ctx.input.path} does not exist. Can't zip it.`,\n );\n }\n if (fs.lstatSync(sourceFilepath).isDirectory()) {\n zip.addLocalFolder(sourceFilepath);\n } else if (fs.lstatSync(sourceFilepath).isFile()) {\n zip.addLocalFile(sourceFilepath);\n }\n zip.writeZip(destFilepath);\n ctx.output('outputPath', ctx.input.outputPath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createWriteFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:write',\n description: 'Creates a file with the content on the given path',\n schema: {\n input: {\n required: ['path', 'content'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be the content of the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.outputFileSync(destFilepath, ctx.input.content);\n ctx.output('path', destFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createAppendFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:append',\n description:\n 'Append content to the end of the given file, it will create the file if it does not exist.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be appended to the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.appendFileSync(sourceFilepath, ctx.input.content);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport { extname } from 'path';\nimport { merge } from 'lodash';\nimport YAML from 'yaml';\n\nexport function createMergeJSONAction({ actionId }: { actionId?: string }) {\n return createTemplateAction<{ path: string; content: any }>({\n id: actionId || 'roadiehq:utils:json:merge',\n description: 'Merge new data into an existing JSON file.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n let existingContent;\n\n if (fs.existsSync(sourceFilepath)) {\n existingContent = JSON.parse(\n fs.readFileSync(sourceFilepath).toString(),\n );\n } else {\n ctx.logger.info(\n `The file ${sourceFilepath} does not exist, creating it.`,\n );\n existingContent = {};\n }\n const content =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content;\n\n fs.writeFileSync(\n sourceFilepath,\n JSON.stringify(merge(existingContent, content), null, 2),\n );\n ctx.output('path', sourceFilepath);\n },\n });\n}\n\nexport function createMergeAction() {\n return createTemplateAction<{ path: string; content: any }>({\n id: 'roadiehq:utils:merge',\n description: 'Merges data into an existing structured file.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n ctx.logger.error(`The file ${sourceFilepath} does not exist.`);\n throw new Error(`The file ${sourceFilepath} does not exist.`);\n }\n const originalContent = fs.readFileSync(sourceFilepath).toString();\n let mergedContent;\n\n switch (extname(sourceFilepath)) {\n case '.json': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = JSON.stringify(\n merge(JSON.parse(originalContent), newContent),\n null,\n 2,\n );\n break;\n }\n case '.yml':\n case '.yaml': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? YAML.parse(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = YAML.stringify(\n merge(YAML.parse(originalContent), newContent),\n );\n break;\n }\n default:\n break;\n }\n if (!mergedContent) {\n return;\n }\n fs.writeFileSync(sourceFilepath, mergedContent);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\n\nexport function createSleepAction(options?: { maxSleep?: number }) {\n return createTemplateAction<{ amount: number }>({\n id: 'roadiehq:utils:sleep',\n description: 'Halts the scaffolding for the given amount of seconds',\n schema: {\n input: {\n type: 'object',\n required: ['amount'],\n properties: {\n amount: {\n title: 'Sleep Amount',\n description: 'How much seconds should this step take.',\n type: 'number',\n },\n },\n },\n },\n async handler(ctx) {\n if (isNaN(ctx.input?.amount)) {\n throw new InputError('amount must be a number');\n } else if (options?.maxSleep && ctx.input.amount > options.maxSleep) {\n throw new InputError(\n `sleep amount can not be greater than maxSleep. amount: ${ctx.input.amount}, maxSleep: ${options.maxSleep}`,\n );\n }\n ctx.logger.info(`Waiting ${ctx.input.amount} seconds`);\n\n await new Promise(resolve => {\n setTimeout(resolve, ctx.input.amount * 1000);\n });\n },\n });\n}\n"],"names":["createTemplateAction","AdmZip","resolveSafeChildPath","fs","InputError","merge","extname","YAML"],"mappings":";;;;;;;;;;;;;;;;;;;AAKO,SAAS,eAAe,GAAG;AAClC,EAAE,OAAOA,4CAAoB,CAAC;AAC9B,IAAI,EAAE,EAAE,oBAAoB;AAC5B,IAAI,WAAW,EAAE,8BAA8B;AAC/C,IAAI,MAAM,EAAE;AACZ,MAAM,KAAK,EAAE;AACb,QAAQ,QAAQ,EAAE,CAAC,MAAM,CAAC;AAC1B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,IAAI,EAAE;AAChB,YAAY,KAAK,EAAE,MAAM;AACzB,YAAY,WAAW,EAAE,qCAAqC;AAC9D,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,aAAa;AAChC,YAAY,WAAW,EAAE,2CAA2C;AACpE,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,MAAM,MAAM,EAAE;AACd,QAAQ,IAAI,EAAE,QA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G,QAAQ,MAAM,IAAIA,iBAAU,CAAC,CAAC,uDAAuD,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC1I,OAAO;AACP,MAAM,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC7D,MAAM,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK;AACrC,QAAQ,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACpD,OAAO,CAAC,CAAC;AACT,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roadiehq/scaffolder-backend-module-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"files": [
|
|
54
54
|
"dist"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "947f773c4833c8e2db64422e8d947fecd70ccb9c"
|
|
57
57
|
}
|