0.3.11 • Published 9 months ago

@flownet/lib-to-macos-app v0.3.11

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
9 months ago

@flownet/lib-to-macos-app

This project provides a streamlined utility for creating a macOS application using Flownet. It assists in automating the process of transforming a source project into a macOS app package by leveraging existing templates and assets, making it easier for developers to build macOS apps without starting from scratch.

How It Works

The utility functions by taking a set of parameters and existing source files, and then it processes these using a series of tasks. It renders templates with custom settings, copies necessary files, generates icons and launch screens, and finally compiles the application using Xcode tools.

Key Features

  • Template Rendering: Utilizes predefined templates to generate necessary project files.
  • Asset Generation: Automatically creates macOS app icons and launch screens.
  • Xcode Build Automation: Compiles the project using Xcode with appropriate configurations for easy deployment.
  • File Management: Manages the creation and cleanup of output and package directories.

Conclusion

The @flownet/lib-to-macos-app tool provides a straightforward approach to macOS app development by automating much of the setup and configuration process. This utility effectively supports developers looking to efficiently package their applications for macOS, reducing the need for extensive manual setup.

Developer Guide for @flownet/lib-to-macos-app

Overview

@flownet/lib-to-macos-app is a Node.js library designed to assist developers in converting a project directory into a functional macOS application. The library streamlines the packaging and building processes, focusing on seamless integration with your existing project setup. By leveraging this library, developers can automate the creation of macOS app icons, launch screens, and configure Xcode projects for distributed builds.

Installation

To use the library in your project, you can install it via npm or yarn:

npm install @flownet/lib-to-macos-app

or

yarn add @flownet/lib-to-macos-app

Usage

The primary usage of the library is through its main function, which orchestrates the transformation of your project assets into a macOS application package. Here's a basic example to demonstrate how to utilize this functionality in your Node.js environment:

import buildMacOSApp from '@flownet/lib-to-macos-app';

const params = {
  name: "my-macos-app",
  entry: "src/entry",
  id: "com.example.my-macos-app",
  version: "1.0.0",
  // Additional configuration parameters
};

const config = {
  // Application-specific configuration
};

const src = "/path/to/source";
const dest = "/path/to/destination";

(async () => {
  try {
    await buildMacOSApp({
      params,
      config,
      src,
      dest
    });
    console.log('macOS app created successfully.');
  } catch (error) {
    console.error('Error creating macOS app:', error);
  }
})();

Examples

Here are a few scenarios demonstrating how you might use the library:

Basic Setup

await buildMacOSApp({
  params: {
    name: "simple-app",
    entry: "app/macos"
  },
  src: "/source/directory",
  dest: "/output/directory"
});

Advanced Configuration

await buildMacOSApp({
  params: {
    name: "advanced-app",
    entry: "app/entry",
    id: "com.advanced.app",
    version: "2.0.0",
    author: "Advanced Developer",
    description: "An advanced macOS application",
    code_sign_identity: "Apple Development",
    development_team: "TEAMID123"
  },
  config: {
    // Additional configuration options
  },
  src: "/advanced/source",
  dest: "/advanced/output"
});

In these examples, the library automates the rendering of templates, the copying of distribution files, creation of icons and launch screens, and the building of the application using Xcode tools.

Acknowledgement

This library integrates functionalities from various components within the Flownet ecosystem, such as @flownet/lib-create-ios-icons, @flownet/lib-create-ios-launch-screens, and @flownet/lib-render-templates-dir. It also utilizes @fnet/xcode-cert-inspector to ascertain code-signing details necessary for app creation. Their contributions are invaluable for ensuring a smooth app-building process.

Input Schema

$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
  params:
    type: object
    properties:
      name:
        type: string
        description: Application name
        default: macos-app
      entry:
        type: string
        description: Entry point for the application
        default: app/macos
      id:
        type: string
        description: Application identifier
        default: com.example.macos-app
      version:
        type: string
        description: Application version
        default: 0.1.0
      title:
        type: string
        description: Application title
        default: macOS App
      package_name:
        type: string
        description: Package name
      author:
        type: string
        description: Application author
        default: Flownet
      description:
        type: string
        description: Application description
        default: macOS App built with Flownet
      vendor:
        type: string
        description: Application vendor
        default: flownet.ai
      include_css:
        type: boolean
        description: Include CSS option status
      bundle_name:
        type: string
        description: Bundle name
      package_dir:
        type: string
        description: Directory for the package
      code_sign_identity:
        type: string
        description: Code sign identity
        default: Apple Development
      code_sign_style:
        type: string
        description: Code sign style
        default: Automatic
      development_team:
        type: string
        description: Development team ID
      product_bundle_identifier:
        type: string
        description: Product bundle identifier
      product_name:
        type: string
        description: Product name
      out_dir:
        type: string
        description: Output directory
  config:
    type: object
    description: Configuration object
  src:
    type: string
    description: Source directory
  dest:
    type: string
    description: Destination directory
0.3.9

9 months ago

0.3.11

9 months ago

0.3.10

9 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.6

9 months ago

0.3.5

9 months ago

0.3.2

9 months ago

0.3.1

9 months ago

0.3.4

9 months ago

0.2.5

9 months ago

0.3.3

9 months ago

0.2.4

9 months ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago