Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
280 changes: 280 additions & 0 deletions .yarn/patches/@backstage-backend-defaults-npm-0.13.1-51efe19efd.patch

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
diff --git a/dist/scaffolder/actions/builtin/filesystem/delete.cjs.js.map b/dist/scaffolder/actions/builtin/filesystem/delete.cjs.js.map
index 060babc8f57cc3c15d7869f78ea4f7b3bb01300a..8b77d360c817656e4f232a815a80b145260d1b90 100644
--- a/dist/scaffolder/actions/builtin/filesystem/delete.cjs.js.map
+++ b/dist/scaffolder/actions/builtin/filesystem/delete.cjs.js.map
@@ -1 +1 @@
-{"version":3,"file":"delete.cjs.js","sources":["../../../../../src/scaffolder/actions/builtin/filesystem/delete.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\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-node';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-plugin-api';\nimport fs from 'fs-extra';\nimport globby from 'globby';\nimport { examples } from './delete.examples';\n\n/**\n * Creates new action that enables deletion of files and directories in the workspace.\n * @public\n */\nexport const createFilesystemDeleteAction = () => {\n return createTemplateAction({\n id: 'fs:delete',\n description: 'Deletes files and directories from the workspace',\n examples,\n schema: {\n input: {\n files: z =>\n z.array(z.string(), {\n description: 'A list of files and directories that will be deleted',\n }),\n },\n },\n supportsDryRun: true,\n async handler(ctx) {\n if (!Array.isArray(ctx.input?.files)) {\n throw new InputError('files must be an Array');\n }\n\n for (const file of ctx.input.files) {\n // globby cannot handle backslash file separators\n const safeFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n file,\n ).replace(/\\\\/g, '/');\n const resolvedPaths = await globby(safeFilepath, {\n cwd: ctx.workspacePath,\n absolute: true,\n dot: true,\n });\n\n for (const filepath of resolvedPaths) {\n try {\n const safePath = resolveSafeChildPath(ctx.workspacePath, filepath);\n await fs.remove(safePath);\n ctx.logger.info(`File ${safePath} deleted successfully`);\n } catch (err) {\n ctx.logger.error(`Failed to delete file`, err);\n throw err;\n }\n }\n }\n },\n });\n};\n"],"names":["createTemplateAction","examples","InputError","resolveSafeChildPath","globby","fs"],"mappings":";;;;;;;;;;;;;;AA2BO,MAAM,+BAA+B,MAAM;AAChD,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,WAAA;AAAA,IACJ,WAAA,EAAa,kDAAA;AAAA,cACbC,wBAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,OAAO,CAAA,CAAA,KACL,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,QAAO,EAAG;AAAA,UAClB,WAAA,EAAa;AAAA,SACd;AAAA;AACL,KACF;AAAA,IACA,cAAA,EAAgB,IAAA;AAAA,IAChB,MAAM,QAAQ,GAAA,EAAK;AACjB,MAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,KAAA,EAAO,KAAK,CAAA,EAAG;AACpC,QAAA,MAAM,IAAIC,kBAAW,wBAAwB,CAAA;AAAA,MAC/C;AAEA,MAAA,KAAA,MAAW,IAAA,IAAQ,GAAA,CAAI,KAAA,CAAM,KAAA,EAAO;AAElC,QAAA,MAAM,YAAA,GAAeC,qCAAA;AAAA,UACnB,GAAA,CAAI,aAAA;AAAA,UACJ;AAAA,SACF,CAAE,OAAA,CAAQ,KAAA,EAAO,GAAG,CAAA;AACpB,QAAA,MAAM,aAAA,GAAgB,MAAMC,uBAAA,CAAO,YAAA,EAAc;AAAA,UAC/C,KAAK,GAAA,CAAI,aAAA;AAAA,UACT,QAAA,EAAU,IAAA;AAAA,UACV,GAAA,EAAK;AAAA,SACN,CAAA;AAED,QAAA,KAAA,MAAW,YAAY,aAAA,EAAe;AACpC,UAAA,IAAI;AACF,YAAA,MAAM,QAAA,GAAWD,qCAAA,CAAqB,GAAA,CAAI,aAAA,EAAe,QAAQ,CAAA;AACjE,YAAA,MAAME,mBAAA,CAAG,OAAO,QAAQ,CAAA;AACxB,YAAA,GAAA,CAAI,MAAA,CAAO,IAAA,CAAK,CAAA,KAAA,EAAQ,QAAQ,CAAA,qBAAA,CAAuB,CAAA;AAAA,UACzD,SAAS,GAAA,EAAK;AACZ,YAAA,GAAA,CAAI,MAAA,CAAO,KAAA,CAAM,CAAA,qBAAA,CAAA,EAAyB,GAAG,CAAA;AAC7C,YAAA,MAAM,GAAA;AAAA,UACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
\ No newline at end of file
+{"version":3,"file":"delete.cjs.js","sources":["../../../../../src/scaffolder/actions/builtin/filesystem/delete.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\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-node';\nimport { InputError } from '@backstage/errors';\nimport {\n isChildPath,\n resolveSafeChildPath,\n} from '@backstage/backend-plugin-api';\nimport fs from 'fs-extra';\nimport globby from 'globby';\nimport { examples } from './delete.examples';\n\n/**\n * Creates new action that enables deletion of files and directories in the workspace.\n * @public\n */\nexport const createFilesystemDeleteAction = () => {\n return createTemplateAction({\n id: 'fs:delete',\n description: 'Deletes files and directories from the workspace',\n examples,\n schema: {\n input: {\n files: z =>\n z.array(z.string(), {\n description: 'A list of files and directories that will be deleted',\n }),\n },\n },\n supportsDryRun: true,\n async handler(ctx) {\n if (!Array.isArray(ctx.input?.files)) {\n throw new InputError('files must be an Array');\n }\n\n for (const file of ctx.input.files) {\n // globby cannot handle backslash file separators\n const safeFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n file,\n ).replace(/\\\\/g, '/');\n const resolvedPaths = await globby(safeFilepath, {\n cwd: ctx.workspacePath,\n absolute: true,\n dot: true,\n });\n\n for (const filepath of resolvedPaths) {\n try {\n const safePath = resolveSafeChildPath(ctx.workspacePath, filepath);\n await fs.remove(safePath);\n ctx.logger.info(`File ${safePath} deleted successfully`);\n } catch (err) {\n ctx.logger.error(`Failed to delete file`, err);\n throw err;\n }\n }\n }\n },\n });\n};\n"],"names":["createTemplateAction","examples","InputError","resolveSafeChildPath","globby","fs"],"mappings":";;;;;;;;;;;;;;AA8BO,MAAM,+BAA+B,MAAM;AAChD,EAAA,OAAOA,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,WAAA;AAAA,IACJ,WAAA,EAAa,kDAAA;AAAA,cACbC,wBAAA;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,OAAO,CAAA,CAAA,KACL,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,QAAO,EAAG;AAAA,UAClB,WAAA,EAAa;AAAA,SACd;AAAA;AACL,KACF;AAAA,IACA,cAAA,EAAgB,IAAA;AAAA,IAChB,MAAM,QAAQ,GAAA,EAAK;AACjB,MAAA,IAAI,CAAC,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,KAAA,EAAO,KAAK,CAAA,EAAG;AACpC,QAAA,MAAM,IAAIC,kBAAW,w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