@hanzogui/types 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +18 -0
  3. package/types.ts +174 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 Nate Wienert
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@hanzogui/types",
3
+ "version": "2.0.0",
4
+ "files": [
5
+ "types.ts"
6
+ ],
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "types": "./types.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./types.ts"
13
+ }
14
+ },
15
+ "publishConfig": {
16
+ "access": "public"
17
+ }
18
+ }
package/types.ts ADDED
@@ -0,0 +1,174 @@
1
+ export interface GuiBuildOptions {
2
+ /**
3
+ * module paths you want to compile with gui (for example ['gui'])
4
+ * */
5
+ components?: string[]
6
+
7
+ /**
8
+ * relative path to your gui.config.ts
9
+ */
10
+ config?: string
11
+
12
+ /**
13
+ * Use the new ThemeBuilder in `@gui/create-theme` to create beautiful theme sets,
14
+ * see docs at https://gui.hanzo.ai/docs/guides/theme-builder
15
+ * This helps you automate generating the build themes typescript file which loads fastere
16
+ * and has smaller bundle size.
17
+ */
18
+ themeBuilder?: {
19
+ input: string
20
+ output: string
21
+ }
22
+
23
+ /**
24
+ * Emit design system related CSS during build step for usage with frameworks
25
+ */
26
+ outputCSS?: string | null | false
27
+
28
+ /**
29
+ * (Experimental) outputs themes using CSS Nesting https://caniuse.com/css-nesting
30
+ * Which can cut them in half due to no media query duplication.
31
+ */
32
+ useCSSNesting?: boolean
33
+
34
+ /**
35
+ * Gui can follow imports and evaluate them when parsing styles, leading to
36
+ * higher percent of flattened / optimized views. We normalize this to be the
37
+ * full path of the file, always ending in ".js".
38
+ *
39
+ * So to have Gui partially evaluate "app/src/constants.tsx" you can put
40
+ * ["app/src/constants.js"].
41
+ */
42
+ importsWhitelist?: string[]
43
+
44
+ /**
45
+ * Whitelist file extensions to evaluate
46
+ *
47
+ * @default ['.tsx', '.jsx']
48
+ */
49
+ includeExtensions?: string[]
50
+
51
+ /**
52
+ * Web-only. Allows you to trim the bundle size of react-native-web.
53
+ * Pass in values like ['Switch', 'Modal'].
54
+ */
55
+ excludeReactNativeWebExports?: string[]
56
+
57
+ /**
58
+ * Enable logging the time it takes to extract.
59
+ *
60
+ * @default true
61
+ */
62
+ logTimings?: boolean
63
+
64
+ /**
65
+ * Custom prefix for the timing logs
66
+ */
67
+ prefixLogs?: string
68
+
69
+ /**
70
+ * (Advanced) Enables Gui to try and evaluate components outside the `components` option.
71
+ * When true, Gui will bundle and load components as its running across every file,
72
+ * if it loads them successfully it will perform all optimiziations inline.
73
+ */
74
+ enableDynamicEvaluation?: boolean
75
+
76
+ /**
77
+ * Completely disable gui for these files
78
+ */
79
+ disable?: boolean | string[]
80
+
81
+ /**
82
+ * Disable just optimization for these files, but enable helpful debug attributes.
83
+ */
84
+ disableExtraction?: boolean | string[]
85
+
86
+ /**
87
+ * Disable just the addition of data- attributes that are added in dev mode to help
88
+ * tie DOM to your filename/component-name.
89
+ */
90
+
91
+ disableDebugAttr?: boolean
92
+
93
+ /**
94
+ * (Advanced) Disable evaluation of useMedia() hook
95
+ */
96
+ disableExtractInlineMedia?: boolean
97
+
98
+ /**
99
+ * (Advanced) Disable just view flattening.
100
+ */
101
+ disableFlattening?: boolean
102
+
103
+ /**
104
+ * (Advanced) Disable extracting to theme variables.
105
+ */
106
+ disableExtractVariables?: boolean | 'theme'
107
+
108
+ /**
109
+ * (Advanced) Disables the initial build and attempts to load from the .gui directory
110
+ */
111
+ disableInitialBuild?: boolean
112
+
113
+ /**
114
+ * If you have a gui.build.ts file that describes your compiler setup, you can set it here
115
+ */
116
+ buildFile?: string
117
+
118
+ evaluateVars?: boolean
119
+ cssPath?: string
120
+ cssData?: any
121
+ deoptProps?: Set<string>
122
+ excludeProps?: Set<string>
123
+ inlineProps?: Set<string>
124
+
125
+ /**
126
+ * Use react-native-web-lite for better tree shaking on web.
127
+ * Set to 'without-animated' to exclude animated components.
128
+ */
129
+ useReactNativeWebLite?: boolean | 'without-animated'
130
+ disableWatchGuiConfig?: boolean
131
+
132
+ /**
133
+ * (Experimental) Flatten theme access on native for better performance
134
+ */
135
+ experimentalFlattenThemesOnNative?: boolean
136
+ }
137
+
138
+ export interface GuiOptions extends GuiBuildOptions {
139
+ platform?: 'native' | 'web'
140
+ }
141
+
142
+ // for cli
143
+
144
+ export type CLIUserOptions = {
145
+ root?: string
146
+ host?: string
147
+ tsconfigPath?: string
148
+ guiOptions: Partial<GuiOptions>
149
+ debug?: boolean | 'verbose'
150
+ loadGuiOptions?: boolean
151
+ }
152
+
153
+ export type CLIResolvedOptions = {
154
+ root: string
155
+ port?: number
156
+ host?: string
157
+ mode: 'development' | 'production'
158
+ debug?: CLIUserOptions['debug']
159
+ tsconfigPath: string
160
+ guiOptions: GuiOptions
161
+ pkgJson: {
162
+ name?: string
163
+ main?: string
164
+ module?: string
165
+ source?: string
166
+ exports?: Record<string, Record<string, string>>
167
+ }
168
+ paths: {
169
+ root: string
170
+ dotDir: string
171
+ conf: string
172
+ types: string
173
+ }
174
+ }