-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #591 from thoth-pub/feature/upgrade_rust_1_77_1
Feature/upgrade rust 1 77 1
- Loading branch information
Showing
43 changed files
with
630 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG MUSL_IMAGE=clux/muslrust:1.76.0 | ||
ARG MUSL_IMAGE=clux/muslrust:1.77.2-stable | ||
|
||
FROM ${MUSL_IMAGE} as build | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
ARG RUST_VERSION=1.76.0 | ||
ARG RUST_VERSION=1.77.2 | ||
|
||
FROM rust:${RUST_VERSION} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,40 +2,28 @@ | |
/// Generate the HTML source to show a GraphiQL interface | ||
pub fn graphiql_source(graphql_endpoint_url: &str) -> String { | ||
let default_query = r#"# Welcome to Thoth's GraphQL API explorer (GraphiQL). | ||
let version = env!("CARGO_PKG_VERSION"); | ||
let default_query = r##"# Welcome to Thoth's GraphQL API explorer (GraphiQL). | ||
# | ||
# GraphiQL is an in-browser tool for writing, validating, and | ||
# testing GraphQL queries. | ||
# | ||
# Type queries into this side of the screen, and you will see intelligent | ||
# typeaheads aware of the current GraphQL type schema and live syntax and | ||
# validation errors highlighted within the text. | ||
# Type queries into this side of the screen, and you will see | ||
# intelligent typeaheads aware of the current GraphQL type | ||
# schema and live syntax and validation errors highlighted | ||
# within the text. | ||
# | ||
# Click on the QueryRoot in the Documentation Explorer ( < Docs ) on the | ||
# right hand side of the screen to navigate the API schema. | ||
# Click on the QueryRoot in the Documentation Explorer | ||
# (first icon) on the top left of the screen to navigate | ||
# the API schema. | ||
# | ||
# GraphQL queries typically start with a "{" character. Lines that starts | ||
# with a # are ignored. | ||
# GraphQL queries typically start with a "{" character. | ||
# Lines that starts with a "#" are ignored. | ||
# | ||
# An example Thoth GraphQL query might look like: | ||
# | ||
# { | ||
# books(workStatuses: [ACTIVE]) { | ||
# fullTitle | ||
# doi | ||
# } | ||
# } | ||
# | ||
# Keyboard shortcuts: | ||
# Run the following example Thoth GraphQL query: | ||
# | ||
# Run Query: Ctrl-Enter (or press the play button above) | ||
# | ||
# Auto Complete: Ctrl-Space (or just start typing) | ||
# | ||
# | ||
# Run the following query (Ctrl-Enter): | ||
# | ||
{ | ||
books(order: {field: PUBLICATION_DATE, direction: ASC}) { | ||
fullTitle | ||
|
@@ -50,62 +38,142 @@ pub fn graphiql_source(graphql_endpoint_url: &str) -> String { | |
} | ||
} | ||
} | ||
"#; | ||
"##; | ||
|
||
format!( | ||
r#" | ||
r##" | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Thoth GraphQL API Documentation</title> | ||
<link rel="shortcut icon" href="https://thoth.pub/favicon.ico" /> | ||
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/npm/[email protected]/graphiql.min.css"> | ||
<style> | ||
html, body, #app {{ | ||
height: 100vh; | ||
margin: 0; | ||
overflow: hidden; | ||
}} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/fetch/2.0.3/fetch.js"></script> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/react/16.10.2/umd/react.production.min.js"></script> | ||
<script src="//cdnjs.cloudflare.com/ajax/libs/react-dom/16.10.2/umd/react-dom.production.min.js"></script> | ||
<script src="//cdn.jsdelivr.net/npm/[email protected]/graphiql.min.js"></script> | ||
<script>var GRAPHQL_URL = '{graphql_endpoint_url}';</script> | ||
<script> | ||
function graphQLFetcher(params) {{ | ||
return fetch(GRAPHQL_URL, {{ | ||
method: 'post', | ||
headers: {{ | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}}, | ||
credentials: 'include', | ||
body: JSON.stringify(params) | ||
}}).then(function (response) {{ | ||
return response.text(); | ||
}}).then(function (body) {{ | ||
try {{ | ||
return JSON.parse(body); | ||
}} catch (error) {{ | ||
return body; | ||
}} | ||
}}); | ||
}} | ||
ReactDOM.render( | ||
React.createElement(GraphiQL, {{ | ||
fetcher: graphQLFetcher, | ||
query: String.raw`{default_query}`, | ||
}}), | ||
document.querySelector('#app')); | ||
</script> | ||
</body> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<title>Thoth GraphQL API Documentation</title> | ||
<link rel="shortcut icon" href="https://cdn.thoth.pub/favicon.ico" /> | ||
<link rel="apple-touch-icon" sizes="57x57" href="https://cdn.thoth.pub/apple-icon-57x57.png"> | ||
<link rel="apple-touch-icon" sizes="60x60" href="https://cdn.thoth.pub/apple-icon-60x60.png"> | ||
<link rel="apple-touch-icon" sizes="72x72" href="https://cdn.thoth.pub/apple-icon-72x72.png"> | ||
<link rel="apple-touch-icon" sizes="76x76" href="https://cdn.thoth.pub/apple-icon-76x76.png"> | ||
<link rel="apple-touch-icon" sizes="114x114" href="https://cdn.thoth.pub/apple-icon-114x114.png"> | ||
<link rel="apple-touch-icon" sizes="120x120" href="https://cdn.thoth.pub/apple-icon-120x120.png"> | ||
<link rel="apple-touch-icon" sizes="144x144" href="https://cdn.thoth.pub/apple-icon-144x144.png"> | ||
<link rel="apple-touch-icon" sizes="152x152" href="https://cdn.thoth.pub/apple-icon-152x152.png"> | ||
<link rel="apple-touch-icon" sizes="180x180" href="https://cdn.thoth.pub/apple-icon-180x180.png"> | ||
<link rel="icon" type="image/png" sizes="192x192" href="https://cdn.thoth.pub/android-icon-192x192.png"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="https://cdn.thoth.pub/favicon-32x32.png"> | ||
<link rel="icon" type="image/png" sizes="96x96" href="https://cdn.thoth.pub/favicon-96x96.png"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="https://cdn.thoth.pub/favicon-16x16.png"> | ||
<link rel="manifest" href="https://cdn.thoth.pub/manifest.json"> | ||
<meta name="msapplication-TileColor" content="#FFDD57"> | ||
<meta name="msapplication-TileImage" content="https://cdn.thoth.pub/ms-icon-144x144.png"> | ||
<meta name="theme-color" content="#FFDD57"> | ||
<script crossorigin src="https://unpkg.com/react@18/umd/react.development.js"></script> | ||
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script> | ||
<script src="https://unpkg.com/[email protected]/graphiql.min.js" type="application/javascript"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]/graphiql.min.css" /> | ||
<script crossorigin src="https://unpkg.com/@graphiql/plugin-explorer@2/dist/index.umd.js"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/@graphiql/plugin-explorer@2/dist/style.css"/> | ||
<style> | ||
.graphiql-container, | ||
.CodeMirror-info, | ||
.CodeMirror-lint-tooltip, | ||
.graphiql-dialog, | ||
.graphiql-dialog-overlay, | ||
.graphiql-tooltip, | ||
[data-radix-popper-content-wrapper] {{ | ||
--color-primary: 298, 38%, 40%; | ||
--color-secondary: 154, 100%, 24%; | ||
--color-tertiary: 320, 95%, 43%; | ||
--color-info: 188, 100%, 36%; | ||
--color-warning: 24, 80%, 50%; | ||
--color-base: 46, 100%, 97%; | ||
}} | ||
@media (prefers-color-scheme: dark) {{ | ||
body:not(.graphiql-light) .graphiql-container, | ||
body:not(.graphiql-light) .CodeMirror-info, | ||
body:not(.graphiql-light) .CodeMirror-lint-tooltip, | ||
body:not(.graphiql-light) .graphiql-dialog, | ||
body:not(.graphiql-light) .graphiql-dialog-overlay, | ||
body:not(.graphiql-light) .graphiql-tooltip, | ||
body:not(.graphiql-light) [data-radix-popper-content-wrapper] {{ | ||
--color-primary: 298, 38%, 40%; | ||
--color-secondary: 154, 58%, 47%; | ||
--color-tertiary: 338, 100%, 67%; | ||
--color-info: 188, 100%, 36%; | ||
--color-warning: 24, 100%, 63%; | ||
--color-base: 221, 39%, 11%; | ||
}} | ||
}} | ||
body.graphiql-dark .graphiql-container, | ||
body.graphiql-dark .CodeMirror-info, | ||
body.graphiql-dark .CodeMirror-lint-tooltip, | ||
body.graphiql-dark .graphiql-dialog, | ||
body.graphiql-dark .graphiql-dialog-overlay, | ||
body.graphiql-dark .graphiql-tooltip, | ||
body.graphiql-dark [data-radix-popper-content-wrapper] {{ | ||
--color-primary: 298, 38%, 40%; | ||
--color-secondary: 154, 58%, 47%; | ||
--color-tertiary: 338, 100%, 67%; | ||
--color-info: 188, 100%, 36%; | ||
--color-warning: 24, 100%, 63%; | ||
--color-base: 221, 39%, 11%; | ||
}} | ||
body {{ | ||
height: 100%; | ||
margin: 0; | ||
width: 100%; | ||
overflow: hidden; | ||
}} | ||
#graphiql {{ | ||
height: 100vh; | ||
}} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="graphiql">Loading...</div> | ||
<script> | ||
const root = ReactDOM.createRoot(document.getElementById('graphiql')); | ||
const fetcher = GraphiQL.createFetcher({{ | ||
url: '{graphql_endpoint_url}', | ||
method: 'post', | ||
headers: {{ | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/json', | ||
}}, | ||
}}); | ||
const explorerPlugin = GraphiQLPluginExplorer.explorerPlugin(); | ||
root.render( | ||
React.createElement(GraphiQL, {{ | ||
fetcher, | ||
query: String.raw`{default_query}`, | ||
defaultEditorToolsVisibility: false, | ||
plugins: [explorerPlugin], | ||
}}, | ||
React.createElement(GraphiQL.Logo, null, | ||
React.createElement('div', {{ style: {{ display: 'flex', alignItems: 'center' }}}}, | ||
React.createElement('span', null, 'Thoth GraphQL API'), | ||
React.createElement('img', {{ | ||
src: 'https://cdn.thoth.pub/thoth_logo.png', | ||
height: 38, | ||
alt: 'Thoth Logo', | ||
style: {{ marginLeft: '10px', marginTop: '-5px' }} | ||
}}), | ||
) | ||
), | ||
React.createElement(GraphiQL.Footer, null, | ||
React.createElement('div', {{ style: {{ display: 'flex', justifyContent: 'space-between' }}}}, | ||
React.createElement('a', {{ href: 'https://github.com/thoth-pub/thoth/blob/master/CHANGELOG.md', style: {{ textDecoration: 'none' }} }}, 'v{version}'), | ||
React.createElement('span', {{ style: {{ color: 'hsla(var(--color-neutral), var(--alpha-secondary))' }} }}, 'Thoth Open Metadata'), | ||
React.createElement('a', {{ href: 'https://thoth.pub/policies/privacy', style: {{ textDecoration: 'none' }} }}, 'Privacy policy'), | ||
) | ||
), | ||
), | ||
); | ||
</script> | ||
</body> | ||
</html> | ||
"#, | ||
"##, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.