create-disposabl-app 0.8.1 → 0.8.2
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/dist/disposabl.js +36 -2
- package/dist/index.js +73 -5
- package/dist/templates/default/.github/scripts/apple.sh +62 -0
- package/dist/templates/default/.github/scripts/disposabl.mjs +31 -14
- package/dist/templates/default/.github/scripts/mobile.sh +9 -9
- package/dist/templates/default/.github/scripts/platforms.sh +3 -3
- package/dist/templates/default/.github/scripts/release.sh +1 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +115 -6
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +5 -0
- package/dist/templates/default/apps/desktop/.oxlintrc.json +6 -0
- package/dist/templates/default/apps/desktop/README.md +90 -0
- package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +124 -0
- package/dist/templates/default/apps/desktop/gitignore +146 -0
- package/dist/templates/default/apps/desktop/index.html +16 -0
- package/dist/templates/default/apps/desktop/package.json +55 -0
- package/dist/templates/default/apps/desktop/rpm.spec.ejs +84 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.icns +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.ico +0 -0
- package/dist/templates/default/apps/desktop/src/assets/icon.png +0 -0
- package/dist/templates/default/apps/desktop/src/assets/logo.svg +8 -0
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +4 -0
- package/dist/templates/default/apps/desktop/src/index.css +27 -0
- package/dist/templates/default/apps/desktop/src/main.ts +54 -0
- package/dist/templates/default/apps/desktop/src/preload.ts +3 -0
- package/dist/templates/default/apps/desktop/src/renderer.ts +1 -0
- package/dist/templates/default/apps/desktop/tsconfig.json +14 -0
- package/dist/templates/default/apps/desktop/vite.main.config.mts +9 -0
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +4 -0
- package/dist/templates/default/apps/mobile/README.md +1 -1
- package/dist/templates/default/apps/mobile/eas.json +2 -2
- package/dist/templates/default/apps/web/src/components/connections/provider-logo.tsx +38 -0
- package/dist/templates/default/apps/web/src/index.css +0 -22
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.connections.tsx +244 -153
- package/dist/templates/default/bun.lock +4 -0
- package/dist/templates/default/dev.ts +22 -6
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +10 -0
- package/dist/templates/default/packages/backend/convex/apps/actions/cleanup.ts +1 -0
- package/dist/templates/default/packages/backend/convex/apps/internal.ts +17 -1
- package/dist/templates/default/packages/backend/convex/connections/actions/github.ts +5 -4
- package/dist/templates/default/packages/backend/convex/connections/actions/oauth.ts +2 -2
- package/dist/templates/default/packages/backend/convex/downloads/action.ts +136 -0
- package/dist/templates/default/packages/backend/convex/downloads/http.ts +32 -0
- package/dist/templates/default/packages/backend/convex/downloads/internal.ts +58 -0
- package/dist/templates/default/packages/backend/convex/github/actions/http.ts +37 -8
- package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +1 -0
- package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +1 -1
- package/dist/templates/default/packages/backend/convex/github/actions/secrets.ts +38 -6
- package/dist/templates/default/packages/backend/convex/github/actions/signing.ts +41 -0
- package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +82 -16
- package/dist/templates/default/packages/backend/convex/github/identityCache.ts +54 -0
- package/dist/templates/default/packages/backend/convex/http.ts +3 -0
- package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +21 -3
- package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +17 -2
- package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +4 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +7 -0
- package/dist/templates/default/packages/backend/generated/openapi.json +107 -1
- package/dist/templates/default/packages/backend/generated/platforms.ts +12 -10
- package/dist/templates/default/packages/backend/package.json +3 -1
- package/dist/templates/default/packages/cli/preview.ts +63 -0
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +3 -0
- package/dist/templates/default/packages/sdk/src/generated/index.ts +5 -0
- package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +20 -0
- package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +69 -0
- package/dist/templates/default/packages/skill/SKILL.md +38 -0
- package/package.json +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
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.
|
|
89
|
+
|
|
90
|
+
The desktop window uses the web app at `http://localhost:3000` during development. Packaged builds use the `CONVEX_SITE_URL` supplied at build time. This shares the same home, login/signup, and authentication-disabled behavior. If the website is unavailable, a bundled Disposabl starter home is shown.
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { resolve } from 'node:path';
|
|
2
|
+
import manifest from './package.json' with { type: 'json' };
|
|
3
|
+
import type { ForgeConfig } from '@electron-forge/shared-types';
|
|
4
|
+
import { MakerSquirrel } from '@electron-forge/maker-squirrel';
|
|
5
|
+
import { MakerDMG } from '@electron-forge/maker-dmg';
|
|
6
|
+
import { MakerDeb } from '@electron-forge/maker-deb';
|
|
7
|
+
import { MakerRpm } from '@electron-forge/maker-rpm';
|
|
8
|
+
import { VitePlugin } from '@electron-forge/plugin-vite';
|
|
9
|
+
import { FusesPlugin } from '@electron-forge/plugin-fuses';
|
|
10
|
+
import { FuseV1Options, FuseVersion } from '@electron/fuses';
|
|
11
|
+
|
|
12
|
+
const executableName = manifest.productName
|
|
13
|
+
.toLowerCase()
|
|
14
|
+
.replace(/[^a-z0-9-]/g, '-');
|
|
15
|
+
|
|
16
|
+
// specTemplate is supported by electron-installer-redhat but absent from Forge's types.
|
|
17
|
+
const rpmOptions = {
|
|
18
|
+
name: executableName,
|
|
19
|
+
bin: executableName,
|
|
20
|
+
specTemplate: resolve('rpm.spec.ejs'),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const signedRelease =
|
|
24
|
+
process.platform === 'darwin' && process.env.MACOS_NOTARIZE === 'true';
|
|
25
|
+
if (
|
|
26
|
+
signedRelease &&
|
|
27
|
+
(!process.env.APPLE_API_KEY ||
|
|
28
|
+
!process.env.APPLE_API_KEY_ID ||
|
|
29
|
+
!process.env.APPLE_API_ISSUER)
|
|
30
|
+
)
|
|
31
|
+
throw new Error('macOS releases require Apple notarization credentials');
|
|
32
|
+
|
|
33
|
+
const config: ForgeConfig = {
|
|
34
|
+
packagerConfig: {
|
|
35
|
+
asar: true,
|
|
36
|
+
executableName,
|
|
37
|
+
icon: 'src/assets/icon',
|
|
38
|
+
appBundleId: process.env.MACOS_BUNDLE_ID || 'dev.disposabl.starter.desktop',
|
|
39
|
+
...(process.platform === 'darwin'
|
|
40
|
+
? {
|
|
41
|
+
osxSign: signedRelease
|
|
42
|
+
? {}
|
|
43
|
+
: {
|
|
44
|
+
identity: '-',
|
|
45
|
+
identityValidation: false,
|
|
46
|
+
optionsForFile: () => ({
|
|
47
|
+
hardenedRuntime: false,
|
|
48
|
+
timestamp: 'none',
|
|
49
|
+
}),
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
: {}),
|
|
53
|
+
...(signedRelease
|
|
54
|
+
? {
|
|
55
|
+
osxNotarize: {
|
|
56
|
+
appleApiKey: process.env.APPLE_API_KEY!,
|
|
57
|
+
appleApiKeyId: process.env.APPLE_API_KEY_ID!,
|
|
58
|
+
appleApiIssuer: process.env.APPLE_API_ISSUER!,
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
: {}),
|
|
62
|
+
download: {
|
|
63
|
+
cacheRoot: process.env.electron_config_cache,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
rebuildConfig: {},
|
|
67
|
+
hooks: {
|
|
68
|
+
prePackage: async (_config, platform, arch) => {
|
|
69
|
+
const supported =
|
|
70
|
+
(platform === 'darwin' && arch === 'arm64') ||
|
|
71
|
+
((platform === 'win32' || platform === 'linux') && arch === 'x64');
|
|
72
|
+
|
|
73
|
+
if (!supported) {
|
|
74
|
+
throw new Error(
|
|
75
|
+
`Unsupported desktop target ${platform}/${arch}. Use Windows x64, Linux x64, or macOS arm64.`,
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
makers: [
|
|
81
|
+
new MakerSquirrel({ setupIcon: 'src/assets/icon.ico' }),
|
|
82
|
+
new MakerDMG({ format: 'ULFO' }),
|
|
83
|
+
new MakerRpm({ options: rpmOptions }),
|
|
84
|
+
new MakerDeb({ options: { name: executableName, bin: executableName } }),
|
|
85
|
+
],
|
|
86
|
+
plugins: [
|
|
87
|
+
new VitePlugin({
|
|
88
|
+
// `build` can specify multiple entry builds, which can be Main process, Preload scripts, Worker process, etc.
|
|
89
|
+
// If you are familiar with Vite configuration, it will look really familiar.
|
|
90
|
+
build: [
|
|
91
|
+
{
|
|
92
|
+
// `entry` is just an alias for `build.lib.entry` in the corresponding file of `config`.
|
|
93
|
+
entry: 'src/main.ts',
|
|
94
|
+
config: 'vite.main.config.mts',
|
|
95
|
+
target: 'main',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
entry: 'src/preload.ts',
|
|
99
|
+
config: 'vite.preload.config.mts',
|
|
100
|
+
target: 'preload',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
renderer: [
|
|
104
|
+
{
|
|
105
|
+
name: 'main_window',
|
|
106
|
+
config: 'vite.renderer.config.mts',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
}),
|
|
110
|
+
// Fuses are used to enable/disable various Electron functionality
|
|
111
|
+
// at package time, before code signing the application
|
|
112
|
+
new FusesPlugin({
|
|
113
|
+
version: FuseVersion.V1,
|
|
114
|
+
[FuseV1Options.RunAsNode]: false,
|
|
115
|
+
[FuseV1Options.EnableCookieEncryption]: true,
|
|
116
|
+
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
|
|
117
|
+
[FuseV1Options.EnableNodeCliInspectArguments]: false,
|
|
118
|
+
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
|
|
119
|
+
[FuseV1Options.OnlyLoadAppFromAsar]: true,
|
|
120
|
+
}),
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export default config;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
lerna-debug.log*
|
|
8
|
+
|
|
9
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
10
|
+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
11
|
+
|
|
12
|
+
# Runtime data
|
|
13
|
+
pids
|
|
14
|
+
*.pid
|
|
15
|
+
*.seed
|
|
16
|
+
*.pid.lock
|
|
17
|
+
|
|
18
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
19
|
+
lib-cov
|
|
20
|
+
|
|
21
|
+
# Coverage directory used by tools like istanbul
|
|
22
|
+
coverage
|
|
23
|
+
*.lcov
|
|
24
|
+
|
|
25
|
+
# nyc test coverage
|
|
26
|
+
.nyc_output
|
|
27
|
+
|
|
28
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
29
|
+
.grunt
|
|
30
|
+
|
|
31
|
+
# Bower dependency directory (https://bower.io/)
|
|
32
|
+
bower_components
|
|
33
|
+
|
|
34
|
+
# node-waf configuration
|
|
35
|
+
.lock-wscript
|
|
36
|
+
|
|
37
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
38
|
+
build/Release
|
|
39
|
+
|
|
40
|
+
# Dependency directories
|
|
41
|
+
node_modules/
|
|
42
|
+
jspm_packages/
|
|
43
|
+
|
|
44
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
45
|
+
web_modules/
|
|
46
|
+
|
|
47
|
+
# TypeScript cache
|
|
48
|
+
*.tsbuildinfo
|
|
49
|
+
|
|
50
|
+
# Optional npm cache directory
|
|
51
|
+
.npm
|
|
52
|
+
|
|
53
|
+
# Optional oxlint cache
|
|
54
|
+
.oxlintcache
|
|
55
|
+
|
|
56
|
+
# Optional stylelint cache
|
|
57
|
+
.stylelintcache
|
|
58
|
+
|
|
59
|
+
# Optional REPL history
|
|
60
|
+
.node_repl_history
|
|
61
|
+
|
|
62
|
+
# Output of 'npm pack'
|
|
63
|
+
*.tgz
|
|
64
|
+
|
|
65
|
+
# Yarn Integrity file
|
|
66
|
+
.yarn-integrity
|
|
67
|
+
|
|
68
|
+
# dotenv environment variable files
|
|
69
|
+
.env
|
|
70
|
+
.env.*
|
|
71
|
+
!.env.example
|
|
72
|
+
|
|
73
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
74
|
+
.cache
|
|
75
|
+
.parcel-cache
|
|
76
|
+
|
|
77
|
+
# Next.js build output
|
|
78
|
+
.next
|
|
79
|
+
out
|
|
80
|
+
|
|
81
|
+
# Nuxt.js build / generate output
|
|
82
|
+
.nuxt
|
|
83
|
+
dist
|
|
84
|
+
.output
|
|
85
|
+
|
|
86
|
+
# Gatsby files
|
|
87
|
+
.cache/
|
|
88
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
89
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
90
|
+
# public
|
|
91
|
+
|
|
92
|
+
# vuepress build output
|
|
93
|
+
.vuepress/dist
|
|
94
|
+
|
|
95
|
+
# vuepress v2.x temp directory
|
|
96
|
+
.temp
|
|
97
|
+
|
|
98
|
+
# Sveltekit cache directory
|
|
99
|
+
.svelte-kit/
|
|
100
|
+
|
|
101
|
+
# vitepress build output
|
|
102
|
+
**/.vitepress/dist
|
|
103
|
+
|
|
104
|
+
# vitepress cache directory
|
|
105
|
+
**/.vitepress/cache
|
|
106
|
+
|
|
107
|
+
# Docusaurus cache and generated files
|
|
108
|
+
.docusaurus
|
|
109
|
+
|
|
110
|
+
# Serverless directories
|
|
111
|
+
.serverless/
|
|
112
|
+
|
|
113
|
+
# FuseBox cache
|
|
114
|
+
.fusebox/
|
|
115
|
+
|
|
116
|
+
# DynamoDB Local files
|
|
117
|
+
.dynamodb/
|
|
118
|
+
|
|
119
|
+
# Firebase cache directory
|
|
120
|
+
.firebase/
|
|
121
|
+
|
|
122
|
+
# TernJS port file
|
|
123
|
+
.tern-port
|
|
124
|
+
|
|
125
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
126
|
+
.vscode-test
|
|
127
|
+
|
|
128
|
+
# pnpm
|
|
129
|
+
.pnpm-store
|
|
130
|
+
|
|
131
|
+
# yarn v3
|
|
132
|
+
.pnp.*
|
|
133
|
+
.yarn/*
|
|
134
|
+
!.yarn/patches
|
|
135
|
+
!.yarn/plugins
|
|
136
|
+
!.yarn/releases
|
|
137
|
+
!.yarn/sdks
|
|
138
|
+
!.yarn/versions
|
|
139
|
+
|
|
140
|
+
# Vite files
|
|
141
|
+
vite.config.js.timestamp-*
|
|
142
|
+
vite.config.ts.timestamp-*
|
|
143
|
+
.vite/
|
|
144
|
+
|
|
145
|
+
# Electron-Forge
|
|
146
|
+
out/
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>Disposabl</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<main>
|
|
10
|
+
<img src="/src/assets/logo.svg" alt="Disposabl" />
|
|
11
|
+
<h1>Welcome to Disposabl</h1>
|
|
12
|
+
<p>Your desktop app is ready. Start building something great.</p>
|
|
13
|
+
</main>
|
|
14
|
+
<script type="module" src="/src/renderer.ts"></script>
|
|
15
|
+
</body>
|
|
16
|
+
</html>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "desktop",
|
|
3
|
+
"productName": "Disposabl",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "Disposabl desktop starter",
|
|
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
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<% /* Adapted from electron-installer-redhat 4.0.0.
|
|
2
|
+
Copyright (c) 2016 Daniel Perez Alvarez
|
|
3
|
+
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
5
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
6
|
+
the Software without restriction, including without limitation the rights to
|
|
7
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
8
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
9
|
+
so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
|
21
|
+
*/ %>
|
|
22
|
+
%define _binary_payload w<%= compressionLevel %>.xzdio
|
|
23
|
+
|
|
24
|
+
%if "%{_host_cpu}" != "%{_target_cpu}"
|
|
25
|
+
%global __strip /bin/true
|
|
26
|
+
%endif
|
|
27
|
+
|
|
28
|
+
Name: <%= name %>
|
|
29
|
+
Version: <%= version %>
|
|
30
|
+
Release: <%= revision %>%{?dist}
|
|
31
|
+
<% if (description) { print(`Summary: ${description}\n`) }
|
|
32
|
+
%>
|
|
33
|
+
<% if (license) { print(`License: ${license}\n`) }
|
|
34
|
+
if (homepage) { print(`URL: ${homepage}\n`) }
|
|
35
|
+
if (license || homepage) { print('\n') }
|
|
36
|
+
|
|
37
|
+
%>Requires: <%= requires.join(', ') %>
|
|
38
|
+
AutoReqProv: no
|
|
39
|
+
|
|
40
|
+
<% if (productDescription) {
|
|
41
|
+
%>%description
|
|
42
|
+
<% print(productDescription)
|
|
43
|
+
print('\n\n\n') }
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
%>%install
|
|
47
|
+
mkdir -p %{buildroot}/usr/
|
|
48
|
+
# The installer stages under BUILD/usr; RPM may enter a nested build directory.
|
|
49
|
+
cp <%= process.platform === 'darwin' ? '-R' : '-r' %> "%{_topdir}/BUILD/usr/"* "%{buildroot}/usr/"
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
%files
|
|
53
|
+
/usr/bin/<%= name %>
|
|
54
|
+
/usr/lib/<%= name %>/
|
|
55
|
+
/usr/share/applications/<%= name %>.desktop
|
|
56
|
+
/usr/share/doc/<%= name %>/
|
|
57
|
+
<% if (_.isObject(icon)) {
|
|
58
|
+
_.forEach(icon, function (path, resolution) {
|
|
59
|
+
%>/usr/share/icons/hicolor/<%= resolution %>/apps/<%= name %><%= resolution === 'symbolic' ? '-symbolic' : '' %>.<%= ['scalable', 'symbolic'].includes(resolution) ? 'svg' : 'png' %>
|
|
60
|
+
<% }) } else {
|
|
61
|
+
%>/usr/share/pixmaps/<%= name %>.png
|
|
62
|
+
<% } %>
|
|
63
|
+
|
|
64
|
+
<% if (pre) {
|
|
65
|
+
%>%pre
|
|
66
|
+
<% print(pre)
|
|
67
|
+
if (preun || post || postun) print('\n\n\n') }
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
%><% if (preun) {
|
|
71
|
+
%>%preun
|
|
72
|
+
<% print(preun)
|
|
73
|
+
if (post || postun) print('\n\n\n') }
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
%><% if (post) {
|
|
77
|
+
%>%post
|
|
78
|
+
<% print(post)
|
|
79
|
+
if (postun) print('\n\n\n') }
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
%><% if (postun) {
|
|
83
|
+
%>%postun
|
|
84
|
+
<% print(postun) } %>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill="#101A32" d="M616 142h166v740H616v-76c-52 53-119 80-201 80-151 0-274-123-274-274s123-274 274-274c74 0 141 28 201 80V142Zm-183 362c-61 0-110 49-110 109s49 109 110 109 110-49 110-109-49-109-110-109Z"/>
|
|
3
|
+
<rect x="285" y="413" width="331" height="315" rx="36" fill="#F8F5EF"/>
|
|
4
|
+
<path d="M285 489h331" stroke="#101A32" stroke-width="24"/>
|
|
5
|
+
<circle cx="336" cy="451" r="12" fill="#101A32"/>
|
|
6
|
+
<circle cx="375" cy="451" r="12" fill="#101A32" opacity=".42"/>
|
|
7
|
+
<path d="m378 574 154-64v205l-154-75V574Z" fill="#FF6B57"/>
|
|
8
|
+
</svg>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
body {
|
|
2
|
+
margin: 0;
|
|
3
|
+
background: #f8f5ef;
|
|
4
|
+
color: #101a32;
|
|
5
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
6
|
+
}
|
|
7
|
+
main {
|
|
8
|
+
min-height: 100vh;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
text-align: center;
|
|
14
|
+
padding: 2rem;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
img {
|
|
18
|
+
width: 120px;
|
|
19
|
+
height: 120px;
|
|
20
|
+
}
|
|
21
|
+
h1 {
|
|
22
|
+
margin: 1rem 0 0.5rem;
|
|
23
|
+
}
|
|
24
|
+
p {
|
|
25
|
+
margin: 0;
|
|
26
|
+
color: #515d70;
|
|
27
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { app, BrowserWindow } from 'electron';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import started from 'electron-squirrel-startup';
|
|
4
|
+
|
|
5
|
+
if (started) app.quit();
|
|
6
|
+
|
|
7
|
+
async function createWindow() {
|
|
8
|
+
const window = new BrowserWindow({
|
|
9
|
+
title: 'Disposabl',
|
|
10
|
+
width: 1000,
|
|
11
|
+
height: 720,
|
|
12
|
+
webPreferences: {
|
|
13
|
+
sandbox: true,
|
|
14
|
+
contextIsolation: true,
|
|
15
|
+
nodeIntegration: false,
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
window.webContents.session.setPermissionRequestHandler(
|
|
19
|
+
(_contents, _permission, callback) => callback(false),
|
|
20
|
+
);
|
|
21
|
+
window.webContents.setWindowOpenHandler(() => ({ action: 'deny' }));
|
|
22
|
+
// Reuse the website's home, authentication and feature selection in the desktop app.
|
|
23
|
+
const website = app.isPackaged ? DISPOSABL_WEB_URL : 'http://localhost:3000';
|
|
24
|
+
if (website) {
|
|
25
|
+
const origin = new URL(website).origin;
|
|
26
|
+
if (app.isPackaged && !website.startsWith('https://'))
|
|
27
|
+
throw new Error('Desktop requires an HTTPS website.');
|
|
28
|
+
window.webContents.on('will-navigate', (event, url) => {
|
|
29
|
+
if (new URL(url).origin !== origin) event.preventDefault();
|
|
30
|
+
});
|
|
31
|
+
try {
|
|
32
|
+
await window.loadURL(website);
|
|
33
|
+
return;
|
|
34
|
+
} catch {
|
|
35
|
+
/* Show the starter home if the website is unavailable. */
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (MAIN_WINDOW_VITE_DEV_SERVER_URL)
|
|
39
|
+
await window.loadURL(MAIN_WINDOW_VITE_DEV_SERVER_URL);
|
|
40
|
+
else
|
|
41
|
+
await window.loadFile(
|
|
42
|
+
path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
app.whenReady().then(() => {
|
|
47
|
+
void createWindow();
|
|
48
|
+
app.on('activate', () => {
|
|
49
|
+
if (BrowserWindow.getAllWindows().length === 0) void createWindow();
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
app.on('window-all-closed', () => {
|
|
53
|
+
if (process.platform !== 'darwin') app.quit();
|
|
54
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './index.css';
|