@choochmeque/tauri-windows-bundle 0.1.0 → 0.1.1

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
@@ -77,7 +77,7 @@ Edit `src-tauri/gen/windows/bundle.config.json`:
77
77
  ### Build
78
78
 
79
79
  ```bash
80
- # Build x64 only (default)
80
+ # Build x64 only (default, uses cargo)
81
81
  pnpm tauri:windows:build
82
82
 
83
83
  # Build multiarch bundle (x64 + arm64)
@@ -85,6 +85,10 @@ pnpm tauri:windows:build --arch x64,arm64
85
85
 
86
86
  # Release build
87
87
  pnpm tauri:windows:build --release
88
+
89
+ # Use different build runner (pnpm, npm, yarn, bun, etc.)
90
+ pnpm tauri:windows:build --runner pnpm
91
+ pnpm tauri:windows:build --runner npm
88
92
  ```
89
93
 
90
94
  ### Output
package/dist/cli.js CHANGED
@@ -4,7 +4,7 @@ import * as fs from 'node:fs';
4
4
  import * as path from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { glob } from 'glob';
7
- import { exec } from 'node:child_process';
7
+ import { exec, spawn } from 'node:child_process';
8
8
  import { promisify } from 'node:util';
9
9
  import * as readline from 'node:readline';
10
10
 
@@ -64,6 +64,7 @@ function toFourPartVersion(version) {
64
64
  return parts.slice(0, 4).join('.');
65
65
  }
66
66
 
67
+ const DEFAULT_RUNNER = 'cargo';
67
68
  const MSIX_ASSETS = [
68
69
  { name: 'StoreLogo.png', size: 50 },
69
70
  { name: 'Square44x44Logo.png', size: 44 },
@@ -594,6 +595,33 @@ async function promptInstall(message) {
594
595
  });
595
596
  });
596
597
  }
598
+ async function execWithProgress(command, options) {
599
+ return new Promise((resolve, reject) => {
600
+ const [cmd, ...args] = command.split(' ');
601
+ const child = spawn(cmd, args, {
602
+ cwd: options?.cwd,
603
+ stdio: ['inherit', 'pipe', 'pipe'],
604
+ shell: true,
605
+ });
606
+ child.stdout?.on('data', (data) => {
607
+ process.stdout.write(data);
608
+ });
609
+ child.stderr?.on('data', (data) => {
610
+ process.stderr.write(data);
611
+ });
612
+ child.on('close', (code) => {
613
+ if (code === 0) {
614
+ resolve();
615
+ }
616
+ else {
617
+ reject(new Error(`Command failed with exit code ${code}`));
618
+ }
619
+ });
620
+ child.on('error', (error) => {
621
+ reject(error);
622
+ });
623
+ });
624
+ }
597
625
 
