@@ -18,6 +18,8 @@ import {
1818} from "../common/declarations" ;
1919import { SupportedConfigValues } from "../tools/config-manipulation/config-transformer" ;
2020import * as constants from "../constants" ;
21+ import type { ProjectData } from "../contracts/project-data" ;
22+ import type { ProjectDataService } from "../contracts/project-data-service" ;
2123
2224interface IProjectName {
2325 /**
@@ -209,165 +211,9 @@ interface INsConfig {
209211 buildPath ?: string ;
210212}
211213
212- interface IProjectData extends ICreateProjectData {
213- platformsDir : string ;
214- projectFilePath : string ;
215- projectId : string ;
216- projectIdentifiers ?: Mobile . IProjectIdentifier ;
217- dependencies : any ;
218- ignoredDependencies ?: string [ ] ;
219- devDependencies : IStringDictionary ;
220- appDirectoryPath : string ;
221- appResourcesDirectoryPath : string ;
222- projectType : string ;
223- packageJsonData : any ;
224- nsConfig : INsConfig ;
225- androidManifestPath : string ;
226- appGradlePath : string ;
227- gradleFilesDirectoryPath : string ;
228- infoPlistPath : string ;
229- buildXcconfigPath : string ;
230- podfilePath : string ;
231- initialized ?: boolean ;
232- /**
233- * Defines if the project is a code sharing one.
234- * Value is true when project has nativescript.config and it has `shared: true` in it.
235- */
236- isShared : boolean ;
237- /**
238- * Specifies the bundler used to build the application.
239- *
240- * - `"webpack"`: Uses Webpack for traditional bundling.
241- * - `"rspack"`: Uses Rspack for fast bundling.
242- * - `"vite"`: Uses Vite for fast bundling.
243- *
244- * @default "webpack"
245- */
246- bundler : BundlerType ;
247- /**
248- * @deprecated Use bundlerConfigPath
249- * Defines the path to the configuration file passed to webpack process.
250- * By default this is the webpack.config.js at the root of the application.
251- * The value can be changed by setting `webpackConfigPath` in nativescript.config.
252- */
253- webpackConfigPath : string ;
254- /**
255- * Defines the path to the bundler configuration file passed to the compiler.
256- * The value can be changed by setting `bundlerConfigPath` in nativescript.config.
257- */
258- bundlerConfigPath : string ;
259- projectName : string ;
260-
261- /**
262- * Initializes project data with the given project directory. If none supplied defaults to --path option or cwd.
263- * @param {string } projectDir Project root directory.
264- * @returns {void }
265- */
266- initializeProjectData ( projectDir ?: string ) : void ;
267- initializeProjectDataFromContent (
268- packageJsonContent : string ,
269- projectDir ?: string ,
270- ) : void ;
271- getAppDirectoryPath ( projectDir ?: string ) : string ;
272- getAppDirectoryRelativePath ( ) : string ;
273- getAppResourcesDirectoryPath ( projectDir ?: string ) : string ;
274- getAppResourcesRelativeDirectoryPath ( ) : string ;
275- }
276-
277- interface IProjectDataService {
278- /**
279- * Returns a value from `nativescript` key in project's package.json.
280- * @param {string } projectDir The project directory - the place where the root package.json is located.
281- * @param {string } propertyName The name of the property to be checked in `nativescript` key.
282- * @returns {any } The value of the property.
283- */
284- getNSValue ( projectDir : string , propertyName : string ) : any ;
285-
286- /**
287- * Sets a value in the `nativescript` key in a project's package.json.
288- * @param {string } projectDir The project directory - the place where the root package.json is located.
289- * @param {string } key Key to be added to `nativescript` key in project's package.json.
290- * @param {any } value Value of the key to be added to `nativescript` key in project's package.json.
291- * @returns {void }
292- */
293- setNSValue ( projectDir : string , key : string , value : any ) : void ;
294-
295- /**
296- * Removes a property from `nativescript` key in project's package.json.
297- * @param {string } projectDir The project directory - the place where the root package.json is located.
298- * @param {string } propertyName The name of the property to be removed from `nativescript` key.
299- * @returns {void }
300- */
301- removeNSProperty ( projectDir : string , propertyName : string ) : void ;
302-
303- /**
304- * Removes a property from `nativescript.config`.
305- * @param {string } projectDir The project directory - the place where the `nativescript.config` is located.
306- * @param {string } propertyName The name of the property to be removed.
307- * @returns {void }
308- */
309- removeNSConfigProperty ( projectDir : string , propertyName : string ) : void ;
214+ interface IProjectData extends ProjectData { }
310215
311- /**
312- * Removes dependency from package.json
313- * @param {string } projectDir The project directory - the place where the root package.json is located.
314- * @param {string } dependencyName Name of the dependency that has to be removed.
315- * @returns {void }
316- */
317- removeDependency ( projectDir : string , dependencyName : string ) : void ;
318-
319- getProjectData ( projectDir ?: string ) : IProjectData ;
320-
321- /**
322- * Gives information about the whole assets structure for both iOS and Android.
323- * For each of the platforms, the returned object will contain icons, splashBackgrounds, splashCenterImages and splashImages (only for iOS).
324- * @param {IProjectDir } opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
325- * @returns {Promise<IAssetsStructure> } An object describing the current asset structure.
326- */
327- getAssetsStructure ( opts : IProjectDir ) : Promise < IAssetsStructure > ;
328-
329- /**
330- * Gives information about the whole assets structure for iOS.
331- * The returned object will contain icons, splashBackgrounds, splashCenterImages and splashImages.
332- * @param {IProjectDir } opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
333- * @returns {Promise<IAssetGroup> } An object describing the current asset structure for iOS.
334- */
335- getIOSAssetsStructure ( opts : IProjectDir ) : Promise < IAssetGroup > ;
336-
337- /**
338- * Gives information about the whole assets structure for Android.
339- * The returned object will contain icons, splashBackgrounds and splashCenterImages.
340- * @param {IProjectDir } opts Object with a single property - projectDir. This is the root directory where NativeScript project is located.
341- * @returns {Promise<IAssetGroup> } An object describing the current asset structure for Android.
342- */
343- getAndroidAssetsStructure ( opts : IProjectDir ) : Promise < IAssetGroup > ;
344-
345- /**
346- * Returns array with paths to all `.js` or `.ts` files in application's app directory.
347- * @param {string } projectDir Path to application.
348- * @returns {string[] } Array of paths to `.js` or `.ts` files.
349- */
350- getAppExecutableFiles ( projectDir : string ) : string [ ] ;
351-
352- /**
353- * Returns package details for runtime, respecting the nativescript key for legacy projects
354- * @param {string } projectDir Path to application.
355- * @param {string } platform Platform key
356- */
357- getRuntimePackage (
358- projectDir : string ,
359- platform : SupportedPlatform ,
360- ) : IBasePluginData ;
361-
362- /**
363- * Returns a value from `nativescript` key in project's package.json.
364- * @param {string } jsonData The project directory - the place where the root package.json is located.
365- * @param {string } propertyName The name of the property to be checked in `nativescript` key.
366- * @returns {any } The value of the property.
367- * @deprecated no longer used - will be removed in 8.0.
368- */
369- getNSValueFromContent ( jsonData : Object , propertyName : string ) : any ;
370- }
216+ interface IProjectDataService extends ProjectDataService { }
371217
372218interface IProjectCleanupService {
373219 /**
0 commit comments