@flownet/lib-to-ios-app
v0.3.14
Published
This project is designed to streamline the process of creating an iOS application from your source files using Flownet's infrastructure. Its primary function is to automate and simplify the tasks involved in setting up an iOS project, rendering templates,
Downloads
240
Readme
@flownet/lib-to-ios-app
This project is designed to streamline the process of creating an iOS application from your source files using Flownet's infrastructure. Its primary function is to automate and simplify the tasks involved in setting up an iOS project, rendering templates, and incorporating essential resources like icons and launch screens.
How It Works
The iOS app creation process begins by setting up various parameters for your app, such as its name, version, and identifier. The project then:
- Inspects your system for suitable development certificates and uses them to configure code-signing settings.
- Prepares the necessary directories for project output and packaging.
- Renders project templates using your predefined configurations.
- Includes the content from your source directory into a structured output folder.
- Generates default app icons and launch screens for various device sizes.
- Compiles the iOS application using Xcode's build tools, producing both Debug and Release versions.
Key Features
- Automated Setup: Configures your iOS app project with essential settings and structures.
- Template Rendering: Utilizes provided templates to standardize your app’s foundation.
- Asset Generation: Creates app icons and launch screens to ensure your app looks professional across devices.
- Certificate Inspection: Automatically selects suitable development certificates and adapts to your macOS configuration.
- Build Automation: Leverages Xcode commands to build your app for both simulator and device deployment.
Conclusion
@flownet/lib-to-ios-app is a useful tool for developers looking to efficiently produce iOS applications. By automating many of the initial setup tasks, it provides a smooth transition from development environment to a deployable iOS project, allowing you to focus more on building features and less on setup logistics.
@flownet/lib-to-ios-app Developer Guide
Overview
@flownet/lib-to-ios-app
is a Node.js library that facilitates the conversion of source code into a structured iOS application. It's designed to streamline the setup and build processes, enabling developers to quickly create iOS applications with pre-defined structures, organize assets, and manage build configurations. The library automates tasks like generating app icons and launch screens, rendering templates, and running Xcode build processes.
Installation
Install the library using npm or yarn with the following commands:
# Using npm
npm install @flownet/lib-to-ios-app
# Using yarn
yarn add @flownet/lib-to-ios-app
Usage
Below is an example of using @flownet/lib-to-ios-app
to create an iOS application package from a specified source directory. Ensure that the required parameters like src
(source directory) and dest
(destination directory) are provided.
import createIosApp from '@flownet/lib-to-ios-app';
// Define parameters for the iOS app creation
const params = {
name: "my-ios-app",
entry: "src", // source directory
id: "com.example.my-ios-app",
version: "1.0.0"
};
// Define source and destination directories
const src = path.resolve(__dirname, '../app-source'); // your source directory
const dest = path.resolve(__dirname, '../dist'); // your output directory
// Execute the function to create the iOS app
createIosApp({ params, src, dest }).then(() => {
console.log('iOS app created successfully.');
}).catch(error => {
console.error('An error occurred:', error);
});
Examples
Basic Example
The following code sets up a simple iOS application named "my-ios-app" using default settings. It specifies source and destination folders for the build:
import createIosApp from '@flownet/lib-to-ios-app';
const params = {
name: "my-ios-app",
entry: "src/app",
id: "com.example.myiosapp",
};
const src = path.resolve(__dirname, 'path/to/source');
const dest = path.resolve(__dirname, 'path/to/output');
createIosApp({ params, src, dest }).then(() => {
console.log('iOS application build completed.');
}).catch(err => {
console.error('Failed to create iOS application:', err);
});
Custom Configuration Example
This code demonstrates how to specify custom build configurations and additional settings for the iOS application:
const params = {
name: "custom-ios-app",
id: "org.custom.iosapp",
version: "2.0.0",
code_sign_identity: "Custom Developer Identity",
development_team: "TEAM_ID"
};
const src = path.resolve(__dirname, 'custom/src');
const dest = path.resolve(__dirname, 'custom/output');
createIosApp({ params, src, dest }).catch(err => {
console.error('Build process encountered issues: ', err);
});
Acknowledgement
Development by the Flownet team; contributions and utilities by related Flownet packages are acknowledged accordingly.
Input Schema
$schema: https://json-schema.org/draft/2020-12/schema
type: object
properties:
params:
type: object
properties:
name:
type: string
default: ios-app
description: The name of the iOS application.
entry:
type: string
default: app/ios
description: The entry point directory of the iOS app.
id:
type: string
default: com.example.ios-app
description: The app identifier.
version:
type: string
default: 0.1.0
description: The version of the application.
title:
type: string
default: iOS App
description: The title of the application.
package_name:
type: string
description: The package name for the app.
author:
type: string
default: Flownet
description: The author of the app.
description:
type: string
default: iOS App built with Flownet
description: The description of the app.
vendor:
type: string
default: flownet.ai
description: The vendor of the app.
include_css:
type: boolean
description: Flag to include CSS extraction.
bundle_name:
type: string
description: The bundle name for the app.
package_dir:
type: string
description: The package directory.
code_sign_identity:
type: string
default: Apple Development
description: Identity used for code signing.
code_sign_style:
type: string
default: Automatic
description: The code sign style for the app.
development_team:
type: string
description: The development team ID.
provisioning_profile_specifier:
type: string
description: The provisioning profile specifier.
product_bundle_identifier:
type: string
description: The product bundle identifier.
product_name:
type: string
description: The product name.
out_dir:
type: string
description: The output directory for the build artifacts.
config:
type: object
description: Additional configuration for the app.
src:
type: string
description: The source directory for the application.
dest:
type: string
description: The destination directory for the build.