1 | import type { InstrumentationMode } from '../profiling';
|
2 | interface IConfigPlatform {
|
3 | /**
|
4 | * App's bundle id
|
5 | */
|
6 | id?: string;
|
7 | /**
|
8 | * Discard any uncaught JS exceptions
|
9 | * This can be very useful in production environments when you don't want your app to just crash if a developer forgot to guard against an unexpected JS level exception.
|
10 | */
|
11 | discardUncaughtJsExceptions?: boolean;
|
12 | }
|
13 | export interface IOSRemoteSPMPackage {
|
14 | name: string;
|
15 | libs: string[];
|
16 | repositoryURL: string;
|
17 | version: string;
|
18 | }
|
19 | export interface IOSLocalSPMPackage {
|
20 | name: string;
|
21 | libs: string[];
|
22 | path: string;
|
23 | }
|
24 | export type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage;
|
25 | interface IConfigIOS extends IConfigPlatform {
|
26 | /**
|
27 | * Swift Package Manager
|
28 | * List packages to be included in the iOS build.
|
29 | */
|
30 | SPMPackages?: Array<IOSSPMPackage>;
|
31 | }
|
32 | interface IConfigVisionOS extends IConfigIOS {
|
33 | }
|
34 | interface IConfigAndroid extends IConfigPlatform {
|
35 | /**
|
36 | * These are the v8 runtime flags you can pass in, you must have "--expose_gc" as this is used in the runtime
|
37 | */
|
38 | v8Flags?: string;
|
39 | /**
|
40 | * Enable code cache by setting this to "true"
|
41 | */
|
42 | codeCache?: boolean;
|
43 | /**
|
44 | * Depreciated
|
45 | * Do not change
|
46 | */
|
47 | heapSnapshotScript?: string;
|
48 | /**
|
49 | * Depreciated
|
50 | * Do No change - File to use for Snapshots
|
51 | */
|
52 | SnapshotFile?: string;
|
53 | /**
|
54 | * Directory of profiler out put files
|
55 | */
|
56 | profilerOutputDir?: string;
|
57 | /**
|
58 | * How frequently in MS to automatically trigger a gc (0 = Disabled & Default)
|
59 | * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management
|
60 | */
|
61 | gcThrottleTime?: number;
|
62 | /**
|
63 | * "none" & "full" is supported, "full" is depreciated
|
64 | * Default: none
|
65 | */
|
66 | markingMode?: string;
|
67 | /**
|
68 | * Allow time zone changes to notify app, default: false
|
69 | */
|
70 | handleTimeZoneChanges?: boolean;
|
71 | /**
|
72 | * Maximum size of a single output string; default: 1024
|
73 | */
|
74 | maxLogcatObjectSize?: number;
|
75 | /**
|
76 | * Enable logging in Release applications, default: false
|
77 | */
|
78 | forceLog?: boolean;
|
79 | /**
|
80 | * How frequently in ms that it does the freeMemoryRatio check
|
81 | * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management
|
82 | */
|
83 | memoryCheckInterval?: number;
|
84 | /**
|
85 | * Percentage of memory (0.0 to 1.0) before it forces a GC (default & disabled = 0)
|
86 | * Paired with he memoryCheckInterval
|
87 | * Docs: https://docs.nativescript.org/core-concepts/android-runtime/advanced-topics/memory-management
|
88 | */
|
89 | freeMemoryRatio?: number;
|
90 | /**
|
91 | * Used for Advanced debugging
|
92 | */
|
93 | enableLineBreakpoints?: boolean;
|
94 | /**
|
95 | * Enable the multithreaded JavaScript engine, this will probably break plugins...
|
96 | * Default: false - disabled.
|
97 | */
|
98 | enableMultithreadedJavascript?: boolean;
|
99 | }
|
100 | interface IConfigCLI {
|
101 | /**
|
102 | * Set the package manager to use for this project.
|
103 | * Defaults to the CLI set package manager, or `npm` if not set globally
|
104 | */
|
105 | packageManager: 'yarn' | 'pnpm' | 'npm';
|
106 | /**
|
107 | * Optional - Override the files or paths to clean when running the `ns clean` command
|
108 | */
|
109 | pathsToClean?: string[];
|
110 | /**
|
111 | * Optional - Additional files or paths to clean when running the `ns clean` command, the paths are appended to the default list of paths.
|
112 | */
|
113 | additionalPathsToClean?: string[];
|
114 | }
|
115 | interface IConfigHook {
|
116 | /**
|
117 | * Event name for when to run the hook.
|
118 | * Possible event names are any of the following with the pattern
|
119 | * `before-*` and `after-*`
|
120 | *
|
121 | * * `buildAndroidPlugin` - Builds aar file for Android plugin, runs during prepareNativeApp
|
122 | * * `buildAndroid` - Builds Android app
|
123 | * * `buildIOS` - Builds iOS app
|
124 | * * `checkEnvironment` - Validate project env, runs during ns doctor, clean, and most build commands
|
125 | * * `checkForChanges` - Changes occurred during watch
|
126 | * * `install` - Application installed to device/emulator
|
127 | * * `prepare` - Compiles webpack and prepares native app in platforms folder
|
128 | * * `prepareNativeApp` - Preparing the actual native app, runs during prepare/watch hook
|
129 | * * `resolveCommand` - Resolves command and arguments, runs before all cli commands
|
130 | * * `watch` - Setup watchers for live sync, runs during prepare hook
|
131 | * * `watchPatterns` - Setup watch patterns, runs during watch hook
|
132 | */
|
133 | type: 'before-buildAndroidPlugin' | 'after-buildAndroidPlugin' | 'before-buildAndroid' | 'after-buildAndroid' | 'before-buildIOS' | 'after-buildIOS' | 'before-checkEnvironment' | 'after-checkEnvironment' | 'before-checkForChanges' | 'after-checkForChanges' | 'before-install' | 'after-install' | 'before-prepare' | 'after-prepare' | 'before-prepareNativeApp' | 'after-prepareNativeApp' | 'before-resolveCommand' | 'after-resolveCommand' | 'before-watch' | 'after-watch' | 'before-watchPatterns' | 'after-watchPatterns';
|
134 | /**
|
135 | * Path to the hook script file to run
|
136 | */
|
137 | script: string;
|
138 | }
|
139 | interface IConfigEmbedProps {
|
140 | /**
|
141 | * Relative path to the platform host project directory.
|
142 | */
|
143 | hostProjectPath?: string;
|
144 | /**
|
145 | * (Android only) Optional custom module name.
|
146 | */
|
147 | hostProjectModuleName?: string;
|
148 | }
|
149 | interface IConfigEmbed extends IConfigEmbedProps {
|
150 | /**
|
151 | * iOS specific embed configurations
|
152 | */
|
153 | ios?: IConfigEmbedProps;
|
154 | /**
|
155 | * Android specific embed configurations
|
156 | */
|
157 | android?: IConfigEmbedProps;
|
158 | }
|
159 | export interface NativeScriptConfig {
|
160 | /**
|
161 | * App's bundle id
|
162 | * Used for both iOS and Android if they use the same bundle id. You can override per platform in the respective platform specific configurations.
|
163 | */
|
164 | id?: string;
|
165 | /**
|
166 | * App's main entry file - this setting overrides the value set in package.json
|
167 | */
|
168 | main?: string;
|
169 | /**
|
170 | * Path to the app source directory
|
171 | * This is often the `src` or `app` directory however can be changed.
|
172 | */
|
173 | appPath?: string;
|
174 | /**
|
175 | * App_Resources path
|
176 | * This is often at the root or inside `src` or `app` directory however can be anywhere.
|
177 | */
|
178 | appResourcesPath?: string;
|
179 | shared?: boolean;
|
180 | previewAppSchema?: string;
|
181 | overridePods?: string;
|
182 | /**
|
183 | * Custom platform project name.
|
184 | * By default, the platforms/{platform}/{name} is based on the basename of the project directory.
|
185 | * You can override that to use a name of your choice by setting this.
|
186 | */
|
187 | projectName?: string;
|
188 | /**
|
189 | * For embedding into existing platform host projects.
|
190 | */
|
191 | embed?: IConfigEmbed;
|
192 | /**
|
193 | * Custom webpack config path
|
194 | * The default is `webpack.config.js` in the root however you can use a custom name and place elsewhere.
|
195 | */
|
196 | webpackConfigPath?: string;
|
197 | /**
|
198 | * iOS specific configurations
|
199 | * Various iOS specific configurations including iOS runtime flags.
|
200 | */
|
201 | ios?: IConfigIOS;
|
202 | /**
|
203 | * Vision Pro specific configurations
|
204 | * Various VisionOS specific configurations including iOS runtime flags.
|
205 | */
|
206 | visionos?: IConfigVisionOS;
|
207 | /**
|
208 | * Android specific configurations
|
209 | * Various Android specific configurations including Android runtime flags.
|
210 | */
|
211 | android?: IConfigAndroid;
|
212 | /**
|
213 | * Enable profiling for the application. Default: no profiling
|
214 | * In most cases when profiling, you will want to use "timeline"
|
215 | */
|
216 | profiling?: InstrumentationMode;
|
217 | /**
|
218 | * Set the default CSS parser that NativeScript will use.
|
219 | * Default: css-tree
|
220 | */
|
221 | cssParser?: 'rework' | 'nativescript' | 'css-tree';
|
222 | /**
|
223 | * Optionally specify a list of npm package names for which you would like the NativeScript CLI to ignore when attaching native dependencies to the build
|
224 | */
|
225 | ignoredNativeDependencies?: string[];
|
226 | /**
|
227 | * Set cli options
|
228 | */
|
229 | cli?: IConfigCLI;
|
230 | /**
|
231 | * Set project persistent hooks to run
|
232 | */
|
233 | hooks?: IConfigHook[];
|
234 | }
|
235 | export {};
|