@choochmeque/tauri-windows-bundle 0.1.13 → 0.1.14

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 CHANGED
@@ -73,6 +73,8 @@ Edit `src-tauri/gen/windows/bundle.config.json`:
73
73
  }
74
74
  ```
75
75
 
76
+ `publisher` and `publisherDisplayName` are optional in `bundle.config.json`. If omitted, `publisher` falls back to `bundle.publisher` from `tauri.conf.json` or `tauri.windows.conf.json`. If `publisherDisplayName` is omitted, it defaults to the resolved `publisher` value.
77
+
76
78
  **Capabilities** are validated at build time. Three types are supported:
77
79
 
78
80
  ```json
@@ -91,14 +93,17 @@ Edit `src-tauri/gen/windows/bundle.config.json`:
91
93
 
92
94
  Note: `runFullTrust` is always auto-added (required for Tauri apps).
93
95
 
94
- **Auto-read from tauri.conf.json:**
96
+ **Auto-read from tauri.conf.json / tauri.windows.conf.json:**
95
97
  - `displayName` ← `productName`
96
98
  - `version` ← `version` (auto-converted to 4-part: `1.0.0` → `1.0.0.0`)
97
99
  - `description` ← `bundle.shortDescription`
100
+ - `publisher` ← `bundle.publisher` (fallback when not in bundle.config.json)
98
101
  - `icons` ← `bundle.icon`
99
102
  - `resources` ← `bundle.resources`
100
103
  - `signing` ← `bundle.windows.certificateThumbprint`
101
104
 
