Skip to content

Commit 0b546a1

Browse files
authored
Merge branch 'v3-alpha' into notifications_darwin
2 parents 75dbe85 + 9e2e980 commit 0b546a1

File tree

34 files changed

+269
-2632
lines changed

34 files changed

+269
-2632
lines changed

docs/src/content/docs/changelog.mdx

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7777
- Add prepared statement support to `sqlite` service with JS bindings by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
7878
- Add `SetMenu()` on window to allow for setting a menu on a window by [@leaanthony](https://github.com/leaanthony)
7979
- Add Notification support by [@popaprozac] in [#4098](https://github.com/wailsapp/wails/pull/4098)
80+
-  Add File Association support for mac by [@wimaha](https://github.com/wimaha) in [#4177](https://github.com/wailsapp/wails/pull/4177)
8081

8182
### Fixed
8283

@@ -112,6 +113,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
112113
- Fixed initially-hidden menu items by [@IanVS](https://github.com/IanVS) in [#4116](https://github.com/wailsapp/wails/pull/4116)
113114
- Fixed assetFileServer not serving `.html` files when non-extension request when `[request]` doesn't exist but `[request].html` does
114115
- Fixed icon generation paths by [@robin-samuel](https://github.com/robin-samuel) in [#4125](https://github.com/wailsapp/wails/pull/4125)
116+
- Fixed Dialogs runtime function returning escaped paths on Windows by [TheGB0077](https://github.com/TheGB0077) in [#4188](https://github.com/wailsapp/wails/pull/4188)
115117

116118
### Changed
117119

@@ -140,6 +142,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
140142
- Built-in service types are now consistently called `Service` by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
141143
- Built-in service creation functions with options are now consistently called `NewWithConfig` by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
142144
- `Select` method on `sqlite` service is now named `Query` for consistency with Go APIs by [@fbbdev](https://github.com/fbbdev) in [#4067](https://github.com/wailsapp/wails/pull/4067)
145+
- Templates: moved runtime to "dependencies", organized package.json files by [@IanVS](https://github.com/IanVS) in [#4133](https://github.com/wailsapp/wails/pull/4133)
146+
- Creates and ad-hoc signs app bundles in dev to enable certain macOS APIs by [@popaprozac] in [#4171](https://github.com/wailsapp/wails/pull/4171)
143147

144148
## v3.0.0-alpha.9 - 2025-01-13
145149

docs/src/content/docs/guides/file-associations.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fileAssociations:
6262
| description | Description shown in file properties | Windows |
6363
| iconName | Name of the icon file (without extension) in the build folder | All |
6464
| role | Application's role for this file type (e.g., `Editor`, `Viewer`) | macOS |
65+
| mimeType | MIME type for the file (e.g., `image/jpeg`) | macOS |
6566

6667
## Listening for File Open Events
6768

@@ -105,6 +106,8 @@ Let's walk through setting up file associations for a simple text editor:
105106
Run `wails3 generate icons --help` for more information.
106107
:::
107108

109+
- For macOS add copy statement like `cp build/darwin/documenticon.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources` in the `create:app:bundle:` task.
110+
108111
2. ### Configure File Associations
109112

110113
Edit the `build/config.yml` file to add your file associations:

docs/src/content/docs/learn/build.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ the application on macOS. Key features include:
123123
- Building binaries for amd64, arm64 and universal (both) architectures
124124
- Generating `.icns` icon file
125125
- Creating an `.app` bundle for distributing
126+
- Ad-hoc signing `.app` bundles
126127
- Setting macOS-specific build flags and environment variables
127128

128129
## Task Execution and Command Aliases

v3/internal/commands/build-assets.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import (
44
"embed"
55
_ "embed"
66
"fmt"
7-
"github.com/leaanthony/gosod"
8-
"gopkg.in/yaml.v3"
97
"io/fs"
108
"os"
119
"path/filepath"
1210
"runtime"
1311
"strings"
1412
"time"
13+
14+
"github.com/leaanthony/gosod"
15+
"gopkg.in/yaml.v3"
1516
)
1617

1718
//go:embed build_assets
@@ -121,6 +122,7 @@ type FileAssociation struct {
121122
Description string `yaml:"description"`
122123
IconName string `yaml:"iconName"`
123124
Role string `yaml:"role"`
125+
MimeType string `yaml:"mimeType"`
124126
}
125127

126128
type UpdateConfig struct {

v3/internal/commands/build_assets/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ fileAssociations:
5656
# description: Image File
5757
# iconName: jpegFileIcon
5858
# role: Editor
59+
# mimeType: image/jpeg # (optional)
5960

6061
# Other data
6162
other:

v3/internal/commands/build_assets/darwin/Taskfile.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ tasks:
6969
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/Resources
7070
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents/MacOS
7171
- cp build/darwin/Info.plist {{.BIN_DIR}}/{{.APP_NAME}}.app/Contents
72+
- codesign --force --deep --sign - {{.BIN_DIR}}/{{.APP_NAME}}.app
7273

7374
run:
7475
cmds:
75-
- '{{.BIN_DIR}}/{{.APP_NAME}}'
76+
- mkdir -p {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/{MacOS,Resources}
77+
- cp build/darwin/icons.icns {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/Resources
78+
- cp {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS
79+
- cp build/darwin/Info.dev.plist {{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/Info.plist
80+
- codesign --force --deep --sign - {{.BIN_DIR}}/{{.APP_NAME}}.dev.app
81+
- '{{.BIN_DIR}}/{{.APP_NAME}}.dev.app/Contents/MacOS/{{.APP_NAME}}'

v3/internal/commands/updatable_build_assets/darwin/Info.dev.plist.tmpl

+34-11
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,50 @@
22
<plist version="1.0">
33
<dict>
44
<key>CFBundlePackageType</key>
5-
<string>APPL</string>
5+
<string>APPL</string>
66
<key>CFBundleName</key>
7-
<string>{{.ProductName}}</string>
7+
<string>{{.ProductName}}</string>
88
<key>CFBundleExecutable</key>
9-
<string>{{.BinaryName}}</string>
9+
<string>{{.BinaryName}}</string>
1010
<key>CFBundleIdentifier</key>
11-
<string>{{.ProductIdentifier}}</string>
11+
<string>{{.ProductIdentifier}}</string>
1212
<key>CFBundleVersion</key>
13-
<string>{{.ProductVersion}}</string>
13+
<string>{{.ProductVersion}}</string>
1414
<key>CFBundleGetInfoString</key>
15-
<string>{{.ProductComments}}</string>
15+
<string>{{.ProductComments}}</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>{{.ProductVersion}}</string>
17+
<string>{{.ProductVersion}}</string>
1818
<key>CFBundleIconFile</key>
19-
<string>icons</string>
19+
<string>icons</string>
2020
<key>LSMinimumSystemVersion</key>
21-
<string>10.15.0</string>
21+
<string>10.15.0</string>
2222
<key>NSHighResolutionCapable</key>
23-
<string>true</string>
23+
<string>true</string>
2424
<key>NSHumanReadableCopyright</key>
25-
<string>{{.ProductCopyright}}</string>
25+
<string>{{.ProductCopyright}}</string>
26+
{{- if .FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{- range .FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
{{- if .MimeType}}
42+
<key>CFBundleTypeMimeType</key>
43+
<string>{{.MimeType}}</string>
44+
{{- end}}
45+
</dict>
46+
{{- end}}
47+
</array>
48+
{{- end}}
2649
<key>NSAppTransportSecurity</key>
2750
<dict>
2851
<key>NSAllowsLocalNetworking</key>

v3/internal/commands/updatable_build_assets/darwin/Info.plist.tmpl

+34-11
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,49 @@
22
<plist version="1.0">
33
<dict>
44
<key>CFBundlePackageType</key>
5-
<string>APPL</string>
5+
<string>APPL</string>
66
<key>CFBundleName</key>
7-
<string>{{.ProductName}}</string>
7+
<string>{{.ProductName}}</string>
88
<key>CFBundleExecutable</key>
9-
<string>{{.BinaryName}}</string>
9+
<string>{{.BinaryName}}</string>
1010
<key>CFBundleIdentifier</key>
11-
<string>{{.ProductIdentifier}}</string>
11+
<string>{{.ProductIdentifier}}</string>
1212
<key>CFBundleVersion</key>
13-
<string>{{.ProductVersion}}</string>
13+
<string>{{.ProductVersion}}</string>
1414
<key>CFBundleGetInfoString</key>
15-
<string>{{.ProductComments}}</string>
15+
<string>{{.ProductComments}}</string>
1616
<key>CFBundleShortVersionString</key>
17-
<string>{{.ProductVersion}}</string>
17+
<string>{{.ProductVersion}}</string>
1818
<key>CFBundleIconFile</key>
19-
<string>icons</string>
19+
<string>icons</string>
2020
<key>LSMinimumSystemVersion</key>
21-
<string>10.15.0</string>
21+
<string>10.15.0</string>
2222
<key>NSHighResolutionCapable</key>
23-
<string>true</string>
23+
<string>true</string>
2424
<key>NSHumanReadableCopyright</key>
25-
<string>{{.ProductCopyright}}</string>
25+
<string>{{.ProductCopyright}}</string>
26+
{{- if .FileAssociations}}
27+
<key>CFBundleDocumentTypes</key>
28+
<array>
29+
{{- range .FileAssociations}}
30+
<dict>
31+
<key>CFBundleTypeExtensions</key>
32+
<array>
33+
<string>{{.Ext}}</string>
34+
</array>
35+
<key>CFBundleTypeName</key>
36+
<string>{{.Name}}</string>
37+
<key>CFBundleTypeRole</key>
38+
<string>{{.Role}}</string>
39+
<key>CFBundleTypeIconFile</key>
40+
<string>{{.IconName}}</string>
41+
{{- if .MimeType}}
42+
<key>CFBundleTypeMimeType</key>
43+
<string>{{.MimeType}}</string>
44+
{{- end}}
45+
</dict>
46+
{{- end}}
47+
</array>
48+
{{- end}}
2649
</dict>
2750
</plist>

v3/internal/templates/lit-ts/frontend/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"lit": "^3.1.0"
1415
},
1516
"devDependencies": {
1617
"typescript": "^5.2.2",
17-
"vite": "^5.0.0",
18-
"@wailsio/runtime": "latest"
18+
"vite": "^5.0.0"
1919
}
20-
}
20+
}

v3/internal/templates/lit/frontend/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"lit": "^3.1.0"
1415
},
1516
"devDependencies": {
16-
"vite": "^5.0.0",
17-
"@wailsio/runtime": "latest"
17+
"vite": "^5.0.0"
1818
}
19-
}
19+
}

v3/internal/templates/preact-ts/frontend/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"preact": "^10.19.3"
1415
},
1516
"devDependencies": {
1617
"@preact/preset-vite": "^2.7.0",
1718
"typescript": "^5.2.2",
18-
"vite": "^5.0.8",
19-
"@wailsio/runtime": "latest"
19+
"vite": "^5.0.8"
2020
}
21-
}
21+
}

v3/internal/templates/preact/frontend/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"preact": "^10.19.3"
1415
},
1516
"devDependencies": {
1617
"@preact/preset-vite": "^2.7.0",
17-
"vite": "^5.0.8",
18-
"@wailsio/runtime": "latest"
18+
"vite": "^5.0.8"
1919
}
20-
}
20+
}

v3/internal/templates/qwik-ts/frontend/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"build": "tsc && vite build --mode production",
1010
"preview": "vite preview"
1111
},
12-
"devDependencies": {
13-
"typescript": "^5.2.2",
14-
"vite": "^5.0.8"
15-
},
1612
"dependencies": {
1713
"@builder.io/qwik": "^1.3.0",
1814
"@wailsio/runtime": "latest"
15+
},
16+
"devDependencies": {
17+
"typescript": "^5.2.2",
18+
"vite": "^5.0.8"
1919
}
2020
}

v3/internal/templates/qwik/frontend/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"build": "vite build --mode production",
1010
"preview": "vite preview"
1111
},
12-
"devDependencies": {
13-
"typescript": "^5.2.2",
14-
"vite": "^5.0.8"
15-
},
1612
"dependencies": {
1713
"@builder.io/qwik": "^1.3.0",
1814
"@wailsio/runtime": "latest"
15+
},
16+
"devDependencies": {
17+
"typescript": "^5.2.2",
18+
"vite": "^5.0.8"
1919
}
2020
}

v3/internal/templates/react-swc-ts/frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"react": "^18.2.0",
1415
"react-dom": "^18.2.0"
1516
},
@@ -18,7 +19,6 @@
1819
"@types/react-dom": "^18.2.17",
1920
"@vitejs/plugin-react-swc": "^3.5.0",
2021
"typescript": "^5.2.2",
21-
"vite": "^5.0.8",
22-
"@wailsio/runtime": "latest"
22+
"vite": "^5.0.8"
2323
}
2424
}

