rosefc 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,67 @@
1
+ # Rosefc - iOS build (GitHub Actions): an UNSIGNED archive.
2
+ #
3
+ # `rosefc export xcode` copies this file into the export tree as
4
+ # .github/workflows/ios.yml, at the root of the exported Xcode project, so
5
+ # every path below is the project's own. The shared scheme this archives is
6
+ # emitted beside project.pbxproj by the same export.
7
+ #
8
+ # No credential is written into this file. A signed archive reads its
9
+ # certificate from `${{ secrets.NAME }}` - see DEPLOY.md.
10
+
11
+ name: iOS
12
+
13
+ on:
14
+ push:
15
+ branches: [main]
16
+ pull_request:
17
+ workflow_dispatch:
18
+
19
+ jobs:
20
+ archive:
21
+ runs-on: macos-14
22
+
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: List the project
27
+ run: xcodebuild -list -project RosefcApp.xcodeproj
28
+
29
+ # No certificate, no provisioning profile, no team: signing is switched
30
+ # off and the archive lands unsigned in build/. Installing or shipping
31
+ # it is the manual step - see DEPLOY.md.
32
+ - name: xcodebuild archive (unsigned)
33
+ run: |
34
+ xcodebuild archive \
35
+ -project RosefcApp.xcodeproj \
36
+ -scheme RosefcApp \
37
+ -configuration Release \
38
+ -destination 'generic/platform=iOS' \
39
+ -archivePath build/RosefcApp.xcarchive \
40
+ CODE_SIGNING_ALLOWED=NO \
41
+ CODE_SIGNING_REQUIRED=NO \
42
+ CODE_SIGN_IDENTITY=""
43
+
44
+ - uses: actions/upload-artifact@v4
45
+ with:
46
+ name: rosefc-ios-xcarchive
47
+ path: build/RosefcApp.xcarchive
48
+ if-no-files-found: error
49
+
50
+ # Signed archive: add the certificate as repository secrets, import it into a
51
+ # temporary keychain before the archive, and replace CODE_SIGNING_ALLOWED=NO
52
+ # with `-allowProvisioningUpdates`.
53
+ #
54
+ # env:
55
+ # IOS_CERT_P12_BASE64: ${{ secrets.IOS_CERT_P12_BASE64 }}
56
+ # IOS_CERT_PASSWORD: ${{ secrets.IOS_CERT_PASSWORD }}
57
+ # IOS_KEYCHAIN_PASSWORD: ${{ secrets.IOS_KEYCHAIN_PASSWORD }}
58
+ #
59
+ # steps:
60
+ # - name: Import the signing certificate
61
+ # run: |
62
+ # echo "$IOS_CERT_P12_BASE64" | base64 -d > cert.p12
63
+ # security create-keychain -p "$IOS_KEYCHAIN_PASSWORD" build.keychain
64
+ # security default-keychain -s build.keychain
65
+ # security unlock-keychain -p "$IOS_KEYCHAIN_PASSWORD" build.keychain
66
+ # security import cert.p12 -k build.keychain -P "$IOS_CERT_PASSWORD" -T /usr/bin/codesign
67
+ # security set-key-partition-list -S apple-tool:,apple: -s -k "$IOS_KEYCHAIN_PASSWORD" build.keychain
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The rosefc Netlify function - the dynamic half of a Netlify deploy.
3
+ *
4
+ * Every request that is NOT a static file in dist/ lands here: dynamic
5
+ * pages (/sign, anything reading getContext() or $store()), /api routes,
6
+ * and POST server actions. Static answers - prerendered documents, the
7
+ * bundles, baked API bodies - are served by the CDN straight from dist/
8
+ * (the `publish` directory) and never touch this code. That split is the
9
+ * whole rosefc story: the static half costs zero function invocations.
10
+ *
11
+ * It reuses the framework's own edge adapter (the same Web-standard fetch
12
+ * handler the edge adapter test exercises) over the built server bundle,
13
+ * on Netlify's Functions v2 Web-standard signature - `export default`
14
+ * taking a Request and returning a Response. Netlify compiles TypeScript
15
+ * entrypoints and their imports, so this file and the adapter it pulls in
16
+ * stay .ts. The Lambda runtime has a filesystem, so `included_files`
17
+ * (`dist/**` in netlify.toml) carries dist/ into the bundle and the
18
+ * adapter reads server.js / client.js from it at boot.
19
+ *
20
+ * Install: copy this file to <project>/netlify/functions/rosefc.ts and
21
+ * deploy/netlify.toml to <project>/netlify.toml, then push (or
22
+ * `netlify deploy --prod`). In a project that depends on the published
23
+ * package the import below becomes:
24
+ * import { createEdgeHandler } from 'rosefc/edge';
25
+ */
26
+ import { createEdgeHandler } from '../../src/cli/edge.ts';
27
+ import { fileURLToPath } from 'node:url';
28
+
29
+ let handle: ((request: Request) => Promise<Response>) | null = null;
30
+
31
+ export default async function rosefc(request: Request): Promise<Response> {
32
+ if (!handle) {
33
+ handle = await createEdgeHandler(fileURLToPath(new URL('../../dist', import.meta.url)));
34
+ }
35
+ return handle(request);
36
+ }
@@ -0,0 +1,17 @@
1
+ [build]
2
+ command = "npm run build"
3
+ publish = "dist"
4
+
5
+ [functions]
6
+ directory = "netlify/functions"
7
+ included_files = ["dist/**"]
8
+
9
+ # Netlify answers the publish directory first, so a prerendered document, a
10
+ # bundle or a baked API body is served by the CDN and never invokes the
11
+ # function. Everything else - dynamic routes, live /api routes, POST server
12
+ # actions - falls through to the catch-all below (status 200 = rewrite, not
13
+ # redirect; the browser keeps its URL).
14
+ [[redirects]]
15
+ from = "/*"
16
+ to = "/.netlify/functions/rosefc"
17
+ status = 200
@@ -0,0 +1,4 @@
1
+ import('./dist/prod.mjs').catch((err) => {
2
+ console.error('[server.cjs] failed to start dist/prod.mjs:', err);
3
+ process.exit(1);
4
+ });
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://openapi.vercel.sh/vercel.json",
3
+ "buildCommand": "npm run build",
4
+ "outputDirectory": "dist",
5
+ "functions": {
6
+ "api/rosefc.ts": {
7
+ "includeFiles": "dist/**"
8
+ }
9
+ },
10
+ "rewrites": [
11
+ { "source": "/(.*)", "destination": "/api/rosefc" }
12
+ ]
13
+ }