-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_native_index.clj
158 lines (148 loc) · 6.39 KB
/
build_native_index.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
(ns component.build-native-index
(:use code.test)
(:require [std.lang :as l]
[std.lib :as h]
[std.string :as str]
[std.make :as make :refer [def.make]]
[component.web-native-index :as web-native-index]))
(def +expo-makefile+
{:type :makefile
:main '[[:init
[yarn install]]
[:build-web
[yarn install]
[npx expo build:web]]
[:dev
[yarn install]
[npx expo start --web]]
[:ios
[yarn install]
[npx expo start --ios]]
[:android
[yarn install]
[npx expo start --android]]
[:purge [npx expo r -c]]]})
(def +github-workflows-build+
{:type :yaml
:file ".github/workflows/build.yml"
:main [[:name "build gh-pages"]
[:on ["push"]]
[:jobs
{:build
{:runs-on "ubuntu-latest"
:steps
[{:name "Checkout repo"
:uses "actions/checkout@v3"}
{:name "Node Setup"
:uses "actions/setup-node@v3"
:with {:node-version "16.x"}}
{:name "SSH Init"
:run (str/|
"install -m 600 -D /dev/null ~/.ssh/id_rsa"
"echo '${{ secrets.GH_SSH_PRIVATE_KEY }}' > ~/.ssh/id_rsa"
"ssh-keyscan -H github.com > ~/.ssh/known_hosts")}
{:name "Deploy gh-pages"
:run
(str/|
"make build-web"
"git config --global user.name github-actions"
"git config --global user.email github-actions@github.com"
"cd web-build && git init && git add -A && git commit -m 'deploying to gh-pages'"
"git remote add origin git@github.com:zcaudate-xyz/demo.foundation-base.git"
"git push origin HEAD:gh-pages --force")}]}}]]})
(def.make COMPONENT-NATIVE
{:tag "native"
:build ".build/native"
:github {:repo "zcaudate-xyz/demo.foundation-base"
:description "Js Web Components"}
:sections {:common [+expo-makefile+
+github-workflows-build+]
:node [{:type :gitignore,
:main
["node_modules/**/*"
".expo/*"
"npm-debug.*"
"*.jks"
"*.p8"
"*.p12"
"*.key"
"*.mobileprovision"
"*.orig.*"
"web-build/"
".DS_Store"
"yarn.lock"
"yarn-error.log"]}
{:type :json
:file "app.json"
:main {"expo"
{"name" "Js Web Components"
"slug" "js-web-components"
"version" "1.0.0",
"orientation" "portrait",
"entryPoint" "./src/App.js",
"splash"
{"resizeMode" "contain",
"backgroundColor" "#ffffff"}
"updates" {"fallbackToCacheTimeout" 0},
"assetBundlePatterns" ["**/*"]
"ios" {"supportsTablet" true},}}}
{:type :package.json,
:main {"main" "node_modules/expo/AppEntry.js",
"name" "js-web-components",
"private" true,
"homepage" "/demo.foundation-base"
"scripts"
{"start" "expo start",
"android" "expo start --android",
"ios" "expo start --ios",
"web" "expo start --web",
"eject" "expo eject"},
"dependencies"
{"react-native-svg" "12.3.0",
"javascript-time-ago" "2.3.11",
"react-native" "0.68.1",
"expo-media-library" "14.1.0",
"expo-web-browser" "10.2.1",
"uuid" "8.3.2",
"react-dom" "17.0.2",
"lightweight-charts" "3.8.0",
"dateformat" "^4",
"react-native-vector-icons" "9.1.0",
"react-native-web" "0.17.7",
"react-native-error-boundary" "1.1.10",
"base-64" "1.0.0",
"react-native-base64" "0.1.0",
"react" "17.0.2",
"react-native-get-random-values" "1.8.0",
"expo-random" "12.2.0"},
"devDependencies"
{"@babel/core" "7.9.0",
"@babel/preset-env" "7.13.15",
"@types/react" "16.9.35",
"@types/react-native" "0.63.2",
"expo" "45.0.3",
"expo-cli" "6.3.7",
"typescript" "4.3.5"},
"metro" {"watchFolders" ["assets"]}}}]}
:default [{:type :module.graph
:lang :js
:target "src"
:main 'component.web-native-index
:emit {:code {:label true}}}]})
(def +init+
(make/triggers-set
COMPONENT-NATIVE
#{"js"
"component.web-native"}))
(comment
(make/build-all COMPONENT-NATIVE)
(do (make/build-all COMPONENT-NATIVE)
(make/gh:dwim-init COMPONENT-NATIVE))
(make/gh:dwim-init COMPONENT-NATIVE)
(make/gh:dwim-push COMPONENT-NATIVE)
(def *res*
(future (make/run-internal COMPONENT-NATIVE :build-web)))
(def *res*
(make/run COMPONENT-NATIVE :build-web))
(make/run COMPONENT-NATIVE :dev)
)