Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY Public ./Public/
RUN npx webpack --config webpack.prod.js


FROM swift:5.10-focal as swift
FROM swift:6.1-jammy as swift
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y\
Expand All @@ -40,7 +40,7 @@ RUN [ -d /build/Public ] && { mv /build/Public ./Public && chmod -R a-w ./Public
RUN [ -d /build/Resources ] && { mv /build/Resources ./Resources && chmod -R a-w ./Resources; } || true


FROM swift:5.10-focal-slim
FROM swift:6.1-jammy-slim
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
&& apt-get -q update \
&& apt-get -q dist-upgrade -y \
Expand Down
7 changes: 0 additions & 7 deletions Public/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
"use strict";

import Plausible from "plausible-tracker";

const { enableAutoPageviews } = Plausible({
domain: "swift-format.com",
});
enableAutoPageviews();

import "./scss/default.scss";

import "codemirror/lib/codemirror.css";
Expand Down
34 changes: 10 additions & 24 deletions Sources/App/entrypoint.swift
Original file line number Diff line number Diff line change
@@ -1,35 +1,21 @@
import Vapor
import Dispatch
import Logging

/// This extension is temporary and can be removed once Vapor gets this support.
private extension Vapor.Application {
static let baseExecutionQueue = DispatchQueue(label: "vapor.codes.entrypoint")

func runFromAsyncMainEntrypoint() async throws {
try await withCheckedThrowingContinuation { continuation in
Vapor.Application.baseExecutionQueue.async { [self] in
do {
try self.run()
continuation.resume()
} catch {
continuation.resume(throwing: error)
}
}
}
}
}

@main
enum Entrypoint {
static func main() async throws {
var env = try Environment.detect()
try LoggingSystem.bootstrap(from: &env)

let app = Application(env)
defer { app.shutdown() }
let app = try await Application.make(env)

try await configure(app)
try await app.runFromAsyncMainEntrypoint()
do {
try await configure(app)
try await app.execute()
} catch {
app.logger.report(error: error)
try? await app.asyncShutdown()
throw error
}
try await app.asyncShutdown()
}
}
Loading