@backstage-community/plugin-scaffolder-backend-module-regex 2.2.3 → 2.2.5
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 +12 -0
- package/dist/actions/regex/replace.cjs.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/module.cjs.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
### Dependencies
|
|
2
2
|
|
|
3
|
+
## 2.2.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0f5c451: Updated dependency `prettier` to `3.4.2`.
|
|
8
|
+
|
|
9
|
+
## 2.2.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- f7ffafe: Clean up api report warnings and remove unnecessary files
|
|
14
|
+
|
|
3
15
|
## 2.2.3
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace.cjs.js","sources":["../../../src/actions/regex/replace.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\n\nimport yaml from 'yaml';\nimport { z } from 'zod';\n\nconst schemaInput = z.object({\n regExps: z.array(\n z.object({\n pattern: z\n .string()\n .refine(\n // You should not parse a regex (regular language) with a regex (regular language),\n // you actually need a context free grammar to parse a regex (regular language).\n // Hence, we are using a string comparison here.\n value => !value.startsWith('/') && !value.endsWith('/'),\n {\n message:\n 'The RegExp constructor cannot take a string pattern with a leading and trailing forward slash.',\n },\n )\n .describe(\n 'The regex pattern to match the value like in String.prototype.replace()',\n ),\n flags: z\n .array(\n // Prefer array over set here because input values are normally defined in YAML which doesn't support Sets.\n z.enum(['g', 'm', 'i', 'y', 'u', 's', 'd'], {\n invalid_type_error:\n 'Invalid flag, possible values are: g, m, i, y, u, s, d',\n }),\n )\n .optional()\n .describe('The flags for the regex'),\n replacement: z\n .string()\n .describe(\n 'The replacement value for the regex like in String.prototype.replace()',\n ),\n values: z.array(\n z.object({\n key: z.string().describe('The key to access the regex value'),\n value: z.string().describe('The input value of the regex'),\n }),\n ),\n }),\n ),\n});\n\nconst exampleValue =\n 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';\n\nconst id = 'regex:replace';\n\nconst examples = [\n {\n description: 'Create a regex to capture the first word of a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: '^(\\\\S+).*$',\n replacement: '$1',\n values: [\n { key: 'eg1', value: 'Hello world!' },\n { key: 'eg2', value: 'Test world!' },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a regex to replace a word in a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: 'dog',\n replacement: 'monkey',\n values: [\n {\n key: 'eg1',\n value: exampleValue,\n },\n ],\n },\n {\n pattern: 'Dog',\n replacement: 'ferret',\n flags: ['i'],\n values: [\n {\n key: 'eg2',\n value: exampleValue,\n },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a regex to replace a word globally in a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: 'dog',\n replacement: 'monkey',\n flags: ['g'],\n values: [\n {\n key: 'eg1',\n value: exampleValue,\n },\n ],\n },\n {\n pattern: 'Dog',\n replacement: 'ferret',\n flags: ['gi'],\n values: [\n {\n key: 'eg2',\n value: exampleValue,\n },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n];\n\nexport const createReplaceAction = () => {\n return createTemplateAction({\n id,\n description:\n 'Replaces strings that match a regular expression pattern with a specified replacement string',\n examples,\n schema: {\n input: schemaInput,\n },\n\n async handler(ctx) {\n const input = ctx.input;\n\n const values: Record<string, string> = {};\n\n for (const {\n pattern,\n flags: flagsInput,\n replacement,\n values: valuesInput,\n } of input.regExps) {\n // remove duplicates from the flags input array\n const flags = flagsInput\n ? Array.from(new Set(flagsInput)).join('')\n : '';\n const regex = new RegExp(pattern, flags);\n\n for (const { key, value } of valuesInput) {\n const match = value.replace(regex, replacement);\n\n if (values.hasOwnProperty(key)) {\n throw new Error(\n `The key '${key}' is used more than once in the input.`,\n );\n }\n\n values[key] = match;\n }\n }\n\n ctx.output('values', values);\n },\n });\n};\n"],"names":["z","yaml","createTemplateAction"],"mappings":";;;;;;;;;;AAoBA,MAAM,WAAA,GAAcA,MAAE,MAAO,CAAA;AAAA,EAC3B,SAASA,KAAE,CAAA,KAAA;AAAA,IACTA,MAAE,MAAO,CAAA;AAAA,MACP,OAAA,EAASA,KACN,CAAA,MAAA,EACA,CAAA,MAAA;AAAA;AAAA;AAAA;AAAA,QAIC,CAAA,KAAA,KAAS,CAAC,KAAM,CAAA,UAAA,CAAW,GAAG,CAAK,IAAA,CAAC,KAAM,CAAA,QAAA,CAAS,GAAG,CAAA;AAAA,QACtD;AAAA,UACE,OACE,EAAA;AAAA;AACJ,OAED,CAAA,QAAA;AAAA,QACC;AAAA,OACF;AAAA,MACF,OAAOA,KACJ,CAAA,KAAA;AAAA;AAAA,QAECA,KAAA,CAAE,IAAK,CAAA,CAAC,GAAK,EAAA,GAAA,EAAK,KAAK,GAAK,EAAA,GAAA,EAAK,GAAK,EAAA,GAAG,CAAG,EAAA;AAAA,UAC1C,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;AAAA;AAEL,CAAA;
|
|
1
|
+
{"version":3,"file":"replace.cjs.js","sources":["../../../src/actions/regex/replace.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\n\nimport yaml from 'yaml';\nimport { z } from 'zod';\n\nconst schemaInput = z.object({\n regExps: z.array(\n z.object({\n pattern: z\n .string()\n .refine(\n // You should not parse a regex (regular language) with a regex (regular language),\n // you actually need a context free grammar to parse a regex (regular language).\n // Hence, we are using a string comparison here.\n value => !value.startsWith('/') && !value.endsWith('/'),\n {\n message:\n 'The RegExp constructor cannot take a string pattern with a leading and trailing forward slash.',\n },\n )\n .describe(\n 'The regex pattern to match the value like in String.prototype.replace()',\n ),\n flags: z\n .array(\n // Prefer array over set here because input values are normally defined in YAML which doesn't support Sets.\n z.enum(['g', 'm', 'i', 'y', 'u', 's', 'd'], {\n invalid_type_error:\n 'Invalid flag, possible values are: g, m, i, y, u, s, d',\n }),\n )\n .optional()\n .describe('The flags for the regex'),\n replacement: z\n .string()\n .describe(\n 'The replacement value for the regex like in String.prototype.replace()',\n ),\n values: z.array(\n z.object({\n key: z.string().describe('The key to access the regex value'),\n value: z.string().describe('The input value of the regex'),\n }),\n ),\n }),\n ),\n});\n\nconst exampleValue =\n 'The quick brown fox jumps over the lazy dog. If the dog reacted, was it really lazy?';\n\nconst id = 'regex:replace';\n\nconst examples = [\n {\n description: 'Create a regex to capture the first word of a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: '^(\\\\S+).*$',\n replacement: '$1',\n values: [\n { key: 'eg1', value: 'Hello world!' },\n { key: 'eg2', value: 'Test world!' },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a regex to replace a word in a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: 'dog',\n replacement: 'monkey',\n values: [\n {\n key: 'eg1',\n value: exampleValue,\n },\n ],\n },\n {\n pattern: 'Dog',\n replacement: 'ferret',\n flags: ['i'],\n values: [\n {\n key: 'eg2',\n value: exampleValue,\n },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n {\n description: 'Create a regex to replace a word globally in a string',\n example: yaml.stringify({\n steps: [\n {\n id: 'regexValues',\n action: id,\n name: 'Regex Values',\n input: {\n regExps: [\n {\n pattern: 'dog',\n replacement: 'monkey',\n flags: ['g'],\n values: [\n {\n key: 'eg1',\n value: exampleValue,\n },\n ],\n },\n {\n pattern: 'Dog',\n replacement: 'ferret',\n flags: ['gi'],\n values: [\n {\n key: 'eg2',\n value: exampleValue,\n },\n ],\n },\n ],\n },\n },\n ],\n }),\n },\n];\n\n/**\n * @public\n */\nexport const createReplaceAction = () => {\n return createTemplateAction({\n id,\n description:\n 'Replaces strings that match a regular expression pattern with a specified replacement string',\n examples,\n schema: {\n input: schemaInput,\n },\n\n async handler(ctx) {\n const input = ctx.input;\n\n const values: Record<string, string> = {};\n\n for (const {\n pattern,\n flags: flagsInput,\n replacement,\n values: valuesInput,\n } of input.regExps) {\n // remove duplicates from the flags input array\n const flags = flagsInput\n ? Array.from(new Set(flagsInput)).join('')\n : '';\n const regex = new RegExp(pattern, flags);\n\n for (const { key, value } of valuesInput) {\n const match = value.replace(regex, replacement);\n\n if (values.hasOwnProperty(key)) {\n throw new Error(\n `The key '${key}' is used more than once in the input.`,\n );\n }\n\n values[key] = match;\n }\n }\n\n ctx.output('values', values);\n },\n });\n};\n"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AAM,KAAQ,GAAA,IAAI,MAAO,CAAA,OAAA,EAAS,KAAK,CAAA;AAEvC,QAAA,KAAA,MAAW,EAAE,GAAA,EAAK,KAAM,EAAA,IAAK,WAAa,EAAA;AACxC,UAAA,MAAM,KAAQ,GAAA,KAAA,CAAM,OAAQ,CAAA,KAAA,EAAO,WAAW,CAAA;AAE9C,UAAI,IAAA,MAAA,CAAO,cAAe,CAAA,GAAG,CAAG,EAAA;AAC9B,YAAA,MAAM,IAAI,KAAA;AAAA,cACR,YAAY,GAAG,CAAA,sCAAA;AAAA,aACjB;AAAA;AAGF,UAAA,MAAA,CAAO,GAAG,CAAI,GAAA,KAAA;AAAA;AAChB;AAGF,MAAI,GAAA,CAAA,MAAA,CAAO,UAAU,MAAM,CAAA;AAAA;AAC7B,GACD,CAAA;AACH;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder
|
|
|
2
2
|
import * as _backstage_types from '@backstage/types';
|
|
3
3
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
5
8
|
declare const createReplaceAction: () => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
6
9
|
regExps: {
|
|
7
10
|
values: {
|
|
@@ -14,6 +17,9 @@ declare const createReplaceAction: () => _backstage_plugin_scaffolder_node.Templ
|
|
|
14
17
|
}[];
|
|
15
18
|
}, _backstage_types.JsonObject>;
|
|
16
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
17
23
|
declare const scaffolderModuleRegexActions: _backstage_backend_plugin_api.BackendFeature;
|
|
18
24
|
|
|
19
25
|
export { createReplaceAction, scaffolderModuleRegexActions as default };
|
package/dist/module.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\n\nimport { createReplaceAction } from './actions';\n\nexport const scaffolderModuleRegexActions = createBackendModule({\n moduleId: 'scaffolder-backend-regexp',\n pluginId: 'scaffolder',\n register(env) {\n env.registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n },\n async init({ scaffolder }) {\n scaffolder.addActions(createReplaceAction());\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","createReplaceAction"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { createBackendModule } from '@backstage/backend-plugin-api';\nimport { scaffolderActionsExtensionPoint } from '@backstage/plugin-scaffolder-node/alpha';\n\nimport { createReplaceAction } from './actions';\n\n/**\n * @public\n */\nexport const scaffolderModuleRegexActions = createBackendModule({\n moduleId: 'scaffolder-backend-regexp',\n pluginId: 'scaffolder',\n register(env) {\n env.registerInit({\n deps: {\n scaffolder: scaffolderActionsExtensionPoint,\n },\n async init({ scaffolder }) {\n scaffolder.addActions(createReplaceAction());\n },\n });\n },\n});\n"],"names":["createBackendModule","scaffolderActionsExtensionPoint","createReplaceAction"],"mappings":";;;;;;AAuBO,MAAM,+BAA+BA,oCAAoB,CAAA;AAAA,EAC9D,QAAU,EAAA,2BAAA;AAAA,EACV,QAAU,EAAA,YAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,UAAY,EAAAC;AAAA,OACd;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,UAAA,EAAc,EAAA;AACzB,QAAW,UAAA,CAAA,UAAA,CAAWC,6BAAqB,CAAA;AAAA;AAC7C,KACD,CAAA;AAAA;AAEL,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-scaffolder-backend-module-regex",
|
|
3
3
|
"description": "The regex custom actions",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.5",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@backstage/cli": "0.28.2",
|
|
47
47
|
"@backstage/plugin-scaffolder-node-test-utils": "0.1.14",
|
|
48
48
|
"@spotify/prettier-config": "^15.0.0",
|
|
49
|
-
"prettier": "3.
|
|
49
|
+
"prettier": "3.4.2"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"dist",
|