8000 types: cli and hooks types for config (#9625) · NativeScript/NativeScript@37cc612 · GitHub
[go: up one dir, main page]

Skip to content

Commit 37cc612

Browse files
authored
types: cli and hooks types for config (#9625)
1 parent 05082b1 commit 37cc612

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

packages/core/config/config.interface.ts

Lines changed: 56 additions & 0 deletions
+
| 'before-checkEnvironment' | 'after-checkEnvironment'
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,52 @@ interface IConfigAndroid extends IConfigPlatform {
9494
enableMultithreadedJavascript?: boolean;
9595
}
9696

97+
interface IConfigCLI {
98+
/**
99+
* Set the package manager to use for this project.
100+
* Defaults to the CLI set package manager, or `npm` if not set globally
101+
*/
102+
packageManager: 'yarn' | 'pnpm' | 'npm';
103+
}
104+
105+
interface IConfigHook {
106+
// prettier-ignore
107+
/**
108+
* Event name for when to run the hook.
109+
* Possible event names are any of the following with the pattern
110+
* `before-*` and `after-*`
111+
*
112+
* * `buildAndroidPlugin` - Builds aar file for Android plugin, runs during prepareNativeApp
113+
* * `buildAndroid` - Builds Android app
114+
* * `buildIOS` - Builds iOS app
115+
* * `checkEnvironment` - Validate project env, runs during ns doctor, clean, and most build commands
116+
* * `checkForChanges` - Changes occured during watch
117+
* * `install` - Application installed to device/emulator
118+
* * `prepare` - Compiles webpack and prepares native app in platforms folder
119+
* * `prepareNativeApp` - Preparing the actual native app, runs during prepare/watch hook
120+
* * `resolveCommand` - Resolves command and arguments, runs before all cli commands
121+
* * `watch` - Setup watchers for live sync, runs during prepare hook
122+
* * `watchPatterns` - Setup watch patterns, runs during watch hook
123+
*/
124+
type:
125+
| 'before-buildAndroidPlugin' | 'after-buildAndroidPlugin'
126+
| 'before-buildAndroid' | 'after-buildAndroid'
127+
| 'before-buildIOS' | 'after-buildIOS'
128
129+
| 'before-checkForChanges' | 'after-checkForChanges'
130+
| 'before-install' | 'after-install'
131+
| 'before-prepare' | 'after-prepare'
132+
| 'before-prepareNativeApp' | 'after-prepareNativeApp'
133+
| 'before-resolveCommand' | 'after-resolveCommand'
134+
| 'before-watch' | 'after-watch'
135+
| 'before-watchPatterns' | 'after-watchPatterns';
136+
137+
/**
138+
* Path to the hook script file to run
139+
*/
140+
script: string;
141+
}
142+
97143
export interface NativeScriptConfig {
98144
/**
99145
* App's bundle id
@@ -147,4 +193,14 @@ export interface NativeScriptConfig {
147193
* 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
148194
*/
149195
ignoredNativeDependencies?: string[];
196+
197+
/**
198+
* Set cli options
199+
*/
200+
cli?: IConfigCLI;
201+
202+
/**
203+
* Set project persistent hooks to run
204+
*/
205+
hooks?: IConfigHook[];
150206
}

0 commit comments

Comments
 (0)
0