|
|
|
@ -43,11 +43,6 @@ export class Server {
|
|
|
|
apiBaseUrl: this.giteaApiBaseUrl,
|
|
|
|
apiBaseUrl: this.giteaApiBaseUrl,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const promises = []
|
|
|
|
const promises = []
|
|
|
|
promises.push(server.frontend.loadRepo(
|
|
|
|
|
|
|
|
'macchiato',
|
|
|
|
|
|
|
|
'pages',
|
|
|
|
|
|
|
|
{srcPath: [], destPath: []}
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
const repos = [
|
|
|
|
const repos = [
|
|
|
|
'loader',
|
|
|
|
'loader',
|
|
|
|
'editor',
|
|
|
|
'editor',
|
|
|
|
@ -65,7 +60,37 @@ export class Server {
|
|
|
|
{srcPath: [], destPath: [repo]}
|
|
|
|
{srcPath: [], destPath: [repo]}
|
|
|
|
))
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
promises.push(server.frontend.loadRepo(
|
|
|
|
|
|
|
|
'macchiato',
|
|
|
|
|
|
|
|
'pages',
|
|
|
|
|
|
|
|
{srcPath: [], destPath: []}
|
|
|
|
|
|
|
|
))
|
|
|
|
|
|
|
|
promises.push(server.frontend.loadRepo(
|
|
|
|
|
|
|
|
'macchiato',
|
|
|
|
|
|
|
|
'server',
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
srcPath: [],
|
|
|
|
|
|
|
|
destPath: ['server'],
|
|
|
|
|
|
|
|
ref: 'shared-server'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
))
|
|
|
|
await Promise.all(promises)
|
|
|
|
await Promise.all(promises)
|
|
|
|
|
|
|
|
this.frontend.files['/app.js'] = (
|
|
|
|
|
|
|
|
this.frontend.files['/server/app.js']
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
this.frontend.files['/'] = (
|
|
|
|
|
|
|
|
this.frontend.files['/index.html']
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
const sw = this.frontend.files['/sw.js']
|
|
|
|
|
|
|
|
const commit = (
|
|
|
|
|
|
|
|
this.frontend.files['/server/app.js'].commit
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
sw.body = (
|
|
|
|
|
|
|
|
new TextEncoder().encode(
|
|
|
|
|
|
|
|
new TextDecoder().decode(sw.body) +
|
|
|
|
|
|
|
|
`\n// ${commit}\n`
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async serveRequest(event) {
|
|
|
|
async serveRequest(event) {
|
|
|
|
|