Microsoftが面白そうなツールをリリースしています。 Webアプリケーションが発展し、スマートフォンアプリと変わらない機能、UIで動くようになってきていています。Cordovaなどでラッピングすればスマートフォンアプリと変わらないのではないかと思うこともあるでしょう。 それを実現できるソフトウェアがManifold JSです。W3CのWeb App manifestを使ってコンテンツを読み込み、そのままCordovaプロジェクトにしてくれます。

Manifold JSの使い方

Manifold JSはnpmでインストールができます。

$ npm install -g manifoldjs

manifoldjsというコマンドができるのですが、Mac OSXではそのままでは動かなかったので、次のようにコマンドを実行しました。

$ node manifoldjs http://meteorite.azurewebsites.net -d ~/Downloads/app -l info -p windows10,android,ios -b
Scanning http://meteorite.azurewebsites.net for manifest...
Found a W3C manifest...
Validation warning (android): Launcher icons of the following sizes are required: 48x48, 72x72, 96x96, 144x144, 192x192, 512x512
Validation warning (ios): An app icon of the following sizes is required: 76x76, 120x120, 152x152 and 180x180
Validation warning (ios): An 1024x1024 app icon for the App Store is required
Validation warning (ios): A launch image of the following sizes is required: 750x1334, 1334x750, 1242x2208, 2208x1242, 640x1136, 640x960, 1536x2048, 2048x1536, 768x1024 and 1024x768
Generating the Windows 10 application...
Generating the Cordova application...
Creating the Cordova project...
Downloading Windows 10 icons...
Copying the W3C manifest to the app folder...
Adding the Hosted Web App plugin to the Cordova project...
Adding Cordova platform: android...
Adding Cordova platform: ios...
Copying the Windows 10 manifest to the app folder...
Copying documentation file "Windows10-next-steps.md" to target: /Users/nakatsugawa/Downloads/app/WATDocs/windows10/Windows10-next-steps.md...
Applying fix for Android...
Copying documentation file "Android-next-steps.md" to target: /Users/nakatsugawa/Downloads/app/WATDocs/cordova/platforms/android/Android-next-steps.md...
Creating Cordova shortcut for platform: android...
Building Cordova platform: android...
WARNING: Failed to build Cordova platform: android.
npm http GET https://registry.npmjs.org/cordova-ios/3.8.0
npm http 200 https://registry.npmjs.org/cordova-ios/3.8.0
npm http GET https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
npm http 200 https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
npm http GET https://registry.npmjs.org/cordova-ios/3.8.0
npm http 200 https://registry.npmjs.org/cordova-ios/3.8.0
npm http GET https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
npm http 200 https://registry.npmjs.org/cordova-ios/-/cordova-ios-3.8.0.tgz
Copying documentation file "Apple-next-steps.md" to target: /Users/nakatsugawa/Downloads/app/WATDocs/cordova/platforms/ios/Apple-next-steps.md...
Creating Cordova shortcut for platform: ios...
Building Cordova platform: ios...
WARNING: Failed to build Cordova platform: ios.
WARNING: One or more tasks failed while generating the Cordova application.
WARNING: One or more errors occurred when generating the application.
  :

のようにしてAndroid、Windows10、iOS向けのコード生成を行います。後はそのままビルドしたり、カスタマイズを行えます。

W3C Web App manifestはスマートフォンでホーム画面に設置したりするのに使われるようですが、Manifold JSによってスマートフォンアプリ開発にも使えるようになります。Webサイトをスマホアプリ化したいといったニーズにぴったりと言えそうです。

Manifold JSはnode/JavaScript製、MIT Licenseのオープンソース・ソフトウェアです。

Manifold JS manifoldjs/ManifoldJS