Skip to content

Commit b39fdaa

Browse files
Initial commit
0 parents  commit b39fdaa

File tree

13 files changed

+542
-0
lines changed

13 files changed

+542
-0
lines changed

.dockerignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
.env
3+
.dockerignore
4+
.git
5+
.github
6+
.gitignore
7+
.vscode
8+
renovate.json
9+
Dockerfile
10+
LICENSE
11+
README.md
12+
SECURITY.md

.github/renovate.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["config:base"],
4+
"packageRules": [
5+
{
6+
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
7+
"automerge": false
8+
}
9+
]
10+
}

.github/workflows/test.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
branches: [main]
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- name: Build
12+
run: |
13+
set -ex
14+
docker build --rm --no-cache .

.github/workflows/udd.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: udd-update-dependencies
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "42 19 * * *"
7+
8+
jobs:
9+
update-dependencies:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: denoland/setup-deno@v1
14+
with:
15+
deno-version: vx.x.x
16+
- name: Update dependencies
17+
run: |
18+
deno run -A https://deno.land/x/udd/main.ts deps.ts
19+
- name: Create Pull Request
20+
uses: peter-evans/create-pull-request@v7
21+
id: cpr
22+
with:
23+
commit-message: "Update dependencies"
24+
title: Update dependencies
25+
body: >
26+
Dependencies updated by [udd](https://github.com/hayd/deno-udd).
27+
branch: deno-dependency-updates
28+
author: GitHub <[email protected]>
29+
delete-branch: true
30+
token: ${{ secrets.GH_PAT }}
31+
- name: Enable Pull Request Automerge
32+
if: ${{ steps.cpr.outputs.pull-request-url }}
33+
run: gh pr merge --merge --auto ${{ steps.cpr.outputs.pull-request-url }}
34+
env:
35+
GH_TOKEN: ${{ secrets.GH_PAT }}

.gitignore

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
### https://raw.github.com/github/gitignore/752b7678db497edb377fa982ded0c70035393794/Global/macOS.gitignore
2+
3+
# General
4+
.DS_Store
5+
.AppleDouble
6+
.LSOverride
7+
8+
# Icon must end with two \r
9+
Icon
10+
11+
# Thumbnails
12+
._*
13+
14+
# Files that might appear in the root of a volume
15+
.DocumentRevisions-V100
16+
.fseventsd
17+
.Spotlight-V100
18+
.TemporaryItems
19+
.Trashes
20+
.VolumeIcon.icns
21+
.com.apple.timemachine.donotpresent
22+
23+
# Directories potentially created on remote AFP share
24+
.AppleDB
25+
.AppleDesktop
26+
Network Trash Folder
27+
Temporary Items
28+
.apdisk
29+
30+
31+
### https://raw.github.com/github/gitignore/752b7678db497edb377fa982ded0c70035393794/Node.gitignore
32+
33+
# Logs
34+
logs
35+
*.log
36+
npm-debug.log*
37+
yarn-debug.log*
38+
yarn-error.log*
39+
lerna-debug.log*
40+
.pnpm-debug.log*
41+
42+
# Diagnostic reports (https://nodejs.org/api/report.html)
43+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
44+
45+
# Runtime data
46+
pids
47+
*.pid
48+
*.seed
49+
*.pid.lock
50+
51+
# Directory for instrumented libs generated by jscoverage/JSCover
52+
lib-cov
53+
54+
# Coverage directory used by tools like istanbul
55+
coverage
56+
*.lcov
57+
58+
# nyc test coverage
59+
.nyc_output
60+
61+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
62+
.grunt
63+
64+
# Bower dependency directory (https://bower.io/)
65+
bower_components
66+
67+
# node-waf configuration
68+
.lock-wscript
69+
70+
# Compiled binary addons (https://nodejs.org/api/addons.html)
71+
build/Release
72+
73+
# Dependency directories
74+
node_modules/
75+
jspm_packages/
76+
77+
# Snowpack dependency directory (https://snowpack.dev/)
78+
web_modules/
79+
80+
# TypeScript cache
81+
*.tsbuildinfo
82+
83+
# Optional npm cache directory
84+
.npm
85+
86+
# Optional eslint cache
87+
.eslintcache
88+
89+
# Optional stylelint cache
90+
.stylelintcache
91+
92+
# Microbundle cache
93+
.rpt2_cache/
94+
.rts2_cache_cjs/
95+
.rts2_cache_es/
96+
.rts2_cache_umd/
97+
98+
# Optional REPL history
99+
.node_repl_history
100+
101+
# Output of 'npm pack'
102+
*.tgz
103+
104+
# Yarn Integrity file
105+
.yarn-integrity
106+
107+
# dotenv environment variable files
108+
.env
109+
.env.development.local
110+
.env.test.local
111+
.env.production.local
112+
.env.local
113+
114+
# parcel-bundler cache (https://parceljs.org/)
115+
.cache
116+
.parcel-cache
117+
118+
# Next.js build output
119+
.next
120+
out
121+
122+
# Nuxt.js build / generate output
123+
.nuxt
124+
dist
125+
126+
# Gatsby files
127+
.cache/
128+
# Comment in the public line in if your project uses Gatsby and not Next.js
129+
# https://nextjs.org/blog/next-9-1#public-directory-support
130+
# public
131+
132+
# vuepress build output
133+
.vuepress/dist
134+
135+
# vuepress v2.x temp and cache directory
136+
.temp
137+
.cache
138+
139+
# Docusaurus cache and generated files
140+
.docusaurus
141+
142+
# Serverless directories
143+
.serverless/
144+
145+
# FuseBox cache
146+
.fusebox/
147+
148+
# DynamoDB Local files
149+
.dynamodb/
150+
151+
# TernJS port file
152+
.tern-port
153+
154+
# Stores VSCode versions used for testing VSCode extensions
155+
.vscode-test
156+
157+
# yarn v2
158+
.yarn/cache
159+
.yarn/unplugged
160+
.yarn/build-state.yml
161+
.yarn/install-state.gz
162+
.pnp.*
163+
164+

.vscode/settings.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"deno.enable": true,
3+
"deno.lint": true,
4+
"deno.unstable": true,
5+
"editor.formatOnSave": true,
6+
"[typescript]": {
7+
"editor.defaultFormatter": "denoland.vscode-deno"
8+
}
9+
}

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM denoland/deno:bin-1.39.0 AS deno
2+
FROM swift:6.1.0-jammy
3+
4+
WORKDIR /app
5+
6+
COPY ./_Packages/ ./swiftfiddle.com/_Packages/
7+
RUN cd ./swiftfiddle.com/_Packages/ \
8+
&& swift build -c release \
9+
&& rm -rf .build/repositories/
10+
11+
RUN echo 'int isatty(int fd) { return 1; }' | \
12+
clang -O2 -fpic -shared -ldl -o faketty.so -xc -
13+
RUN strip faketty.so && chmod 400 faketty.so
14+
15+
COPY --from=deno /deno /usr/local/bin/deno
16+
17+
COPY deps.ts .
18+
RUN deno cache deps.ts
19+
20+
ADD . .
21+
RUN deno cache main.ts
22+
23+
EXPOSE 8000
24+
CMD ["deno", "run", "--allow-net", "--allow-run", "main.ts"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 SwiftFiddle Project
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# swiftfiddle-runner-functions-61

_Packages/Package.swift

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// swift-tools-version:5.7
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "_Packages",
6+
products: [
7+
.library(name: "_Packages", type: .dynamic, targets: ["_Packages"]),
8+
],
9+
dependencies: [
10+
.package(url: "https://github.com/apple/swift-algorithms", from: "1.2.1"),
11+
.package(url: "https://github.com/apple/swift-atomics", from: "1.2.0"),
12+
.package(url: "https://github.com/apple/swift-collections", from: "1.1.4"),
13+
.package(url: "https://github.com/apple/swift-crypto", from: "3.12.3"),
14+
.package(url: "https://github.com/apple/swift-numerics", from: "1.0.3"),
15+
.package(url: "https://github.com/apple/swift-system", from: "1.4.2"),
16+
],
17+
targets: [
18+
.target(
19+
name: "_Packages",
20+
dependencies: [
21+
.product(name: "Algorithms", package: "swift-algorithms"),
22+
.product(name: "Atomics", package: "swift-atomics"),
23+
.product(name: "Collections", package: "swift-collections"),
24+
.product(name: "Crypto", package: "swift-crypto"),
25+
.product(name: "Numerics", package: "swift-numerics"),
26+
.product(name: "SystemPackage", package: "swift-system"),
27+
],
28+
swiftSettings: [
29+
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release)),
30+
]
31+
),
32+
]
33+
)

0 commit comments

Comments
 (0)