create-disposabl-app 0.4.2 → 0.5.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.
Files changed (80) hide show
  1. package/README.md +6 -0
  2. package/dist/index.js +67 -57
  3. package/dist/templates/default/apps/docs/README.md +37 -0
  4. package/dist/templates/default/apps/docs/content/guides/writing.mdx +15 -0
  5. package/dist/templates/default/apps/docs/content/index.mdx +10 -0
  6. package/dist/templates/default/apps/docs/package.json +29 -1
  7. package/dist/templates/default/apps/docs/press.config.ts +20 -0
  8. package/dist/templates/default/apps/docs/src/app.css +4 -0
  9. package/dist/templates/default/apps/docs/tsconfig.json +14 -0
  10. package/dist/templates/default/apps/docs/vite.config.ts +8 -0
  11. package/dist/templates/default/apps/mobile/.env.example +2 -0
  12. package/dist/templates/default/apps/mobile/README.md +63 -4
  13. package/dist/templates/default/apps/mobile/app.json +2 -0
  14. package/dist/templates/default/apps/mobile/package.json +16 -3
  15. package/dist/templates/default/apps/mobile/src/app/(auth)/_layout.tsx +1 -0
  16. package/dist/templates/default/apps/mobile/src/app/(auth)/login.tsx +1 -0
  17. package/dist/templates/default/apps/mobile/src/app/(auth)/signup.tsx +1 -0
  18. package/dist/templates/default/apps/mobile/src/app/(authenticated)/_layout.tsx +1 -0
  19. package/dist/templates/default/apps/mobile/src/app/(authenticated)/account.tsx +1 -0
  20. package/dist/templates/default/apps/mobile/src/app/_layout.tsx +1 -5
  21. package/dist/templates/default/apps/mobile/src/app/index.tsx +1 -17
  22. package/dist/templates/default/apps/mobile/tsconfig.json +8 -1
  23. package/dist/templates/default/apps/web/package.json +2 -1
  24. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.api-keys.tsx +1 -1
  25. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +2 -0
  26. package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +1 -1
  27. package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +1 -1
  28. package/dist/templates/default/apps/web/tests/auth-branches.test.tsx +44 -0
  29. package/dist/templates/default/apps/web/vite.config.ts +15 -0
  30. package/dist/templates/default/bun.lock +564 -18
  31. package/dist/templates/default/disposabl.json +2 -13
  32. package/dist/templates/default/packages/backend/convex/users.ts +23 -0
  33. package/dist/templates/default/packages/disposabl-kit/client/components/ui/log-out.tsx +16 -0
  34. package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +6 -3
  35. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +1 -1
  36. package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +1 -1
  37. package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/route.tsx +25 -16
  38. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +1 -1
  39. package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +23 -2
  40. package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +20 -9
  41. package/dist/templates/default/packages/disposabl-kit/eslint.config.js +1 -1
  42. package/dist/templates/default/packages/disposabl-kit/features.ts +4 -0
  43. package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-form.tsx +125 -0
  44. package/dist/templates/default/packages/disposabl-kit/mobile/components/auth-ui.tsx +107 -0
  45. package/dist/templates/default/packages/disposabl-kit/mobile/expo-plugin.cjs +26 -0
  46. package/dist/templates/default/packages/disposabl-kit/mobile/index.ts +10 -0
  47. package/dist/templates/default/packages/disposabl-kit/mobile/layout.tsx +101 -0
  48. package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-errors.ts +40 -0
  49. package/dist/templates/default/packages/disposabl-kit/mobile/lib/auth-storage.ts +9 -0
  50. package/dist/templates/default/packages/disposabl-kit/mobile/lib/convex.ts +1 -0
  51. package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +67 -0
  52. package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +50 -0
  53. package/dist/templates/default/packages/disposabl-kit/mobile/screens/login.tsx +5 -0
  54. package/dist/templates/default/packages/disposabl-kit/mobile/screens/signup.tsx +5 -0
  55. package/dist/templates/default/packages/disposabl-kit/package.json +24 -1
  56. package/dist/templates/default/packages/disposabl-kit/platforms.ts +1 -27
  57. package/dist/templates/default/packages/disposabl-kit/server/http.ts +6 -0
  58. package/dist/templates/default/packages/disposabl-kit/server/lib/docs.test.ts +111 -0
  59. package/dist/templates/default/packages/disposabl-kit/server/lib/docs.ts +62 -0
  60. package/dist/templates/default/packages/disposabl-kit/tsconfig.json +1 -1
  61. package/dist/templates/default/turbo.json +7 -0
  62. package/package.json +1 -1
  63. package/dist/templates/default/apps/blog/package.json +0 -1
  64. package/dist/templates/default/apps/changelog/package.json +0 -1
  65. package/dist/templates/default/apps/desktop/.oxfmtrc.json +0 -5
  66. package/dist/templates/default/apps/desktop/.oxlintrc.json +0 -6
  67. package/dist/templates/default/apps/desktop/README.md +0 -88
  68. package/dist/templates/default/apps/desktop/build-ci.mjs +0 -56
  69. package/dist/templates/default/apps/desktop/forge.config.mts +0 -109
  70. package/dist/templates/default/apps/desktop/index.html +0 -12
  71. package/dist/templates/default/apps/desktop/package.json +0 -55
  72. package/dist/templates/default/apps/desktop/src/declarations.d.ts +0 -2
  73. package/dist/templates/default/apps/desktop/src/index.css +0 -8
  74. package/dist/templates/default/apps/desktop/src/main.ts +0 -58
  75. package/dist/templates/default/apps/desktop/src/preload.ts +0 -3
  76. package/dist/templates/default/apps/desktop/src/renderer.ts +0 -19
  77. package/dist/templates/default/apps/desktop/tsconfig.json +0 -14
  78. package/dist/templates/default/apps/desktop/vite.main.config.mts +0 -4
  79. package/dist/templates/default/apps/desktop/vite.preload.config.mts +0 -4
  80. package/dist/templates/default/apps/desktop/vite.renderer.config.mts +0 -4
@@ -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,2 +0,0 @@
1
- /// <reference types="@electron-forge/plugin-vite/forge-vite-env" />
2
- declare module '*.css';
@@ -1,8 +0,0 @@
1
- body {
2
- font-family:
3
- -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial,
4
- sans-serif;
5
- margin: auto;
6
- max-width: 38rem;
7
- padding: 2rem;
8
- }
@@ -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,3 +0,0 @@
1
- // oxlint-disable eslint-plugin-unicorn/no-empty-file
2
- // See the Electron documentation for details on how to use preload scripts:
3
- // https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
@@ -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,4 +0,0 @@
1
- import { defineConfig } from 'vite';
2
-
3
- // https://vitejs.dev/config
4
- export default defineConfig({});
@@ -1,4 +0,0 @@
1
- import { defineConfig } from 'vite';
2
-
3
- // https://vitejs.dev/config
4
- export default defineConfig({});
@@ -1,4 +0,0 @@
1
- import { defineConfig } from 'vite';
2
-
3
- // https://vitejs.dev/config
4
- export default defineConfig({});