598
626
  async function build(options) {
599
627
  console.log('Building MSIX package...\n');
@@ -601,10 +629,10 @@ async function build(options) {
601
629
  if (!(await isMsixbundleCliInstalled())) {
602
630
  const shouldInstall = await promptInstall('msixbundle-cli is required but not installed.\n' + 'Install it now? (requires Rust/Cargo)');
603
631
  if (shouldInstall) {
604
- console.log('Installing msixbundle-cli...');
632
+ console.log('Installing msixbundle-cli...\n');
605
633
  try {
606
- await execAsync('cargo install msixbundle-cli');
607
- console.log(' msixbundle-cli installed\n');
634
+ await execWithProgress('cargo install msixbundle-cli');
635
+ console.log('\n msixbundle-cli installed\n');
608
636
  }
609
637
  catch (error) {
610
638
  console.error('Failed to install msixbundle-cli:', error);
@@ -647,14 +675,25 @@ async function build(options) {
647
675
  const architectures = options.arch?.split(',') || ['x64'];
648
676
  const minVersion = options.minWindows || DEFAULT_MIN_WINDOWS_VERSION;
649
677
  const appxDirs = [];
678
+ const runner = options.runner || DEFAULT_RUNNER;
650
679
  for (const arch of architectures) {
651
680
  console.log(`Building for ${arch}...`);
652
681
  // Build Tauri app
653
682
  const target = arch === 'x64' ? 'x86_64-pc-windows-msvc' : 'aarch64-pc-windows-msvc';
654
683
  const releaseFlag = options.release ? '--release' : '';
684
+ // Build command based on runner
685
+ let buildCommand;
686
+ if (runner === 'npm') {
687
+ // npm requires -- to pass args to the script
688
+ buildCommand = `npm run tauri build -- --target ${target} ${releaseFlag}`.trim();
689
+ }
690
+ else {
691
+ // cargo, pnpm, yarn, bun, etc.
692
+ buildCommand = `${runner} tauri build --target ${target} ${releaseFlag}`.trim();
693
+ }
655
694
  try {
656
- console.log(` Running: cargo tauri build --target ${target} ${releaseFlag}`);
657
- await execAsync(`cargo tauri build --target ${target} ${releaseFlag}`.trim(), {
695
+ console.log(` Running: ${buildCommand}\n`);
696
+ await execWithProgress(buildCommand, {
658
697
  cwd: projectRoot,
659
698
  });
660
699
  }
@@ -1429,6 +1468,7 @@ program
1429
1468
  .option('--arch <architectures>', 'Architectures to build (comma-separated: x64,arm64)', 'x64')
1430
1469
  .option('--release', 'Build in release mode')
1431
1470
  .option('--min-windows <version>', 'Minimum Windows version', '10.0.17763.0')
1471
+ .option('--runner <runner>', 'Build runner (cargo, pnpm, npm, yarn, etc.)', 'cargo')
1432
1472
  .action(async (options) => {
1433
1473
  try {
1434
1474
  await build(options);
package/dist/index.js CHANGED
@@ -2,10 +2,11 @@ import * as fs from 'node:fs';
2
2
  import * as path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { glob } from 'glob';
5
- import { exec } from 'node:child_process';
5
+ import { exec, spawn } from 'node:child_process';
6
6
  import { promisify } from 'node:util';
7
7
  import * as readline from 'node:readline';
8
8
 
9
+ const DEFAULT_RUNNER = 'cargo';
9
10
  const MSIX_ASSETS = [
10
11
  { name: 'StoreLogo.png', size: 50 },
11
12
  { name: 'Square44x44Logo.png', size: 44 },
@@ -592,6 +593,33 @@ async function promptInstall(message) {
592
593
  });
593
594
  });
594
595
  }
596
+ async function execWithProgress(command, options) {
597
+ return new Promise((resolve, reject) => {
598
+ const [cmd, ...args] = command.split(' ');
599
+ const child = spawn(cmd, args, {
600
+ cwd: options?.cwd,
601
+ stdio: ['inherit', 'pipe', 'pipe'],
602
+ shell: true,
603
+ });
604
+ child.stdout?.on('data', (data) => {
605
+ process.stdout.write(data);
606
+ });
607
+ child.stderr?.on('data', (data) => {
608
+ process.stderr.write(data);
609
+ });
610
+ child.on('close', (code) => {
611
+ if (code === 0) {
612
+ resolve();
613
+ }
614
+ else {
615
+ reject(new Error(`Command failed with exit code ${code}`));
616
+ }
617
+ });
618
+ child.on('error', (error) => {
619
+ reject(error);
620
+ });
621
+ });
622
+ }
595
623
 
596
624
  async function build(options) {
597
625
  console.log('Building MSIX package...\n');
@@ -599,10 +627,10 @@ async function build(options) {
599
627
  if (!(await isMsixbundleCliInstalled())) {
600
628
  const shouldInstall = await promptInstall('msixbundle-cli is required but not installed.\n' + 'Install it now? (requires Rust/Cargo)');
601
629
  if (shouldInstall) {
602
- console.log('Installing msixbundle-cli...');
630
+ console.log('Installing msixbundle-cli...\n');
603
631
  try {
604
- await execAsync('cargo install msixbundle-cli');
605
- console.log(' msixbundle-cli installed\n');
632
+ await execWithProgress('cargo install msixbundle-cli');
633
+ console.log('\n msixbundle-cli installed\n');
606
634
  }
607
635
  catch (error) {
608
636
  console.error('Failed to install msixbundle-cli:', error);
@@ -645,14 +673,25 @@ async function build(options) {
645
673
  const architectures = options.arch?.split(',') || ['x64'];
646
674
  const minVersion = options.minWindows || DEFAULT_MIN_WINDOWS_VERSION;
647
675
  const appxDirs = [];
676
+ const runner = options.runner || DEFAULT_RUNNER;
648
677
  for (const arch of architectures) {
649
678
  console.log(`Building for ${arch}...`);
650
679
  // Build Tauri app
651
680
  const target = arch === 'x64' ? 'x86_64-pc-windows-msvc' : 'aarch64-pc-windows-msvc';
652
681
  const releaseFlag = options.release ? '--release' : '';
682
+ // Build command based on runner
683
+ let buildCommand;
684
+ if (runner === 'npm') {
685
+ // npm requires -- to pass args to the script
686
+ buildCommand = `npm run tauri build -- --target ${target} ${releaseFlag}`.trim();
687
+ }
688
+ else {
689
+ // cargo, pnpm, yarn, bun, etc.
690
+ buildCommand = `${runner} tauri build --target ${target} ${releaseFlag}`.trim();
691
+ }
653
692
  try {
654
- console.log(` Running: cargo tauri build --target ${target} ${releaseFlag}`);
655
- await execAsync(`cargo tauri build --target ${target} ${releaseFlag}`.trim(), {
693
+ console.log(` Running: ${buildCommand}\n`);
694
+ await execWithProgress(buildCommand, {
656
695
  cwd: projectRoot,
657
696
  });
658
697
  }
@@ -1403,4 +1442,4 @@ async function extensionRemove(type, name, options) {
1403
1442
  }
1404
1443
  }
1405
1444
 
1406
- export { DEFAULT_CAPABILITIES, DEFAULT_MIN_WINDOWS_VERSION, MSIX_ASSETS, build, extensionAddAppExecutionAlias, extensionAddAppService, extensionAddAutoplay, extensionAddBackgroundTask, extensionAddContextMenu, extensionAddFileAssociation, extensionAddPreviewHandler, extensionAddProtocol, extensionAddThumbnailHandler, extensionDisablePrintTaskSettings, extensionDisableShareTarget, extensionDisableStartupTask, extensionDisableToastActivation, extensionEnablePrintTaskSettings, extensionEnableShareTarget, extensionEnableStartupTask, extensionEnableToastActivation, extensionList, extensionRemove, findProjectRoot, generateManifest, generateManifestTemplate, getWindowsDir, init, prepareAppxContent, readBundleConfig$1 as readBundleConfig, readTauriConfig, toFourPartVersion };
1445
+ export { DEFAULT_CAPABILITIES, DEFAULT_MIN_WINDOWS_VERSION, DEFAULT_RUNNER, MSIX_ASSETS, build, extensionAddAppExecutionAlias, extensionAddAppService, extensionAddAutoplay, extensionAddBackgroundTask, extensionAddContextMenu, extensionAddFileAssociation, extensionAddPreviewHandler, extensionAddProtocol, extensionAddThumbnailHandler, extensionDisablePrintTaskSettings, extensionDisableShareTarget, extensionDisableStartupTask, extensionDisableToastActivation, extensionEnablePrintTaskSettings, extensionEnableShareTarget, extensionEnableStartupTask, extensionEnableToastActivation, extensionList, extensionRemove, findProjectRoot, generateManifest, generateManifestTemplate, getWindowsDir, init, prepareAppxContent, readBundleConfig$1 as readBundleConfig, readTauriConfig, toFourPartVersion };
package/dist/types.d.ts CHANGED
@@ -102,7 +102,9 @@ export interface BuildOptions {
102
102
  arch?: string;
103
103
  release?: boolean;
104
104
  minWindows?: string;
105
+ runner?: string;
105
106
  }
107
+ export declare const DEFAULT_RUNNER = "cargo";
106
108
  export interface MsixAsset {
107
109
  name: string;
108
110
  size?: number;
@@ -9,3 +9,6 @@ export declare function getMsixbundleCliVersion(): Promise<string | null>;
9
9
  export declare function isVersionSufficient(version: string, minVersion: string): boolean;
10
10
  export declare const MIN_MSIXBUNDLE_CLI_VERSION = "1.0.0";
11
11
  export declare function promptInstall(message: string): Promise<boolean>;
12
+ export declare function execWithProgress(command: string, options?: {
13
+ cwd?: string;
14
+ }): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@choochmeque/tauri-windows-bundle",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MSIX packaging tool for Tauri apps - Windows Store ready bundles",
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,17 +8,6 @@
8
8
  },
9
9
  "main": "./dist/index.js",
10
10
  "types": "./dist/index.d.ts",
11
- "scripts": {
12
- "build": "rollup -c",
13
- "prepublishOnly": "pnpm build",
14
- "pretest": "pnpm build",
15
- "test": "vitest run",
16
- "test:watch": "vitest",
17
- "test:coverage": "vitest run --coverage",
18
- "lint": "eslint .",
19
- "format": "prettier --write \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\"",
20
- "format:check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\""
21
- },
22
11
  "keywords": [
23
12
  "tauri",
24
13
  "windows",
@@ -55,5 +44,14 @@
55
44
  "typescript": "^5.3.3",
56
45
  "vitest": "^2.0.0"
57
46
  },
58
- "packageManager": "pnpm@10.16.0+sha512.8066e7b034217b700a9a4dbb3a005061d641ba130a89915213a10b3ca4919c19c037bec8066afdc559b89635fdb806b16ea673f2468fbb28aabfa13c53e3f769"
59
- }
47
+ "scripts": {
48
+ "build": "rollup -c",
49
+ "pretest": "pnpm build",
50
+ "test": "vitest run",
51
+ "test:watch": "vitest",
52
+ "test:coverage": "vitest run --coverage",
53
+ "lint": "eslint .",
54
+ "format": "prettier --write \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\"",
55
+ "format:check": "prettier --check \"./**/*.{cjs,mjs,js,jsx,mts,ts,tsx,html,css,json}\""
56
+ }
57
+ }