@backstage/plugin-scaffolder-node 0.8.2-next.3 → 0.8.3-next.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/CHANGELOG.md +23 -0
- package/dist/actions/util.cjs.js +4 -0
- package/dist/actions/util.cjs.js.map +1 -1
- package/dist/index.cjs.js +1 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,28 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-node
|
|
2
2
|
|
|
3
|
+
## 0.8.3-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c8ff0c: Update pull request creation filter to include .gitignore files in the created pull request
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-plugin-api@1.4.0-next.0
|
|
10
|
+
|
|
11
|
+
## 0.8.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 16e2e9c: trim leading and trailing slashes from parseRepoUrl query parameters
|
|
16
|
+
- 72d019d: Removed various typos
|
|
17
|
+
- ec42f8e: Generating new tokens on each Scaffolder Task Retry
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/integration@1.17.0
|
|
20
|
+
- @backstage/catalog-model@1.7.4
|
|
21
|
+
- @backstage/backend-plugin-api@1.3.1
|
|
22
|
+
- @backstage/errors@1.2.7
|
|
23
|
+
- @backstage/types@1.2.1
|
|
24
|
+
- @backstage/plugin-scaffolder-common@1.5.11
|
|
25
|
+
|
|
3
26
|
## 0.8.2-next.3
|
|
4
27
|
|
|
5
28
|
### Patch Changes
|
package/dist/actions/util.cjs.js
CHANGED
|
@@ -127,8 +127,12 @@ const parseSchemas = (action) => {
|
|
|
127
127
|
outputSchema: action.schema.output
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
+
function isNotGitDirectoryOrContents(path) {
|
|
131
|
+
return !(path.endsWith(".git") || path.includes(".git/"));
|
|
132
|
+
}
|
|
130
133
|
|
|
131
134
|
exports.getRepoSourceDirectory = getRepoSourceDirectory;
|
|
135
|
+
exports.isNotGitDirectoryOrContents = isNotGitDirectoryOrContents;
|
|
132
136
|
exports.parseRepoUrl = parseRepoUrl;
|
|
133
137
|
exports.parseSchemas = parseSchemas;
|
|
134
138
|
//# sourceMappingURL=util.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.cjs.js","sources":["../../src/actions/util.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 { InputError } from '@backstage/errors';\nimport { isChildPath } from '@backstage/backend-plugin-api';\nimport { join as joinPath, normalize as normalizePath } from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { TemplateActionOptions } from './createTemplateAction';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { z } from 'zod';\nimport { Schema } from 'jsonschema';\nimport { trim } from 'lodash';\n\n/**\n * @public\n */\nexport const getRepoSourceDirectory = (\n workspacePath: string,\n sourcePath: string | undefined,\n) => {\n if (sourcePath) {\n const safeSuffix = normalizePath(sourcePath).replace(\n /^(\\.\\.(\\/|\\\\|$))+/,\n '',\n );\n const path = joinPath(workspacePath, safeSuffix);\n if (!isChildPath(workspacePath, path)) {\n throw new Error('Invalid source path');\n }\n return path;\n }\n return workspacePath;\n};\n\n/**\n * @public\n */\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): {\n repo: string;\n host: string;\n owner?: string;\n organization?: string;\n workspace?: string;\n project?: string;\n} => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n const { owner, organization, workspace, project, repo } = Object.fromEntries(\n ['owner', 'organization', 'workspace', 'project', 'repo'].map(param => [\n param,\n parsed.searchParams.has(param)\n ? trim(parsed.searchParams.get(param)!, '/')\n : undefined,\n ]),\n );\n switch (type) {\n case 'bitbucket': {\n if (host === 'www.bitbucket.org') {\n checkRequiredParams(parsed, 'workspace');\n }\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'azure': {\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'gitlab': {\n // project is the projectID, and if defined, owner and repo won't be needed.\n if (!project) {\n checkRequiredParams(parsed, 'owner', 'repo');\n }\n break;\n }\n case 'gitea': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n case 'gerrit': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n default: {\n checkRequiredParams(parsed, 'repo', 'owner');\n break;\n }\n }\n return { host, owner, repo: repo!, organization, workspace, project };\n};\n\nfunction checkRequiredParams(repoUrl: URL, ...params: string[]) {\n for (let i = 0; i < params.length; i++) {\n if (!repoUrl.searchParams.get(params[i])) {\n throw new InputError(\n `Invalid repo URL passed to publisher: ${repoUrl.toString()}, missing ${\n params[i]\n }`,\n );\n }\n }\n}\n\nconst isZodSchema = (schema: unknown): schema is z.ZodType => {\n return typeof schema === 'object' && !!schema && 'safeParseAsync' in schema;\n};\n\nconst isNativeZodSchema = (\n schema: unknown,\n): schema is { [key in string]: (zImpl: typeof z) => z.ZodType } => {\n return (\n typeof schema === 'object' &&\n !!schema &&\n Object.values(schema).every(v => typeof v === 'function')\n );\n};\n\nexport const parseSchemas = (\n action: TemplateActionOptions,\n): { inputSchema?: Schema; outputSchema?: Schema } => {\n if (!action.schema) {\n return { inputSchema: undefined, outputSchema: undefined };\n }\n\n if (isZodSchema(action.schema.input)) {\n return {\n inputSchema: zodToJsonSchema(action.schema.input) as Schema,\n outputSchema: isZodSchema(action.schema.output)\n ? (zodToJsonSchema(action.schema.output) as Schema)\n : undefined,\n };\n }\n\n if (isNativeZodSchema(action.schema.input)) {\n const input = z.object(\n Object.fromEntries(\n Object.entries(action.schema.input).map(([k, v]) => [k, v(z)]),\n ),\n );\n\n return {\n inputSchema: zodToJsonSchema(input) as Schema,\n outputSchema: isNativeZodSchema(action.schema.output)\n ? (zodToJsonSchema(\n z.object(\n Object.fromEntries(\n Object.entries(action.schema.output).map(([k, v]) => [k, v(z)]),\n ),\n ),\n ) as Schema)\n : undefined,\n };\n }\n\n return {\n inputSchema: action.schema.input,\n outputSchema: action.schema.output,\n };\n};\n"],"names":["normalizePath","path","joinPath","isChildPath","InputError","trim","zodToJsonSchema","z"],"mappings":";;;;;;;;;;;;;AA6Ba,MAAA,sBAAA,GAAyB,CACpC,aAAA,EACA,UACG,KAAA;AACH,EAAA,IAAI,UAAY,EAAA;AACd,IAAM,MAAA,UAAA,GAAaA,cAAc,CAAA,UAAU,CAAE,CAAA,OAAA;AAAA,MAC3C,mBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAM,MAAAC,MAAA,GAAOC,SAAS,CAAA,aAAA,EAAe,UAAU,CAAA;AAC/C,IAAA,IAAI,CAACC,4BAAA,CAAY,aAAe,EAAAF,MAAI,CAAG,EAAA;AACrC,MAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAEvC,IAAO,OAAAA,MAAA;AAAA;AAET,EAAO,OAAA,aAAA;AACT;AAKa,MAAA,YAAA,GAAe,CAC1B,OAAA,EACA,YAQG,KAAA;AACH,EAAI,IAAA,MAAA;AACJ,EAAI,IAAA;AACF,IAAA,MAAA,GAAS,IAAI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,EAAO,OAAA;AAAA,IACL,WAAA,EAAa,OAAO,MAAO,CAAA,KAAA;AAAA,IAC3B,YAAA,EAAc,OAAO,MAAO,CAAA;AAAA,GAC9B;AACF
|
|
1
|
+
{"version":3,"file":"util.cjs.js","sources":["../../src/actions/util.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 { InputError } from '@backstage/errors';\nimport { isChildPath } from '@backstage/backend-plugin-api';\nimport { join as joinPath, normalize as normalizePath } from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { TemplateActionOptions } from './createTemplateAction';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { z } from 'zod';\nimport { Schema } from 'jsonschema';\nimport { trim } from 'lodash';\n\n/**\n * @public\n */\nexport const getRepoSourceDirectory = (\n workspacePath: string,\n sourcePath: string | undefined,\n) => {\n if (sourcePath) {\n const safeSuffix = normalizePath(sourcePath).replace(\n /^(\\.\\.(\\/|\\\\|$))+/,\n '',\n );\n const path = joinPath(workspacePath, safeSuffix);\n if (!isChildPath(workspacePath, path)) {\n throw new Error('Invalid source path');\n }\n return path;\n }\n return workspacePath;\n};\n\n/**\n * @public\n */\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): {\n repo: string;\n host: string;\n owner?: string;\n organization?: string;\n workspace?: string;\n project?: string;\n} => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n const { owner, organization, workspace, project, repo } = Object.fromEntries(\n ['owner', 'organization', 'workspace', 'project', 'repo'].map(param => [\n param,\n parsed.searchParams.has(param)\n ? trim(parsed.searchParams.get(param)!, '/')\n : undefined,\n ]),\n );\n switch (type) {\n case 'bitbucket': {\n if (host === 'www.bitbucket.org') {\n checkRequiredParams(parsed, 'workspace');\n }\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'azure': {\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'gitlab': {\n // project is the projectID, and if defined, owner and repo won't be needed.\n if (!project) {\n checkRequiredParams(parsed, 'owner', 'repo');\n }\n break;\n }\n case 'gitea': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n case 'gerrit': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n default: {\n checkRequiredParams(parsed, 'repo', 'owner');\n break;\n }\n }\n return { host, owner, repo: repo!, organization, workspace, project };\n};\n\nfunction checkRequiredParams(repoUrl: URL, ...params: string[]) {\n for (let i = 0; i < params.length; i++) {\n if (!repoUrl.searchParams.get(params[i])) {\n throw new InputError(\n `Invalid repo URL passed to publisher: ${repoUrl.toString()}, missing ${\n params[i]\n }`,\n );\n }\n }\n}\n\nconst isZodSchema = (schema: unknown): schema is z.ZodType => {\n return typeof schema === 'object' && !!schema && 'safeParseAsync' in schema;\n};\n\nconst isNativeZodSchema = (\n schema: unknown,\n): schema is { [key in string]: (zImpl: typeof z) => z.ZodType } => {\n return (\n typeof schema === 'object' &&\n !!schema &&\n Object.values(schema).every(v => typeof v === 'function')\n );\n};\n\nexport const parseSchemas = (\n action: TemplateActionOptions,\n): { inputSchema?: Schema; outputSchema?: Schema } => {\n if (!action.schema) {\n return { inputSchema: undefined, outputSchema: undefined };\n }\n\n if (isZodSchema(action.schema.input)) {\n return {\n inputSchema: zodToJsonSchema(action.schema.input) as Schema,\n outputSchema: isZodSchema(action.schema.output)\n ? (zodToJsonSchema(action.schema.output) as Schema)\n : undefined,\n };\n }\n\n if (isNativeZodSchema(action.schema.input)) {\n const input = z.object(\n Object.fromEntries(\n Object.entries(action.schema.input).map(([k, v]) => [k, v(z)]),\n ),\n );\n\n return {\n inputSchema: zodToJsonSchema(input) as Schema,\n outputSchema: isNativeZodSchema(action.schema.output)\n ? (zodToJsonSchema(\n z.object(\n Object.fromEntries(\n Object.entries(action.schema.output).map(([k, v]) => [k, v(z)]),\n ),\n ),\n ) as Schema)\n : undefined,\n };\n }\n\n return {\n inputSchema: action.schema.input,\n outputSchema: action.schema.output,\n };\n};\n\n/**\n * Filter function to exclude the .git directory and its contents\n * while keeping other files like .gitignore\n * @public\n */\nexport function isNotGitDirectoryOrContents(path: string): boolean {\n return !(path.endsWith('.git') || path.includes('.git/'));\n}\n"],"names":["normalizePath","path","joinPath","isChildPath","InputError","trim","zodToJsonSchema","z"],"mappings":";;;;;;;;;;;;;AA6Ba,MAAA,sBAAA,GAAyB,CACpC,aAAA,EACA,UACG,KAAA;AACH,EAAA,IAAI,UAAY,EAAA;AACd,IAAM,MAAA,UAAA,GAAaA,cAAc,CAAA,UAAU,CAAE,CAAA,OAAA;AAAA,MAC3C,mBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAM,MAAAC,MAAA,GAAOC,SAAS,CAAA,aAAA,EAAe,UAAU,CAAA;AAC/C,IAAA,IAAI,CAACC,4BAAA,CAAY,aAAe,EAAAF,MAAI,CAAG,EAAA;AACrC,MAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAEvC,IAAO,OAAAA,MAAA;AAAA;AAET,EAAO,OAAA,aAAA;AACT;AAKa,MAAA,YAAA,GAAe,CAC1B,OAAA,EACA,YAQG,KAAA;AACH,EAAI,IAAA,MAAA;AACJ,EAAI,IAAA;AACF,IAAA,MAAA,GAAS,IAAI,GAAA,CAAI,CAAW,QAAA,EAAA,OAAO,CAAE,CAAA,CAAA;A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AA;AAAA,IAC3B,YAAA,EAAc,OAAO,MAAO,CAAA;AAAA,GAC9B;AACF;AAOO,SAAS,4BAA4B,IAAuB,EAAA;AACjE,EAAA,OAAO,EAAE,IAAK,CAAA,QAAA,CAAS,MAAM,CAAK,IAAA,IAAA,CAAK,SAAS,OAAO,CAAA,CAAA;AACzD;;;;;;;"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -21,6 +21,7 @@ exports.commitAndPushRepo = gitHelpers.commitAndPushRepo;
|
|
|
21
21
|
exports.createBranch = gitHelpers.createBranch;
|
|
22
22
|
exports.initRepoAndPush = gitHelpers.initRepoAndPush;
|
|
23
23
|
exports.getRepoSourceDirectory = util.getRepoSourceDirectory;
|
|
24
|
+
exports.isNotGitDirectoryOrContents = util.isNotGitDirectoryOrContents;
|
|
24
25
|
exports.parseRepoUrl = util.parseRepoUrl;
|
|
25
26
|
exports.serializeDirectoryContents = serializeDirectoryContents.serializeDirectoryContents;
|
|
26
27
|
exports.deserializeDirectoryContents = deserializeDirectoryContents.deserializeDirectoryContents;
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -546,6 +546,12 @@ declare const parseRepoUrl: (repoUrl: string, integrations: ScmIntegrationRegist
|
|
|
546
546
|
workspace?: string;
|
|
547
547
|
project?: string;
|
|
548
548
|
};
|
|
549
|
+
/**
|
|
550
|
+
* Filter function to exclude the .git directory and its contents
|
|
551
|
+
* while keeping other files like .gitignore
|
|
552
|
+
* @public
|
|
553
|
+
*/
|
|
554
|
+
declare function isNotGitDirectoryOrContents(path: string): boolean;
|
|
549
555
|
|
|
550
556
|
/**
|
|
551
557
|
* @public
|
|
@@ -575,4 +581,4 @@ declare function serializeDirectoryContents(sourcePath: string, options?: {
|
|
|
575
581
|
*/
|
|
576
582
|
declare function deserializeDirectoryContents(targetPath: string, files: SerializedFile[]): Promise<void>;
|
|
577
583
|
|
|
578
|
-
export { type ActionContext, type ExecuteShellCommandOptions, type SerializedFile, type SerializedTask, type SerializedTaskEvent, type TaskBroker, type TaskBrokerDispatchOptions, type TaskBrokerDispatchResult, type TaskCompletionState, type TaskContext, type TaskEventType, type TaskSecrets, type TaskStatus, type TemplateAction, type TemplateActionOptions, type TemplateExample, addFiles, cloneRepo, commitAndPushBranch, commitAndPushRepo, createBranch, createTemplateAction, deserializeDirectoryContents, executeShellCommand, fetchContents, fetchFile, getRepoSourceDirectory, initRepoAndPush, parseRepoUrl, serializeDirectoryContents };
|
|
584
|
+
export { type ActionContext, type ExecuteShellCommandOptions, type SerializedFile, type SerializedTask, type SerializedTaskEvent, type TaskBroker, type TaskBrokerDispatchOptions, type TaskBrokerDispatchResult, type TaskCompletionState, type TaskContext, type TaskEventType, type TaskSecrets, type TaskStatus, type TemplateAction, type TemplateActionOptions, type TemplateExample, addFiles, cloneRepo, commitAndPushBranch, commitAndPushRepo, createBranch, createTemplateAction, deserializeDirectoryContents, executeShellCommand, fetchContents, fetchFile, getRepoSourceDirectory, initRepoAndPush, isNotGitDirectoryOrContents, parseRepoUrl, serializeDirectoryContents };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-node",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3-next.0",
|
|
4
4
|
"description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "node-library",
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
"test": "backstage-cli package test"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@backstage/backend-plugin-api": "1.
|
|
66
|
-
"@backstage/catalog-model": "1.7.
|
|
65
|
+
"@backstage/backend-plugin-api": "1.4.0-next.0",
|
|
66
|
+
"@backstage/catalog-model": "1.7.4",
|
|
67
67
|
"@backstage/errors": "1.2.7",
|
|
68
|
-
"@backstage/integration": "1.17.0
|
|
69
|
-
"@backstage/plugin-scaffolder-common": "1.5.11
|
|
68
|
+
"@backstage/integration": "1.17.0",
|
|
69
|
+
"@backstage/plugin-scaffolder-common": "1.5.11",
|
|
70
70
|
"@backstage/types": "1.2.1",
|
|
71
71
|
"@isomorphic-git/pgp-plugin": "^0.0.7",
|
|
72
72
|
"concat-stream": "^2.0.0",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"zod-to-json-schema": "^3.20.4"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@backstage/backend-test-utils": "1.
|
|
87
|
-
"@backstage/cli": "0.32.1
|
|
86
|
+
"@backstage/backend-test-utils": "1.6.0-next.0",
|
|
87
|
+
"@backstage/cli": "0.32.1",
|
|
88
88
|
"@backstage/config": "1.3.2",
|
|
89
89
|
"@types/lodash": "^4.14.151"
|
|
90
90
|
}
|