From 114d31661a8e7d238088525bd34b9f83e310fdc3 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 20 Mar 2025 13:02:00 -0700 Subject: [PATCH 01/16] feat: config + compiler option for rspack, vite with fallback to webpack --- .../webpack/webpack-compiler-service.ts | 129 ++++++++++-------- 1 file changed, 73 insertions(+), 56 deletions(-) diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 323899793a..0758b233e4 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -16,7 +16,7 @@ import { IOptions, } from "../../declarations"; import { IPlatformData } from "../../definitions/platform"; -import { IProjectData } from "../../definitions/project"; +import { IProjectConfigService, IProjectData } from "../../definitions/project"; import { IDictionary, IErrors, @@ -64,7 +64,8 @@ export class WebpackCompilerService private $mobileHelper: Mobile.IMobileHelper, private $cleanupService: ICleanupService, private $packageManager: IPackageManager, - private $packageInstallationManager: IPackageInstallationManager // private $sharedEventBus: ISharedEventBus + private $packageInstallationManager: IPackageInstallationManager, + private $projectConfigService: IProjectConfigService, ) { super(); } @@ -72,7 +73,7 @@ export class WebpackCompilerService public async compileWithWatch( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise { return new Promise(async (resolve, reject) => { if (this.webpackProcesses[platformData.platformNameLowerCase]) { @@ -86,7 +87,7 @@ export class WebpackCompilerService const childProcess = await this.startWebpackProcess( platformData, projectData, - prepareData + prepareData, ); childProcess.stdout.on("data", function (data) { @@ -125,7 +126,7 @@ export class WebpackCompilerService message as IWebpackMessage, platformData, projectData, - prepareData + prepareData, ); } @@ -153,7 +154,7 @@ export class WebpackCompilerService message.emittedFiles, message.chunkFiles, message.hash, - platformData.platformNameLowerCase + platformData.platformNameLowerCase, ); } else { result = { @@ -166,21 +167,21 @@ export class WebpackCompilerService path.join( platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, - file - ) + file, + ), ); const fallbackFiles = result.fallbackFiles.map((file: string) => path.join( platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, - file - ) + file, + ), ); const data = { files, hasOnlyHotUpdateFiles: files.every( - (f) => f.indexOf("hot-update") > -1 + (f) => f.indexOf("hot-update") > -1, ), hmrData: { hash: result.hash, @@ -204,7 +205,7 @@ export class WebpackCompilerService childProcess.on("error", (err) => { this.$logger.trace( - `Unable to start webpack process in watch mode. Error is: ${err}` + `Unable to start webpack process in watch mode. Error is: ${err}`, ); delete this.webpackProcesses[platformData.platformNameLowerCase]; reject(err); @@ -212,15 +213,15 @@ export class WebpackCompilerService childProcess.on("close", async (arg: any) => { await this.$cleanupService.removeKillProcess( - childProcess.pid.toString() + childProcess.pid.toString(), ); const exitCode = typeof arg === "number" ? arg : arg && arg.code; this.$logger.trace( - `Webpack process exited with code ${exitCode} when we expected it to be long living with watch.` + `Webpack process exited with code ${exitCode} when we expected it to be long living with watch.`, ); const error: any = new Error( - `Executing webpack failed with exit code ${exitCode}.` + `Executing webpack failed with exit code ${exitCode}.`, ); error.code = exitCode; delete this.webpackProcesses[platformData.platformNameLowerCase]; @@ -235,7 +236,7 @@ export class WebpackCompilerService public async compileWithoutWatch( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise { return new Promise(async (resolve, reject) => { if (this.webpackProcesses[platformData.platformNameLowerCase]) { @@ -247,12 +248,12 @@ export class WebpackCompilerService const childProcess = await this.startWebpackProcess( platformData, projectData, - prepareData + prepareData, ); childProcess.on("error", (err) => { this.$logger.trace( - `Unable to start webpack process in non-watch mode. Error is: ${err}` + `Unable to start webpack process in non-watch mode. Error is: ${err}`, ); delete this.webpackProcesses[platformData.platformNameLowerCase]; reject(err); @@ -260,7 +261,7 @@ export class WebpackCompilerService childProcess.on("close", async (arg: any) => { await this.$cleanupService.removeKillProcess( - childProcess.pid.toString() + childProcess.pid.toString(), ); delete this.webpackProcesses[platformData.platformNameLowerCase]; @@ -269,7 +270,7 @@ export class WebpackCompilerService resolve(); } else { const error: any = new Error( - `Executing webpack failed with exit code ${exitCode}.` + `Executing webpack failed with exit code ${exitCode}.`, ); error.code = exitCode; reject(error); @@ -307,24 +308,24 @@ export class WebpackCompilerService private async startWebpackProcess( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise { if (!this.$fs.exists(projectData.webpackConfigPath)) { this.$errors.fail( - `The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.` + `The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, ); } const envData = this.buildEnvData( platformData.platformNameLowerCase, projectData, - prepareData + prepareData, ); const envParams = await this.buildEnvCommandLineParams( envData, platformData, projectData, - prepareData + prepareData, ); const additionalNodeArgs = semver.major(process.version) <= 8 ? ["--harmony"] : []; @@ -340,7 +341,7 @@ export class WebpackCompilerService const args = [ ...additionalNodeArgs, this.getWebpackExecutablePath(projectData), - this.isWebpack5(projectData) ? `build` : null, + this.isModernBundler(projectData) ? `build` : null, `--config=${projectData.webpackConfigPath}`, ...envParams, ].filter(Boolean); @@ -372,7 +373,7 @@ export class WebpackCompilerService const childProcess = this.$childProcess.spawn( process.execPath, args, - options + options, ); this.webpackProcesses[platformData.platformNameLowerCase] = childProcess; @@ -384,7 +385,7 @@ export class WebpackCompilerService private buildEnvData( platform: string, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ) { const { env } = prepareData; const envData = Object.assign({}, env, { [platform.toLowerCase()]: true }); @@ -403,9 +404,9 @@ export class WebpackCompilerService __dirname, "..", "..", - "nativescript-cli-lib.js" + "nativescript-cli-lib.js", ), - } + }, ); envData.verbose = envData.verbose || this.$logger.isVerbose(); @@ -452,7 +453,7 @@ export class WebpackCompilerService envData: any, platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ) { const envFlagNames = Object.keys(envData); const canSnapshot = @@ -462,7 +463,7 @@ export class WebpackCompilerService if (!canSnapshot) { this.$logger.warn( "Stripping the snapshot flag. " + - "Bear in mind that snapshot is only available in Android release builds." + "Bear in mind that snapshot is only available in Android release builds.", ); envFlagNames.splice(envFlagNames.indexOf("snapshot"), 1); } else if (this.$hostInfo.isWindows) { @@ -470,18 +471,18 @@ export class WebpackCompilerService const installedWebpackPluginVersion = await this.$packageInstallationManager.getInstalledDependencyVersion( WEBPACK_PLUGIN_NAME, - projectData.projectDir + projectData.projectDir, ); const hasWebpackPluginWithWinSnapshotsSupport = !!installedWebpackPluginVersion ? semver.gte( semver.coerce(installedWebpackPluginVersion), - minWebpackPluginWithWinSnapshotsVersion - ) + minWebpackPluginWithWinSnapshotsVersion, + ) : true; if (!hasWebpackPluginWithWinSnapshotsSupport) { this.$errors.fail( - `In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i ${WEBPACK_PLUGIN_NAME}@latest).` + `In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i ${WEBPACK_PLUGIN_NAME}@latest).`, ); } } @@ -513,7 +514,7 @@ export class WebpackCompilerService allEmittedFiles: string[], chunkFiles: string[], nextHash: string, - platform: string + platform: string, ) { const currentHash = this.getCurrentHotUpdateHash(allEmittedFiles); @@ -535,7 +536,7 @@ export class WebpackCompilerService ? _.difference(allEmittedFiles, chunkFiles) : allEmittedFiles; const fallbackFiles = chunkFiles.concat( - emittedHotUpdatesAndAssets.filter((f) => f.indexOf("hot-update") === -1) + emittedHotUpdatesAndAssets.filter((f) => f.indexOf("hot-update") === -1), ); return { @@ -548,7 +549,7 @@ export class WebpackCompilerService private getCurrentHotUpdateHash(emittedFiles: string[]) { let hotHash; const hotUpdateScripts = emittedFiles.filter((x) => - x.endsWith(".hot-update.js") + x.endsWith(".hot-update.js"), ); if (hotUpdateScripts && hotUpdateScripts.length) { // the hash is the same for each hot update in the current compilation @@ -575,7 +576,7 @@ export class WebpackCompilerService message: IWebpackMessage, platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ) { // handle new webpack hmr packets this.$logger.trace("Received message from webpack process:", message); @@ -590,21 +591,21 @@ export class WebpackCompilerService path.join( platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, - asset - ) + asset, + ), ); const staleFiles = message.data.staleAssets.map((asset: string) => path.join( platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, - asset - ) + asset, + ), ); // extract last hash from emitted filenames const lastHash = (() => { const absoluteFileNameWithLastHash = files.find((fileName: string) => - fileName.endsWith("hot-update.js") + fileName.endsWith("hot-update.js"), ); if (!absoluteFileNameWithLastHash) { @@ -636,8 +637,10 @@ export class WebpackCompilerService } private getWebpackExecutablePath(projectData: IProjectData): string { - if (this.isWebpack5(projectData)) { - const packagePath = resolvePackagePath("@nativescript/webpack", { + const bundler = this.getBundler(); + + if (this.isModernBundler(projectData)) { + const packagePath = resolvePackagePath(`@nativescript/${bundler}`, { paths: [projectData.projectDir], }); @@ -657,22 +660,36 @@ export class WebpackCompilerService return path.resolve(packagePath, "bin", "webpack.js"); } - private isWebpack5(projectData: IProjectData): boolean { - const packageJSONPath = resolvePackageJSONPath("@nativescript/webpack", { - paths: [projectData.projectDir], - }); + private isModernBundler(projectData: IProjectData): boolean { + const bundler = this.getBundler(); + switch (bundler) { + case "rspack": + return true; + default: + const packageJSONPath = resolvePackageJSONPath( + "@nativescript/webpack", + { + paths: [projectData.projectDir], + }, + ); - if (packageJSONPath) { - const packageData = this.$fs.readJson(packageJSONPath); - const ver = semver.coerce(packageData.version); + if (packageJSONPath) { + const packageData = this.$fs.readJson(packageJSONPath); + const ver = semver.coerce(packageData.version); - if (semver.satisfies(ver, ">= 5.0.0")) { - return true; - } + if (semver.satisfies(ver, ">= 5.0.0")) { + return true; + } + } + break; } return false; } + + public getBundler(): "webpack" | "rspack" | "vite" { + return this.$projectConfigService.getValue(`bundler`, "webpack"); + } } injector.register("webpackCompilerService", WebpackCompilerService); From 2451f15aba04687cf9c2549a848b1c51fea7e19c Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 21 Mar 2025 14:14:52 -0700 Subject: [PATCH 02/16] feat: bundler config https://github.com/NativeScript/nativescript-cli/issues/5836 --- lib/definitions/project.d.ts | 7 ++++ lib/project-data.ts | 41 +++++++++++-------- .../webpack/webpack-compiler-service.ts | 18 +++++--- test/stubs.ts | 1 + 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/lib/definitions/project.d.ts b/lib/definitions/project.d.ts index e99e204691..3b557bf5e1 100644 --- a/lib/definitions/project.d.ts +++ b/lib/definitions/project.d.ts @@ -182,6 +182,7 @@ interface INsConfig { shared?: boolean; overridePods?: string; webpackConfigPath?: string; + bundlerConfigPath?: string; ios?: INsConfigIOS; android?: INsConfigAndroid; visionos?: INSConfigVisionOS; @@ -217,11 +218,17 @@ interface IProjectData extends ICreateProjectData { isShared: boolean; /** + * @deprecated Use bundlerConfigPath * Defines the path to the configuration file passed to webpack process. * By default this is the webpack.config.js at the root of the application. * The value can be changed by setting `webpackConfigPath` in nativescript.config. */ webpackConfigPath: string; + /** + * Defines the path to the bundler configuration file passed to the compiler. + * The value can be changed by setting `bundlerConfigPath` in nativescript.config. + */ + bundlerConfigPath: string; projectName: string; /** diff --git a/lib/project-data.ts b/lib/project-data.ts index 3e36c374b5..5505ca8b6e 100644 --- a/lib/project-data.ts +++ b/lib/project-data.ts @@ -99,6 +99,7 @@ export class ProjectData implements IProjectData { public podfilePath: string; public isShared: boolean; public webpackConfigPath: string; + public bundlerConfigPath: string; public initialized: boolean; constructor( @@ -110,7 +111,7 @@ export class ProjectData implements IProjectData { private $logger: ILogger, private $injector: IInjector, private $androidResourcesMigrationService: IAndroidResourcesMigrationService, - private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants + private $devicePlatformsConstants: Mobile.IDevicePlatformsConstants, ) {} get projectConfig(): IProjectConfigService { @@ -142,7 +143,7 @@ export class ProjectData implements IProjectData { public initializeProjectDataFromContent( packageJsonContent: string, - projectDir?: string + projectDir?: string, ): void { projectDir = projectDir || this.$projectHelper.projectDir || ""; this.projectDir = projectDir; @@ -157,7 +158,7 @@ export class ProjectData implements IProjectData { this.$errors.fail( `The project file ${this.projectFilePath} is corrupted. ${EOL}` + `Consider restoring an earlier version from your source control or backup.${EOL}` + - `Additional technical info: ${err.toString()}` + `Additional technical info: ${err.toString()}`, ); } @@ -178,36 +179,40 @@ export class ProjectData implements IProjectData { this.appDirectoryPath = this.getAppDirectoryPath(); this.appResourcesDirectoryPath = this.getAppResourcesDirectoryPath(); this.androidManifestPath = this.getPathToAndroidManifest( - this.appResourcesDirectoryPath + this.appResourcesDirectoryPath, ); this.gradleFilesDirectoryPath = path.join( this.appResourcesDirectoryPath, - this.$devicePlatformsConstants.Android + this.$devicePlatformsConstants.Android, ); this.appGradlePath = path.join( this.gradleFilesDirectoryPath, - constants.APP_GRADLE_FILE_NAME + constants.APP_GRADLE_FILE_NAME, ); this.infoPlistPath = path.join( this.appResourcesDirectoryPath, this.$devicePlatformsConstants.iOS, - constants.INFO_PLIST_FILE_NAME + constants.INFO_PLIST_FILE_NAME, ); this.buildXcconfigPath = path.join( this.appResourcesDirectoryPath, this.$devicePlatformsConstants.iOS, - constants.BUILD_XCCONFIG_FILE_NAME + constants.BUILD_XCCONFIG_FILE_NAME, ); this.podfilePath = path.join( this.appResourcesDirectoryPath, this.$devicePlatformsConstants.iOS, - constants.PODFILE_NAME + constants.PODFILE_NAME, ); this.isShared = !!(this.nsConfig && this.nsConfig.shared); this.webpackConfigPath = this.nsConfig && this.nsConfig.webpackConfigPath ? path.resolve(this.projectDir, this.nsConfig.webpackConfigPath) : path.join(this.projectDir, "webpack.config.js"); + this.bundlerConfigPath = + this.nsConfig && this.nsConfig.bundlerConfigPath + ? path.resolve(this.projectDir, this.nsConfig.bundlerConfigPath) + : null; return; } @@ -217,7 +222,7 @@ export class ProjectData implements IProjectData { private getPathToAndroidManifest(appResourcesDir: string): string { const androidDirPath = path.join( appResourcesDir, - this.$devicePlatformsConstants.Android + this.$devicePlatformsConstants.Android, ); const androidManifestDir = this.$androidResourcesMigrationService.hasMigrated(appResourcesDir) @@ -230,13 +235,13 @@ export class ProjectData implements IProjectData { private errorInvalidProject(projectDir: string): void { const currentDir = path.resolve("."); this.$logger.trace( - `Unable to find project. projectDir: ${projectDir}, options.path: ${this.$options.path}, ${currentDir}` + `Unable to find project. projectDir: ${projectDir}, options.path: ${this.$options.path}, ${currentDir}`, ); // This is the case when no project file found this.$errors.fail( "No project found at or above '%s' and neither was a --path specified.", - projectDir || this.$options.path || currentDir + projectDir || this.$options.path || currentDir, ); } @@ -291,7 +296,7 @@ export class ProjectData implements IProjectData { private resolveToProjectDir( pathToResolve: string, - projectDir?: string + projectDir?: string, ): string { if (!projectDir) { projectDir = this.projectDir; @@ -306,7 +311,7 @@ export class ProjectData implements IProjectData { @cache() private initializeProjectIdentifiers( - config: INsConfig + config: INsConfig, ): Mobile.IProjectIdentifier { this.$logger.trace(`Initializing project identifiers. Config: `, config); @@ -341,18 +346,18 @@ export class ProjectData implements IProjectData { private getProjectType(): string { let detectedProjectType = _.find( ProjectData.PROJECT_TYPES, - (projectType) => projectType.isDefaultProjectType + (projectType) => projectType.isDefaultProjectType, ).type; const deps: string[] = _.keys(this.dependencies).concat( - _.keys(this.devDependencies) + _.keys(this.devDependencies), ); _.each(ProjectData.PROJECT_TYPES, (projectType) => { if ( _.some( projectType.requiredDependencies, - (requiredDependency) => deps.indexOf(requiredDependency) !== -1 + (requiredDependency) => deps.indexOf(requiredDependency) !== -1, ) ) { detectedProjectType = projectType.type; @@ -366,7 +371,7 @@ export class ProjectData implements IProjectData { @cache() private warnProjectId(): void { this.$logger.warn( - "[WARNING]: IProjectData.projectId is deprecated. Please use IProjectData.projectIdentifiers[platform]." + "[WARNING]: IProjectData.projectId is deprecated. Please use IProjectData.projectIdentifiers[platform].", ); } } diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/webpack/webpack-compiler-service.ts index 0758b233e4..0c8924b2a2 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/webpack/webpack-compiler-service.ts @@ -310,10 +310,18 @@ export class WebpackCompilerService projectData: IProjectData, prepareData: IPrepareData, ): Promise { - if (!this.$fs.exists(projectData.webpackConfigPath)) { - this.$errors.fail( - `The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, - ); + if (projectData.bundlerConfigPath) { + if (!this.$fs.exists(projectData.bundlerConfigPath)) { + this.$errors.fail( + `The bundler configuration file ${projectData.bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, + ); + } + } else { + if (!this.$fs.exists(projectData.webpackConfigPath)) { + this.$errors.fail( + `The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, + ); + } } const envData = this.buildEnvData( @@ -342,7 +350,7 @@ export class WebpackCompilerService ...additionalNodeArgs, this.getWebpackExecutablePath(projectData), this.isModernBundler(projectData) ? `build` : null, - `--config=${projectData.webpackConfigPath}`, + `--config=${projectData.bundlerConfigPath || projectData.webpackConfigPath}`, ...envParams, ].filter(Boolean); diff --git a/test/stubs.ts b/test/stubs.ts index fc4d687c15..404660d467 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -658,6 +658,7 @@ export class ProjectDataStub implements IProjectData { projectDir: string; projectName: string; webpackConfigPath: string; + bundlerConfigPath: string; get platformsDir(): string { return ( From 247f9618c53ba6a8e8c7dedd54392c0e6606a8e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20de=20Dios=20Mart=C3=ADnez=20Vallejo?= Date: Tue, 25 Mar 2025 16:20:07 +0100 Subject: [PATCH 03/16] feat: bundler config refactor (#5840) --- lib/bootstrap.ts | 4 +- lib/constants.ts | 3 + lib/controllers/prepare-controller.ts | 16 +- lib/definitions/project.d.ts | 13 +- lib/project-data.ts | 9 + .../bundler-compiler-service.ts} | 188 ++++++++++-------- .../webpack.d.ts => bundler/bundler.ts} | 42 ++-- test/controllers/prepare-controller.ts | 6 +- .../bundler-compiler-service.ts} | 113 ++++++----- test/stubs.ts | 2 + 10 files changed, 224 insertions(+), 172 deletions(-) rename lib/services/{webpack/webpack-compiler-service.ts => bundler/bundler-compiler-service.ts} (77%) rename lib/services/{webpack/webpack.d.ts => bundler/bundler.ts} (90%) rename test/services/{webpack/webpack-compiler-service.ts => bundler/bundler-compiler-service.ts} (62%) diff --git a/lib/bootstrap.ts b/lib/bootstrap.ts index ca8fe39888..ad181a1062 100644 --- a/lib/bootstrap.ts +++ b/lib/bootstrap.ts @@ -414,8 +414,8 @@ injector.require( injector.requirePublic("cleanupService", "./services/cleanup-service"); injector.require( - "webpackCompilerService", - "./services/webpack/webpack-compiler-service", + "bundlerCompilerService", + "./services/bundler/bundler-compiler-service", ); injector.require( diff --git a/lib/constants.ts b/lib/constants.ts index 0ac436ec77..b9dc247d83 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -16,6 +16,7 @@ export const SCOPED_TNS_CORE_MODULES = "@nativescript/core"; export const TNS_CORE_THEME_NAME = "nativescript-theme-core"; export const SCOPED_TNS_CORE_THEME_NAME = "@nativescript/theme"; export const WEBPACK_PLUGIN_NAME = "@nativescript/webpack"; +export const RSPACK_PLUGIN_NAME = "@nativescript/rspack"; export const TNS_CORE_MODULES_WIDGETS_NAME = "tns-core-modules-widgets"; export const UI_MOBILE_BASE_NAME = "@nativescript/ui-mobile-base"; export const TNS_ANDROID_RUNTIME_NAME = "tns-android"; @@ -36,6 +37,7 @@ export const XML_FILE_EXTENSION = ".xml"; export const PLATFORMS_DIR_NAME = "platforms"; export const HOOKS_DIR_NAME = "hooks"; export const WEBPACK_CONFIG_NAME = "webpack.config.js"; +export const RSPACK_CONFIG_NAME = "rspack.config.js"; export const TSCCONFIG_TNS_JSON_NAME = "tsconfig.tns.json"; export const KARMA_CONFIG_NAME = "karma.conf.js"; export const LIB_DIR_NAME = "lib"; @@ -223,6 +225,7 @@ export const FILES_CHANGE_EVENT_NAME = "filesChangeEvent"; export const INITIAL_SYNC_EVENT_NAME = "initialSyncEvent"; export const PREPARE_READY_EVENT_NAME = "prepareReadyEvent"; export const WEBPACK_COMPILATION_COMPLETE = "webpackCompilationComplete"; +export const BUNDLER_COMPILATION_COMPLETE = "bundlerCompilationComplete"; export class DebugCommandErrors { public static UNABLE_TO_USE_FOR_DEVICE_AND_EMULATOR = diff --git a/lib/controllers/prepare-controller.ts b/lib/controllers/prepare-controller.ts index 8ba3550b86..7b21219f63 100644 --- a/lib/controllers/prepare-controller.ts +++ b/lib/controllers/prepare-controller.ts @@ -67,7 +67,7 @@ export class PrepareController extends EventEmitter { private $prepareNativePlatformService: IPrepareNativePlatformService, private $projectChangesService: IProjectChangesService, private $projectDataService: IProjectDataService, - private $webpackCompilerService: IWebpackCompilerService, + private $bundlerCompilerService: IBundlerCompilerService, private $watchIgnoreListService: IWatchIgnoreListService, private $analyticsService: IAnalyticsService, private $markingModeService: IMarkingModeService, @@ -117,8 +117,8 @@ export class PrepareController extends EventEmitter { this.watchersData[projectDir][platformLowerCase] && this.watchersData[projectDir][platformLowerCase].hasWebpackCompilerProcess ) { - await this.$webpackCompilerService.stopWebpackCompiler(platformLowerCase); - this.$webpackCompilerService.removeListener( + await this.$bundlerCompilerService.stopBundlerCompiler(platformLowerCase); + this.$bundlerCompilerService.removeListener( WEBPACK_COMPILATION_COMPLETE, this.webpackCompilerHandler, ); @@ -177,7 +177,7 @@ export class PrepareController extends EventEmitter { prepareData, ); } else { - await this.$webpackCompilerService.compileWithoutWatch( + await this.$bundlerCompilerService.compileWithoutWatch( platformData, projectData, prepareData, @@ -296,7 +296,7 @@ export class PrepareController extends EventEmitter { }; this.webpackCompilerHandler = handler.bind(this); - this.$webpackCompilerService.on( + this.$bundlerCompilerService.on( WEBPACK_COMPILATION_COMPLETE, this.webpackCompilerHandler, ); @@ -304,7 +304,7 @@ export class PrepareController extends EventEmitter { this.watchersData[projectData.projectDir][ platformData.platformNameLowerCase ].hasWebpackCompilerProcess = true; - await this.$webpackCompilerService.compileWithWatch( + await this.$bundlerCompilerService.compileWithWatch( platformData, projectData, prepareData, @@ -560,7 +560,7 @@ export class PrepareController extends EventEmitter { if (this.pausedFileWatch) { for (const watcher of watchers) { for (const platform in watcher) { - await this.$webpackCompilerService.stopWebpackCompiler(platform); + await this.$bundlerCompilerService.stopBundlerCompiler(platform); watcher[platform].hasWebpackCompilerProcess = false; } } @@ -569,7 +569,7 @@ export class PrepareController extends EventEmitter { for (const platform in watcher) { const args = watcher[platform].prepareArguments; watcher[platform].hasWebpackCompilerProcess = true; - await this.$webpackCompilerService.compileWithWatch( + await this.$bundlerCompilerService.compileWithWatch( args.platformData, args.projectData, args.prepareData, diff --git a/lib/definitions/project.d.ts b/lib/definitions/project.d.ts index 3b557bf5e1..c8046b2ed4 100644 --- a/lib/definitions/project.d.ts +++ b/lib/definitions/project.d.ts @@ -121,6 +121,7 @@ export interface IOSLocalSPMPackage extends IOSSPMPackageBase { } export type IOSSPMPackage = IOSRemoteSPMPackage | IOSLocalSPMPackage; +export type BundlerType = "webpack" | "rspack" | "vite"; interface INsConfigIOS extends INsConfigPlaform { discardUncaughtJsExceptions?: boolean; @@ -183,6 +184,7 @@ interface INsConfig { overridePods?: string; webpackConfigPath?: string; bundlerConfigPath?: string; + bundler?: BundlerType; ios?: INsConfigIOS; android?: INsConfigAndroid; visionos?: INSConfigVisionOS; @@ -216,7 +218,16 @@ interface IProjectData extends ICreateProjectData { * Value is true when project has nativescript.config and it has `shared: true` in it. */ isShared: boolean; - + /** + * Specifies the bundler used to build the application. + * + * - `"webpack"`: Uses Webpack for traditional bundling. + * - `"rspack"`: Uses Rspack for fast bundling. + * - `"vite"`: Uses Vite for fast bundling. + * + * @default "webpack" + */ + bundler: BundlerType; /** * @deprecated Use bundlerConfigPath * Defines the path to the configuration file passed to webpack process. diff --git a/lib/project-data.ts b/lib/project-data.ts index 5505ca8b6e..cbe06da65f 100644 --- a/lib/project-data.ts +++ b/lib/project-data.ts @@ -5,6 +5,7 @@ import { parseJson } from "./common/helpers"; import { EOL } from "os"; import { cache } from "./common/decorators"; import { + BundlerType, INsConfig, IProjectConfigService, IProjectData, @@ -100,6 +101,7 @@ export class ProjectData implements IProjectData { public isShared: boolean; public webpackConfigPath: string; public bundlerConfigPath: string; + public bundler: BundlerType; public initialized: boolean; constructor( @@ -213,6 +215,13 @@ export class ProjectData implements IProjectData { this.nsConfig && this.nsConfig.bundlerConfigPath ? path.resolve(this.projectDir, this.nsConfig.bundlerConfigPath) : null; + this.bundler = + this.nsConfig && this.nsConfig.bundler + ? (path.resolve( + this.projectDir, + this.nsConfig.bundler, + ) as BundlerType) + : "webpack"; return; } diff --git a/lib/services/webpack/webpack-compiler-service.ts b/lib/services/bundler/bundler-compiler-service.ts similarity index 77% rename from lib/services/webpack/webpack-compiler-service.ts rename to lib/services/bundler/bundler-compiler-service.ts index 0c8924b2a2..65b496a2b3 100644 --- a/lib/services/webpack/webpack-compiler-service.ts +++ b/lib/services/bundler/bundler-compiler-service.ts @@ -5,8 +5,8 @@ import * as _ from "lodash"; import { EventEmitter } from "events"; import { performanceLog } from "../../common/decorators"; import { - WEBPACK_COMPILATION_COMPLETE, WEBPACK_PLUGIN_NAME, + BUNDLER_COMPILATION_COMPLETE, PackageManagers, CONFIG_FILE_NAME_DISPLAY, } from "../../constants"; @@ -16,7 +16,11 @@ import { IOptions, } from "../../declarations"; import { IPlatformData } from "../../definitions/platform"; -import { IProjectConfigService, IProjectData } from "../../definitions/project"; +import { + BundlerType, + IProjectConfigService, + IProjectData, +} from "../../definitions/project"; import { IDictionary, IErrors, @@ -34,23 +38,23 @@ import { } from "../../helpers/package-path-helper"; // todo: move out of here -interface IWebpackMessage { +interface IBundlerMessage { type: "compilation" | "hmr-status"; version?: number; hash?: string; data?: T; } -interface IWebpackCompilation { +interface IBundlerCompilation { emittedAssets: string[]; staleAssets: string[]; } -export class WebpackCompilerService +export class BundlerCompilerService extends EventEmitter - implements IWebpackCompilerService + implements IBundlerCompilerService { - private webpackProcesses: IDictionary = {}; + private bundlerProcesses: IDictionary = {}; private expectedHashes: IStringDictionary = {}; constructor( @@ -76,15 +80,15 @@ export class WebpackCompilerService prepareData: IPrepareData, ): Promise { return new Promise(async (resolve, reject) => { - if (this.webpackProcesses[platformData.platformNameLowerCase]) { + if (this.bundlerProcesses[platformData.platformNameLowerCase]) { resolve(void 0); return; } - let isFirstWebpackWatchCompilation = true; + let isFirstBundlerWatchCompilation = true; prepareData.watch = true; try { - const childProcess = await this.startWebpackProcess( + const childProcess = await this.startBundleProcess( platformData, projectData, prepareData, @@ -98,8 +102,8 @@ export class WebpackCompilerService process.stderr.write(data); }); - childProcess.on("message", (message: string | IWebpackEmitMessage) => { - this.$logger.trace("Message from webpack", message); + childProcess.on("message", (message: string | IBundlerEmitMessage) => { + this.$logger.trace(`Message from ${projectData.bundler}`, message); // if we are on webpack5 - we handle HMR in a slightly different way if ( @@ -109,8 +113,8 @@ export class WebpackCompilerService ) { // first compilation can be ignored because it will be synced regardless // handling it here would trigger 2 syncs - if (isFirstWebpackWatchCompilation) { - isFirstWebpackWatchCompilation = false; + if (isFirstBundlerWatchCompilation) { + isFirstBundlerWatchCompilation = false; resolve(childProcess); return; } @@ -123,22 +127,27 @@ export class WebpackCompilerService // } return this.handleHMRMessage( - message as IWebpackMessage, + message as IBundlerMessage, platformData, projectData, prepareData, ); } - if (message === "Webpack compilation complete.") { - this.$logger.info("Webpack build done!"); + if ( + message === + `${capitalizeFirstLetter(projectData.bundler)} compilation complete.` + ) { + this.$logger.info( + `${capitalizeFirstLetter(projectData.bundler)} build done!`, + ); resolve(childProcess); } - message = message as IWebpackEmitMessage; + message = message as IBundlerEmitMessage; if (message.emittedFiles) { - if (isFirstWebpackWatchCompilation) { - isFirstWebpackWatchCompilation = false; + if (isFirstBundlerWatchCompilation) { + isFirstBundlerWatchCompilation = false; this.expectedHashes[platformData.platformNameLowerCase] = prepareData.hmr ? message.hash : ""; return; @@ -190,7 +199,10 @@ export class WebpackCompilerService platform: platformData.platformNameLowerCase, }; - this.$logger.trace("Generated data from webpack message:", data); + this.$logger.trace( + `Generated data from ${projectData.bundler} message:`, + data, + ); // the hash of the compilation is the same as the previous one and there are only hot updates produced if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) { @@ -198,16 +210,16 @@ export class WebpackCompilerService } if (data.files.length) { - this.emit(WEBPACK_COMPILATION_COMPLETE, data); + this.emit(BUNDLER_COMPILATION_COMPLETE, data); } } }); childProcess.on("error", (err) => { this.$logger.trace( - `Unable to start webpack process in watch mode. Error is: ${err}`, + `Unable to start ${projectData.bundler} process in watch mode. Error is: ${err}`, ); - delete this.webpackProcesses[platformData.platformNameLowerCase]; + delete this.bundlerProcesses[platformData.platformNameLowerCase]; reject(err); }); @@ -218,13 +230,13 @@ export class WebpackCompilerService const exitCode = typeof arg === "number" ? arg : arg && arg.code; this.$logger.trace( - `Webpack process exited with code ${exitCode} when we expected it to be long living with watch.`, + `${capitalizeFirstLetter(projectData.bundler)} process exited with code ${exitCode} when we expected it to be long living with watch.`, ); const error: any = new Error( - `Executing webpack failed with exit code ${exitCode}.`, + `Executing ${projectData.bundler} failed with exit code ${exitCode}.`, ); error.code = exitCode; - delete this.webpackProcesses[platformData.platformNameLowerCase]; + delete this.bundlerProcesses[platformData.platformNameLowerCase]; reject(error); }); } catch (err) { @@ -239,13 +251,13 @@ export class WebpackCompilerService prepareData: IPrepareData, ): Promise { return new Promise(async (resolve, reject) => { - if (this.webpackProcesses[platformData.platformNameLowerCase]) { + if (this.bundlerProcesses[platformData.platformNameLowerCase]) { resolve(); return; } try { - const childProcess = await this.startWebpackProcess( + const childProcess = await this.startBundleProcess( platformData, projectData, prepareData, @@ -253,9 +265,9 @@ export class WebpackCompilerService childProcess.on("error", (err) => { this.$logger.trace( - `Unable to start webpack process in non-watch mode. Error is: ${err}`, + `Unable to start ${projectData.bundler} process in non-watch mode. Error is: ${err}`, ); - delete this.webpackProcesses[platformData.platformNameLowerCase]; + delete this.bundlerProcesses[platformData.platformNameLowerCase]; reject(err); }); @@ -264,13 +276,13 @@ export class WebpackCompilerService childProcess.pid.toString(), ); - delete this.webpackProcesses[platformData.platformNameLowerCase]; + delete this.bundlerProcesses[platformData.platformNameLowerCase]; const exitCode = typeof arg === "number" ? arg : arg && arg.code; if (exitCode === 0) { resolve(); } else { const error: any = new Error( - `Executing webpack failed with exit code ${exitCode}.`, + `Executing ${projectData.bundler} failed with exit code ${exitCode}.`, ); error.code = exitCode; reject(error); @@ -282,14 +294,14 @@ export class WebpackCompilerService }); } - public async stopWebpackCompiler(platform: string): Promise { + public async stopBundlerCompiler(platform: string): Promise { if (platform) { - await this.stopWebpackForPlatform(platform); + await this.stopBundlerForPlatform(platform); } else { - const webpackedPlatforms = Object.keys(this.webpackProcesses); + const bundlerPlatforms = Object.keys(this.bundlerProcesses); - for (let i = 0; i < webpackedPlatforms.length; i++) { - await this.stopWebpackForPlatform(webpackedPlatforms[i]); + for (let i = 0; i < bundlerPlatforms.length; i++) { + await this.stopBundlerForPlatform(bundlerPlatforms[i]); } } } @@ -305,7 +317,7 @@ export class WebpackCompilerService } @performanceLog() - private async startWebpackProcess( + private async startBundleProcess( platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData, @@ -317,9 +329,9 @@ export class WebpackCompilerService ); } } else { - if (!this.$fs.exists(projectData.webpackConfigPath)) { + if (!this.$fs.exists(projectData.bundlerConfigPath)) { this.$errors.fail( - `The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, + `The ${projectData.bundler} configuration file ${projectData.bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}.`, ); } } @@ -348,9 +360,9 @@ export class WebpackCompilerService const args = [ ...additionalNodeArgs, - this.getWebpackExecutablePath(projectData), + this.getBundlerExecutablePath(projectData), this.isModernBundler(projectData) ? `build` : null, - `--config=${projectData.bundlerConfigPath || projectData.webpackConfigPath}`, + `--config=${projectData.bundlerConfigPath}`, ...envParams, ].filter(Boolean); @@ -365,6 +377,7 @@ export class WebpackCompilerService }; options.env = { NATIVESCRIPT_WEBPACK_ENV: JSON.stringify(envData), + NATIVESCRIPT_BUNDLER_ENV: JSON.stringify(envData), }; if (this.$hostInfo.isWindows) { Object.assign(options.env, { APPDATA: process.env.appData }); @@ -384,7 +397,7 @@ export class WebpackCompilerService options, ); - this.webpackProcesses[platformData.platformNameLowerCase] = childProcess; + this.bundlerProcesses[platformData.platformNameLowerCase] = childProcess; await this.$cleanupService.addKillProcess(childProcess.pid.toString()); return childProcess; @@ -475,23 +488,26 @@ export class WebpackCompilerService ); envFlagNames.splice(envFlagNames.indexOf("snapshot"), 1); } else if (this.$hostInfo.isWindows) { - const minWebpackPluginWithWinSnapshotsVersion = "1.3.0"; - const installedWebpackPluginVersion = - await this.$packageInstallationManager.getInstalledDependencyVersion( - WEBPACK_PLUGIN_NAME, - projectData.projectDir, - ); - const hasWebpackPluginWithWinSnapshotsSupport = - !!installedWebpackPluginVersion - ? semver.gte( - semver.coerce(installedWebpackPluginVersion), - minWebpackPluginWithWinSnapshotsVersion, - ) - : true; - if (!hasWebpackPluginWithWinSnapshotsSupport) { - this.$errors.fail( - `In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i ${WEBPACK_PLUGIN_NAME}@latest).`, - ); + if (projectData.bundler === "webpack") { + //TODO: check this use case for webpack5 WEBPACK_PLUGIN_NAME + const minWebpackPluginWithWinSnapshotsVersion = "1.3.0"; + const installedWebpackPluginVersion = + await this.$packageInstallationManager.getInstalledDependencyVersion( + WEBPACK_PLUGIN_NAME, + projectData.projectDir, + ); + const hasWebpackPluginWithWinSnapshotsSupport = + !!installedWebpackPluginVersion + ? semver.gte( + semver.coerce(installedWebpackPluginVersion), + minWebpackPluginWithWinSnapshotsVersion, + ) + : true; + if (!hasWebpackPluginWithWinSnapshotsSupport) { + this.$errors.fail( + `In order to generate Snapshots on Windows, please upgrade your Webpack plugin version (npm i ${WEBPACK_PLUGIN_NAME}@latest).`, + ); + } } } } @@ -570,30 +586,37 @@ export class WebpackCompilerService return hotHash || ""; } - private async stopWebpackForPlatform(platform: string) { - this.$logger.trace(`Stopping webpack watch for platform ${platform}.`); - const webpackProcess = this.webpackProcesses[platform]; - await this.$cleanupService.removeKillProcess(webpackProcess.pid.toString()); - if (webpackProcess) { - webpackProcess.kill("SIGINT"); - delete this.webpackProcesses[platform]; + private async stopBundlerForPlatform(platform: string) { + this.$logger.trace( + `Stopping ${this.getBundler()} watch for platform ${platform}.`, + ); + const bundlerProcess = this.bundlerProcesses[platform]; + await this.$cleanupService.removeKillProcess(bundlerProcess.pid.toString()); + if (bundlerProcess) { + bundlerProcess.kill("SIGINT"); + delete this.bundlerProcesses[platform]; } } private handleHMRMessage( - message: IWebpackMessage, + message: IBundlerMessage, platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData, ) { - // handle new webpack hmr packets - this.$logger.trace("Received message from webpack process:", message); + // handle new bundler hmr packets + this.$logger.trace( + `Received message from ${projectData.bundler} process:`, + message, + ); if (message.type !== "compilation") { return; } - this.$logger.trace("Webpack build done!"); + this.$logger.trace( + `${capitalizeFirstLetter(projectData.bundler)} build done!`, + ); const files = message.data.emittedAssets.map((asset: string) => path.join( @@ -632,7 +655,7 @@ export class WebpackCompilerService return; } - this.emit(WEBPACK_COMPILATION_COMPLETE, { + this.emit(BUNDLER_COMPILATION_COMPLETE, { files, staleFiles, hasOnlyHotUpdateFiles: prepareData.hmr, @@ -644,7 +667,7 @@ export class WebpackCompilerService }); } - private getWebpackExecutablePath(projectData: IProjectData): string { + private getBundlerExecutablePath(projectData: IProjectData): string { const bundler = this.getBundler(); if (this.isModernBundler(projectData)) { @@ -674,12 +697,9 @@ export class WebpackCompilerService case "rspack": return true; default: - const packageJSONPath = resolvePackageJSONPath( - "@nativescript/webpack", - { - paths: [projectData.projectDir], - }, - ); + const packageJSONPath = resolvePackageJSONPath(WEBPACK_PLUGIN_NAME, { + paths: [projectData.projectDir], + }); if (packageJSONPath) { const packageData = this.$fs.readJson(packageJSONPath); @@ -695,9 +715,13 @@ export class WebpackCompilerService return false; } - public getBundler(): "webpack" | "rspack" | "vite" { + public getBundler(): BundlerType { return this.$projectConfigService.getValue(`bundler`, "webpack"); } } -injector.register("webpackCompilerService", WebpackCompilerService); +function capitalizeFirstLetter(val: string) { + return String(val).charAt(0).toUpperCase() + String(val).slice(1); +} + +injector.register("bundlerCompilerService", BundlerCompilerService); diff --git a/lib/services/webpack/webpack.d.ts b/lib/services/bundler/bundler.ts similarity index 90% rename from lib/services/webpack/webpack.d.ts rename to lib/services/bundler/bundler.ts index e3a8dddd8b..691d45f8c5 100644 --- a/lib/services/webpack/webpack.d.ts +++ b/lib/services/bundler/bundler.ts @@ -18,21 +18,21 @@ import { import { INotConfiguredEnvOptions } from "../../common/definitions/commands"; declare global { - interface IWebpackCompilerService extends EventEmitter { + interface IBundlerCompilerService extends EventEmitter { compileWithWatch( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise; compileWithoutWatch( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise; - stopWebpackCompiler(platform: string): Promise; + stopBundlerCompiler(platform: string): Promise; } - interface IWebpackEnvOptions { + interface IBundlerEnvOptions { sourceMap?: boolean; uglify?: boolean; production?: boolean; @@ -42,19 +42,19 @@ declare global { checkForChanges( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise; getPrepareInfoFilePath(platformData: IPlatformData): string; getPrepareInfo(platformData: IPlatformData): IPrepareInfo; savePrepareInfo( platformData: IPlatformData, projectData: IProjectData, - prepareData: IPrepareData + prepareData: IPrepareData, ): Promise; setNativePlatformStatus( platformData: IPlatformData, projectData: IProjectData, - addedPlatform: IAddedNativePlatform + addedPlatform: IAddedNativePlatform, ): void; currentChanges: IProjectChangesInfo; } @@ -68,7 +68,7 @@ declare global { hasNativeChanges: boolean; } - interface IWebpackEmitMessage { + interface IBundlerEmitMessage { emittedFiles: string[]; chunkFiles: string[]; hash: string; @@ -81,12 +81,12 @@ declare global { validate( projectData: IProjectData, options: IOptions, - notConfiguredEnvOptions?: INotConfiguredEnvOptions + notConfiguredEnvOptions?: INotConfiguredEnvOptions, ): Promise; createProject( frameworkDir: string, frameworkVersion: string, - projectData: IProjectData + projectData: IProjectData, ): Promise; interpolateData(projectData: IProjectData): Promise; interpolateConfigurationFile(projectData: IProjectData): void; @@ -108,13 +108,13 @@ declare global { validateOptions( projectId?: string, provision?: true | string, - teamId?: true | string + teamId?: true | string, ): Promise; buildProject( projectRoot: string, projectData: IProjectData, - buildConfig: T + buildConfig: T, ): Promise; /** @@ -125,7 +125,7 @@ declare global { */ prepareProject( projectData: IProjectData, - prepareData: T + prepareData: T, ): Promise; /** @@ -146,7 +146,7 @@ declare global { preparePluginNativeCode( pluginData: IPluginData, - options?: any + options?: any, ): Promise; /** @@ -157,17 +157,17 @@ declare global { */ removePluginNativeCode( pluginData: IPluginData, - projectData: IProjectData + projectData: IProjectData, ): Promise; beforePrepareAllPlugins( projectData: IProjectData, - dependencies?: IDependencyData[] + dependencies?: IDependencyData[], ): Promise; handleNativeDependenciesChange( projectData: IProjectData, - opts: IRelease + opts: IRelease, ): Promise; /** @@ -178,11 +178,11 @@ declare global { cleanDeviceTempFolder( deviceIdentifier: string, - projectData: IProjectData + projectData: IProjectData, ): Promise; processConfigurationFilesFromAppResources( projectData: IProjectData, - opts: { release: boolean } + opts: { release: boolean }, ): Promise; /** @@ -214,7 +214,7 @@ declare global { checkForChanges( changeset: IProjectChangesInfo, prepareData: T, - projectData: IProjectData + projectData: IProjectData, ): Promise; /** diff --git a/test/controllers/prepare-controller.ts b/test/controllers/prepare-controller.ts index a8bf78ad3b..e3982de1e4 100644 --- a/test/controllers/prepare-controller.ts +++ b/test/controllers/prepare-controller.ts @@ -38,7 +38,7 @@ function createTestInjector(data: { hasNativeChanges: boolean }): IInjector { }, }); - injector.register("webpackCompilerService", { + injector.register("bundlerCompilerService", { on: () => ({}), emit: () => ({}), compileWithWatch: async () => { @@ -119,7 +119,7 @@ describe("prepareController", () => { injector.resolve("prepareController"); const prepareNativePlatformService = injector.resolve( - "prepareNativePlatformService" + "prepareNativePlatformService", ); prepareNativePlatformService.prepareNativePlatform = async () => { const nativeFilesWatcher = (prepareController).watchersData[ @@ -128,7 +128,7 @@ describe("prepareController", () => { nativeFilesWatcher.emit( "all", "change", - "my/project/App_Resources/some/file" + "my/project/App_Resources/some/file", ); isNativePrepareCalled = true; return false; diff --git a/test/services/webpack/webpack-compiler-service.ts b/test/services/bundler/bundler-compiler-service.ts similarity index 62% rename from test/services/webpack/webpack-compiler-service.ts rename to test/services/bundler/bundler-compiler-service.ts index d15cccc430..49d69a55f4 100644 --- a/test/services/webpack/webpack-compiler-service.ts +++ b/test/services/bundler/bundler-compiler-service.ts @@ -1,5 +1,5 @@ import { Yok } from "../../../lib/common/yok"; -import { WebpackCompilerService } from "../../../lib/services/webpack/webpack-compiler-service"; +import { BundlerCompilerService } from "../../../lib/services/bundler/bundler-compiler-service"; import { assert } from "chai"; import { ErrorsStub } from "../../stubs"; import { IInjector } from "../../../lib/common/definitions/yok"; @@ -23,7 +23,7 @@ function createTestInjector(): IInjector { testInjector.register("packageManager", { getPackageManagerName: async () => "npm", }); - testInjector.register("webpackCompilerService", WebpackCompilerService); + testInjector.register("bundlerCompilerService", BundlerCompilerService); testInjector.register("childProcess", {}); testInjector.register("hooksService", {}); testInjector.register("hostInfo", {}); @@ -33,6 +33,9 @@ function createTestInjector(): IInjector { testInjector.register("packageInstallationManager", {}); testInjector.register("mobileHelper", {}); testInjector.register("cleanupService", {}); + testInjector.register("projectConfigService", { + getValue: (key: string, defaultValue?: string) => defaultValue, + }); testInjector.register("fs", { exists: (filePath: string) => true, }); @@ -40,23 +43,23 @@ function createTestInjector(): IInjector { return testInjector; } -describe("WebpackCompilerService", () => { +describe("BundlerCompilerService", () => { let testInjector: IInjector = null; - let webpackCompilerService: WebpackCompilerService = null; + let bundlerCompilerService: BundlerCompilerService = null; beforeEach(() => { testInjector = createTestInjector(); - webpackCompilerService = testInjector.resolve(WebpackCompilerService); + bundlerCompilerService = testInjector.resolve(BundlerCompilerService); }); describe("getUpdatedEmittedFiles", () => { // backwards compatibility with old versions of nativescript-dev-webpack it("should return only hot updates when nextHash is not provided", async () => { - const result = webpackCompilerService.getUpdatedEmittedFiles( + const result = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, null, - iOSPlatformName + iOSPlatformName, ); const expectedEmittedFiles = [ "bundle.hash1.hot-update.js", @@ -65,19 +68,19 @@ describe("WebpackCompilerService", () => { assert.deepStrictEqual(result.emittedFiles, expectedEmittedFiles); }); - // 2 successful webpack compilations + // 2 successful bundler compilations it("should return only hot updates when nextHash is provided", async () => { - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, "hash2", - iOSPlatformName + iOSPlatformName, ); - const result = webpackCompilerService.getUpdatedEmittedFiles( + const result = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash2"), chunkFiles, "hash3", - iOSPlatformName + iOSPlatformName, ); assert.deepStrictEqual(result.emittedFiles, [ @@ -85,19 +88,19 @@ describe("WebpackCompilerService", () => { "hash2.hot-update.json", ]); }); - // 1 successful webpack compilation, n compilations with no emitted files - it("should return all files when there is a webpack compilation with no emitted files", () => { - webpackCompilerService.getUpdatedEmittedFiles( + // 1 successful bundler compilation, n compilations with no emitted files + it("should return all files when there is a bundler compilation with no emitted files", () => { + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, "hash2", - iOSPlatformName + iOSPlatformName, ); - const result = webpackCompilerService.getUpdatedEmittedFiles( + const result = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash4"), chunkFiles, "hash5", - iOSPlatformName + iOSPlatformName, ); assert.deepStrictEqual(result.emittedFiles, [ @@ -107,25 +110,25 @@ describe("WebpackCompilerService", () => { "hash4.hot-update.json", ]); }); - // 1 successful webpack compilation, n compilations with no emitted files, 1 successful webpack compilation + // 1 successful bundler compilation, n compilations with no emitted files, 1 successful bundler compilation it("should return only hot updates after fixing the compilation error", () => { - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, "hash2", - iOSPlatformName + iOSPlatformName, ); - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash5"), chunkFiles, "hash6", - iOSPlatformName + iOSPlatformName, ); - const result = webpackCompilerService.getUpdatedEmittedFiles( + const result = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash6"), chunkFiles, "hash7", - iOSPlatformName + iOSPlatformName, ); assert.deepStrictEqual(result.emittedFiles, [ @@ -133,16 +136,16 @@ describe("WebpackCompilerService", () => { "hash6.hot-update.json", ]); }); - // 1 webpack compilation with no emitted files + // 1 bundler compilation with no emitted files it("should return all files when first compilation on livesync change is not successful", () => { - (webpackCompilerService).expectedHashes = { + (bundlerCompilerService).expectedHashes = { ios: "hash1", }; - const result = webpackCompilerService.getUpdatedEmittedFiles( + const result = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, "hash2", - iOSPlatformName + iOSPlatformName, ); assert.deepStrictEqual(result.emittedFiles, [ @@ -151,48 +154,48 @@ describe("WebpackCompilerService", () => { ]); }); it("should return correct hashes when there are more than one platform", () => { - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash1"), chunkFiles, "hash2", - iOSPlatformName + iOSPlatformName, ); - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash3"), chunkFiles, "hash4", - androidPlatformName + androidPlatformName, ); - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash2"), chunkFiles, "hash5", - iOSPlatformName + iOSPlatformName, ); - webpackCompilerService.getUpdatedEmittedFiles( + bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash4"), chunkFiles, "hash6", - androidPlatformName + androidPlatformName, ); - const iOSResult = webpackCompilerService.getUpdatedEmittedFiles( + const iOSResult = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash5"), chunkFiles, "hash7", - iOSPlatformName + iOSPlatformName, ); assert.deepStrictEqual(iOSResult.emittedFiles, [ "bundle.hash5.hot-update.js", "hash5.hot-update.json", ]); - const androidResult = webpackCompilerService.getUpdatedEmittedFiles( + const androidResult = bundlerCompilerService.getUpdatedEmittedFiles( getAllEmittedFiles("hash6"), chunkFiles, "hash8", - androidPlatformName + androidPlatformName, ); assert.deepStrictEqual(androidResult.emittedFiles, [ "bundle.hash6.hot-update.js", @@ -202,33 +205,33 @@ describe("WebpackCompilerService", () => { }); describe("compileWithWatch", () => { - it("fails when the value set for webpackConfigPath is not existant file", async () => { - const webpackConfigPath = "some path.js"; + it("fails when the value set for bundlerConfigPath is not existant file", async () => { + const bundlerConfigPath = "some path.js"; testInjector.resolve("fs").exists = (filePath: string) => - filePath !== webpackConfigPath; + filePath !== bundlerConfigPath; await assert.isRejected( - webpackCompilerService.compileWithWatch( + bundlerCompilerService.compileWithWatch( { platformNameLowerCase: "android" }, - { webpackConfigPath }, - {} + { bundlerConfigPath: bundlerConfigPath }, + {}, ), - `The webpack configuration file ${webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}` + `The bundler configuration file ${bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}`, ); }); }); describe("compileWithoutWatch", () => { - it("fails when the value set for webpackConfigPath is not existant file", async () => { - const webpackConfigPath = "some path.js"; + it("fails when the value set for bundlerConfigPath is not existant file", async () => { + const bundlerConfigPath = "some path.js"; testInjector.resolve("fs").exists = (filePath: string) => - filePath !== webpackConfigPath; + filePath !== bundlerConfigPath; await assert.isRejected( - webpackCompilerService.compileWithoutWatch( + bundlerCompilerService.compileWithoutWatch( { platformNameLowerCase: "android" }, - { webpackConfigPath }, - {} + { bundlerConfigPath: bundlerConfigPath }, + {}, ), - `The webpack configuration file ${webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}` + `The bundler configuration file ${bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${CONFIG_FILE_NAME_DISPLAY}`, ); }); }); diff --git a/test/stubs.ts b/test/stubs.ts index 404660d467..7ec3580891 100644 --- a/test/stubs.ts +++ b/test/stubs.ts @@ -38,6 +38,7 @@ import { IProjectConfigInformation, IProjectBackupService, IBackup, + BundlerType, } from "../lib/definitions/project"; import { IPlatformData, @@ -659,6 +660,7 @@ export class ProjectDataStub implements IProjectData { projectName: string; webpackConfigPath: string; bundlerConfigPath: string; + bundler: BundlerType; get platformsDir(): string { return ( From 5b809744a776e712f81ab34df68019f3cd5bcd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20de=20Dios=20Mart=C3=ADnez=20Vallejo?= Date: Tue, 25 Mar 2025 18:12:08 +0100 Subject: [PATCH 04/16] test: bundler and bundlerConfigPath (#5841) --- lib/project-data.ts | 14 +++---- test/project-data.ts | 93 ++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 91 insertions(+), 16 deletions(-) diff --git a/lib/project-data.ts b/lib/project-data.ts index cbe06da65f..277dbf32d1 100644 --- a/lib/project-data.ts +++ b/lib/project-data.ts @@ -207,21 +207,17 @@ export class ProjectData implements IProjectData { constants.PODFILE_NAME, ); this.isShared = !!(this.nsConfig && this.nsConfig.shared); - this.webpackConfigPath = + + const webpackConfigPath = this.nsConfig && this.nsConfig.webpackConfigPath ? path.resolve(this.projectDir, this.nsConfig.webpackConfigPath) : path.join(this.projectDir, "webpack.config.js"); + this.webpackConfigPath = webpackConfigPath; this.bundlerConfigPath = this.nsConfig && this.nsConfig.bundlerConfigPath ? path.resolve(this.projectDir, this.nsConfig.bundlerConfigPath) - : null; - this.bundler = - this.nsConfig && this.nsConfig.bundler - ? (path.resolve( - this.projectDir, - this.nsConfig.bundler, - ) as BundlerType) - : "webpack"; + : webpackConfigPath; + this.bundler = this?.nsConfig?.bundler ?? "webpack"; return; } diff --git a/test/project-data.ts b/test/project-data.ts index 7ce33a1320..5b8c747bd1 100644 --- a/test/project-data.ts +++ b/test/project-data.ts @@ -56,14 +56,16 @@ describe("projectData", () => { configData?: { shared?: boolean; webpackConfigPath?: string; + bundlerConfigPath?: string; projectName?: string; + bundler?: string; }; }): IProjectData => { const testInjector = createTestInjector(); const fs = testInjector.resolve("fs"); testInjector.register( "projectConfigService", - stubs.ProjectConfigServiceStub.initWithConfig(opts?.configData) + stubs.ProjectConfigServiceStub.initWithConfig(opts?.configData), ); fs.exists = (filePath: string) => { @@ -98,7 +100,7 @@ describe("projectData", () => { const assertProjectType = ( dependencies: any, devDependencies: any, - expectedProjecType: string + expectedProjecType: string, ) => { const projectData = prepareTest({ packageJsonData: { @@ -125,7 +127,7 @@ describe("projectData", () => { assertProjectType( { "nativescript-vue": "*" }, { typescript: "*" }, - "Vue.js" + "Vue.js", ); }); @@ -141,7 +143,7 @@ describe("projectData", () => { assertProjectType( null, { "nativescript-dev-typescript": "*" }, - "Pure TypeScript" + "Pure TypeScript", ); }); @@ -195,13 +197,13 @@ describe("projectData", () => { const projectData = prepareTest(); assert.equal( projectData.webpackConfigPath, - path.join(projectDir, "webpack.config.js") + path.join(projectDir, "webpack.config.js"), ); }); it("returns correct path when full path is set in nsconfig.json", () => { const pathToConfig = path.resolve( - path.join("/testDir", "innerDir", "mywebpack.config.js") + path.join("/testDir", "innerDir", "mywebpack.config.js"), ); const projectData = prepareTest({ configData: { webpackConfigPath: pathToConfig }, @@ -211,7 +213,7 @@ describe("projectData", () => { it("returns correct path when relative path is set in nsconfig.json", () => { const pathToConfig = path.resolve( - path.join("projectDir", "innerDir", "mywebpack.config.js") + path.join("projectDir", "innerDir", "mywebpack.config.js"), ); const projectData = prepareTest({ configData: { @@ -221,4 +223,81 @@ describe("projectData", () => { assert.equal(projectData.webpackConfigPath, pathToConfig); }); }); + + describe("bundlerConfigPath", () => { + it("default path to webpack.config.js is set when nsconfig.json does not set value", () => { + const projectData = prepareTest(); + assert.equal( + projectData.bundlerConfigPath, + path.join(projectDir, "webpack.config.js"), + ); + }); + + it("should use webpackConfigPath property when bundlerConfigPath is not defined", () => { + const pathToConfig = path.resolve( + path.join("/testDir", "innerDir", "mywebpack.config.js"), + ); + const projectData = prepareTest({ + configData: { webpackConfigPath: pathToConfig }, + }); + assert.equal(projectData.bundlerConfigPath, pathToConfig); + }); + + it("returns correct path when full path is set in nsconfig.json", () => { + const pathToConfig = path.resolve( + path.join("/testDir", "innerDir", "mywebpack.config.js"), + ); + const projectData = prepareTest({ + configData: { bundlerConfigPath: pathToConfig }, + }); + assert.equal(projectData.bundlerConfigPath, pathToConfig); + }); + + it("returns correct path when relative path is set in nsconfig.json", () => { + const pathToConfig = path.resolve( + path.join("projectDir", "innerDir", "mywebpack.config.js"), + ); + const projectData = prepareTest({ + configData: { + bundlerConfigPath: path.join("./innerDir", "mywebpack.config.js"), + }, + }); + assert.equal(projectData.bundlerConfigPath, pathToConfig); + }); + + it("should use bundlerConfigPath instead of webpackConfigPath if both are defined.", () => { + const pathToConfig = path.resolve( + path.join("projectDir", "innerDir", "myrspack.config.js"), + ); + const projectData = prepareTest({ + configData: { + webpackConfigPath: path.join("./innerDir", "mywebpack.config.js"), + bundlerConfigPath: path.join("./innerDir", "myrspack.config.js"), + }, + }); + assert.equal(projectData.bundlerConfigPath, pathToConfig); + }); + }); + + describe("bundler", () => { + it("sets bundler to 'webpack' by default when nsconfig.json does not specify a bundler", () => { + const projectData = prepareTest(); + assert.equal(projectData.bundler, "webpack"); + }); + + it("sets bundler to 'webpack' when explicitly defined in nsconfig.json", () => { + const projectData = prepareTest({ configData: { bundler: "webpack" } }); + assert.equal(projectData.bundler, "webpack"); + }); + + it("sets bundler to 'rspack' when explicitly defined in nsconfig.json", () => { + const projectData = prepareTest({ configData: { bundler: "rspack" } }); + assert.equal(projectData.bundler, "rspack"); + }); + + it("sets bundler to 'vite' when explicitly defined in nsconfig.json", () => { + const projectData = prepareTest({ configData: { bundler: "vite" } }); + assert.equal(projectData.bundler, "vite"); + }); + }); }); From fd695d158e29f029abc8e116d745788241abb34a Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 22 Apr 2025 12:17:07 -0700 Subject: [PATCH 05/16] feat: wip vite setup --- lib/constants.ts | 1 - lib/controllers/prepare-controller.ts | 6 +- .../bundler/bundler-compiler-service.ts | 58 ++++++++++++++----- 3 files changed, 48 insertions(+), 17 deletions(-) diff --git a/lib/constants.ts b/lib/constants.ts index b9dc247d83..c76d6f6696 100644 --- a/lib/constants.ts +++ b/lib/constants.ts @@ -224,7 +224,6 @@ export const CACACHE_DIRECTORY_NAME = "_cacache"; export const FILES_CHANGE_EVENT_NAME = "filesChangeEvent"; export const INITIAL_SYNC_EVENT_NAME = "initialSyncEvent"; export const PREPARE_READY_EVENT_NAME = "prepareReadyEvent"; -export const WEBPACK_COMPILATION_COMPLETE = "webpackCompilationComplete"; export const BUNDLER_COMPILATION_COMPLETE = "bundlerCompilationComplete"; export class DebugCommandErrors { diff --git a/lib/controllers/prepare-controller.ts b/lib/controllers/prepare-controller.ts index 7b21219f63..73fa9ab5b3 100644 --- a/lib/controllers/prepare-controller.ts +++ b/lib/controllers/prepare-controller.ts @@ -13,6 +13,7 @@ import { hook } from "../common/helpers"; import { injector } from "../common/yok"; import { AnalyticsEventLabelDelimiter, + BUNDLER_COMPILATION_COMPLETE, CONFIG_FILE_NAME_JS, CONFIG_FILE_NAME_TS, PACKAGE_JSON_FILE_NAME, @@ -20,7 +21,6 @@ import { PREPARE_READY_EVENT_NAME, SupportedPlatform, TrackActionNames, - WEBPACK_COMPILATION_COMPLETE, } from "../constants"; import { IOptions, IWatchIgnoreListService } from "../declarations"; import { @@ -119,7 +119,7 @@ export class PrepareController extends EventEmitter { ) { await this.$bundlerCompilerService.stopBundlerCompiler(platformLowerCase); this.$bundlerCompilerService.removeListener( - WEBPACK_COMPILATION_COMPLETE, + BUNDLER_COMPILATION_COMPLETE, this.webpackCompilerHandler, ); this.watchersData[projectDir][ @@ -297,7 +297,7 @@ export class PrepareController extends EventEmitter { this.webpackCompilerHandler = handler.bind(this); this.$bundlerCompilerService.on( - WEBPACK_COMPILATION_COMPLETE, + BUNDLER_COMPILATION_COMPLETE, this.webpackCompilerHandler, ); diff --git a/lib/services/bundler/bundler-compiler-service.ts b/lib/services/bundler/bundler-compiler-service.ts index 65b496a2b3..6473e7c54d 100644 --- a/lib/services/bundler/bundler-compiler-service.ts +++ b/lib/services/bundler/bundler-compiler-service.ts @@ -224,14 +224,31 @@ export class BundlerCompilerService }); childProcess.on("close", async (arg: any) => { - await this.$cleanupService.removeKillProcess( - childProcess.pid.toString(), - ); - const exitCode = typeof arg === "number" ? arg : arg && arg.code; this.$logger.trace( `${capitalizeFirstLetter(projectData.bundler)} process exited with code ${exitCode} when we expected it to be long living with watch.`, ); + if (this.getBundler() === "vite" && exitCode === 0) { + // note experimental: investigate watch mode + const bundlePath = path.join( + projectData.projectDir, + "dist/bundle.js", + ); + console.log("bundlePath:", bundlePath); + const data = { + files: [bundlePath], + hasOnlyHotUpdateFiles: false, + hmrData: {}, + platform: platformData.platformNameLowerCase, + }; + this.emit(BUNDLER_COMPILATION_COMPLETE, data); + resolve(1); + return; + } + + await this.$cleanupService.removeKillProcess( + childProcess.pid.toString(), + ); const error: any = new Error( `Executing ${projectData.bundler} failed with exit code ${exitCode}.`, ); @@ -341,12 +358,15 @@ export class BundlerCompilerService projectData, prepareData, ); - const envParams = await this.buildEnvCommandLineParams( - envData, - platformData, - projectData, - prepareData, - ); + const isVite = this.getBundler() === "vite"; + const envParams = isVite + ? [`--mode=${platformData.platformNameLowerCase}`] + : await this.buildEnvCommandLineParams( + envData, + platformData, + projectData, + prepareData, + ); const additionalNodeArgs = semver.major(process.version) <= 8 ? ["--harmony"] : []; @@ -366,8 +386,10 @@ export class BundlerCompilerService ...envParams, ].filter(Boolean); - if (prepareData.watch) { - args.push("--watch"); + if (!isVite) { + if (prepareData.watch) { + args.push("--watch"); + } } const stdio = prepareData.watch ? ["ipc"] : "inherit"; @@ -391,6 +413,8 @@ export class BundlerCompilerService }); } + console.log("args:", args); + const childProcess = this.$childProcess.spawn( process.execPath, args, @@ -670,7 +694,15 @@ export class BundlerCompilerService private getBundlerExecutablePath(projectData: IProjectData): string { const bundler = this.getBundler(); - if (this.isModernBundler(projectData)) { + if (bundler === "vite") { + const packagePath = resolvePackagePath(`vite`, { + paths: [projectData.projectDir], + }); + + if (packagePath) { + return path.resolve(packagePath, "bin", "vite.js"); + } + } else if (this.isModernBundler(projectData)) { const packagePath = resolvePackagePath(`@nativescript/${bundler}`, { paths: [projectData.projectDir], }); From a369f81ebd5a9629c04807a9fc7b51ba11e621a6 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 7 Jul 2025 18:35:59 -0700 Subject: [PATCH 06/16] feat(hooks): support esm --- lib/common/services/hooks-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/services/hooks-service.ts b/lib/common/services/hooks-service.ts index 4879ae4a5b..dc13513531 100644 --- a/lib/common/services/hooks-service.ts +++ b/lib/common/services/hooks-service.ts @@ -179,7 +179,7 @@ export class HooksService implements IHooksService { let inProc = false; if (!command) { command = hook.fullPath; - if (path.extname(hook.fullPath).toLowerCase() === ".js") { + if ([".mjs", ".js"].includes(path.extname(hook.fullPath).toLowerCase())) { command = process.argv[0]; inProc = this.shouldExecuteInProcess(this.$fs.readText(hook.fullPath)); } From 312db9e4f7c38b907fffb6414e0b0c1a20c062a6 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 7 Jul 2025 18:40:53 -0700 Subject: [PATCH 07/16] chore: 9.0.0-alpha.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5fe54c4a8a..addfe5724b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "main": "./lib/nativescript-cli-lib.js", - "version": "8.9.3", + "version": "9.0.0-alpha.0", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { @@ -50,7 +50,7 @@ }, "keywords": [ "nativescript", - "telerik", + "typescript", "mobile" ], "dependencies": { From 0cc056bc9104107d10b6716f2c8c9d487c63814a Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 20 Jul 2025 20:09:04 -0700 Subject: [PATCH 08/16] feat(vite): ensure cli flags are passed --- lib/services/bundler/bundler-compiler-service.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/services/bundler/bundler-compiler-service.ts b/lib/services/bundler/bundler-compiler-service.ts index 59ea0bed02..421808dfdc 100644 --- a/lib/services/bundler/bundler-compiler-service.ts +++ b/lib/services/bundler/bundler-compiler-service.ts @@ -359,14 +359,16 @@ export class BundlerCompilerService prepareData, ); const isVite = this.getBundler() === "vite"; + const cliArgs = await this.buildEnvCommandLineParams( + envData, + platformData, + projectData, + prepareData, + ); + // Note: With Vite, we need `--` to prevent vite cli from erroring on unknown options. const envParams = isVite - ? [`--mode=${platformData.platformNameLowerCase}`] - : await this.buildEnvCommandLineParams( - envData, - platformData, - projectData, - prepareData, - ); + ? [`--mode=${platformData.platformNameLowerCase}`, "--", ...cliArgs] + : cliArgs; const additionalNodeArgs = semver.major(process.version) <= 8 ? ["--harmony"] : []; From 4b9e4518fb94f052e5b6b21939537c9d51615b11 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 20 Jul 2025 20:16:18 -0700 Subject: [PATCH 09/16] feat(hooks): support esm --- lib/common/services/hooks-service.ts | 98 ++++++++++++++++------------ 1 file changed, 56 insertions(+), 42 deletions(-) diff --git a/lib/common/services/hooks-service.ts b/lib/common/services/hooks-service.ts index dc13513531..4b04e9b7a9 100644 --- a/lib/common/services/hooks-service.ts +++ b/lib/common/services/hooks-service.ts @@ -24,7 +24,10 @@ import { color } from "../../color"; import { memoize } from "../decorators"; class Hook implements IHook { - constructor(public name: string, public fullPath: string) {} + constructor( + public name: string, + public fullPath: string, + ) {} } export class HooksService implements IHooksService { @@ -45,7 +48,7 @@ export class HooksService implements IHooksService { private $projectHelper: IProjectHelper, private $options: IOptions, private $performanceService: IPerformanceService, - private $projectConfigService: IProjectConfigService + private $projectConfigService: IProjectConfigService, ) {} public get hookArgsName(): string { @@ -69,12 +72,12 @@ export class HooksService implements IHooksService { if (projectDir) { this.hooksDirectories.push( - path.join(projectDir, HooksService.HOOKS_DIRECTORY_NAME) + path.join(projectDir, HooksService.HOOKS_DIRECTORY_NAME), ); } this.$logger.trace( - "Hooks directories: " + util.inspect(this.hooksDirectories) + "Hooks directories: " + util.inspect(this.hooksDirectories), ); const customHooks = this.$projectConfigService.getValue("hooks", []); @@ -91,7 +94,7 @@ export class HooksService implements IHooksService { public executeBeforeHooks( commandName: string, - hookArguments?: IDictionary + hookArguments?: IDictionary, ): Promise { const beforeHookName = `before-${HooksService.formatHookName(commandName)}`; const traceMessage = `BeforeHookName for command ${commandName} is ${beforeHookName}`; @@ -100,7 +103,7 @@ export class HooksService implements IHooksService { public executeAfterHooks( commandName: string, - hookArguments?: IDictionary + hookArguments?: IDictionary, ): Promise { const afterHookName = `after-${HooksService.formatHookName(commandName)}`; const traceMessage = `AfterHookName for command ${commandName} is ${afterHookName}`; @@ -110,7 +113,7 @@ export class HooksService implements IHooksService { private async executeHooks( hookName: string, traceMessage: string, - hookArguments?: IDictionary + hookArguments?: IDictionary, ): Promise { if (this.$config.DISABLE_HOOKS || !this.$options.hooks) { return; @@ -135,8 +138,8 @@ export class HooksService implements IHooksService { await this.executeHooksInDirectory( hooksDirectory, hookName, - hookArguments - ) + hookArguments, + ), ); } @@ -148,8 +151,8 @@ export class HooksService implements IHooksService { this.$projectHelper.projectDir, hookName, hook, - hookArguments - ) + hookArguments, + ), ); } } catch (err) { @@ -160,11 +163,16 @@ export class HooksService implements IHooksService { return _.flatten(results); } + private isESModule(hook: IHook): boolean { + const ext = path.extname(hook.fullPath).toLowerCase(); + return ext === ".mjs"; + } + private async executeHook( directoryPath: string, hookName: string, hook: IHook, - hookArguments?: IDictionary + hookArguments?: IDictionary, ): Promise { hookArguments = hookArguments || {}; @@ -173,15 +181,18 @@ export class HooksService implements IHooksService { const relativePath = path.relative(directoryPath, hook.fullPath); const trackId = relativePath.replace( new RegExp("\\" + path.sep, "g"), - AnalyticsEventLabelDelimiter + AnalyticsEventLabelDelimiter, ); + const isESM = this.isESModule(hook); let command = this.getSheBangInterpreter(hook); let inProc = false; if (!command) { command = hook.fullPath; if ([".mjs", ".js"].includes(path.extname(hook.fullPath).toLowerCase())) { command = process.argv[0]; - inProc = this.shouldExecuteInProcess(this.$fs.readText(hook.fullPath)); + inProc = isESM + ? true + : this.shouldExecuteInProcess(this.$fs.readText(hook.fullPath)); } } @@ -190,15 +201,21 @@ export class HooksService implements IHooksService { this.$logger.trace( "Executing %s hook at location %s in-process", hookName, - hook.fullPath + hook.fullPath, ); - const hookEntryPoint = require(hook.fullPath); + let hookEntryPoint; + if (isESM) { + const { default: hookFn } = await import(hook.fullPath); + hookEntryPoint = hookFn; + } else { + hookEntryPoint = require(hook.fullPath); + } this.$logger.trace(`Validating ${hookName} arguments.`); const invalidArguments = this.validateHookArguments( hookEntryPoint, - hook.fullPath + hook.fullPath, ); if (invalidArguments.length) { @@ -206,8 +223,8 @@ export class HooksService implements IHooksService { `${ hook.fullPath } will NOT be executed because it has invalid arguments - ${color.grey( - invalidArguments.join(", ") - )}.` + invalidArguments.join(", "), + )}.`, ); return; } @@ -220,14 +237,13 @@ export class HooksService implements IHooksService { const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"]; if (projectDataHookArg) { - hookArguments["projectData"] = hookArguments[ - "$projectData" - ] = projectDataHookArg; + hookArguments["projectData"] = hookArguments["$projectData"] = + projectDataHookArg; } const maybePromise = this.$injector.resolve( hookEntryPoint, - hookArguments + hookArguments, ); if (maybePromise) { this.$logger.trace("Hook promises to signal completion"); @@ -255,7 +271,7 @@ export class HooksService implements IHooksService { "Executing %s hook at location %s with environment ", hookName, hook.fullPath, - environment + environment, ); const output = await this.$childProcess.spawnFromEvent( @@ -263,7 +279,7 @@ export class HooksService implements IHooksService { [hook.fullPath], "close", environment, - { throwError: false } + { throwError: false }, ); result = output; @@ -275,7 +291,7 @@ export class HooksService implements IHooksService { "Finished executing %s hook at location %s with environment ", hookName, hook.fullPath, - environment + environment, ); } const endTime = this.$performanceService.now(); @@ -289,7 +305,7 @@ export class HooksService implements IHooksService { private async executeHooksInDirectory( directoryPath: string, hookName: string, - hookArguments?: IDictionary + hookArguments?: IDictionary, ): Promise { hookArguments = hookArguments || {}; const results: any[] = []; @@ -301,7 +317,7 @@ export class HooksService implements IHooksService { directoryPath, hookName, hook, - hookArguments + hookArguments, ); if (result) { @@ -316,14 +332,14 @@ export class HooksService implements IHooksService { const hooks: IHook[] = []; const customHooks: INsConfigHooks[] = this.$projectConfigService.getValue( "hooks", - [] + [], ); for (const cHook of customHooks) { if (cHook.type === hookName) { const fullPath = path.join( this.$projectHelper.projectDir, - cHook.script + cHook.script, ); const isFile = this.$fs.getFsStats(fullPath).isFile(); @@ -332,8 +348,8 @@ export class HooksService implements IHooksService { hooks.push( new Hook( this.getBaseFilename(fileNameParts[fileNameParts.length - 1]), - fullPath - ) + fullPath, + ), ); } } @@ -346,10 +362,10 @@ export class HooksService implements IHooksService { const allBaseHooks = this.getHooksInDirectory(directoryPath); const baseHooks = _.filter( allBaseHooks, - (hook) => hook.name.toLowerCase() === hookName.toLowerCase() + (hook) => hook.name.toLowerCase() === hookName.toLowerCase(), ); const moreHooks = this.getHooksInDirectory( - path.join(directoryPath, hookName) + path.join(directoryPath, hookName), ); return baseHooks.concat(moreHooks); } @@ -385,13 +401,11 @@ export class HooksService implements IHooksService { const clientName = this.$staticConfig.CLIENT_NAME.toUpperCase(); const environment: IStringDictionary = {}; - environment[util.format("%s-COMMANDLINE", clientName)] = process.argv.join( - " " - ); + environment[util.format("%s-COMMANDLINE", clientName)] = + process.argv.join(" "); environment[util.format("%s-HOOK_FULL_PATH", clientName)] = hookFullPath; - environment[ - util.format("%s-VERSION", clientName) - ] = this.$staticConfig.version; + environment[util.format("%s-VERSION", clientName)] = + this.$staticConfig.version; return { cwd: this.$projectHelper.projectDir, @@ -463,7 +477,7 @@ export class HooksService implements IHooksService { private validateHookArguments( hookConstructor: any, - hookFullPath: string + hookFullPath: string, ): string[] { const invalidArguments: string[] = []; @@ -477,7 +491,7 @@ export class HooksService implements IHooksService { } } catch (err) { this.$logger.trace( - `Cannot resolve ${argument} of hook ${hookFullPath}, reason: ${err}` + `Cannot resolve ${argument} of hook ${hookFullPath}, reason: ${err}`, ); invalidArguments.push(argument); } From b6f6baeba5aa6c75de25a77781b8e1cf05b076ac Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 20 Jul 2025 20:27:51 -0700 Subject: [PATCH 10/16] chore: 9.0.0-alpha.2 --- package-lock.json | 719 ++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 342 insertions(+), 379 deletions(-) diff --git a/package-lock.json b/package-lock.json index 123e11e5c8..c93eb29f0a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nativescript", - "version": "8.9.3", + "version": "9.0.0-alpha.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nativescript", - "version": "8.9.3", + "version": "9.0.0-alpha.2", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -132,23 +132,23 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.26.2", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz", - "integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz", + "integrity": "sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==", "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.9", + "@babel/helper-validator-identifier": "^7.27.1", "js-tokens": "^4.0.0", - "picocolors": "^1.0.0" + "picocolors": "^1.1.1" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.9", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", - "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "version": "7.27.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.27.1.tgz", + "integrity": "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==", "license": "MIT", "engines": { "node": ">=6.9.0" @@ -301,6 +301,29 @@ "node": ">=16.0.0" } }, + "node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -834,9 +857,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", - "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz", + "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==", "license": "MIT" }, "node_modules/@jridgewell/trace-mapping": { @@ -890,6 +913,18 @@ "node": ">=10" } }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -949,9 +984,9 @@ } }, "node_modules/@npmcli/arborist": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-9.0.0.tgz", - "integrity": "sha512-ZFsI/VJ7wJ2rTksLNJ9xqr75Ste/wiKvW+7w12ZGbcT67xWii97yS+aDlh3edNhqlqoXvdzYG4hTNui81VxJCA==", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-9.1.2.tgz", + "integrity": "sha512-KIuQc8TuMTcL8OTVmOTdVIXmkDFFOHmVlVd94N9wwHjuOA2ZyNsoJPS50Q/irdkS3LF/9BiIcxSIV/ukSjqO6g==", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -1149,9 +1184,9 @@ } }, "node_modules/@npmcli/metavuln-calculator": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-9.0.0.tgz", - "integrity": "sha512-znLKqdy1ZEGNK3VB9j/RzGyb/P0BJb3fGpvEbHIAyBAXsps2l1ce8SVHfsGAFLl9s8072PxafqTn7RC8wSnQPg==", + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/metavuln-calculator/-/metavuln-calculator-9.0.1.tgz", + "integrity": "sha512-B7ziEnkSmnauecEvFbg9h0d2CVa3uJudd9bTDc9vScfYdRETkQkCriFiYCV3PXE++igd5JRw35WJz902HnGrCg==", "license": "ISC", "dependencies": { "cacache": "^19.0.0", @@ -1183,9 +1218,9 @@ } }, "node_modules/@npmcli/package-json": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-6.1.1.tgz", - "integrity": "sha512-d5qimadRAUCO4A/Txw71VM7UrRZzV+NPclxz/dc+M6B2oYwjWTjqh8HA/sGQgs9VZuJ6I/P7XIAlJvgrl27ZOw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-6.2.0.tgz", + "integrity": "sha512-rCNLSB/JzNvot0SEyXqWZ7tX2B5dD2a1br2Dp0vSYVo5jh8Z0EZ7lS9TsZ1UtziddB1UfNUaMCc538/HztnJGA==", "license": "ISC", "dependencies": { "@npmcli/git": "^6.0.0", @@ -1288,30 +1323,30 @@ } }, "node_modules/@npmcli/query": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-4.0.0.tgz", - "integrity": "sha512-3pPbese0fbCiFJ/7/X1GBgxAKYFE8sxBddA7GtuRmOgNseH4YbGsXJ807Ig3AEwNITjDUISHglvy89cyDJnAwA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/query/-/query-4.0.1.tgz", + "integrity": "sha512-4OIPFb4weUUwkDXJf4Hh1inAn8neBGq3xsH4ZsAaN6FK3ldrFkH7jSpCc7N9xesi0Sp+EBXJ9eGMDrEww2Ztqw==", "license": "ISC", "dependencies": { - "postcss-selector-parser": "^6.1.2" + "postcss-selector-parser": "^7.0.0" }, "engines": { "node": "^18.17.0 || >=20.5.0" } }, "node_modules/@npmcli/redact": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.1.1.tgz", - "integrity": "sha512-3Hc2KGIkrvJWJqTbvueXzBeZlmvoOxc2jyX00yzr3+sNFquJg0N8hH4SAPLPVrkWIRQICVpVgjrss971awXVnA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@npmcli/redact/-/redact-3.2.2.tgz", + "integrity": "sha512-7VmYAmk4csGv08QzrDKScdzn11jHPFGyqJW39FyPgPuAp3zIaUmuCo1yxw9aGs+NEJuTGQ9Gwqpt93vtJubucg==", "license": "ISC", "engines": { "node": "^18.17.0 || >=20.5.0" } }, "node_modules/@npmcli/run-script": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.0.2.tgz", - "integrity": "sha512-cJXiUlycdizQwvqE1iaAb4VRUM3RX09/8q46zjvy+ct9GhfZRWd7jXYVc1tn/CfRlGPVkX/u4sstRlepsm7hfw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@npmcli/run-script/-/run-script-9.1.0.tgz", + "integrity": "sha512-aoNSbxtkePXUlbZB+anS1LqsJdctG5n3UVhfU47+CDdwMi6uNTBMF9gPcQRnqghQd2FGzcwwIFBruFMxjhBewg==", "license": "ISC", "dependencies": { "@npmcli/node-gyp": "^4.0.0", @@ -1325,6 +1360,15 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.2.2.tgz", + "integrity": "sha512-ZOBkgDwEdoYVlSeRbYYXs0S9MejQofiVYoTbKzy/6GQa39/q5tQU2IX46+shYnUkpEl3wc+J6wRlar7r2EK2xA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -1477,9 +1521,9 @@ } }, "node_modules/@sigstore/protobuf-specs": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.4.0.tgz", - "integrity": "sha512-o09cLSIq9EKyRXwryWDOJagkml9XgQCoCSRjHOnHLnvsivaW7Qznzz6yjfV7PHJHhIvyp8OH7OX8w0Dc5bQK7A==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@sigstore/protobuf-specs/-/protobuf-specs-0.4.3.tgz", + "integrity": "sha512-fk2zjD9117RL9BjqEwF7fwv7Q/P9yGsMV4MUJZ/DocaQJ6+3pKr+syBq1owU5Q5qGw5CUbXzm+4yJ2JVRDQeSA==", "license": "Apache-2.0", "engines": { "node": "^18.17.0 || >=20.5.0" @@ -1503,12 +1547,12 @@ } }, "node_modules/@sigstore/tuf": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-3.1.0.tgz", - "integrity": "sha512-suVMQEA+sKdOz5hwP9qNcEjX6B45R+hFFr4LAWzbRc5O+U2IInwvay/bpG5a4s+qR35P/JK/PiKiRGjfuLy1IA==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@sigstore/tuf/-/tuf-3.1.1.tgz", + "integrity": "sha512-eFFvlcBIoGwVkkwmTi/vEQFSva3xs5Ot3WmBcjgjVdiaoelBLQaQ/ZBfhlG0MnG0cmTYScPpk7eDdGDWUcFUmg==", "license": "Apache-2.0", "dependencies": { - "@sigstore/protobuf-specs": "^0.4.0", + "@sigstore/protobuf-specs": "^0.4.1", "tuf-js": "^3.0.1" }, "engines": { @@ -1516,14 +1560,14 @@ } }, "node_modules/@sigstore/verify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-2.1.0.tgz", - "integrity": "sha512-kAAM06ca4CzhvjIZdONAL9+MLppW3K48wOFy1TbuaWFW/OMfl8JuTgW0Bm02JB1WJGT/ET2eqav0KTEKmxqkIA==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@sigstore/verify/-/verify-2.1.1.tgz", + "integrity": "sha512-hVJD77oT67aowHxwT4+M6PGOp+E2LtLdTK3+FC0lBO9T7sYwItDMXZ7Z07IDCvR1M717a4axbIWckrW67KMP/w==", "license": "Apache-2.0", "dependencies": { "@sigstore/bundle": "^3.1.0", "@sigstore/core": "^2.0.0", - "@sigstore/protobuf-specs": "^0.4.0" + "@sigstore/protobuf-specs": "^0.4.1" }, "engines": { "node": "^18.17.0 || >=20.5.0" @@ -1710,9 +1754,9 @@ } }, "node_modules/@types/cacache": { - "version": "17.0.2", - "resolved": "https://registry.npmjs.org/@types/cacache/-/cacache-17.0.2.tgz", - "integrity": "sha512-IrqHzVX2VRMDQQKa7CtKRnuoCLdRJiLW6hWU+w7i7+AaQ0Ii5bKwJxd5uRK4zBCyrHd3tG6G8zOm2LplxbSfQg==", + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/@types/cacache/-/cacache-19.0.0.tgz", + "integrity": "sha512-O4V427CUunRaoaoG6awmIbamf/gTmsys9PHJNb2ujB+tGtSiDkAtkT+M8Lc04jhDxVBIWnBkFoKjFyne4zjKEw==", "dev": true, "license": "MIT", "dependencies": { @@ -1867,12 +1911,12 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.13.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.13.9.tgz", - "integrity": "sha512-acBjXdRJ3A6Pb3tqnw9HZmyR3Fiol3aGxRCK1x3d+6CDAMjl7I649wpSd+yNURCjbOUGu9tqtLKnTGxmK6CyGw==", + "version": "22.16.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.16.5.tgz", + "integrity": "sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==", "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "undici-types": "~6.21.0" } }, "node_modules/@types/node-fetch": { @@ -1900,9 +1944,9 @@ "license": "MIT" }, "node_modules/@types/npm-registry-fetch": { - "version": "8.0.7", - "resolved": "https://registry.npmjs.org/@types/npm-registry-fetch/-/npm-registry-fetch-8.0.7.tgz", - "integrity": "sha512-db9iBh7kDDg4lRT4k4XZ6IiecTEgFCID4qk+VDVPbtzU855q3KZLCn08ATr4H27ntRJVhulQ7GWjl24H42x96w==", + "version": "8.0.8", + "resolved": "https://registry.npmjs.org/@types/npm-registry-fetch/-/npm-registry-fetch-8.0.8.tgz", + "integrity": "sha512-VL/chssZawBkaQ5gFD5njblJce/ny9OICBlWAG9X6/m/ypPNJMWYiM22SY2mhLIGoknd4AyEJyi+FGyrBnsr+A==", "dev": true, "license": "MIT", "dependencies": { @@ -1914,9 +1958,9 @@ } }, "node_modules/@types/npmcli__arborist": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/@types/npmcli__arborist/-/npmcli__arborist-6.3.0.tgz", - "integrity": "sha512-CXkuOBZDlcb+r0UMlmEAq3XOUZrL9XfZ2MXIwCSo726OBkkg+UIWlZ9h3n6To9w1WqMEIOZT2LkerhLgnsPV+Q==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@types/npmcli__arborist/-/npmcli__arborist-6.3.1.tgz", + "integrity": "sha512-CUADRvIKRFwVuiroLQ0wWzOpeOcL8OacCbODtZZxMOA+PBg1au/D8ry/zBnQWdEH+i0IXKeNL2Nt0er30bYWng==", "dev": true, "license": "MIT", "dependencies": { @@ -2034,25 +2078,64 @@ "license": "MIT" }, "node_modules/@types/shelljs": { - "version": "0.8.15", - "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.15.tgz", - "integrity": "sha512-vzmnCHl6hViPu9GNLQJ+DZFd6BQI2DBTUeOvYHqkWQLMfKAAQYMb/xAmZkTogZI/vqXHCWkqDRymDI5p0QTi5Q==", + "version": "0.8.17", + "resolved": "https://registry.npmjs.org/@types/shelljs/-/shelljs-0.8.17.tgz", + "integrity": "sha512-IDksKYmQA2W9MkQjiyptbMmcQx+8+Ol6b7h6dPU5S05JyiQDSb/nZKnrMrZqGwgV6VkVdl6/SPCKPDlMRvqECg==", "dev": true, "license": "MIT", "dependencies": { - "@types/glob": "~7.2.0", - "@types/node": "*" + "@types/node": "*", + "glob": "^11.0.3" } }, - "node_modules/@types/shelljs/node_modules/@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "node_modules/@types/shelljs/node_modules/glob": { + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", + "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "@types/minimatch": "*", - "@types/node": "*" + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.0.3", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@types/shelljs/node_modules/minimatch": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", + "dev": true, + "license": "ISC", + "dependencies": { + "@isaacs/brace-expansion": "^5.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@types/shelljs/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/@types/sinon": { @@ -2219,9 +2302,9 @@ } }, "node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "license": "MIT", "bin": { "acorn": "bin/acorn" @@ -2249,9 +2332,9 @@ "license": "MIT" }, "node_modules/agent-base": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz", - "integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz", + "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==", "license": "MIT", "engines": { "node": ">= 14" @@ -2833,9 +2916,9 @@ "license": "MIT" }, "node_modules/bare-events": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.4.tgz", - "integrity": "sha512-+gFfDkR8pj4/TrWCGUGWmJIkBwuxPS5F+a5yWjOHQt2hHvNZd5YLzadjmDUtFmMM4y429bnKLa8bYBMHcYdnQA==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz", + "integrity": "sha512-EKZ5BTXYExaNqi3I3f9RtEsaI/xBSGjE0XZCZilPzFAV/goswFHuPd9jEZlPIZ/iNZJwDSao9qRiScySz7MbQg==", "license": "Apache-2.0", "optional": true }, @@ -3002,9 +3085,9 @@ } }, "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" @@ -4094,9 +4177,9 @@ } }, "node_modules/conventional-changelog-cli/node_modules/conventional-changelog-writer": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.0.1.tgz", - "integrity": "sha512-hlqcy3xHred2gyYg/zXSMXraY2mjAYYo0msUCpK+BGyaVJMFCKWVXPIHiaacGO2GGp13kvHWXFhYmxT4QQqW3Q==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-8.2.0.tgz", + "integrity": "sha512-Y2aW4596l9AEvFJRwFGJGiQjt2sBYTjPD18DdvxX9Vpz0Z7HQ+g1Z+6iYDAm1vR3QOJrDBkRHixHK/+FhkR6Pw==", "dev": true, "license": "MIT", "dependencies": { @@ -4123,9 +4206,9 @@ } }, "node_modules/conventional-changelog-cli/node_modules/conventional-commits-parser": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.1.0.tgz", - "integrity": "sha512-5nxDo7TwKB5InYBl4ZC//1g9GRwB/F3TXOGR9hgUjMGfvSP4Vu5NkpNro2+1+TIEy1vwxApl5ircECr2ri5JIw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.2.0.tgz", + "integrity": "sha512-uLnoLeIW4XaoFtH37qEcg/SXMJmKF4vi7V0H2rnPueg+VEtFGA/asSCNTcq4M/GQ6QmlzchAEtOoDTtKqWeHag==", "dev": true, "license": "MIT", "dependencies": { @@ -4201,15 +4284,15 @@ } }, "node_modules/conventional-changelog-cli/node_modules/parse-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", - "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.22.13", - "index-to-position": "^0.1.2", - "type-fest": "^4.7.1" + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" }, "engines": { "node": ">=18" @@ -4239,9 +4322,9 @@ } }, "node_modules/conventional-changelog-cli/node_modules/type-fest": { - "version": "4.37.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.37.0.tgz", - "integrity": "sha512-S/5/0kFftkq27FPNye0XM1e2NsnoD/3FS+pBmbjmmtLT6I+i344KoOf7pvXreaFsDamWeaJX55nczA1m5PsBDg==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -5075,9 +5158,9 @@ } }, "node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.1.tgz", + "integrity": "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==", "license": "MIT", "dependencies": { "ms": "^2.1.3" @@ -5233,9 +5316,9 @@ } }, "node_modules/del/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -6229,14 +6312,15 @@ } }, "node_modules/form-data": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", - "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.4.tgz", + "integrity": "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow==", "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", "mime-types": "^2.1.12" }, "engines": { @@ -6244,15 +6328,18 @@ } }, "node_modules/formidable": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.2.tgz", - "integrity": "sha512-Jqc1btCy3QzRbJaICGwKcBfGWuLADRerLzDqi2NwSt/UkXLsHJw2TVResiaoBufHVHy9aSgClOHCeJsSsFLTbg==", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-3.5.4.tgz", + "integrity": "sha512-YikH+7CUTOtP44ZTnUhR7Ic2UASBPOqmaRkRKxRbywPTe5VxF7RRCck4af9wutiZ/QKM5nME9Bie2fFaPz5Gug==", "license": "MIT", "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", "dezalgo": "^1.0.4", - "hexoid": "^2.0.0", "once": "^1.4.0" }, + "engines": { + "node": ">=14.0.0" + }, "funding": { "url": "https://ko-fi.com/tunnckoCore/commissions" } @@ -7233,9 +7320,9 @@ } }, "node_modules/globule/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -7961,9 +8048,9 @@ } }, "node_modules/grunt/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -8217,15 +8304,6 @@ "he": "bin/he" } }, - "node_modules/hexoid": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-2.0.0.tgz", - "integrity": "sha512-qlspKUK7IlSQv2o+5I7yhUd7TxlOG2Vr5LTa3ve2XSNVKAL/n/u/7KLvKmFNimomDIKvZFXWHv0T12mv7rT8Aw==", - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/highlight.js": { "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", @@ -8258,9 +8336,9 @@ } }, "node_modules/hosted-git-info": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.0.2.tgz", - "integrity": "sha512-sYKnA7eGln5ov8T8gnYlkSOxFJvywzEx9BueN6xo/GKO8PGiI6uK6xx+DIGe45T3bdVjLAQDQW1aicT8z8JwQg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-8.1.0.tgz", + "integrity": "sha512-Rw/B2DNQaPBICNXEm8balFz9a6WpZrkCGpcWFpy7nCj+NyhSdqXipmfvtmWt9xGfp0wZnBxB+iVpLmQMYt47Tw==", "license": "ISC", "dependencies": { "lru-cache": "^10.0.1" @@ -8270,15 +8348,15 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", "license": "BSD-2-Clause" }, "node_modules/http-parser-js": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.9.tgz", - "integrity": "sha512-n1XsPy3rXVxlqxVioEWdC+0+M+SQw0DpJynwtOPo1X+ZlvdzTLtDBIJJlDQTnwZIFJrZSzSGmIOUdP8tu+SgLw==", + "version": "0.5.10", + "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.10.tgz", + "integrity": "sha512-Pysuw9XpUq5dVc/2SMHpuTY01RFl8fttgcyunjL7eEMhGM3cI4eOmiCycJDVCo/7O7ClfQD3SaI6ftDzqOXYMA==", "dev": true, "license": "MIT" }, @@ -8443,9 +8521,9 @@ } }, "node_modules/index-to-position": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-0.1.2.tgz", - "integrity": "sha512-MWDKS3AS1bGCHLBA2VLImJz42f7bJh8wQsTGCzI3j519/CASStoDONUBVz2I/VID0MpiX3SGSnbOD2xUalbE5g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/index-to-position/-/index-to-position-1.1.0.tgz", + "integrity": "sha512-XPdx9Dq4t9Qk1mTMbWONJqU7boCoumEH7fRET37HX5+khDUl3J2W6PdALxhILYlIYx2amlwYcRPp28p0tSiojg==", "dev": true, "license": "MIT", "engines": { @@ -8987,9 +9065,9 @@ "license": "MIT" }, "node_modules/istanbul/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -9112,9 +9190,9 @@ } }, "node_modules/jackspeak": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.0.tgz", - "integrity": "sha512-9DDdhb5j6cpeitCbvLO7n7J4IxnbM6hoF6O1g4HQ5TfhvvKN8ywDM7668ZhMHRqVmxqhps/F6syWK2KcPxYlkw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", "license": "BlueOak-1.0.0", "dependencies": { "@isaacs/cliui": "^8.0.2" @@ -9308,9 +9386,9 @@ } }, "node_modules/ky": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/ky/-/ky-1.7.5.tgz", - "integrity": "sha512-HzhziW6sc5m0pwi5M196+7cEBtbt0lCYi67wNsiwMUmz833wloE0gbzJPWKs1gliFKQb34huItDQX97LyOdPdA==", + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/ky/-/ky-1.8.2.tgz", + "integrity": "sha512-XybQJ3d4Ea1kI27DoelE5ZCT3bSJlibYTtQuMsyzKox3TMyayw1asgQdl54WroAm+fIA3ZCr8zXW2RpR7qWVpA==", "dev": true, "license": "MIT", "engines": { @@ -9510,9 +9588,9 @@ } }, "node_modules/listr2": { - "version": "8.2.5", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.5.tgz", - "integrity": "sha512-iyAZCeyD+c1gPyE9qpFu8af0Y+MRtmKOncdGoA2S5EY8iFq99dmmvkNnHiWo+pj0s7yH7l3KPIgee77tKpXPWQ==", + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.3.3.tgz", + "integrity": "sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==", "dev": true, "license": "MIT", "dependencies": { @@ -9839,9 +9917,9 @@ } }, "node_modules/loupe": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", - "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.4.tgz", + "integrity": "sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==", "dev": true, "license": "MIT" }, @@ -10315,68 +10393,17 @@ "license": "ISC" }, "node_modules/minizlib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.1.tgz", - "integrity": "sha512-umcy022ILvb5/3Djuu8LWeqUa8D68JaBzlttKeMWen48SjabqS3iY5w/vzeMzMUNhLDifyhbOwKDSznB1vvrwg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz", + "integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==", "license": "MIT", "dependencies": { - "minipass": "^7.0.4", - "rimraf": "^5.0.5" + "minipass": "^7.1.2" }, "engines": { "node": ">= 18" } }, - "node_modules/minizlib/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minizlib/node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/minizlib/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/minizlib/node_modules/minipass": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", @@ -10386,37 +10413,6 @@ "node": ">=16 || 14 >=14.17" } }, - "node_modules/minizlib/node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/minizlib/node_modules/rimraf": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", - "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", - "license": "ISC", - "dependencies": { - "glob": "^10.3.7" - }, - "bin": { - "rimraf": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/mixin-deep": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", @@ -10725,9 +10721,9 @@ } }, "node_modules/nan": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.2.tgz", - "integrity": "sha512-DANghxFkS1plDdRsX0X9pm0Z6SJNN6gBdtXfanwoZ8hooC5gosGFSBGRYHUVPz1asKA/kMRqDRdHrluZ61SpBQ==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.23.0.tgz", + "integrity": "sha512-1UxuyYGdoQHcGg87Lkqm3FzefucTa0NAiOcuRsDmysep3c1LVCRK2krrUDafMWtjSG04htvAmvg96+SDknOmgQ==", "dev": true, "license": "MIT", "optional": true @@ -10888,20 +10884,20 @@ } }, "node_modules/node-gyp": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.1.0.tgz", - "integrity": "sha512-/+7TuHKnBpnMvUQnsYEb0JOozDZqarQbfNuSGLXIjhStMT0fbw7IdSqWgopOP5xhRZE+lsbIvAHcekddruPZgQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-11.2.0.tgz", + "integrity": "sha512-T0S1zqskVUSxcsSTkAsLc7xCycrRYmtDHadDinzocrThjyQCn5kMlEBSj6H4qDbgsIOSLmmlRIeb0lZXj+UArA==", "license": "MIT", "dependencies": { "env-paths": "^2.2.0", "exponential-backoff": "^3.1.1", - "glob": "^10.3.10", "graceful-fs": "^4.2.6", "make-fetch-happen": "^14.0.3", "nopt": "^8.0.0", "proc-log": "^5.0.0", "semver": "^7.3.5", "tar": "^7.4.3", + "tinyglobby": "^0.2.12", "which": "^5.0.0" }, "bin": { @@ -10920,81 +10916,6 @@ "node": ">=6" } }, - "node_modules/node-gyp/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "license": "ISC", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/node-gyp/node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "license": "BlueOak-1.0.0", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/node-gyp/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "license": "ISC", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/node-gyp/node_modules/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "license": "ISC", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/node-gyp/node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "license": "BlueOak-1.0.0", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/nodemon": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/nodemon/-/nodemon-3.0.3.tgz", @@ -11049,9 +10970,9 @@ } }, "node_modules/nodemon/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -11155,9 +11076,9 @@ } }, "node_modules/nopt/node_modules/abbrev": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.0.tgz", - "integrity": "sha512-+/kfrslGQ7TNV2ecmQwMJj/B65g5KVq1/L3SGVZ3tCYGqlzFuFCGBZJtMP99wH3NpEUyAjn0zPdPUg0D+DwrOA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-3.0.1.tgz", + "integrity": "sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==", "license": "ISC", "engines": { "node": "^18.17.0 || >=20.5.0" @@ -12073,9 +11994,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.0.2.tgz", - "integrity": "sha512-123qHRfJBmo2jXDbo/a5YOQrJoHF/GNQTLzQ5+IdK5pWpceK17yRc6ozlWd25FxvGKQbIUs91fDFkXmDHTKcyA==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.1.0.tgz", + "integrity": "sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==", "license": "ISC", "engines": { "node": "20 || >=22" @@ -12122,9 +12043,9 @@ } }, "node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", "dev": true, "license": "MIT", "engines": { @@ -12283,9 +12204,9 @@ } }, "node_modules/postcss-selector-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", - "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz", + "integrity": "sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA==", "license": "MIT", "dependencies": { "cssesc": "^3.0.0", @@ -12656,15 +12577,15 @@ } }, "node_modules/read-package-up/node_modules/parse-json": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.1.0.tgz", - "integrity": "sha512-rum1bPifK5SSar35Z6EKZuYPJx85pkNaFrxBK3mwdfSJ1/WKbYrjoW/zTPSjRRamfmVX1ACBIdFAO0VRErW/EA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-8.3.0.tgz", + "integrity": "sha512-ybiGyvspI+fAoRQbIPRddCcSTV9/LsJbf0e/S85VLowVGzRmokfneg2kwVW/KU5rOXrPSbF1qAKPMgNTqqROQQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.22.13", - "index-to-position": "^0.1.2", - "type-fest": "^4.7.1" + "@babel/code-frame": "^7.26.2", + "index-to-position": "^1.1.0", + "type-fest": "^4.39.1" }, "engines": { "node": ">=18" @@ -12694,9 +12615,9 @@ } }, "node_modules/read-package-up/node_modules/type-fest": { - "version": "4.37.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.37.0.tgz", - "integrity": "sha512-S/5/0kFftkq27FPNye0XM1e2NsnoD/3FS+pBmbjmmtLT6I+i344KoOf7pvXreaFsDamWeaJX55nczA1m5PsBDg==", + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", "dev": true, "license": "(MIT OR CC0-1.0)", "engines": { @@ -13104,9 +13025,9 @@ } }, "node_modules/replace/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -13492,9 +13413,9 @@ } }, "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -13715,9 +13636,9 @@ } }, "node_modules/shelljs/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -14164,9 +14085,9 @@ } }, "node_modules/socks": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz", - "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==", + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz", + "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==", "license": "MIT", "dependencies": { "ip-address": "^9.0.5", @@ -14449,9 +14370,9 @@ } }, "node_modules/streamx": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.0.tgz", - "integrity": "sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==", + "version": "2.22.1", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.22.1.tgz", + "integrity": "sha512-znKXEBxfatz2GBNK02kRnCXjV+AA4kjZIUxeWSr3UGirZMJfTE9uiwKHobnbgxWyL/JWro8tTq+vOqAK1/qbSA==", "license": "MIT", "dependencies": { "fast-fifo": "^1.3.2", @@ -14727,9 +14648,9 @@ } }, "node_modules/temp/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -14937,6 +14858,48 @@ "integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==", "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.14.tgz", + "integrity": "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==", + "license": "MIT", + "dependencies": { + "fdir": "^6.4.4", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinyglobby/node_modules/fdir": { + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.6.tgz", + "integrity": "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==", + "license": "MIT", + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/tinyglobby/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/tmp": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", @@ -15128,14 +15091,14 @@ "license": "0BSD" }, "node_modules/tuf-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-3.0.1.tgz", - "integrity": "sha512-+68OP1ZzSF84rTckf3FA95vJ1Zlx/uaXyiiKyPd1pA4rZNkpEvDAKmsu1xUSmbF/chCRYgZ6UZkDwC7PmzmAyA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tuf-js/-/tuf-js-3.1.0.tgz", + "integrity": "sha512-3T3T04WzowbwV2FDiGXBbr81t64g1MUGGJRgT4x5o97N+8ArdhVCAF9IxFrxuSJmM3E5Asn7nKHkao0ibcZXAg==", "license": "MIT", "dependencies": { "@tufjs/models": "3.0.1", - "debug": "^4.3.6", - "make-fetch-happen": "^14.0.1" + "debug": "^4.4.1", + "make-fetch-happen": "^14.0.3" }, "engines": { "node": "^18.17.0 || >=20.5.0" @@ -15249,9 +15212,9 @@ "license": "BSD-3-Clause" }, "node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", "license": "MIT" }, "node_modules/unicode-emoji-modifier-base": { @@ -15517,9 +15480,9 @@ } }, "node_modules/validate-npm-package-name": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.0.tgz", - "integrity": "sha512-d7KLgL1LD3U3fgnvWEY1cQXoO/q6EQ1BSz48Sa149V/5zVTAbgmZIpyI8TRi6U9/JNyeYLlTKsEMPtLC27RFUg==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.1.tgz", + "integrity": "sha512-OaI//3H0J7ZkR1OqlhGA8cA+Cbk/2xFOQpJOt5+s27/ta9eZwpeervh4Mxh4w0im/kdgktowaqVNR7QOrUd7Yg==", "license": "ISC", "engines": { "node": "^18.17.0 || >=20.5.0" @@ -15829,16 +15792,16 @@ } }, "node_modules/yaml": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.7.0.tgz", - "integrity": "sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.0.tgz", + "integrity": "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ==", "dev": true, "license": "ISC", "bin": { "yaml": "bin.mjs" }, "engines": { - "node": ">= 14" + "node": ">= 14.6" } }, "node_modules/yargs": { @@ -15943,9 +15906,9 @@ } }, "node_modules/zod": { - "version": "3.24.2", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", - "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" diff --git a/package.json b/package.json index addfe5724b..b22ceb1b07 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "main": "./lib/nativescript-cli-lib.js", - "version": "9.0.0-alpha.0", + "version": "9.0.0-alpha.2", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { From dba4e1a0bb9c91119702f78c1f2c4a49e9b56143 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 26 Jul 2025 18:37:08 -0700 Subject: [PATCH 11/16] chore: updated lock --- package-lock.json | 77 +++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index c93eb29f0a..9bc1a98c20 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@rigor789/trapezedev-project": "7.1.2", "ansi-colors": "^4.1.3", "archiver": "^7.0.1", - "axios": "1.7.9", + "axios": "1.11.0", "byline": "5.0.0", "chalk": "4.1.2", "chokidar": "4.0.3", @@ -106,6 +106,7 @@ "@types/ws": "8.5.14", "@types/xml2js": "0.4.14", "@types/yargs": "17.0.33", + "braces": ">=3.0.3", "chai": "5.2.0", "chai-as-promised": "8.0.1", "conventional-changelog-cli": "^5.0.0", @@ -122,7 +123,8 @@ "lint-staged": "~15.4.3", "mocha": "11.1.0", "sinon": "19.0.2", - "source-map-support": "0.5.21" + "source-map-support": "0.5.21", + "xml2js": ">=0.5.0" }, "engines": { "node": ">=20.0.0" @@ -305,7 +307,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", - "dev": true, "license": "MIT", "engines": { "node": "20 || >=22" @@ -315,7 +316,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", - "dev": true, "license": "MIT", "dependencies": { "@isaacs/balanced-match": "^4.0.1" @@ -984,9 +984,9 @@ } }, "node_modules/@npmcli/arborist": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-9.1.2.tgz", - "integrity": "sha512-KIuQc8TuMTcL8OTVmOTdVIXmkDFFOHmVlVd94N9wwHjuOA2ZyNsoJPS50Q/irdkS3LF/9BiIcxSIV/ukSjqO6g==", + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-9.1.3.tgz", + "integrity": "sha512-PvwtZD1dipP5VByHyWX28tZfan1AkfBLenJTgr0rDdEbdovZc06Z5PHdGb5SEeN7EERl68wFH8lq6WvuUHmgrw==", "license": "ISC", "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", @@ -1606,14 +1606,13 @@ } }, "node_modules/@sinonjs/samsam": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.2.tgz", - "integrity": "sha512-v46t/fwnhejRSFTGqbpn9u+LQ9xJDse10gNnPgAcxgdoCDMXj/G2asWAC/8Qs+BAZDicX+MNZouXT1A7c83kVw==", + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.3.tgz", + "integrity": "sha512-hw6HbX+GyVZzmaYNh82Ecj1vdGZrqVIn/keDTg63IgAwiQPO+xCz99uG6Woqgb4tM0mUiFENKZ4cqd7IX94AXQ==", "dev": true, "license": "BSD-3-Clause", "dependencies": { "@sinonjs/commons": "^3.0.1", - "lodash.get": "^4.4.2", "type-detect": "^4.1.0" } }, @@ -2893,13 +2892,13 @@ } }, "node_modules/axios": { - "version": "1.7.9", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", - "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.11.0.tgz", + "integrity": "sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA==", "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", - "form-data": "^4.0.0", + "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, @@ -8461,27 +8460,27 @@ "license": "ISC" }, "node_modules/ignore-walk": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-7.0.0.tgz", - "integrity": "sha512-T4gbf83A4NH95zvhVYZc+qWocBBGlpzUXLPGurJggw/WIOwicfXJChLDP/iBZnN5WqROSu5Bm3hhle4z8a8YGQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-8.0.0.tgz", + "integrity": "sha512-FCeMZT4NiRQGh+YkeKMtWrOmBgWjHjMJ26WQWrRQyoyzqevdaGSakUaJW5xQYmjLlUVk2qUnCjYVBax9EKKg8A==", "license": "ISC", "dependencies": { - "minimatch": "^9.0.0" + "minimatch": "^10.0.3" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^20.17.0 || >=22.9.0" } }, "node_modules/ignore-walk/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", "license": "ISC", "dependencies": { - "brace-expansion": "^2.0.1" + "@isaacs/brace-expansion": "^5.0.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -9739,14 +9738,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", - "deprecated": "This package is deprecated. Use the optional chaining (?.) operator instead.", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.ismatch": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz", @@ -9917,9 +9908,9 @@ } }, "node_modules/loupe": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.4.tgz", - "integrity": "sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.0.tgz", + "integrity": "sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==", "dev": true, "license": "MIT" }, @@ -11187,12 +11178,12 @@ } }, "node_modules/npm-packlist": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-10.0.0.tgz", - "integrity": "sha512-rht9U6nS8WOBDc53eipZNPo5qkAV4X2rhKE2Oj1DYUQ3DieXfj0mKkVmjnf3iuNdtMd8WfLdi2L6ASkD/8a+Kg==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-10.0.1.tgz", + "integrity": "sha512-vaC03b2PqJA6QqmwHi1jNU8fAPXEnnyv4j/W4PVfgm24C4/zZGSVut3z0YUeN0WIFCo1oGOL02+6LbvFK7JL4Q==", "license": "ISC", "dependencies": { - "ignore-walk": "^7.0.0" + "ignore-walk": "^8.0.0" }, "engines": { "node": "^20.17.0 || >=22.9.0" @@ -15480,9 +15471,9 @@ } }, "node_modules/validate-npm-package-name": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.1.tgz", - "integrity": "sha512-OaI//3H0J7ZkR1OqlhGA8cA+Cbk/2xFOQpJOt5+s27/ta9eZwpeervh4Mxh4w0im/kdgktowaqVNR7QOrUd7Yg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-6.0.2.tgz", + "integrity": "sha512-IUoow1YUtvoBBC06dXs8bR8B9vuA3aJfmQNKMoaPG/OFsPmoQvw8xh+6Ye25Gx9DQhoEom3Pcu9MKHerm/NpUQ==", "license": "ISC", "engines": { "node": "^18.17.0 || >=20.5.0" From f3a3b9025ad11b7124b1f95afd416803a32c7b57 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 26 Jul 2025 18:48:55 -0700 Subject: [PATCH 12/16] chore: 9.0.0-alpha.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d28382b8c..56c556a116 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "main": "./lib/nativescript-cli-lib.js", - "version": "9.0.0-alpha.2", + "version": "9.0.0-alpha.3", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { From b3bbc1af21994063c947a6e9f576090656023bd6 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 2 Aug 2025 21:59:49 -0700 Subject: [PATCH 13/16] feat(hooks): allow cjs extensions --- lib/common/services/hooks-service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/common/services/hooks-service.ts b/lib/common/services/hooks-service.ts index 4b04e9b7a9..0b9676258a 100644 --- a/lib/common/services/hooks-service.ts +++ b/lib/common/services/hooks-service.ts @@ -188,7 +188,11 @@ export class HooksService implements IHooksService { let inProc = false; if (!command) { command = hook.fullPath; - if ([".mjs", ".js"].includes(path.extname(hook.fullPath).toLowerCase())) { + if ( + [".mjs", ".cjs", ".js"].includes( + path.extname(hook.fullPath).toLowerCase(), + ) + ) { command = process.argv[0]; inProc = isESM ? true From 89daf8a793d4d08971aee37d7a285bcf2836ea1a Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sat, 2 Aug 2025 22:05:38 -0700 Subject: [PATCH 14/16] chore: 9.0.0-alpha.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 56c556a116..12481f5078 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nativescript", "main": "./lib/nativescript-cli-lib.js", - "version": "9.0.0-alpha.3", + "version": "9.0.0-alpha.4", "author": "NativeScript ", "description": "Command-line interface for building NativeScript projects", "bin": { From 8a12366aa93ee655d337948a5cdbf40470773aa7 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 6 Aug 2025 18:53:41 -0700 Subject: [PATCH 15/16] fix: prevent TypeError: Body is unusable during unit test dep generation --- Gruntfile.js | 42 +++++++++++++++++++++++------------------- package-lock.json | 4 ++-- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 26f6fffbe1..a08b50c319 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,7 +2,7 @@ const childProcess = require("child_process"); const EOL = require("os").EOL; const path = require("path"); const now = new Date().toISOString(); -const latestVersion = require('latest-version').default; +const manifest = require('pacote').manifest; const ENVIRONMENTS = { @@ -260,28 +260,26 @@ function registerTestingDependenciesTasks(grunt) { return done(false); } - - // Kick off all version resolutions in parallel - const versionPromises = testDependencies.map(dep => { - if (dep.version) { - dependenciesVersions[dep.name] = dep.version; - return Promise.resolve(); - } - return latestVersion(dep.name).then(v => { - dependenciesVersions[dep.name] = v; - }); - }); - - Promise.all(versionPromises) - .then(() => { - grunt.file.write(generatedVersionFilePath, JSON.stringify(dependenciesVersions, null, 2)); + (async () => { + try { + for (const dep of testDependencies) { + if (dep.version) { + dependenciesVersions[dep.name] = dep.version; + } else { + dependenciesVersions[dep.name] = await latestVersion(dep.name); + } + } + grunt.file.write( + generatedVersionFilePath, + JSON.stringify(dependenciesVersions, null, 2) + ); grunt.log.writeln("Wrote", generatedVersionFilePath); done(); - }) - .catch(err => { + } catch (err) { grunt.log.error(err); done(false); - }); + } + })(); }); grunt.registerTask("verify_unit_testing_dependencies", function () { @@ -291,3 +289,9 @@ function registerTestingDependenciesTasks(grunt) { }); } +async function latestVersion(name) { + // only fetches the package.json for the latest dist-tag + const { version } = await manifest(name.toLowerCase(), { fullMetadata: false }); + return version; +} + diff --git a/package-lock.json b/package-lock.json index f8f394dfe8..a5eb59b872 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "nativescript", - "version": "9.0.0-alpha.2", + "version": "9.0.0-alpha.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nativescript", - "version": "9.0.0-alpha.2", + "version": "9.0.0-alpha.4", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { From 6de802d35c28c8a9f77f0c034a39a8d70a318f4d Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 6 Aug 2025 19:05:40 -0700 Subject: [PATCH 16/16] chore: cleanup --- package-lock.json | 191 ---------------------------------------------- package.json | 1 - 2 files changed, 192 deletions(-) diff --git a/package-lock.json b/package-lock.json index a5eb59b872..ba6411b0d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -119,7 +119,6 @@ "grunt-ts": "6.0.0-beta.22", "husky": "9.1.7", "istanbul": "0.4.5", - "latest-version": "9.0.0", "lint-staged": "~15.4.3", "mocha": "11.1.0", "sinon": "19.0.2", @@ -1379,51 +1378,6 @@ "node": ">=14" } }, - "node_modules/@pnpm/config.env-replace": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@pnpm/config.env-replace/-/config.env-replace-1.1.0.tgz", - "integrity": "sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@pnpm/network.ca-file/-/network.ca-file-1.0.2.tgz", - "integrity": "sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==", - "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "4.2.10" - }, - "engines": { - "node": ">=12.22.0" - } - }, - "node_modules/@pnpm/network.ca-file/node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true, - "license": "ISC" - }, - "node_modules/@pnpm/npm-conf": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", - "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@pnpm/config.env-replace": "^1.1.0", - "@pnpm/network.ca-file": "^1.0.1", - "config-chain": "^1.1.11" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@prettier/plugin-xml": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/@prettier/plugin-xml/-/plugin-xml-2.2.0.tgz", @@ -3895,24 +3849,6 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "license": "MIT" }, - "node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/config-chain/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "license": "ISC" - }, "node_modules/continuable-cache": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/continuable-cache/-/continuable-cache-0.3.1.tgz", @@ -5240,16 +5176,6 @@ "node": ">=6" } }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -9534,35 +9460,6 @@ "node": ">=6" } }, - "node_modules/ky": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/ky/-/ky-1.8.2.tgz", - "integrity": "sha512-XybQJ3d4Ea1kI27DoelE5ZCT3bSJlibYTtQuMsyzKox3TMyayw1asgQdl54WroAm+fIA3ZCr8zXW2RpR7qWVpA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sindresorhus/ky?sponsor=1" - } - }, - "node_modules/latest-version": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-9.0.0.tgz", - "integrity": "sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==", - "dev": true, - "license": "MIT", - "dependencies": { - "package-json": "^10.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/lazystream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.1.tgz", @@ -11784,25 +11681,6 @@ "node": ">=6" } }, - "node_modules/package-json": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-10.0.1.tgz", - "integrity": "sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==", - "dev": true, - "license": "MIT", - "dependencies": { - "ky": "^1.2.0", - "registry-auth-token": "^5.0.2", - "registry-url": "^6.0.1", - "semver": "^7.6.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/package-json-from-dist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", @@ -12500,13 +12378,6 @@ "signal-exit": "^3.0.2" } }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", - "dev": true, - "license": "ISC" - }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -12639,39 +12510,6 @@ "dev": true, "license": "MIT" }, - "node_modules/rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", - "dependencies": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "bin": { - "rc": "cli.js" - } - }, - "node_modules/rc/node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true, - "license": "ISC" - }, - "node_modules/rc/node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/read-cmd-shim": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-5.0.0.tgz", @@ -13089,35 +12927,6 @@ "integrity": "sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==", "license": "MIT" }, - "node_modules/registry-auth-token": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-5.1.0.tgz", - "integrity": "sha512-GdekYuwLXLxMuFTwAPg5UKGLW/UXzQrZvH/Zj791BQif5T05T0RsaLfHc9q3ZOKi7n+BoprPD9mJ0O0k4xzUlw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@pnpm/npm-conf": "^2.1.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/registry-url": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-6.0.1.tgz", - "integrity": "sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "rc": "1.2.8" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", diff --git a/package.json b/package.json index eb3f5f0847..254c15d3ea 100644 --- a/package.json +++ b/package.json @@ -157,7 +157,6 @@ "grunt-ts": "6.0.0-beta.22", "husky": "9.1.7", "istanbul": "0.4.5", - "latest-version": "9.0.0", "lint-staged": "~15.4.3", "mocha": "11.1.0", "sinon": "19.0.2",