v3/internal/templates/react-swc/frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"react": "^18.2.0",
1415
"react-dom": "^18.2.0"
1516
},
1617
"devDependencies": {
1718
"@types/react": "^18.2.43",
1819
"@types/react-dom": "^18.2.17",
1920
"@vitejs/plugin-react-swc": "^3.5.0",
20-
"vite": "^5.0.8",
21-
"@wailsio/runtime": "latest"
21+
"vite": "^5.0.8"
2222
}
2323
}

v3/internal/templates/react-ts/frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"react": "^18.2.0",
1415
"react-dom": "^18.2.0"
1516
},
@@ -18,7 +19,6 @@
1819
"@types/react-dom": "^18.2.17",
1920
"@vitejs/plugin-react": "^4.2.1",
2021
"typescript": "^5.2.2",
21-
"vite": "^5.0.8",
22-
"@wailsio/runtime": "latest"
22+
"vite": "^5.0.8"
2323
}
2424
}

v3/internal/templates/react/frontend/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13+
"@wailsio/runtime": "latest",
1314
"react": "^18.2.0",
1415
"react-dom": "^18.2.0"
1516
},
1617
"devDependencies": {
1718
"@types/react": "^18.2.43",
1819
"@types/react-dom": "^18.2.17",
1920
"@vitejs/plugin-react": "^4.2.1",
20-
"vite": "^5.0.8",
21-
"@wailsio/runtime": "latest"
21+
"vite": "^5.0.8"
2222
}
2323
}

0 commit comments

Comments
 (0)