feat(templates): use nested setup object in basic template

This commit is contained in:
Ayo 2023-11-10 22:32:11 +01:00
parent 93e07d4928
commit 232d1976f2
2 changed files with 46 additions and 36 deletions

73
package-lock.json generated
View file

@ -475,11 +475,11 @@
"link": true "link": true
}, },
"node_modules/@netlify/functions": { "node_modules/@netlify/functions": {
"version": "2.3.0", "version": "2.4.0",
"resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.3.0.tgz", "resolved": "https://registry.npmjs.org/@netlify/functions/-/functions-2.4.0.tgz",
"integrity": "sha512-E3kzXPWMP/r1rAWhjTaXcaOT47dhEvg/eQUJjRLhD9Zzp0WqkdynHr+bqff4rFNv6tuXrtFZrpbPJFKHH0c0zw==", "integrity": "sha512-dIqhdj5u4Lu/8qbYwtYpn8NfvIyPHbSTV2lAP4ocL+iwC9As06AXT0wa/xOpO2vRWJa0IMxdZaqCPnkyHlHiyg==",
"dependencies": { "dependencies": {
"@netlify/serverless-functions-api": "1.9.0", "@netlify/serverless-functions-api": "1.11.0",
"is-promise": "^4.0.0" "is-promise": "^4.0.0"
}, },
"engines": { "engines": {
@ -495,9 +495,9 @@
} }
}, },
"node_modules/@netlify/serverless-functions-api": { "node_modules/@netlify/serverless-functions-api": {
"version": "1.9.0", "version": "1.11.0",
"resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.9.0.tgz", "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.11.0.tgz",
"integrity": "sha512-Jq4uk1Mwa5vyxImupJYXPP+I5yYcp3PtguvXtJRutKdm9DPALXfZVtCQzBWMNdZiqVWCM3La9hvaBsPjSMfeug==", "integrity": "sha512-3splAsr2CekL7VTwgo6yTvzD2+f269/s+TJafYazonqMNNo31yzvFxD5HpLtni4DNE1ppymVKZ4X/rLN3yl0vQ==",
"dependencies": { "dependencies": {
"@netlify/node-cookies": "^0.1.0", "@netlify/node-cookies": "^0.1.0",
"urlpattern-polyfill": "8.0.2" "urlpattern-polyfill": "8.0.2"
@ -2468,9 +2468,13 @@
} }
}, },
"node_modules/local-pkg": { "node_modules/local-pkg": {
"version": "0.4.3", "version": "0.5.0",
"resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz",
"integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==",
"dependencies": {
"mlly": "^1.4.2",
"pkg-types": "^1.0.3"
},
"engines": { "engines": {
"node": ">=14" "node": ">=14"
}, },
@ -2907,15 +2911,15 @@
} }
}, },
"node_modules/openapi-typescript": { "node_modules/openapi-typescript": {
"version": "6.7.0", "version": "6.7.1",
"resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-6.7.0.tgz", "resolved": "https://registry.npmjs.org/openapi-typescript/-/openapi-typescript-6.7.1.tgz",
"integrity": "sha512-eoUfJwhnMEug7euZ1dATG7iRiDVsEROwdPkhLUDiaFjcClV4lzft9F0Ii0fYjULCPNIiWiFi0BqMpSxipuvAgQ==", "integrity": "sha512-Q3Ltt0KUm2smcPrsaR8qKmSwQ1KM4yGDJVoQdpYa0yvKPeN8huDx5utMT7DvwvJastHHzUxajjivK3WN2+fobg==",
"dependencies": { "dependencies": {
"ansi-colors": "^4.1.3", "ansi-colors": "^4.1.3",
"fast-glob": "^3.3.1", "fast-glob": "^3.3.1",
"js-yaml": "^4.1.0", "js-yaml": "^4.1.0",
"supports-color": "^9.4.0", "supports-color": "^9.4.0",
"undici": "^5.23.0", "undici": "^5.27.2",
"yargs-parser": "^21.1.1" "yargs-parser": "^21.1.1"
}, },
"bin": { "bin": {
@ -3482,9 +3486,9 @@
"integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==" "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q=="
}, },
"node_modules/streamx": { "node_modules/streamx": {
"version": "2.15.2", "version": "2.15.4",
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.2.tgz", "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.4.tgz",
"integrity": "sha512-b62pAV/aeMjUoRN2C/9F0n+G8AfcJjNC0zw/ZmOHeFsIe4m4GzjVW9m6VHXVjk536NbdU9JRwKMJRfkc+zUFTg==", "integrity": "sha512-uSXKl88bibiUCQ1eMpItRljCzDENcDx18rsfDmV79r0e/ThfrAwxG4Y2FarQZ2G4/21xcOKmFFd1Hue+ZIDwHw==",
"dependencies": { "dependencies": {
"fast-fifo": "^1.1.0", "fast-fifo": "^1.1.0",
"queue-tick": "^1.0.1" "queue-tick": "^1.0.1"
@ -3704,15 +3708,15 @@
} }
}, },
"node_modules/unimport": { "node_modules/unimport": {
"version": "3.4.0", "version": "3.5.0",
"resolved": "https://registry.npmjs.org/unimport/-/unimport-3.4.0.tgz", "resolved": "https://registry.npmjs.org/unimport/-/unimport-3.5.0.tgz",
"integrity": "sha512-M/lfFEgufIT156QAr/jWHLUn55kEmxBBiQsMxvRSIbquwmeJEyQYgshHDEvQDWlSJrVOOTAgnJ3FvlsrpGkanA==", "integrity": "sha512-0Ei1iTeSYxs7oxxUf79/KaBc2dPjZxe7qdVpw7yIz5YcdTZjmBYO6ToLDW+fX9QOHiueZ3xtwb5Z/wqaSfXx6A==",
"dependencies": { "dependencies": {
"@rollup/pluginutils": "^5.0.4", "@rollup/pluginutils": "^5.0.5",
"escape-string-regexp": "^5.0.0", "escape-string-regexp": "^5.0.0",
"fast-glob": "^3.3.1", "fast-glob": "^3.3.2",
"local-pkg": "^0.4.3", "local-pkg": "^0.5.0",
"magic-string": "^0.30.3", "magic-string": "^0.30.5",
"mlly": "^1.4.2", "mlly": "^1.4.2",
"pathe": "^1.1.1", "pathe": "^1.1.1",
"pkg-types": "^1.0.3", "pkg-types": "^1.0.3",
@ -3807,9 +3811,12 @@
} }
}, },
"node_modules/unstorage/node_modules/lru-cache": { "node_modules/unstorage/node_modules/lru-cache": {
"version": "10.0.1", "version": "10.0.2",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.1.tgz", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.0.2.tgz",
"integrity": "sha512-IJ4uwUTi2qCccrioU6g9g/5rvvVl13bsdczUUcqbciD9iLr095yj8DQKdObriEvuNSx325N1rV1O0sJFszx75g==", "integrity": "sha512-Yj9mA8fPiVgOUpByoTZO5pNrcl5Yk37FcSHsUINpAsaBIEZIuqcCclDZJCVxqQShDsmYX8QG63svJiTbOATZwg==",
"dependencies": {
"semver": "^7.3.5"
},
"engines": { "engines": {
"node": "14 || >=16.14" "node": "14 || >=16.14"
} }
@ -3991,9 +3998,9 @@
} }
}, },
"packages/config/node_modules/@mcflyjs/core": { "packages/config/node_modules/@mcflyjs/core": {
"version": "0.3.1", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@mcflyjs/core/-/core-0.3.1.tgz", "resolved": "https://registry.npmjs.org/@mcflyjs/core/-/core-0.3.2.tgz",
"integrity": "sha512-16yqHjbp+Ms9tvwm1JIUDlH64oEuCe/zT/sJa8kxoMjRNbH2pX3zW0NmjfMT/tIPJiP821/CFyqvFz/MKmDwlg==", "integrity": "sha512-K0d5igqzuY7SjXkNLKbjLodzoNb1lyXrpvvFW4xvSI+vEOX765aSYmRbSRDNrEo9IcKk3xF1PF9+K0InfYeVgA==",
"dependencies": { "dependencies": {
"esprima": "^4.0.1", "esprima": "^4.0.1",
"h3": "^1.8.2", "h3": "^1.8.2",
@ -4066,9 +4073,9 @@
} }
}, },
"templates/basic/node_modules/@mcflyjs/core": { "templates/basic/node_modules/@mcflyjs/core": {
"version": "0.3.1", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@mcflyjs/core/-/core-0.3.1.tgz", "resolved": "https://registry.npmjs.org/@mcflyjs/core/-/core-0.3.2.tgz",
"integrity": "sha512-16yqHjbp+Ms9tvwm1JIUDlH64oEuCe/zT/sJa8kxoMjRNbH2pX3zW0NmjfMT/tIPJiP821/CFyqvFz/MKmDwlg==", "integrity": "sha512-K0d5igqzuY7SjXkNLKbjLodzoNb1lyXrpvvFW4xvSI+vEOX765aSYmRbSRDNrEo9IcKk3xF1PF9+K0InfYeVgA==",
"dependencies": { "dependencies": {
"esprima": "^4.0.1", "esprima": "^4.0.1",
"h3": "^1.8.2", "h3": "^1.8.2",

View file

@ -7,7 +7,10 @@
<my-head> <my-head>
<script server:setup> <script server:setup>
const name = "McFly"; const name = "McFly";
const author = "Ayo Ayco"; const author = {
name: "Ayo Ayco",
url: "https://ayco.io"
}
</script> </script>
</my-head> </my-head>
<body> <body>
@ -45,7 +48,7 @@ class HelloWorld extends HTMLElement {
</code-block> </code-block>
</main> </main>
<my-footer> <my-footer>
<small>A project by <a href="https://ayco.io">{{author}}</a></small> <small>A project by <a href="{{ author.url }}">{{ author.name }}</a></small>
</my-footer> </my-footer>
</body> </body>
</html> </html>