@puredesktop/create-app 1.0.0-beta.1 → 2.1.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/bin/create-puredesktop-app.mjs +265 -115
- package/package.json +1 -1
- package/template/README.md +299 -16
- package/template/agents.md +11 -0
- package/template/gitignore.tpl +5 -5
- package/template/index.html +12 -12
- package/template/package.json +22 -21
- package/template/plugin.json +3 -2
- package/template/scripts/validate-puredesktop-app.mjs +277 -0
- package/template/src/App.tsx +49 -49
- package/template/src/bridge/platformBridge.ts +31 -31
- package/template/src/components/AppShell.tsx +31 -31
- package/template/src/constants.ts +1 -1
- package/template/src/hooks/useAppBoot.ts +45 -45
- package/template/src/main.tsx +9 -9
- package/template/src/types.ts +5 -5
- package/template/tsconfig.json +15 -15
- package/template/vite-env.d.ts +1 -1
- package/template/vite.config.js +28 -28
package/template/vite.config.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import react from '@vitejs/plugin-react-swc'
|
|
2
|
-
import { readFileSync } from 'node:fs'
|
|
3
|
-
import { dirname, join } from 'node:path'
|
|
4
|
-
import { fileURLToPath } from 'node:url'
|
|
5
|
-
import { defineConfig } from 'vite'
|
|
6
|
-
|
|
7
|
-
/** Keep Vite port in sync with plugin.json entrypoint.url. */
|
|
8
|
-
function devServerFromManifest(metaUrl) {
|
|
9
|
-
const appDir = dirname(fileURLToPath(metaUrl))
|
|
10
|
-
const manifest = JSON.parse(readFileSync(join(appDir, 'plugin.json'), 'utf8'))
|
|
11
|
-
const url = new URL(manifest.entrypoint.url)
|
|
12
|
-
return {
|
|
13
|
-
host: url.hostname,
|
|
14
|
-
port: Number(url.port),
|
|
15
|
-
strictPort: true,
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default defineConfig({
|
|
20
|
-
plugins: [
|
|
21
|
-
react({
|
|
22
|
-
plugins: [
|
|
23
|
-
['@swc/plugin-styled-components', { displayName: true, fileName: true }],
|
|
24
|
-
],
|
|
25
|
-
}),
|
|
26
|
-
],
|
|
27
|
-
server: devServerFromManifest(import.meta.url),
|
|
28
|
-
})
|
|
1
|
+
import react from '@vitejs/plugin-react-swc'
|
|
2
|
+
import { readFileSync } from 'node:fs'
|
|
3
|
+
import { dirname, join } from 'node:path'
|
|
4
|
+
import { fileURLToPath } from 'node:url'
|
|
5
|
+
import { defineConfig } from 'vite'
|
|
6
|
+
|
|
7
|
+
/** Keep Vite port in sync with plugin.json entrypoint.url. */
|
|
8
|
+
function devServerFromManifest(metaUrl) {
|
|
9
|
+
const appDir = dirname(fileURLToPath(metaUrl))
|
|
10
|
+
const manifest = JSON.parse(readFileSync(join(appDir, 'plugin.json'), 'utf8'))
|
|
11
|
+
const url = new URL(manifest.entrypoint.url)
|
|
12
|
+
return {
|
|
13
|
+
host: url.hostname,
|
|
14
|
+
port: Number(url.port),
|
|
15
|
+
strictPort: true,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default defineConfig({
|
|
20
|
+
plugins: [
|
|
21
|
+
react({
|
|
22
|
+
plugins: [
|
|
23
|
+
['@swc/plugin-styled-components', { displayName: true, fileName: true }],
|
|
24
|
+
],
|
|
25
|
+
}),
|
|
26
|
+
],
|
|
27
|
+
server: devServerFromManifest(import.meta.url),
|
|
28
|
+
})
|