npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

bare-build

0.5.3

@GitHub Actions

npmHomeRepoSnykSocket
Downloads:5493
$ npm install bare-build
DailyWeeklyMonthlyYearly

bare-build

Application builder for Bare that allows developers to package their JavaScript code as either native application bundles or standalone executables for both desktop and mobile.

npm i [-g] bare-build

Usage

const build = require('bare-build')

for await (const resource of build('/path/to/app.js', {
  base: '/path/to/',
  hosts: ['darwin-arm64', 'darwin-x64'],
  icon: 'icon.icns',
  identifier: 'com.example.App'
})) {
  console.log(resource)
}
bare-build \
  --host darwin-arm64 --host darwin-x64 \
  --icon icon.icns \
  --identifier com.example.App \
  app.js

Formats

PlatformUnpackaged--package--standalone
Linux.AppDir, Snap compatible.AppImageELF executable with self-extracting .so libraries
Android.apk.aabELF executable with self-extracting .so libraries
macOS.app.pkgMach-O executable with self-extracting .framework libraries
iOS.app.pkgMach-O executable with self-extracting .framework libraries
WindowsPlain directory.msixPE executable with self-extracting .dll libraries

Runtimes

bare-build ships with portable runtimes for all supported systems. Similarly to the bare CLI, the portable runtimes are designed to run only the I/O event loop of Bare and they're therefore mostly suited for standalone CLI applications. That's why we refer to them as portable; the same code will run the same way across all systems. For developing native GUI applications, however, the portable runtimes fall short as such applications require tight integration with the native event loop of the corresponding system, such as CFRunLoop in Core Foundation or Looper in Android. These applications must instead use a native runtime designed specifically for the system on which they're run.

For that purpose, an alternative runtime can be specified via the runtime option or the --runtime flag. As with the portable runtimes, we maintain native runtimes for all supported systems.

PlatformRuntimeAPICLI
Linuxbare-gtkruntime: 'bare-gtk/runtime'--runtime bare-gtk/runtime
Androidbare-ndkruntime: 'bare-ndk/runtime'--runtime bare-ndk/runtime
macOSbare-app-kitruntime: 'bare-app-kit/runtime'--runtime bare-app-kit/runtime
iOSbare-ui-kitruntime: 'bare-ui-kit/runtime'--runtime bare-ui-kit/runtime
Windowsbare-win-uiruntime: 'bare-win-ui/runtime'--runtime bare-win-ui/runtime

API

for await (const resource of build(entry[, preflight][, options]))

Options include:

options = {
  name: pkg.name,
  version: pkg.version,
  author: pkg.author,
  description: pkg.description,
  icon,
  identifier,
  manifest,
  resources,
  compatibility,
  base: '.',
  hosts: [],
  out: '.',
  runtime,
  standalone: false,
  package: false,
  sign: false,

  // Apple signing options
  identity: 'Apple Development',
  applicationIdentity: identity,
  installerIdentity: identity,
  provisioningProfile,
  keychain,
  entitlements,
  hardenedRuntime: false,

  // Windows signing options
  subject,
  subjectName,
  thumbprint,

  // Linux signing options
  key,

  // Android signing options
  keystore,
  keystoreKey,
  keystorePassword
}

CLI

bare-build [flags] <entry>

Flags include:

--version|-v                     Print the current version
--config <path>                  Read configuration options from a module
--name|-n <name>                 The application name
--author <name>                  The name of the application author
--description <text>             The description of the application
--icon|-i <path>                 The application icon
--identifier <id>                The unique application identifier
--manifest <path>                The platform specific application manifest
--resources <path>               The platform specific application resources
--compatibility <name>           Apply compatibility patches (choices: snap)
--base <path>                    The base path of the application (default: .)
--host <host>                    The host to target
--out|-o <dir>                   The output directory
--runtime <specifier>            The runtime to use
--standalone                     Build a standalone executable
--package                        Package the application for distribution
--sign                           Sign the application
--identity <id>                  The Apple signing identity
--application-identity <id>      The Apple application signing identity
--installer-identity <id>        The Apple installer signing identity
--provisioning-profile <path>    The Apple provisioning profile
--keychain <name>                The Apple signing keychain
--entitlements <path>            The Apple signing entitlements
--hardened-runtime               Enable the Apple hardened runtime
--subject <id>                   The Windows signing subject
--subject-name <name>            The Windows signing subject friendly name
--thumbprint <sha1>              The Windows signing subject thumbprint
--key <hash>                     The GPG signing key
--keystore <path>                The Java-based keystore file
--keystore-key <name>            The name of the certificate to use from the keystore
--keystore-password <password>   The password to the keystore file
--help|-h                        Show help

License

Apache-2.0