diff --git a/package.json b/package.json index 79a8fed..b28eef2 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "type": "commonjs", "files": [ "template/*", - "template.config.js" + "template.config.js", + "postInitScript.js" ], "dependencies": {}, "devDependencies": { diff --git a/postInitScript.js b/postInitScript.js new file mode 100755 index 0000000..f0d99a7 --- /dev/null +++ b/postInitScript.js @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +const path = require("path"); + +// ANSI escape codes for colors and formatting +const reset = "\x1b[0m"; +const cyan = "\x1b[36m"; +const bold = "\x1b[1m"; + +function printInitScript() { + const projectDir = path.resolve(); + + const instructions = ` + ${cyan}Run instructions for ${bold}visionOS${reset}${cyan}:${reset} + • cd "${projectDir}/visionos" + + • Install Cocoapods + • bundle install # you need to run this only once in your project. + • bundle exec pod install + • cd .. + + • npx react-native run-visionos + `; + + console.log(instructions); +} + +printInitScript(); diff --git a/template.config.js b/template.config.js index c075f1d..555c2d2 100644 --- a/template.config.js +++ b/template.config.js @@ -9,4 +9,6 @@ module.exports = { placeholderName: 'HelloWorld', titlePlaceholder: 'Hello App Display Name', templateDir: './template', + platforms: ['visionos'], + postInitScript: './postInitScript.js', };