105
+ **Platform-specific config:** Values in `tauri.windows.conf.json` override `tauri.conf.json` using [JSON Merge Patch (RFC 7396)](https://datatracker.ietf.org/doc/html/rfc7396). This lets you define Windows-specific settings like `identifier`, `productName`, or `bundle.publisher` separately.
106
+
102
107
  ### Build
103
108
 
104
109
  ```bash
package/dist/cli.js CHANGED
@@ -72,6 +72,26 @@ function readBundleConfig$1(windowsDir) {
72
72
  function getWindowsDir(projectRoot) {
73
73
  return path.join(projectRoot, 'src-tauri', 'gen', 'windows');
74
74
  }
75
+ function resolveVersion(version, tauriConfigDir) {
76
+ const resolvedPath = path.resolve(tauriConfigDir, version);
77
+ if (fs.existsSync(resolvedPath) && fs.statSync(resolvedPath).isFile()) {
78
+ try {
79
+ const content = fs.readFileSync(resolvedPath, 'utf-8');
80
+ const json = JSON.parse(content);
81
+ if (!json.version || typeof json.version !== 'string') {
82
+ throw new Error(`File ${version} does not contain a valid "version" field`);
83
+ }
84
+ return json.version;
85
+ }
86
+ catch (error) {
87
+ if (error instanceof SyntaxError) {
88
+ throw new Error(`Failed to parse ${version} as JSON: ${error.message}`);
89
+ }
90
+ throw error;
91
+ }
92
+ }
93
+ return version;
94
+ }
75
95
  function toFourPartVersion(version) {
76
96
  const parts = version.split('.');
77
97
  while (parts.length < 4)
@@ -939,13 +959,22 @@ async function build(options) {
939
959
  process.exit(1);
940
960
  }
941
961
  }
962
+ // Resolve publisher with fallback to tauriConfig
963
+ const publisher = bundleConfig.publisher || tauriConfig.bundle?.publisher;
964
+ if (!publisher) {
965
+ console.error('Publisher is required. Set it in bundle.config.json or in tauri.conf.json / tauri.windows.conf.json under bundle.publisher');
966
+ process.exit(1);
967
+ }
968
+ const publisherDisplayName = bundleConfig.publisherDisplayName || publisher;
942
969
  // Merge config
943
970
  const config = {
944
971
  displayName: tauriConfig.productName || 'App',
945
- version: toFourPartVersion(tauriConfig.version || '1.0.0'),
972
+ version: toFourPartVersion(resolveVersion(tauriConfig.version || '1.0.0', path.join(projectRoot, 'src-tauri'))),
946
973
  description: tauriConfig.bundle?.shortDescription || '',
947
974
  identifier: tauriConfig.identifier || 'com.example.app',
948
975
  ...bundleConfig,
976
+ publisher,
977
+ publisherDisplayName,
949
978
  };
950
979
  // Architectures from CLI flag
951
980
  const architectures = options.arch?.split(',') || ['x64'];
@@ -4,4 +4,5 @@ export declare function readTauriConfig(projectRoot: string): TauriConfig;
4
4
  export declare function readTauriWindowsConfig(projectRoot: string): TauriConfig | null;
5
5
  export declare function readBundleConfig(windowsDir: string): BundleConfig;
6
6
  export declare function getWindowsDir(projectRoot: string): string;
7
+ export declare function resolveVersion(version: string, tauriConfigDir: string): string;
7
8
  export declare function toFourPartVersion(version: string): string;
package/dist/index.js CHANGED
@@ -153,6 +153,26 @@ function readBundleConfig$1(windowsDir) {
153
153
  function getWindowsDir(projectRoot) {
154
154
  return path.join(projectRoot, 'src-tauri', 'gen', 'windows');
155
155
  }
156
+ function resolveVersion(version, tauriConfigDir) {
157
+ const resolvedPath = path.resolve(tauriConfigDir, version);
158
+ if (fs.existsSync(resolvedPath) && fs.statSync(resolvedPath).isFile()) {
159
+ try {
160
+ const content = fs.readFileSync(resolvedPath, 'utf-8');
161
+ const json = JSON.parse(content);
162
+ if (!json.version || typeof json.version !== 'string') {
163
+ throw new Error(`File ${version} does not contain a valid "version" field`);
164
+ }
165
+ return json.version;
166
+ }
167
+ catch (error) {
168
+ if (error instanceof SyntaxError) {
169
+ throw new Error(`Failed to parse ${version} as JSON: ${error.message}`);
170
+ }
171
+ throw error;
172
+ }
173
+ }
174
+ return version;
175
+ }
156
176
  function toFourPartVersion(version) {
157
177
  const parts = version.split('.');
158
178
  while (parts.length < 4)
@@ -936,13 +956,22 @@ async function build(options) {
936
956
  process.exit(1);
937
957
  }
938
958
  }
959
+ // Resolve publisher with fallback to tauriConfig
960
+ const publisher = bundleConfig.publisher || tauriConfig.bundle?.publisher;
961
+ if (!publisher) {
962
+ console.error('Publisher is required. Set it in bundle.config.json or in tauri.conf.json / tauri.windows.conf.json under bundle.publisher');
963
+ process.exit(1);
964
+ }
965
+ const publisherDisplayName = bundleConfig.publisherDisplayName || publisher;
939
966
  // Merge config
940
967
  const config = {
941
968
  displayName: tauriConfig.productName || 'App',
942
- version: toFourPartVersion(tauriConfig.version || '1.0.0'),
969
+ version: toFourPartVersion(resolveVersion(tauriConfig.version || '1.0.0', path.join(projectRoot, 'src-tauri'))),
943
970
  description: tauriConfig.bundle?.shortDescription || '',
944
971
  identifier: tauriConfig.identifier || 'com.example.app',
945
972
  ...bundleConfig,
973
+ publisher,
974
+ publisherDisplayName,
946
975
  };
947
976
  // Architectures from CLI flag
948
977
  const architectures = options.arch?.split(',') || ['x64'];
@@ -1723,4 +1752,4 @@ async function extensionRemove(type, name, options) {
1723
1752
  }
1724
1753
  }
1725
1754
 
1726
- export { DEFAULT_CAPABILITIES, DEFAULT_MIN_WINDOWS_VERSION, DEFAULT_RUNNER, DEVICE_CAPABILITIES, GENERAL_CAPABILITIES, MSIX_ASSETS, RESTRICTED_CAPABILITIES, build, extensionAddAppExecutionAlias, extensionAddAppService, extensionAddAutoplay, extensionAddBackgroundTask, extensionAddContextMenu, extensionAddFileAssociation, extensionAddPreviewHandler, extensionAddProtocol, extensionAddThumbnailHandler, extensionDisablePrintTaskSettings, extensionDisableShareTarget, extensionDisableStartupTask, extensionDisableToastActivation, extensionEnablePrintTaskSettings, extensionEnableShareTarget, extensionEnableStartupTask, extensionEnableToastActivation, extensionList, extensionRemove, findProjectRoot, generateManifest, generateManifestTemplate, getPackageVersion, getWindowsDir, init, prepareAppxContent, readBundleConfig$1 as readBundleConfig, readTauriConfig, readTauriWindowsConfig, toFourPartVersion, validateCapabilities };
1755
+ export { DEFAULT_CAPABILITIES, DEFAULT_MIN_WINDOWS_VERSION, DEFAULT_RUNNER, DEVICE_CAPABILITIES, GENERAL_CAPABILITIES, MSIX_ASSETS, RESTRICTED_CAPABILITIES, build, extensionAddAppExecutionAlias, extensionAddAppService, extensionAddAutoplay, extensionAddBackgroundTask, extensionAddContextMenu, extensionAddFileAssociation, extensionAddPreviewHandler, extensionAddProtocol, extensionAddThumbnailHandler, extensionDisablePrintTaskSettings, extensionDisableShareTarget, extensionDisableStartupTask, extensionDisableToastActivation, extensionEnablePrintTaskSettings, extensionEnableShareTarget, extensionEnableStartupTask, extensionEnableToastActivation, extensionList, extensionRemove, findProjectRoot, generateManifest, generateManifestTemplate, getPackageVersion, getWindowsDir, init, prepareAppxContent, readBundleConfig$1 as readBundleConfig, readTauriConfig, readTauriWindowsConfig, resolveVersion, toFourPartVersion, validateCapabilities };
package/dist/types.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface TauriConfig {
6
6
  icon?: string[];
7
7
  shortDescription?: string;
8
8
  longDescription?: string;
9
+ publisher?: string;
9
10
  resources?: (string | {
10
11
  src: string;
11
12
  target: string;
@@ -21,8 +22,8 @@ export interface CapabilitiesConfig {
21
22
  restricted?: string[];
22
23
  }
23
24
  export interface BundleConfig {
24
- publisher: string;
25
- publisherDisplayName: string;
25
+ publisher?: string;
26
+ publisherDisplayName?: string;
26
27
  capabilities?: CapabilitiesConfig;
27
28
  extensions?: {
28
29
  shareTarget?: boolean;
@@ -95,6 +96,8 @@ export interface PreviewHandler {
95
96
  fileTypes: string[];
96
97
  }
97
98
  export interface MergedConfig extends BundleConfig {
99
+ publisher: string;
100
+ publisherDisplayName: string;
98
101
  displayName: string;
99
102
  version: string;
100
103
  description: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choochmeque/tauri-windows-bundle",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "MSIX packaging tool for Tauri apps - Windows Store ready bundles",
5
5
  "type": "module",
6
6
  "bin": {