-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
JNG-4576 better dependencies support (#19)
* JNG-4576: initial commit * JNG-4576: update lock file * JNG-4576: improve dependency support
- Loading branch information
Showing
9 changed files
with
362 additions
and
125 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
{ | ||
"@emotion/react": { | ||
"dist/emotion-react.umd.min.js": {"tags": ["importMap", "npm"], "exports": "@emotion/react"} | ||
}, | ||
"@emotion/styled": { | ||
"dist/emotion-styled.umd.min.js": {"tags": ["importMap", "npm"], "exports": "@emotion/styled"} | ||
}, | ||
"@fontsource/roboto": { | ||
"300.css": {"tags": ["css", "npm"]}, | ||
"400.css": {"tags": ["css", "npm"]}, | ||
"500.css": {"tags": ["css", "npm"]}, | ||
"700.css": {"tags": ["css", "npm"]}, | ||
"files/roboto-all-300-normal.woff": {"tags": ["font", "npm"]}, | ||
"files/roboto-all-400-normal.woff": {"tags": ["font", "npm"]}, | ||
"files/roboto-all-500-normal.woff": {"tags": ["font", "npm"]}, | ||
"files/roboto-all-700-normal.woff": {"tags": ["font", "npm"]}, | ||
"files/roboto-latin-300-normal.woff2": {"tags": ["font", "npm"]}, | ||
"files/roboto-latin-400-normal.woff2": {"tags": ["font", "npm"]}, | ||
"files/roboto-latin-500-normal.woff2": {"tags": ["font", "npm"]}, | ||
"files/roboto-latin-700-normal.woff2": {"tags": ["font", "npm"]} | ||
}, | ||
"@judo/data-api-common": { | ||
"umd/judo-data-api-common.min.js": {"tags": ["importMap", "external"], "exports": "@judo/data-api-common"} | ||
}, | ||
"@mdi/font": { | ||
"css/materialdesignicons.min.css": {"tags": ["css", "npm"]}, | ||
"fonts/materialdesignicons-webfont.eot": {"tags": ["font", "npm"]}, | ||
"fonts/materialdesignicons-webfont.ttf": {"tags": ["font", "npm"]}, | ||
"fonts/materialdesignicons-webfont.woff": {"tags": ["font", "npm"]}, | ||
"fonts/materialdesignicons-webfont.woff2": {"tags": ["font", "npm"]} | ||
}, | ||
"@mui/material": { | ||
"umd/mui-material.min.js": {"tags": ["importMap", "external"], "exports": "@mui/material"} | ||
}, | ||
"@mui/material/locale": { | ||
"umd/mui-material-locale.min.js": {"tags": ["importMap", "external"], "exports": "@mui/material/locale"} | ||
}, | ||
"@mui/system": { | ||
"umd/mui-system.min.js": {"tags": ["importMap", "external"], "exports": "@mui/system"} | ||
}, | ||
"@mui/x-data-grid": { | ||
"umd/mui-x-data-grid.min.js": {"tags": ["importMap", "external"], "exports": "@mui/x-data-grid"} | ||
}, | ||
"@mui/x-date-pickers": { | ||
"umd/mui-x-date-pickers.min.js": {"tags": ["importMap", "external"], "exports": "@mui/x-date-pickers"}, | ||
"umd/mui-x-date-pickers-adapter-day-js.min.js": {"tags": ["importMap", "external"], "exports": "@mui/x-date-pickers/AdapterDayjs"} | ||
}, | ||
"@pandino/loader-configuration-dom": { | ||
"dist/system/loader-configuration-dom.min.js": {"tags": ["importMap", "npm"], "exports": "@pandino/loader-configuration-dom"} | ||
}, | ||
"@pandino/pandino": { | ||
"dist/system/pandino.min.js": {"tags": ["importMap", "npm"], "exports": "@pandino/pandino"} | ||
}, | ||
"@pandino/pandino-api": { | ||
"dist/system/pandino-api.min.js": {"tags": ["importMap", "npm"], "exports": "@pandino/pandino-api"} | ||
}, | ||
"@pandino/react-hooks": { | ||
"dist/system/react-hooks.min.js": {"tags": ["importMap", "npm"], "exports": "@pandino/react-hooks"} | ||
}, | ||
"@remix-run/router": { | ||
"dist/router.umd.min.js": {"tags": ["importMap", "npm"], "exports": "@remix-run/router"} | ||
}, | ||
"axios": { | ||
"dist/axios.min.js": {"tags": ["importMap", "npm"], "exports": "axios"} | ||
}, | ||
"dayjs": { | ||
"dayjs.min.js": {"tags": ["importMap", "npm"], "exports": "dayjs"}, | ||
"locale/en.js": {"tags": ["importMap", "npm"], "exports": "dayjs/locale/en"}, | ||
"locale/hu.js": {"tags": ["importMap", "npm"], "exports": "dayjs/locale/hu"} | ||
}, | ||
"i18next": { | ||
"dist/umd/i18next.min.js": {"tags": ["importMap", "npm"], "exports": "i18next"} | ||
}, | ||
"oidc-client-ts": { | ||
"umd/oidc-client-ts.min.js": {"tags": ["importMap", "external"], "exports": "oidc-client-ts"} | ||
}, | ||
"react": { | ||
"umd/react.production.min.js": {"tags": ["importMap", "npm"], "exports": "react"} | ||
}, | ||
"react-dom": { | ||
"umd/react-dom.production.min.js": {"tags": ["importMap", "npm"], "exports": "react-dom"} | ||
}, | ||
"react-dom/client": { | ||
"umd/react-dom-client.min.js": {"tags": ["importMap", "external"], "exports": "react-dom/client"} | ||
}, | ||
"react-i18next": { | ||
"dist/umd/react-i18next.min.js": {"tags": ["importMap", "npm"], "exports": "react-i18next"} | ||
}, | ||
"react-is": { | ||
"umd/react-is.min.js": {"tags": ["importMap", "external"], "exports": "react-is"} | ||
}, | ||
"react-router": { | ||
"dist/umd/react-router.production.min.js": {"tags": ["importMap", "npm"], "exports": "react-router"} | ||
}, | ||
"react-router-dom": { | ||
"dist/umd/react-router-dom.production.min.js": {"tags": ["importMap", "npm"], "exports": "react-router-dom"} | ||
}, | ||
"react/jsx-runtime": { | ||
"umd/react-jsx-runtime.min.js": {"tags": ["importMap", "external"], "exports": "react/jsx-runtime"} | ||
}, | ||
"systemjs": { | ||
"dist/system.min.js": {"tags": ["script", "npm"]}, | ||
"dist/extras/amd.min.js": {"tags": ["script", "npm"]} | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
judo-ui-react/src/main/resources/actor/package.json.dev-dependencies.fragment.hbs
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 was deleted.
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
67 changes: 67 additions & 0 deletions
67
judo-ui-react/src/main/resources/actor/rollup/html-template.mjs
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { EOL } from 'node:os'; | ||
import { createImportMap, getCSSLinks, getScriptLinks } from './utils.mjs'; | ||
|
||
export const makeHtmlAttributes = (attributes) => { | ||
if (!attributes) { | ||
return ''; | ||
} | ||
|
||
const keys = Object.keys(attributes); | ||
return keys.reduce((result, key) => (result += ` ${key}="${attributes[key]}"`), ''); | ||
}; | ||
|
||
export const template = async ({ attributes, files, meta, publicPath, title, inventory }) => { | ||
const generateCssLink = (fileName) => { | ||
const attrs = makeHtmlAttributes(attributes.link); | ||
return `<link href="${publicPath}${fileName}" rel="stylesheet"${attrs}>`; | ||
}; | ||
|
||
const generateJSScript = (fileName) => { | ||
const attrs = makeHtmlAttributes(attributes.script); | ||
return `<script src="${publicPath}${fileName}"${attrs}></script>`; | ||
}; | ||
|
||
const mainScript = files.js.find(f => f.name === 'main' && f.type === 'chunk'); | ||
const scripts = [mainScript] | ||
.map(({fileName}) => { | ||
const attrs = makeHtmlAttributes(attributes.script); | ||
return `<script type="systemjs-module" src="${publicPath}${fileName}"${attrs}></script>`; | ||
}) | ||
.join(EOL); | ||
|
||
const cssFiles = getCSSLinks(inventory) | ||
.map(generateCssLink) | ||
.join(EOL); | ||
|
||
const headScripts = getScriptLinks(inventory) | ||
.map(generateJSScript) | ||
.join(EOL); | ||
|
||
const metas = meta | ||
.map((input) => { | ||
const attrs = makeHtmlAttributes(input); | ||
return `<meta${attrs}>`; | ||
}) | ||
.join(EOL); | ||
|
||
return ` | ||
<!doctype html> | ||
<html${makeHtmlAttributes(attributes.html)}> | ||
<head> | ||
${metas} | ||
<link rel="icon" href="favicon.ico" /> | ||
<link rel="apple-touch-icon" href="logo192.png" /> | ||
<title>${title}</title> | ||
${cssFiles} | ||
${headScripts} | ||
<script type="systemjs-importmap"> | ||
${JSON.stringify({ imports: createImportMap(inventory) }, null, 4)} | ||
</script> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
${scripts} | ||
</body> | ||
</html>`; | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.