Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Cross-platform (xplat) tools for Nx workspaces.

License

NotificationsYou must be signed in to change notification settings

nstudio/xplat

Repository files navigation

LicenseNPM Version


xplat is an added value pack forNx which provides additional app generators and optional supporting architecture for different platform/framework combinations.

Currently supported platforms

  • Electron

    Build cross platform desktop apps with JavaScript, HTML, and CSS.

  • Ionic

    Build amazing apps in one codebase, for any platform, with the web.

  • NativeScript

    Build rich iOS and Android apps with direct access to native api's from JavaScript directly.

Quickstart

Note: Nx 19.x.x compatible.

npx create-nx-workspace@19✔ Where would you like to create your workspace? · {your-workspace-name}# Choose "None"? Which stackdo you want to use? … None:          Configures a minimal structure without specific frameworks or technologies.# Choose "Integrated"? Package-based or integrated? … Integrated:    Nx creates a workspace structure most suitablefor building apps.

Init workspace

Install the @nx/js plugin.

npm install @nx/js -D

Now initialize -- This will ensure atsconfig.base.json is created to begin building your workspace.

npx nx g @nx/js:init

Install the tools:

npm install @nstudio/xplat -D

You are now ready to create apps:

npx nx g @nstudio/xplat:app

App generation examples

The additional app generators can be used as follows:

Electron

Electron app generator can use any web app in the workspace as it's target.

If you don't have a web app yet, create one first:

npx nx g @nstudio/xplat:app sample

chooseweb

You can now use the web app as the Electron target:

npx nx g @nstudio/xplat:app desktop --target=web-sample

chooseelectron

Develop with:

npm run start.electron.desktop

Ionic

npx nx g @nstudio/xplat:app sample

chooseionic

Develop in browser with:

npx nx serve ionic-sample

Build Ionic app:

npx nx build ionic-sample

A.Capacitor iOS - Prepare for development

npm run prepare.ionic.sample.ios

You can now open in Xcode for further development:

npm run open.ionic.sample.ios

B.Capacitor Android - Prepare for development

npm run prepare.ionic.sample.android

You can now open in Android Studio for further development:

npm run open.ionic.sample.android

NativeScript

nx g @nstudio/xplat:app mobile

choosenativescript

A.iOS

npx nx run nativescript-mobile:ios

B.Android

npx nx run nativescript-mobile:android

Talks

Recommended extra tooling

Example repos for different scenarios

Context


[8]ページ先頭

©2009-2025 Movatter.jp