create-disposabl-app 0.4.2 → 0.6.0
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.
- package/README.md +18 -0
- package/dist/disposabl.js +541 -0
- package/dist/index.js +154 -61
- package/dist/templates/default/.github/scripts/android-build.sh +18 -0
- package/dist/templates/default/.github/scripts/disposabl.mjs +95 -0
- package/dist/templates/default/.github/scripts/expo-channel.sh +10 -0
- package/dist/templates/default/.github/scripts/expo-env.sh +17 -0
- package/dist/templates/default/.github/scripts/expo-fingerprint.sh +19 -0
- package/dist/templates/default/.github/scripts/expo-update.sh +11 -0
- package/dist/templates/default/.github/scripts/package-release.sh +23 -0
- package/dist/templates/default/.github/scripts/platforms.sh +37 -0
- package/dist/templates/default/.github/scripts/release-publish.sh +28 -0
- package/dist/templates/default/.github/scripts/release-source.sh +14 -0
- package/dist/templates/default/.github/scripts/verify-artifacts.sh +13 -0
- package/dist/templates/default/.github/scripts/web-deploy.sh +10 -0
- package/dist/templates/default/.github/workflows/pipeline.yml +299 -0
- package/dist/templates/default/apps/docs/README.md +37 -0
- package/dist/templates/default/apps/docs/content/guides/writing.mdx +15 -0
- package/dist/templates/default/apps/docs/content/index.mdx +10 -0
- package/dist/templates/default/apps/docs/package.json +29 -1
- package/dist/templates/default/apps/docs/press.config.ts +20 -0
- package/dist/templates/default/apps/docs/src/app.css +4 -0
- package/dist/templates/default/apps/docs/tsconfig.json +14 -0
- package/dist/templates/default/apps/docs/vite.config.ts +8 -0
- package/dist/templates/default/apps/mobile/.env.example +2 -0
- package/dist/templates/default/apps/mobile/AGENTS.md +2 -2
- package/dist/templates/default/apps/mobile/README.md +64 -4
- package/dist/templates/default/apps/mobile/app.json +5 -4
- package/dist/templates/default/apps/mobile/assets/images/android-icon-foreground.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/icon.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/splash-icon.png +0 -0
- package/dist/templates/default/apps/mobile/eas.json +5 -0
- package/dist/templates/default/apps/mobile/package.json +18 -4
- package/dist/templates/default/apps/mobile/src/app/(auth)/_layout.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(auth)/login.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(auth)/signup.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(authenticated)/_layout.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/(authenticated)/account.tsx +1 -0
- package/dist/templates/default/apps/mobile/src/app/_layout.tsx +1 -5
- package/dist/templates/default/apps/mobile/src/app/index.tsx +1 -17
- package/dist/templates/default/apps/mobile/tsconfig.json +8 -1
- package/dist/templates/default/apps/web/package.json +3 -2
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -44
- package/dist/templates/default/apps/web/src/router/__root.tsx +1 -1
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +2 -1
- package/dist/templates/default/apps/web/src/router/index.tsx +11 -3
- package/dist/templates/default/apps/web/tests/auth-branches.test.tsx +44 -0
- package/dist/templates/default/apps/web/vite.config.ts +15 -0
- package/dist/templates/default/bun.lock +583 -23
- package/dist/templates/default/bunfig.toml +0 -2
- package/dist/templates/default/disposabl.json +2 -13
- package/dist/templates/default/package.json +3 -3
- package/dist/templates/default/packages/backend/AGENTS.md +15 -13
- package/dist/templates/default/packages/backend/README.md +6 -28
- package/dist/templates/default/packages/backend/convex/_generated/ai/ai-files.state.json +1 -1
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +32 -6
- package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +8 -0
- package/dist/templates/default/packages/backend/convex/apps/actions/create.ts +19 -0
- package/dist/templates/default/packages/backend/convex/apps/internal.ts +197 -0
- package/dist/templates/default/packages/backend/convex/auth.ts +1 -1
- package/dist/templates/default/packages/backend/convex/convex.config.ts +8 -0
- package/dist/templates/default/packages/backend/convex/github/actions/http.ts +40 -0
- package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +189 -0
- package/dist/templates/default/packages/backend/convex/github/actions/oidc.ts +75 -0
- package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +80 -0
- package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +66 -0
- package/dist/templates/default/packages/backend/convex/github/internal.ts +34 -0
- package/dist/templates/default/packages/backend/convex/http.ts +3 -0
- package/dist/templates/default/packages/backend/convex/previews/internal.ts +270 -0
- package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +69 -0
- package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +133 -0
- package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +1 -0
- package/dist/templates/default/packages/backend/convex/releases/internal.ts +28 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +34 -4
- package/dist/templates/default/packages/backend/convex/users/index.ts +21 -0
- package/dist/templates/default/packages/backend/convex/users/internal.ts +44 -0
- package/dist/templates/default/packages/backend/convex/validator.ts +87 -0
- package/dist/templates/default/packages/backend/generate.ts +6 -1
- package/dist/templates/default/packages/backend/generated/openapi.json +961 -43
- package/dist/templates/default/packages/backend/generated/pages.json +0 -8
- package/dist/templates/default/packages/backend/generated/platforms.ts +14 -2
- package/dist/templates/default/packages/backend/package.json +1 -1
- package/dist/templates/default/packages/cli/README.md +15 -9
- package/dist/templates/default/packages/cli/auth.ts +11 -3
- package/dist/templates/default/packages/cli/commands.ts +236 -0
- package/dist/templates/default/packages/cli/index.ts +2 -142
- package/dist/templates/default/packages/cli/preview.ts +157 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/log-out.tsx +16 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +6 -3
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
- package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/route.tsx +25 -16
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +3 -2
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +57 -2
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +20 -9
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +1 -1
- package/dist/templates/default/packages/disposabl-kit/features.ts +4 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-form.tsx +125 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-ui.tsx +107 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/expo-plugin.cjs +26 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/index.ts +10 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +101 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-errors.ts +40 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-storage.ts +9 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/convex.ts +1 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/lib/logo.png +0 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +67 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +65 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/login.tsx +5 -0
- package/dist/templates/default/packages/disposabl-kit/mobile/screens/signup.tsx +5 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +24 -1
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +1 -27
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +6 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/docs.test.ts +111 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/docs.ts +62 -0
- package/dist/templates/default/packages/disposabl-kit/tsconfig.json +1 -1
- package/dist/templates/default/packages/sdk/README.md +8 -4
- package/dist/templates/default/packages/sdk/src/config.ts +14 -7
- package/dist/templates/default/packages/sdk/src/generated/index.ts +48 -13
- package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +139 -27
- package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +440 -37
- package/dist/templates/default/turbo.json +7 -0
- package/package.json +6 -3
- package/dist/templates/default/.github/README.md +0 -99
- package/dist/templates/default/.github/actionlint.yaml +0 -6
- package/dist/templates/default/.github/workflows/pipeline.yml.example +0 -546
- package/dist/templates/default/apps/blog/package.json +0 -1
- package/dist/templates/default/apps/changelog/package.json +0 -1
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +0 -5
- package/dist/templates/default/apps/desktop/.oxlintrc.json +0 -6
- package/dist/templates/default/apps/desktop/README.md +0 -88
- package/dist/templates/default/apps/desktop/build-ci.mjs +0 -56
- package/dist/templates/default/apps/desktop/forge.config.mts +0 -109
- package/dist/templates/default/apps/desktop/index.html +0 -12
- package/dist/templates/default/apps/desktop/package.json +0 -55
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +0 -2
- package/dist/templates/default/apps/desktop/src/index.css +0 -8
- package/dist/templates/default/apps/desktop/src/main.ts +0 -58
- package/dist/templates/default/apps/desktop/src/preload.ts +0 -3
- package/dist/templates/default/apps/desktop/src/renderer.ts +0 -19
- package/dist/templates/default/apps/desktop/tsconfig.json +0 -14
- package/dist/templates/default/apps/desktop/vite.main.config.mts +0 -4
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +0 -4
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +0 -4
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +0 -27
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +0 -33
- package/dist/templates/default/packages/backend/convex/todos/index.ts +0 -26
- package/dist/templates/default/packages/backend/convex/todos/internal.ts +0 -43
- package/dist/templates/default/packages/backend/convex/users.ts +0 -20
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# Desktop
|
|
2
|
-
|
|
3
|
-
Electron Forge with Vite and TypeScript, managed by the repository's Bun workspace.
|
|
4
|
-
Requires Bun 1.4.4 and Node.js 22.13 or newer.
|
|
5
|
-
|
|
6
|
-
Run these commands from the repository root:
|
|
7
|
-
|
|
8
|
-
```sh
|
|
9
|
-
bun install
|
|
10
|
-
bun run --cwd apps/desktop dev
|
|
11
|
-
bun run --cwd apps/desktop typecheck
|
|
12
|
-
bun run --cwd apps/desktop lint
|
|
13
|
-
bun run --cwd apps/desktop build
|
|
14
|
-
bun run --cwd apps/desktop make
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
`dev` opens the app with Vite hot reload. `build` packages the application into
|
|
18
|
-
`apps/desktop/out/`. `make` also creates distributables for the current platform.
|
|
19
|
-
The desktop app participates in the root Turbo tasks, so
|
|
20
|
-
`bun run dev --filter=desktop` also starts it.
|
|
21
|
-
|
|
22
|
-
Use the root `bun.lock`; do not generate a separate npm lockfile or run npm install
|
|
23
|
-
inside this workspace. Forge 8 still probes npm's version during its CLI system
|
|
24
|
-
check, so its output can say `Found npm`. Bun installs the dependencies and runs
|
|
25
|
-
the project scripts; Forge and Electron still use Node.js.
|
|
26
|
-
|
|
27
|
-
## Distribution targets
|
|
28
|
-
|
|
29
|
-
| Platform | Architecture | Distributables | Bun script |
|
|
30
|
-
| -------- | -------------------- | ------------------------------------------ | -------------- |
|
|
31
|
-
| Windows | x64 | Squirrel `Setup.exe`, `.nupkg`, `RELEASES` | `make:windows` |
|
|
32
|
-
| Linux | x64 | `.deb` and `.rpm` | `make:linux` |
|
|
33
|
-
| macOS | arm64, Apple Silicon | `.dmg` containing the `.app` | `make:macos` |
|
|
34
|
-
|
|
35
|
-
Run each script with `bun run --cwd apps/desktop <script>`. Packaging rejects other
|
|
36
|
-
platform and architecture combinations, including Windows ARM and Intel macOS.
|
|
37
|
-
Build Windows installers on Windows, Linux packages on Linux, and macOS packages
|
|
38
|
-
on macOS. Linux builders need `fakeroot`, `dpkg`, and `rpm` installed.
|
|
39
|
-
|
|
40
|
-
## CI releases
|
|
41
|
-
|
|
42
|
-
The single root `.github/workflows/pipeline.yml` selects affected desktop targets from
|
|
43
|
-
`disposabl.json`. Windows x64, Linux x64 and macOS arm64 build in parallel alongside
|
|
44
|
-
web/backend deployment on Blacksmith. Each runner uses:
|
|
45
|
-
|
|
46
|
-
```sh
|
|
47
|
-
DISPOSABL_DESKTOP_PLATFORM=linux DISPOSABL_RELEASE_VERSION=1.0.42 bun run --cwd apps/desktop preview
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Use the matching platform value on Windows or macOS. The helper temporarily sets
|
|
51
|
-
the package version, makes the installers, restores `package.json` even on failure,
|
|
52
|
-
and collects outputs into the repository root `dist/release`. Each platform job
|
|
53
|
-
then uploads directly to its own GitHub prerelease using its job-scoped write
|
|
54
|
-
token, without waiting for other platforms. PR tags such as `app-pr-2-macos` stay
|
|
55
|
-
constant while their assets and source commit update after successful builds.
|
|
56
|
-
Main releases use separate platform/run tags. Forge itself does not publish.
|
|
57
|
-
|
|
58
|
-
Windows and Linux installers are unsigned. macOS builds use ad hoc signing by
|
|
59
|
-
default; Developer ID signing and notarization are optional. In-app updates are not configured. The release version is
|
|
60
|
-
`1.0.<workflow run number>`. See the root `.github/README.md` for release behavior.
|
|
61
|
-
|
|
62
|
-
## macOS signing
|
|
63
|
-
|
|
64
|
-
To enable Developer ID signing and notarization, configure all five repository
|
|
65
|
-
secrets, or grant this repository access to equivalent organization secrets:
|
|
66
|
-
|
|
67
|
-
- `MACOS_CERTIFICATES_P12_PRODUCTION`: base64-encoded Developer ID Application
|
|
68
|
-
certificate and private key exported as `.p12`.
|
|
69
|
-
- `MACOS_CERTIFICATES_PASSWORD_PRODUCTION`: the `.p12` export password.
|
|
70
|
-
- `MACOS_APPLE_API_KEY_P8_PRODUCTION`: the raw App Store Connect API private key.
|
|
71
|
-
- `MACOS_APPLE_API_KEY_ID_PRODUCTION`: its Key ID.
|
|
72
|
-
- `MACOS_APPLE_API_ISSUER_PRODUCTION`: its Issuer ID.
|
|
73
|
-
|
|
74
|
-
With all five secrets present, the same credentials sign and notarize prereleases
|
|
75
|
-
and production releases. The suffix is a naming convention. The workflow imports
|
|
76
|
-
the certificate into a temporary keychain, lets Forge sign, notarize and staple
|
|
77
|
-
the app, and checks the app mounted from the DMG with `codesign`, Gatekeeper and `stapler`.
|
|
78
|
-
The keychain and temporary notarization key are cleaned up. Configured signing or
|
|
79
|
-
notarization failures stop publication; they do not silently downgrade the app.
|
|
80
|
-
|
|
81
|
-
Without the complete credential set, previews and production still publish an ad
|
|
82
|
-
hoc signed DMG. This signature does not verify the developer's identity. The
|
|
83
|
-
release notes identify it as unnotarized and link to Apple's installation guidance.
|
|
84
|
-
Users may need **System Settings > Privacy & Security > Open Anyway**; managed Macs
|
|
85
|
-
may disallow this. Local `make:macos` builds also use ad hoc signing by default.
|
|
86
|
-
|
|
87
|
-
Change `MACOS_BUNDLE_ID` at the top of the workflow to set your desktop bundle
|
|
88
|
-
identifier. CI builds only Apple Silicon (`arm64`), never Intel macOS packages.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { cp, mkdir, readFile, readdir, rm, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { spawnSync } from 'node:child_process';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
-
|
|
6
|
-
const root = fileURLToPath(new URL('.', import.meta.url));
|
|
7
|
-
const targets = {
|
|
8
|
-
windows: ['win32', 'x64'],
|
|
9
|
-
linux: ['linux', 'x64'],
|
|
10
|
-
macos: ['darwin', 'arm64'],
|
|
11
|
-
};
|
|
12
|
-
const target = process.env.DISPOSABL_DESKTOP_PLATFORM;
|
|
13
|
-
const version = process.env.DISPOSABL_RELEASE_VERSION;
|
|
14
|
-
if (!Object.hasOwn(targets, target ?? ''))
|
|
15
|
-
throw new Error('Invalid DISPOSABL_DESKTOP_PLATFORM');
|
|
16
|
-
if (!version || !/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/.test(version))
|
|
17
|
-
throw new Error('DISPOSABL_RELEASE_VERSION must be numeric semver');
|
|
18
|
-
if (
|
|
19
|
-
process.platform !== targets[target][0] ||
|
|
20
|
-
process.arch !== targets[target][1]
|
|
21
|
-
)
|
|
22
|
-
throw new Error(`Build ${target} on ${targets[target].join('/')}`);
|
|
23
|
-
const packagePath = join(root, 'package.json');
|
|
24
|
-
const original = await readFile(packagePath, 'utf8');
|
|
25
|
-
try {
|
|
26
|
-
await rm(join(root, 'out'), { recursive: true, force: true });
|
|
27
|
-
await rm(join(root, '../../dist/release'), { recursive: true, force: true });
|
|
28
|
-
await writeFile(
|
|
29
|
-
packagePath,
|
|
30
|
-
JSON.stringify({ ...JSON.parse(original), version }, null, 2) + '\n',
|
|
31
|
-
);
|
|
32
|
-
const result = spawnSync('bun', ['run', `make:${target}`], {
|
|
33
|
-
cwd: root,
|
|
34
|
-
stdio: 'inherit',
|
|
35
|
-
});
|
|
36
|
-
if (result.status !== 0)
|
|
37
|
-
throw new Error(`Forge failed: ${result.error ?? result.status}`);
|
|
38
|
-
const destination = join(root, '../../dist/release');
|
|
39
|
-
await mkdir(destination, { recursive: true });
|
|
40
|
-
async function collect(dir) {
|
|
41
|
-
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
42
|
-
const path = join(dir, entry.name);
|
|
43
|
-
if (entry.isDirectory()) await collect(path);
|
|
44
|
-
else if (entry.isFile())
|
|
45
|
-
await cp(path, join(destination, entry.name), {
|
|
46
|
-
errorOnExist: true,
|
|
47
|
-
force: false,
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
await collect(join(root, 'out', 'make'));
|
|
52
|
-
if (!(await readdir(destination)).length)
|
|
53
|
-
throw new Error('Forge produced no artifacts');
|
|
54
|
-
} finally {
|
|
55
|
-
await writeFile(packagePath, original);
|
|
56
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import type { ForgeConfig } from '@electron-forge/shared-types';
|
|
2
|
-
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
|
|
3
|
-
import { MakerDMG } from '@electron-forge/maker-dmg';
|
|
4
|
-
import { MakerDeb } from '@electron-forge/maker-deb';
|
|
5
|
-
import { MakerRpm } from '@electron-forge/maker-rpm';
|
|
6
|
-
import { VitePlugin } from '@electron-forge/plugin-vite';
|
|
7
|
-
import { FusesPlugin } from '@electron-forge/plugin-fuses';
|
|
8
|
-
import { FuseV1Options, FuseVersion } from '@electron/fuses';
|
|
9
|
-
|
|
10
|
-
const signedRelease =
|
|
11
|
-
process.platform === 'darwin' && process.env.MACOS_NOTARIZE === 'true';
|
|
12
|
-
if (
|
|
13
|
-
signedRelease &&
|
|
14
|
-
(!process.env.APPLE_API_KEY ||
|
|
15
|
-
!process.env.APPLE_API_KEY_ID ||
|
|
16
|
-
!process.env.APPLE_API_ISSUER)
|
|
17
|
-
)
|
|
18
|
-
throw new Error('macOS releases require Apple notarization credentials');
|
|
19
|
-
|
|
20
|
-
const config: ForgeConfig = {
|
|
21
|
-
packagerConfig: {
|
|
22
|
-
asar: true,
|
|
23
|
-
appBundleId: process.env.MACOS_BUNDLE_ID || 'dev.disposabl.starter.desktop',
|
|
24
|
-
...(process.platform === 'darwin'
|
|
25
|
-
? {
|
|
26
|
-
osxSign: signedRelease
|
|
27
|
-
? {}
|
|
28
|
-
: {
|
|
29
|
-
identity: '-',
|
|
30
|
-
identityValidation: false,
|
|
31
|
-
optionsForFile: () => ({
|
|
32
|
-
hardenedRuntime: false,
|
|
33
|
-
timestamp: 'none',
|
|
34
|
-
}),
|
|
35
|
-
},
|
|
36
|
-
}
|
|
37
|
-
: {}),
|
|
38
|
-
...(signedRelease
|
|
39
|
-
? {
|
|
40
|
-
osxNotarize: {
|
|
41
|
-
appleApiKey: process.env.APPLE_API_KEY!,
|
|
42
|
-
appleApiKeyId: process.env.APPLE_API_KEY_ID!,
|
|
43
|
-
appleApiIssuer: process.env.APPLE_API_ISSUER!,
|
|
44
|
-
},
|
|
45
|
-
}
|
|
46
|
-
: {}),
|
|
47
|
-
download: {
|
|
48
|
-
cacheRoot: process.env.electron_config_cache,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
rebuildConfig: {},
|
|
52
|
-
hooks: {
|
|
53
|
-
prePackage: async (_config, platform, arch) => {
|
|
54
|
-
const supported =
|
|
55
|
-
(platform === 'darwin' && arch === 'arm64') ||
|
|
56
|
-
((platform === 'win32' || platform === 'linux') && arch === 'x64');
|
|
57
|
-
|
|
58
|
-
if (!supported) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
`Unsupported desktop target ${platform}/${arch}. Use Windows x64, Linux x64, or macOS arm64.`,
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
makers: [
|
|
66
|
-
new MakerSquirrel({}),
|
|
67
|
-
new MakerDMG({ format: 'ULFO' }),
|
|
68
|
-
new MakerRpm({}),
|
|
69
|
-
new MakerDeb({}),
|
|
70
|
-
],
|
|
71
|
-
plugins: [
|
|
72
|
-
new VitePlugin({
|
|
73
|
-
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
|
|
74
|
-
// If you are familiar with Vite configuration, it will look really familiar.
|
|
75
|
-
build: [
|
|
76
|
-
{
|
|
77
|
-
// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
|
|
78
|
-
entry: 'src/main.ts',
|
|
79
|
-
config: 'vite.main.config.mts',
|
|
80
|
-
target: 'main',
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
entry: 'src/preload.ts',
|
|
84
|
-
config: 'vite.preload.config.mts',
|
|
85
|
-
target: 'preload',
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
renderer: [
|
|
89
|
-
{
|
|
90
|
-
name: 'main_window',
|
|
91
|
-
config: 'vite.renderer.config.mts',
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
}),
|
|
95
|
-
// Fuses are used to enable/disable various Electron functionality
|
|
96
|
-
// at package time, before code signing the application
|
|
97
|
-
new FusesPlugin({
|
|
98
|
-
version: FuseVersion.V1,
|
|
99
|
-
[FuseV1Options.RunAsNode]: false,
|
|
100
|
-
[FuseV1Options.EnableCookieEncryption]: true,
|
|
101
|
-
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
|
102
|
-
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
|
103
|
-
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
|
104
|
-
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
|
105
|
-
}),
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export default config;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<title>Hello World!</title>
|
|
6
|
-
</head>
|
|
7
|
-
<body>
|
|
8
|
-
<h1>💖 Hello World!</h1>
|
|
9
|
-
<p>Welcome to your Electron application.</p>
|
|
10
|
-
<script type="module" src="/src/renderer.ts"></script>
|
|
11
|
-
</body>
|
|
12
|
-
</html>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "desktop",
|
|
3
|
-
"productName": "desktop",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"private": true,
|
|
6
|
-
"description": "My Electron application description",
|
|
7
|
-
"keywords": [],
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"author": {
|
|
10
|
-
"name": "vivek-yast",
|
|
11
|
-
"email": "vivek@yast.ai"
|
|
12
|
-
},
|
|
13
|
-
"main": ".vite/build/main.cjs",
|
|
14
|
-
"packageManager": "bun@1.4.4",
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=22.13.0"
|
|
17
|
-
},
|
|
18
|
-
"scripts": {
|
|
19
|
-
"dev": "electron-forge start",
|
|
20
|
-
"start": "electron-forge start",
|
|
21
|
-
"build": "electron-forge package",
|
|
22
|
-
"package": "electron-forge package",
|
|
23
|
-
"make": "electron-forge make",
|
|
24
|
-
"make:windows": "electron-forge make --platform=win32 --arch=x64",
|
|
25
|
-
"make:linux": "electron-forge make --platform=linux --arch=x64",
|
|
26
|
-
"make:macos": "electron-forge make --platform=darwin --arch=arm64",
|
|
27
|
-
"lint": "oxlint && oxfmt --check",
|
|
28
|
-
"lint:fix": "oxlint --fix && oxfmt --write",
|
|
29
|
-
"format": "oxfmt --write",
|
|
30
|
-
"typecheck": "tsc --noEmit",
|
|
31
|
-
"preview": "bun build-ci.mjs"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"electron-squirrel-startup": "^1.0.1"
|
|
35
|
-
},
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@electron-forge/cli": "8.0.1",
|
|
38
|
-
"@electron-forge/maker-deb": "8.0.1",
|
|
39
|
-
"@electron-forge/maker-dmg": "8.0.1",
|
|
40
|
-
"@electron-forge/maker-rpm": "8.0.1",
|
|
41
|
-
"@electron-forge/maker-squirrel": "8.0.1",
|
|
42
|
-
"@electron-forge/plugin-fuses": "8.0.1",
|
|
43
|
-
"@electron-forge/plugin-vite": "8.0.1",
|
|
44
|
-
"@electron-forge/shared-types": "8.0.1",
|
|
45
|
-
"@electron/fuses": "^2.1.3",
|
|
46
|
-
"@types/electron-squirrel-startup": "^1.0.2",
|
|
47
|
-
"@types/node": "^24",
|
|
48
|
-
"electron": "45.2.1",
|
|
49
|
-
"oxfmt": "^0.75.0",
|
|
50
|
-
"oxlint": "^1.90.0",
|
|
51
|
-
"typescript": "^6.0.2",
|
|
52
|
-
"vite": "^8",
|
|
53
|
-
"@electron-forge/publisher-github": "8.0.1"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { app, BrowserWindow } from 'electron';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import started from 'electron-squirrel-startup';
|
|
4
|
-
|
|
5
|
-
// Handle creating/removing shortcuts on Windows when installing/uninstalling.
|
|
6
|
-
if (started) {
|
|
7
|
-
app.quit();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
const createWindow = () => {
|
|
11
|
-
// Create the browser window.
|
|
12
|
-
const mainWindow = new BrowserWindow({
|
|
13
|
-
width: 800,
|
|
14
|
-
height: 600,
|
|
15
|
-
webPreferences: {
|
|
16
|
-
preload: path.join(__dirname, 'preload.cjs'),
|
|
17
|
-
},
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// and load the index.html of the app.
|
|
21
|
-
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
|
22
|
-
mainWindow.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
|
|
23
|
-
} else {
|
|
24
|
-
mainWindow.loadFile(
|
|
25
|
-
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`),
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Open the DevTools.
|
|
30
|
-
mainWindow.webContents.openDevTools();
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
// This method will be called when Electron has finished
|
|
34
|
-
// initialization and is ready to create browser windows.
|
|
35
|
-
// Some APIs can only be used after this event occurs.
|
|
36
|
-
app.whenReady().then(() => {
|
|
37
|
-
createWindow();
|
|
38
|
-
|
|
39
|
-
// On OS X it's common to re-create a window in the app when the
|
|
40
|
-
// dock icon is clicked and there are no other windows open.
|
|
41
|
-
app.on('activate', () => {
|
|
42
|
-
if (BrowserWindow.getAllWindows().length === 0) {
|
|
43
|
-
createWindow();
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Quit when all windows are closed, except on macOS. There, it's common
|
|
49
|
-
// for applications and their menu bar to stay active until the user quits
|
|
50
|
-
// explicitly with Cmd + Q.
|
|
51
|
-
app.on('window-all-closed', () => {
|
|
52
|
-
if (process.platform !== 'darwin') {
|
|
53
|
-
app.quit();
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
// In this file you can include the rest of your app's specific main process
|
|
58
|
-
// code. You can also put them in separate files and import them here.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file will automatically be loaded by vite and run in the "renderer" context.
|
|
3
|
-
* To learn more about the differences between the "main" and the "renderer" context in
|
|
4
|
-
* Electron, visit:
|
|
5
|
-
*
|
|
6
|
-
* https://electronjs.org/docs/tutorial/process-model
|
|
7
|
-
*
|
|
8
|
-
* By default, Node.js integration in this file is disabled. When enabling Node.js integration
|
|
9
|
-
* in a renderer process, please be aware of potential security implications. You can read
|
|
10
|
-
* more about security risks here:
|
|
11
|
-
*
|
|
12
|
-
* https://electronjs.org/docs/tutorial/security
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import './index.css';
|
|
16
|
-
|
|
17
|
-
console.log(
|
|
18
|
-
'👋 This message is being logged by the renderer process, included via Vite',
|
|
19
|
-
);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "preserve",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"allowJs": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"noImplicitAny": true,
|
|
10
|
-
"sourceMap": true,
|
|
11
|
-
"resolveJsonModule": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*", "*.ts", "*.mts"]
|
|
14
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { createFileRoute, Link } from "@tanstack/react-router";
|
|
2
|
-
import { useQuery } from "convex/react";
|
|
3
|
-
import { api } from "../../../../../../packages/backend/convex/_generated/api";
|
|
4
|
-
import type { Id } from "../../../../../../packages/backend/convex/_generated/dataModel";
|
|
5
|
-
|
|
6
|
-
export const Route = createFileRoute("/_providers/_authenticated/todos/$id")({
|
|
7
|
-
component: Todo,
|
|
8
|
-
errorComponent: () => <p role="alert">Unable to load todo.</p>,
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
function Todo() {
|
|
12
|
-
const { id } = Route.useParams();
|
|
13
|
-
const todo = useQuery(api.todos.index.get, { id: id as Id<"todos"> });
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<main>
|
|
17
|
-
<Link to="/todos">Todos</Link>
|
|
18
|
-
{todo === undefined ? (
|
|
19
|
-
<p>Loading todo…</p>
|
|
20
|
-
) : todo === null ? (
|
|
21
|
-
<p>Todo not found.</p>
|
|
22
|
-
) : (
|
|
23
|
-
<h1>{todo.title}</h1>
|
|
24
|
-
)}
|
|
25
|
-
</main>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createFileRoute, Link } from "@tanstack/react-router";
|
|
2
|
-
import { useQuery } from "convex/react";
|
|
3
|
-
import { api } from "../../../../../../packages/backend/convex/_generated/api";
|
|
4
|
-
|
|
5
|
-
export const Route = createFileRoute("/_providers/_authenticated/todos/")({
|
|
6
|
-
component: Todos,
|
|
7
|
-
errorComponent: () => <p role="alert">Unable to load todos.</p>,
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
function Todos() {
|
|
11
|
-
const todos = useQuery(api.todos.index.list, {});
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<main>
|
|
15
|
-
<h1>Todos</h1>
|
|
16
|
-
{todos === undefined ? (
|
|
17
|
-
<p>Loading todos…</p>
|
|
18
|
-
) : todos.length === 0 ? (
|
|
19
|
-
<p>No todos yet.</p>
|
|
20
|
-
) : (
|
|
21
|
-
<ul>
|
|
22
|
-
{todos.map((todo) => (
|
|
23
|
-
<li key={todo._id}>
|
|
24
|
-
<Link to="/todos/$id" params={{ id: todo._id }}>
|
|
25
|
-
{todo.title}
|
|
26
|
-
</Link>
|
|
27
|
-
</li>
|
|
28
|
-
))}
|
|
29
|
-
</ul>
|
|
30
|
-
)}
|
|
31
|
-
</main>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { getAuthUserId } from "@convex-dev/auth/server";
|
|
2
|
-
import { ConvexError, v } from "convex/values";
|
|
3
|
-
import { internal } from "../_generated/api";
|
|
4
|
-
import type { Doc } from "../_generated/dataModel";
|
|
5
|
-
import { query } from "../_generated/server";
|
|
6
|
-
import schema from "../schema";
|
|
7
|
-
|
|
8
|
-
export const list = query({
|
|
9
|
-
args: {},
|
|
10
|
-
returns: v.array(schema.doc("todos")),
|
|
11
|
-
handler: async (ctx): Promise<Doc<"todos">[]> => {
|
|
12
|
-
const userId = await getAuthUserId(ctx);
|
|
13
|
-
if (!userId) throw new ConvexError("Not signed in");
|
|
14
|
-
return await ctx.runQuery(internal.todos.internal.list, { userId });
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export const get = query({
|
|
19
|
-
args: { id: v.id("todos") },
|
|
20
|
-
returns: v.union(schema.doc("todos"), v.null()),
|
|
21
|
-
handler: async (ctx, { id }): Promise<Doc<"todos"> | null> => {
|
|
22
|
-
const userId = await getAuthUserId(ctx);
|
|
23
|
-
if (!userId) throw new ConvexError("Not signed in");
|
|
24
|
-
return await ctx.runQuery(internal.todos.internal.get, { userId, id });
|
|
25
|
-
},
|
|
26
|
-
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
identityFields,
|
|
3
|
-
internalMutation,
|
|
4
|
-
internalQuery,
|
|
5
|
-
} from "@disposabl/disposabl-kit/server/lib/functions";
|
|
6
|
-
import { ConvexError, v } from "convex/values";
|
|
7
|
-
import schema from "../schema";
|
|
8
|
-
|
|
9
|
-
export const create = internalMutation({
|
|
10
|
-
platforms: true,
|
|
11
|
-
args: { ...identityFields, title: v.string() },
|
|
12
|
-
returns: v.id("todos"),
|
|
13
|
-
handler: async (ctx, { userId, title }) => {
|
|
14
|
-
const trimmed = title.trim();
|
|
15
|
-
if (!trimmed || trimmed.length > 500) {
|
|
16
|
-
throw new ConvexError("Todo title must contain 1 to 500 characters.");
|
|
17
|
-
}
|
|
18
|
-
return await ctx.db.insert("todos", { userId, title: trimmed });
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
export const list = internalQuery({
|
|
23
|
-
platforms: true,
|
|
24
|
-
args: { ...identityFields },
|
|
25
|
-
returns: v.array(schema.doc("todos")),
|
|
26
|
-
handler: async (ctx, { userId }) => {
|
|
27
|
-
return await ctx.db
|
|
28
|
-
.query("todos")
|
|
29
|
-
.withIndex("by_userId", (q) => q.eq("userId", userId))
|
|
30
|
-
.order("desc")
|
|
31
|
-
.take(100);
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export const get = internalQuery({
|
|
36
|
-
platforms: true,
|
|
37
|
-
args: { ...identityFields, id: v.id("todos") },
|
|
38
|
-
returns: v.union(schema.doc("todos"), v.null()),
|
|
39
|
-
handler: async (ctx, { userId, id }) => {
|
|
40
|
-
const todo = await ctx.db.get("todos", id);
|
|
41
|
-
return todo?.userId === userId ? todo : null;
|
|
42
|
-
},
|
|
43
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { v } from "convex/values";
|
|
2
|
-
import { internalMutation } from "@disposabl/disposabl-kit/server/lib/functions";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Create the user row for a new password account and return its id. This
|
|
6
|
-
* example keeps no data in the row, but your app can put a profile here.
|
|
7
|
-
*/
|
|
8
|
-
export const createUser = internalMutation({
|
|
9
|
-
args: {
|
|
10
|
-
provider: v.object({
|
|
11
|
-
name: v.literal("password"),
|
|
12
|
-
accountId: v.string(),
|
|
13
|
-
profile: v.object({}),
|
|
14
|
-
}),
|
|
15
|
-
},
|
|
16
|
-
returns: v.id("users"),
|
|
17
|
-
handler: async (ctx) => {
|
|
18
|
-
return await ctx.db.insert("users", {});
|
|
19
|
-
},
|
|
20
|
-
});
|