@backstage/plugin-scaffolder-react 1.19.8-next.1 → 1.20.0-next.2
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 +18 -0
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js +3 -0
- package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
- package/dist/next/hooks/useDownloadLogs.esm.js +23 -0
- package/dist/next/hooks/useDownloadLogs.esm.js.map +1 -0
- package/package.json +14 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-react
|
|
2
2
|
|
|
3
|
+
## 1.20.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 470f72d: The `LogViewer` component from `@backstage/core-components` now supports downloading logs if a callback is passed to `onDownloadLogs`
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- bd31ddd: Updated dependency `flatted` to `3.3.4`.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/frontend-test-utils@0.5.1-next.2
|
|
14
|
+
- @backstage/frontend-plugin-api@0.15.0-next.1
|
|
15
|
+
- @backstage/core-plugin-api@1.12.4-next.1
|
|
16
|
+
- @backstage/catalog-client@1.14.0-next.2
|
|
17
|
+
- @backstage/plugin-catalog-react@2.1.0-next.2
|
|
18
|
+
- @backstage/core-components@0.18.8-next.1
|
|
19
|
+
- @backstage/plugin-scaffolder-common@2.0.0-next.2
|
|
20
|
+
|
|
3
21
|
## 1.19.8-next.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { LogViewer } from '@backstage/core-components';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
|
+
import { useDownloadLogs } from '../../hooks/useDownloadLogs.esm.js';
|
|
4
5
|
|
|
5
6
|
const useStyles = makeStyles({
|
|
6
7
|
root: {
|
|
@@ -12,9 +13,11 @@ const useStyles = makeStyles({
|
|
|
12
13
|
});
|
|
13
14
|
const TaskLogStream = (props) => {
|
|
14
15
|
const styles = useStyles();
|
|
16
|
+
const onDownloadLogs = useDownloadLogs(props.logs);
|
|
15
17
|
return /* @__PURE__ */ jsx("div", { className: styles.root, children: /* @__PURE__ */ jsx(
|
|
16
18
|
LogViewer,
|
|
17
19
|
{
|
|
20
|
+
onDownloadLog: onDownloadLogs,
|
|
18
21
|
text: Object.values(props.logs).map((l) => l.join("\n")).filter(Boolean).join("\n")
|
|
19
22
|
}
|
|
20
23
|
) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskLogStream.esm.js","sources":["../../../../src/next/components/TaskLogStream/TaskLogStream.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { LogViewer } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n position: 'relative',\n minHeight: 240,\n },\n});\n\n/**\n * The text of the event stream\n *\n * @alpha\n */\nexport const TaskLogStream = (props: { logs: { [k: string]: string[] } }) => {\n const styles = useStyles();\n return (\n <div className={styles.root}>\n <LogViewer\n text={Object.values(props.logs)\n .map(l => l.join('\\n'))\n .filter(Boolean)\n .join('\\n')}\n />\n </div>\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TaskLogStream.esm.js","sources":["../../../../src/next/components/TaskLogStream/TaskLogStream.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 { LogViewer } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { useDownloadLogs } from '../../hooks/useDownloadLogs';\n\nconst useStyles = makeStyles({\n root: {\n width: '100%',\n height: '100%',\n position: 'relative',\n minHeight: 240,\n },\n});\n\n/**\n * The text of the event stream\n *\n * @alpha\n */\nexport const TaskLogStream = (props: { logs: { [k: string]: string[] } }) => {\n const styles = useStyles();\n\n const onDownloadLogs = useDownloadLogs(props.logs);\n\n return (\n <div className={styles.root}>\n <LogViewer\n onDownloadLog={onDownloadLogs}\n text={Object.values(props.logs)\n .map(l => l.join('\\n'))\n .filter(Boolean)\n .join('\\n')}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAmBA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ,MAAA;AAAA,IACR,QAAA,EAAU,UAAA;AAAA,IACV,SAAA,EAAW;AAAA;AAEf,CAAC,CAAA;AAOM,MAAM,aAAA,GAAgB,CAAC,KAAA,KAA+C;AAC3E,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,MAAM,cAAA,GAAiB,eAAA,CAAgB,KAAA,CAAM,IAAI,CAAA;AAEjD,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,MAAA,CAAO,IAAA,EACrB,QAAA,kBAAA,GAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,aAAA,EAAe,cAAA;AAAA,MACf,MAAM,MAAA,CAAO,MAAA,CAAO,KAAA,CAAM,IAAI,EAC3B,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA,CACrB,OAAO,OAAO,CAAA,CACd,KAAK,IAAI;AAAA;AAAA,GACd,EACF,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { useParams } from 'react-router';
|
|
3
|
+
|
|
4
|
+
const useDownloadLogs = (logs) => {
|
|
5
|
+
const { taskId } = useParams();
|
|
6
|
+
return useCallback(() => {
|
|
7
|
+
const element = document.createElement("a");
|
|
8
|
+
const file = new Blob(
|
|
9
|
+
[
|
|
10
|
+
Object.values(logs).map((l) => l.join("\n")).filter(Boolean).join("\n")
|
|
11
|
+
],
|
|
12
|
+
{ type: "text/plain" }
|
|
13
|
+
);
|
|
14
|
+
element.href = URL.createObjectURL(file);
|
|
15
|
+
element.download = `${taskId}.log`;
|
|
16
|
+
element.click();
|
|
17
|
+
URL.revokeObjectURL(element.href);
|
|
18
|
+
element.remove();
|
|
19
|
+
}, [logs, taskId]);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { useDownloadLogs };
|
|
23
|
+
//# sourceMappingURL=useDownloadLogs.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDownloadLogs.esm.js","sources":["../../../src/next/hooks/useDownloadLogs.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { useCallback } from 'react';\nimport { useParams } from 'react-router';\n\nexport const useDownloadLogs = (logs: { [k: string]: string[] }) => {\n const { taskId } = useParams<{ taskId: string }>();\n return useCallback(() => {\n const element = document.createElement('a');\n const file = new Blob(\n [\n Object.values(logs)\n .map(l => l.join('\\n'))\n .filter(Boolean)\n .join('\\n'),\n ],\n { type: 'text/plain' },\n );\n element.href = URL.createObjectURL(file);\n element.download = `${taskId}.log`;\n element.click();\n URL.revokeObjectURL(element.href);\n element.remove();\n }, [logs, taskId]);\n};\n"],"names":[],"mappings":";;;AAmBO,MAAM,eAAA,GAAkB,CAAC,IAAA,KAAoC;AAClE,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAA8B;AACjD,EAAA,OAAO,YAAY,MAAM;AACvB,IAAA,MAAM,OAAA,GAAU,QAAA,CAAS,aAAA,CAAc,GAAG,CAAA;AAC1C,IAAA,MAAM,OAAO,IAAI,IAAA;AAAA,MACf;AAAA,QACE,MAAA,CAAO,MAAA,CAAO,IAAI,CAAA,CACf,IAAI,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA,CACrB,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,IAAI;AAAA,OACd;AAAA,MACA,EAAE,MAAM,YAAA;AAAa,KACvB;AACA,IAAA,OAAA,CAAQ,IAAA,GAAO,GAAA,CAAI,eAAA,CAAgB,IAAI,CAAA;AACvC,IAAA,OAAA,CAAQ,QAAA,GAAW,GAAG,MAAM,CAAA,IAAA,CAAA;AAC5B,IAAA,OAAA,CAAQ,KAAA,EAAM;AACd,IAAA,GAAA,CAAI,eAAA,CAAgB,QAAQ,IAAI,CAAA;AAChC,IAAA,OAAA,CAAQ,MAAA,EAAO;AAAA,EACjB,CAAA,EAAG,CAAC,IAAA,EAAM,MAAM,CAAC,CAAA;AACnB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0-next.2",
|
|
4
4
|
"description": "A frontend library that helps other Backstage plugins interact with the Scaffolder",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "web-library",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"test": "backstage-cli package test"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@backstage/catalog-client": "1.14.0-next.
|
|
77
|
+
"@backstage/catalog-client": "1.14.0-next.2",
|
|
78
78
|
"@backstage/catalog-model": "1.7.6",
|
|
79
|
-
"@backstage/core-components": "0.18.8-next.
|
|
80
|
-
"@backstage/core-plugin-api": "1.12.4-next.
|
|
81
|
-
"@backstage/frontend-plugin-api": "0.
|
|
82
|
-
"@backstage/plugin-catalog-react": "2.1.0-next.
|
|
79
|
+
"@backstage/core-components": "0.18.8-next.1",
|
|
80
|
+
"@backstage/core-plugin-api": "1.12.4-next.1",
|
|
81
|
+
"@backstage/frontend-plugin-api": "0.15.0-next.1",
|
|
82
|
+
"@backstage/plugin-catalog-react": "2.1.0-next.2",
|
|
83
83
|
"@backstage/plugin-permission-react": "0.4.41-next.0",
|
|
84
|
-
"@backstage/plugin-scaffolder-common": "2.0.0-next.
|
|
84
|
+
"@backstage/plugin-scaffolder-common": "2.0.0-next.2",
|
|
85
85
|
"@backstage/theme": "0.7.2",
|
|
86
86
|
"@backstage/types": "1.2.2",
|
|
87
87
|
"@backstage/version-bridge": "1.0.12",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"ajv": "^8.0.1",
|
|
98
98
|
"ajv-errors": "^3.0.0",
|
|
99
99
|
"classnames": "^2.2.6",
|
|
100
|
-
"flatted": "3.3.
|
|
100
|
+
"flatted": "^3.3.4",
|
|
101
101
|
"humanize-duration": "^3.25.1",
|
|
102
102
|
"immer": "^9.0.6",
|
|
103
103
|
"json-schema": "^0.4.0",
|
|
@@ -112,10 +112,10 @@
|
|
|
112
112
|
"zod-to-json-schema": "^3.25.1"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@backstage/cli": "0.36.0-next.
|
|
116
|
-
"@backstage/core-app-api": "1.19.6-next.
|
|
117
|
-
"@backstage/frontend-test-utils": "0.5.1-next.
|
|
118
|
-
"@backstage/plugin-catalog": "
|
|
115
|
+
"@backstage/cli": "0.36.0-next.2",
|
|
116
|
+
"@backstage/core-app-api": "1.19.6-next.1",
|
|
117
|
+
"@backstage/frontend-test-utils": "0.5.1-next.2",
|
|
118
|
+
"@backstage/plugin-catalog": "2.0.0-next.2",
|
|
119
119
|
"@backstage/plugin-catalog-common": "1.1.8",
|
|
120
120
|
"@backstage/plugin-permission-common": "0.9.6",
|
|
121
121
|
"@backstage/test-utils": "1.7.16-next.0",
|
|
@@ -131,10 +131,11 @@
|
|
|
131
131
|
"swr": "^2.0.0"
|
|
132
132
|
},
|
|
133
133
|
"peerDependencies": {
|
|
134
|
-
"@backstage/frontend-test-utils": "0.5.1-next.
|
|
134
|
+
"@backstage/frontend-test-utils": "0.5.1-next.2",
|
|
135
135
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
136
136
|
"react": "^17.0.0 || ^18.0.0",
|
|
137
137
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
138
|
+
"react-router": "^6.30.3",
|
|
138
139
|
"react-router-dom": "^6.30.2"
|
|
139
140
|
},
|
|
140
141
|
"peerDependenciesMeta": {
|