From 7b414c666c49581d43673cfaec589fdaf40ff511 Mon Sep 17 00:00:00 2001 From: amorokh Date: Wed, 12 Apr 2017 13:50:48 +0200 Subject: [PATCH] Added support for WPF app --- re-natal.coffee | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/re-natal.coffee b/re-natal.coffee index 879c789..bcf3509 100644 --- a/re-natal.coffee +++ b/re-natal.coffee @@ -43,6 +43,7 @@ interfaceConf = ios: ["core.cljs"] android: ["core.cljs"] windows: ["core.cljs"] + wpf: ["core.cljs"] common: ["handlers.cljs", "subs.cljs", "db.cljs"] other: [] deps: ['[reagent "0.5.1" :exclusions [cljsjs/react]]' @@ -56,6 +57,7 @@ interfaceConf = ios: ["core.cljs"] android: ["core.cljs"] windows: ["core.cljs"] + wpf: ["core.cljs"] common: ["events.cljs", "subs.cljs", "db.cljs"] other: [["reagent_dom.cljs","reagent/dom.cljs"], ["reagent_dom_server.cljs","reagent/dom/server.cljs"]] deps: ['[reagent "0.6.0" :exclusions [cljsjs/react cljsjs/react-dom cljsjs/react-dom-server]]' @@ -69,6 +71,7 @@ interfaceConf = ios: ["core.cljs"] android: ["core.cljs"] windows: ["core.cljs"] + wpf: ["core.cljs"] common: ["state.cljs"] other: [["support.cljs","re_natal/support.cljs"]] deps: ['[org.omcljs/om "1.0.0-alpha48" :exclusions [cljsjs/react cljsjs/react-dom]]'] @@ -81,6 +84,7 @@ interfaceConf = ios: ["core.cljs"] android: ["core.cljs"] windows: ["core.cljs"] + wpf: ["core.cljs"] common: [] other: [["sablono_compiler.clj","sablono/compiler.clj"],["support.cljs","re_natal/support.cljs"]] deps: ['[rum "0.10.8" :exclusions [cljsjs/react cljsjs/react-dom sablono]]'] @@ -432,7 +436,7 @@ init = (interfaceName, projName) -> # Fixes issue with packager 'TimeoutError: transforming ... took longer than 301 seconds.' 'babel-plugin-transform-es2015-block-scoping': '6.15.0' - if 'windows' in platforms + if 'windows' in platforms || 'wpf' in platforms pkg.dependencies['react-native-windows'] = rnVersion fs.writeFileSync 'package.json', JSON.stringify pkg, null, 2 @@ -450,6 +454,12 @@ init = (interfaceName, projName) -> \"require('react-native-windows/local-cli/generate-windows')('.', '#{projName}', '#{projName}')\" " + if 'wpf' in platforms + log 'Creating React Native WPF skeleton.' + exec "node -e + \"require('react-native-windows/local-cli/generate-wpf')('.', '#{projName}', '#{projName}')\" + " + updateGitIgnore() generateConfig(interfaceName, projName) @@ -636,6 +646,7 @@ cli.command 'init ' .description 'create a new ClojureScript React Native project' .option "-i, --interface [#{interfaceNames.join ' '}]", 'specify React interface', defaultInterface .option '-u, --uwp', 'create skeleton for UWP' + .option '-w, --wpf', 'create skeleton for WPF' .action (name, cmd) -> if typeof name isnt 'string' logErr ''' @@ -647,6 +658,8 @@ cli.command 'init ' logErr "Unsupported React interface: #{cmd.interface}, one of [#{interfaceNames}] was expected." if cmd.uwp? platforms.push 'windows' + if cmd.wpf? + platforms.push 'wpf' ensureFreePort -> init(cmd.interface, name) cli.command 'upgrade'