diff --git a/libs/feature-run/src/lib/target/target.component.ts b/libs/feature-run/src/lib/target/target.component.ts index 5a759b38e6..0bcf0c082c 100644 --- a/libs/feature-run/src/lib/target/target.component.ts +++ b/libs/feature-run/src/lib/target/target.component.ts @@ -1,11 +1,31 @@ import { Architect, Project } from '@angular-console/schema'; -import { CommandOutputComponent, FlagsComponent, TaskRunnerComponent } from '@angular-console/ui'; -import { CommandRunner, IncrementalCommandOutput, Serializer } from '@angular-console/utils'; -import { ChangeDetectionStrategy, Component, OnInit, ViewChild } from '@angular/core'; +import { + CommandOutputComponent, + FlagsComponent, + TaskRunnerComponent +} from '@angular-console/ui'; +import { + CommandRunner, + IncrementalCommandOutput, + Serializer +} from '@angular-console/utils'; +import { + ChangeDetectionStrategy, + Component, + OnInit, + ViewChild +} from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ContextualActionBarService } from '@nrwl/angular-console-enterprise-frontend'; import { BehaviorSubject, Observable, of, Subject } from 'rxjs'; -import { map, publishReplay, refCount, switchMap, tap, withLatestFrom } from 'rxjs/operators'; +import { + map, + publishReplay, + refCount, + switchMap, + tap, + withLatestFrom +} from 'rxjs/operators'; import { ProjectsGQL, RunNgGQL } from '../generated/graphql'; @@ -158,6 +178,10 @@ export class TargetComponent implements OnInit { } initSourceMapAndStatsJson(architect: Architect) { + if (architect.name !== 'build') { + return; + } + const defaultValues = architect.configurations[0] ? architect.configurations[0].defaultValues : []; diff --git a/libs/schema/src/lib/generated/graphql-types.ts b/libs/schema/src/lib/generated/graphql-types.ts index 9d8203e01d..1956bac6d6 100644 --- a/libs/schema/src/lib/generated/graphql-types.ts +++ b/libs/schema/src/lib/generated/graphql-types.ts @@ -462,24 +462,24 @@ export interface OpenDocMutationArgs { import { GraphQLResolveInfo } from 'graphql'; -export type Resolver = ( +export type Resolver = ( parent: Parent, args: Args, - context: Context, + context: TContext, info: GraphQLResolveInfo ) => Promise | Result; -export interface ISubscriptionResolverObject { +export interface ISubscriptionResolverObject { subscribe( parent: P, args: Args, - context: Context, + context: TContext, info: GraphQLResolveInfo ): AsyncIterator | Promise>; resolve?( parent: P, args: Args, - context: Context, + context: TContext, info: GraphQLResolveInfo ): R | Result | Promise; } @@ -487,17 +487,17 @@ export interface ISubscriptionResolverObject { export type SubscriptionResolver< Result, Parent = {}, - Context = {}, + TContext = {}, Args = {} > = | (( ...args: any[] - ) => ISubscriptionResolverObject) - | ISubscriptionResolverObject; + ) => ISubscriptionResolverObject) + | ISubscriptionResolverObject; -export type TypeResolveFn = ( +export type TypeResolveFn = ( parent: Parent, - context: Context, + context: TContext, info: GraphQLResolveInfo ) => Maybe; @@ -512,64 +512,63 @@ export type DirectiveResolverFn = ( ) => TResult | Promise; export namespace QueryResolvers { - export interface Resolvers { - settings?: SettingsResolver; + export interface Resolvers { + settings?: SettingsResolver; schematicCollections?: SchematicCollectionsResolver< any[], TypeParent, - Context + TContext >; - workspace?: WorkspaceResolver; + workspace?: WorkspaceResolver; - editors?: EditorsResolver; + editors?: EditorsResolver; availableExtensions?: AvailableExtensionsResolver< any[], TypeParent, - Context + TContext >; isNodejsInstalled?: IsNodejsInstalledResolver< Maybe, TypeParent, - Context + TContext >; - commands?: CommandsResolver; + commands?: CommandsResolver; } - export type SettingsResolver = Resolver< + export type SettingsResolver = Resolver< R, Parent, - Context + TContext >; export type SchematicCollectionsResolver< R = any[], Parent = {}, - Context = any - > = Resolver; - export type WorkspaceResolver = Resolver< - R, - Parent, - Context, - WorkspaceArgs - >; + TContext = any + > = Resolver; + export type WorkspaceResolver< + R = any, + Parent = {}, + TContext = any + > = Resolver; export interface WorkspaceArgs { path: string; } - export type EditorsResolver = Resolver< - R, - Parent, - Context - >; + export type EditorsResolver< + R = any[], + Parent = {}, + TContext = any + > = Resolver; export type AvailableExtensionsResolver< R = any[], Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface AvailableExtensionsArgs { name?: Maybe; } @@ -577,13 +576,13 @@ export namespace QueryResolvers { export type IsNodejsInstalledResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type CommandsResolver< R = any[], Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface CommandsArgs { id?: Maybe; @@ -592,306 +591,306 @@ export namespace QueryResolvers { } export namespace SettingsResolvers { - export interface Resolvers { - canCollectData?: CanCollectDataResolver; + export interface Resolvers { + canCollectData?: CanCollectDataResolver; - isConnectUser?: IsConnectUserResolver, TypeParent, Context>; + isConnectUser?: IsConnectUserResolver, TypeParent, TContext>; disableAnimations?: DisableAnimationsResolver< Maybe, TypeParent, - Context + TContext >; showSupportPlugin?: ShowSupportPluginResolver< Maybe, TypeParent, - Context + TContext >; installNodeManually?: InstallNodeManuallyResolver< Maybe, TypeParent, - Context + TContext >; enableDetailedStatus?: EnableDetailedStatusResolver< Maybe, TypeParent, - Context + TContext >; - channel?: ChannelResolver, TypeParent, Context>; + channel?: ChannelResolver, TypeParent, TContext>; workspaceSchematicsDirectory?: WorkspaceSchematicsDirectoryResolver< Maybe, TypeParent, - Context + TContext >; workspaceSchematicsNpmScript?: WorkspaceSchematicsNpmScriptResolver< Maybe, TypeParent, - Context + TContext >; - recent?: RecentResolver; + recent?: RecentResolver; - isWsl?: IsWslResolver, TypeParent, Context>; + isWsl?: IsWslResolver, TypeParent, TContext>; - isWindows?: IsWindowsResolver, TypeParent, Context>; + isWindows?: IsWindowsResolver, TypeParent, TContext>; - useNvm?: UseNvmResolver, TypeParent, Context>; + useNvm?: UseNvmResolver, TypeParent, TContext>; } export type CanCollectDataResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type IsConnectUserResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DisableAnimationsResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ShowSupportPluginResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type InstallNodeManuallyResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type EnableDetailedStatusResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ChannelResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type WorkspaceSchematicsDirectoryResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type WorkspaceSchematicsNpmScriptResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; - export type RecentResolver = Resolver< - R, - Parent, - Context - >; + TContext = any + > = Resolver; + export type RecentResolver< + R = any[], + Parent = any, + TContext = any + > = Resolver; export type IsWslResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type IsWindowsResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type UseNvmResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace WorkspaceDefinitionResolvers { - export interface Resolvers { - path?: PathResolver; + export interface Resolvers { + path?: PathResolver; - name?: NameResolver; + name?: NameResolver; - favorite?: FavoriteResolver, TypeParent, Context>; + favorite?: FavoriteResolver, TypeParent, TContext>; pinnedProjectNames?: PinnedProjectNamesResolver< string[], TypeParent, - Context + TContext >; } - export type PathResolver = Resolver< + export type PathResolver = Resolver< R, Parent, - Context + TContext >; - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type FavoriteResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type PinnedProjectNamesResolver< R = string[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace SchematicCollectionForNgNewResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - description?: DescriptionResolver; + description?: DescriptionResolver; - schema?: SchemaResolver; + schema?: SchemaResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type DescriptionResolver< R = string, Parent = any, - Context = any - > = Resolver; - export type SchemaResolver = Resolver< - R, - Parent, - Context - >; + TContext = any + > = Resolver; + export type SchemaResolver< + R = any[], + Parent = any, + TContext = any + > = Resolver; } export namespace SchemaResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - type?: TypeResolver; + type?: TypeResolver; - description?: DescriptionResolver; + description?: DescriptionResolver; - defaultValue?: DefaultValueResolver, TypeParent, Context>; + defaultValue?: DefaultValueResolver, TypeParent, TContext>; - important?: ImportantResolver, TypeParent, Context>; + important?: ImportantResolver, TypeParent, TContext>; - completion?: CompletionResolver, TypeParent, Context>; + completion?: CompletionResolver, TypeParent, TContext>; - required?: RequiredResolver; + required?: RequiredResolver; - positional?: PositionalResolver; + positional?: PositionalResolver; - enum?: EnumResolver, TypeParent, Context>; + enum?: EnumResolver, TypeParent, TContext>; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; - export type TypeResolver = Resolver< + export type TypeResolver = Resolver< R, Parent, - Context + TContext >; export type DescriptionResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DefaultValueResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ImportantResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type CompletionResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type RequiredResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type PositionalResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type EnumResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace WorkspaceResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - path?: PathResolver; + path?: PathResolver; - dependencies?: DependenciesResolver; + dependencies?: DependenciesResolver; - extensions?: ExtensionsResolver; + extensions?: ExtensionsResolver; schematicCollections?: SchematicCollectionsResolver< any[], TypeParent, - Context + TContext >; - npmScripts?: NpmScriptsResolver; + npmScripts?: NpmScriptsResolver; - projects?: ProjectsResolver; + projects?: ProjectsResolver; - docs?: DocsResolver; + docs?: DocsResolver; - completions?: CompletionsResolver, TypeParent, Context>; + completions?: CompletionsResolver, TypeParent, TContext>; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; - export type PathResolver = Resolver< + export type PathResolver = Resolver< R, Parent, - Context + TContext >; export type DependenciesResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ExtensionsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type SchematicCollectionsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface SchematicCollectionsArgs { name?: Maybe; } @@ -899,8 +898,8 @@ export namespace WorkspaceResolvers { export type NpmScriptsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface NpmScriptsArgs { name?: Maybe; } @@ -908,208 +907,208 @@ export namespace WorkspaceResolvers { export type ProjectsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface ProjectsArgs { name?: Maybe; } - export type DocsResolver = Resolver< + export type DocsResolver = Resolver< R, Parent, - Context + TContext >; export type CompletionsResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace DependenciesResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - version?: VersionResolver; + version?: VersionResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type VersionResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace ExtensionResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - description?: DescriptionResolver; + description?: DescriptionResolver; detailedDescription?: DetailedDescriptionResolver< Maybe, TypeParent, - Context + TContext >; - installed?: InstalledResolver, TypeParent, Context>; + installed?: InstalledResolver, TypeParent, TContext>; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type DescriptionResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DetailedDescriptionResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type InstalledResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace SchematicCollectionResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - schematics?: SchematicsResolver; + schematics?: SchematicsResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type SchematicsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface SchematicsArgs { name?: Maybe; } } export namespace SchematicResolvers { - export interface Resolvers { - collection?: CollectionResolver; + export interface Resolvers { + collection?: CollectionResolver; - name?: NameResolver; + name?: NameResolver; - description?: DescriptionResolver; + description?: DescriptionResolver; - npmClient?: NpmClientResolver, TypeParent, Context>; + npmClient?: NpmClientResolver, TypeParent, TContext>; - npmScript?: NpmScriptResolver, TypeParent, Context>; + npmScript?: NpmScriptResolver, TypeParent, TContext>; - schema?: SchemaResolver; + schema?: SchemaResolver; } export type CollectionResolver< R = string, Parent = any, - Context = any - > = Resolver; - export type NameResolver = Resolver< + TContext = any + > = Resolver; + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type DescriptionResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type NpmClientResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type NpmScriptResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; - export type SchemaResolver = Resolver< - R, - Parent, - Context - >; + TContext = any + > = Resolver; + export type SchemaResolver< + R = any[], + Parent = any, + TContext = any + > = Resolver; } export namespace NpmScriptResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - npmClient?: NpmClientResolver, TypeParent, Context>; + npmClient?: NpmClientResolver, TypeParent, TContext>; - schema?: SchemaResolver; + schema?: SchemaResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type NpmClientResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; - export type SchemaResolver = Resolver< - R, - Parent, - Context - >; + TContext = any + > = Resolver; + export type SchemaResolver< + R = any[], + Parent = any, + TContext = any + > = Resolver; } export namespace ProjectResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - root?: RootResolver; + root?: RootResolver; - projectType?: ProjectTypeResolver; + projectType?: ProjectTypeResolver; - architect?: ArchitectResolver; + architect?: ArchitectResolver; - recentActions?: RecentActionsResolver; + recentActions?: RecentActionsResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; - export type RootResolver = Resolver< + export type RootResolver = Resolver< R, Parent, - Context + TContext >; export type ProjectTypeResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ArchitectResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface ArchitectArgs { name?: Maybe; } @@ -1117,150 +1116,150 @@ export namespace ProjectResolvers { export type RecentActionsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace ArchitectResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - project?: ProjectResolver; + project?: ProjectResolver; - builder?: BuilderResolver; + builder?: BuilderResolver; - description?: DescriptionResolver; + description?: DescriptionResolver; - options?: OptionsResolver; + options?: OptionsResolver; - configurations?: ConfigurationsResolver; + configurations?: ConfigurationsResolver; - schema?: SchemaResolver; + schema?: SchemaResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type ProjectResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type BuilderResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DescriptionResolver< R = string, Parent = any, - Context = any - > = Resolver; - export type OptionsResolver = Resolver< + TContext = any + > = Resolver; + export type OptionsResolver = Resolver< R, Parent, - Context + TContext >; export type ConfigurationsResolver< R = any[], Parent = any, - Context = any - > = Resolver; - export type SchemaResolver = Resolver< - R, - Parent, - Context - >; + TContext = any + > = Resolver; + export type SchemaResolver< + R = any[], + Parent = any, + TContext = any + > = Resolver; } export namespace OptionsResolvers { - export interface Resolvers { - defaultValues?: DefaultValuesResolver; + export interface Resolvers { + defaultValues?: DefaultValuesResolver; } export type DefaultValuesResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace FieldValueResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - defaultValue?: DefaultValueResolver, TypeParent, Context>; + defaultValue?: DefaultValueResolver, TypeParent, TContext>; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type DefaultValueResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace ArchitectConfigurationsResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - defaultValues?: DefaultValuesResolver; + defaultValues?: DefaultValuesResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; export type DefaultValuesResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace RecentActionResolvers { - export interface Resolvers { - actionName?: ActionNameResolver; + export interface Resolvers { + actionName?: ActionNameResolver; - schematicName?: SchematicNameResolver, TypeParent, Context>; + schematicName?: SchematicNameResolver, TypeParent, TContext>; } export type ActionNameResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type SchematicNameResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace DocsResolvers { - export interface Resolvers { - workspaceDocs?: WorkspaceDocsResolver; + export interface Resolvers { + workspaceDocs?: WorkspaceDocsResolver; - schematicDocs?: SchematicDocsResolver; + schematicDocs?: SchematicDocsResolver; } export type WorkspaceDocsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type SchematicDocsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface SchematicDocsArgs { collectionName: string; @@ -1271,46 +1270,46 @@ export namespace DocsResolvers { } export namespace DocResolvers { - export interface Resolvers { - prop?: PropResolver, TypeParent, Context>; + export interface Resolvers { + prop?: PropResolver, TypeParent, TContext>; - description?: DescriptionResolver, TypeParent, Context>; + description?: DescriptionResolver, TypeParent, TContext>; - id?: IdResolver; + id?: IdResolver; } export type PropResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DescriptionResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; - export type IdResolver = Resolver< + TContext = any + > = Resolver; + export type IdResolver = Resolver< R, Parent, - Context + TContext >; } export namespace CompletionsTypesResolvers { - export interface Resolvers { - files?: FilesResolver; + export interface Resolvers { + files?: FilesResolver; - projects?: ProjectsResolver; + projects?: ProjectsResolver; - localModules?: LocalModulesResolver; + localModules?: LocalModulesResolver; - absoluteModules?: AbsoluteModulesResolver; + absoluteModules?: AbsoluteModulesResolver; } - export type FilesResolver = Resolver< + export type FilesResolver = Resolver< R, Parent, - Context, + TContext, FilesArgs >; export interface FilesArgs { @@ -1320,8 +1319,8 @@ export namespace CompletionsTypesResolvers { export type ProjectsResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface ProjectsArgs { input: string; } @@ -1329,8 +1328,8 @@ export namespace CompletionsTypesResolvers { export type LocalModulesResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface LocalModulesArgs { input: string; } @@ -1338,171 +1337,175 @@ export namespace CompletionsTypesResolvers { export type AbsoluteModulesResolver< R = any[], Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface AbsoluteModulesArgs { input: string; } } export namespace CompletionResultTypeResolvers { - export interface Resolvers { - value?: ValueResolver; + export interface Resolvers { + value?: ValueResolver; - display?: DisplayResolver, TypeParent, Context>; + display?: DisplayResolver, TypeParent, TContext>; } - export type ValueResolver = Resolver< - R, - Parent, - Context - >; + export type ValueResolver< + R = string, + Parent = any, + TContext = any + > = Resolver; export type DisplayResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace EditorSupportResolvers { - export interface Resolvers { - name?: NameResolver; + export interface Resolvers { + name?: NameResolver; - icon?: IconResolver; + icon?: IconResolver; } - export type NameResolver = Resolver< + export type NameResolver = Resolver< R, Parent, - Context + TContext >; - export type IconResolver = Resolver< + export type IconResolver = Resolver< R, Parent, - Context + TContext >; } export namespace IsNodeInstalledResultResolvers { - export interface Resolvers { - result?: ResultResolver; + export interface Resolvers { + result?: ResultResolver; } export type ResultResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace CommandResponseResolvers { - export interface Resolvers { - id?: IdResolver; + export interface Resolvers { + id?: IdResolver; - workspace?: WorkspaceResolver, TypeParent, Context>; + workspace?: WorkspaceResolver, TypeParent, TContext>; - command?: CommandResolver; + command?: CommandResolver; - status?: StatusResolver; + status?: StatusResolver; - detailedStatus?: DetailedStatusResolver, TypeParent, Context>; + detailedStatus?: DetailedStatusResolver< + Maybe, + TypeParent, + TContext + >; - outChunk?: OutChunkResolver; + outChunk?: OutChunkResolver; - out?: OutResolver; + out?: OutResolver; } - export type IdResolver = Resolver< + export type IdResolver = Resolver< R, Parent, - Context + TContext >; export type WorkspaceResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type CommandResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type StatusResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type DetailedStatusResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type OutChunkResolver< R = string, Parent = any, - Context = any - > = Resolver; - export type OutResolver = Resolver< + TContext = any + > = Resolver; + export type OutResolver = Resolver< R, Parent, - Context + TContext >; } export namespace MutationResolvers { - export interface Resolvers { - ngAdd?: NgAddResolver, TypeParent, Context>; + export interface Resolvers { + ngAdd?: NgAddResolver, TypeParent, TContext>; - ngNew?: NgNewResolver, TypeParent, Context>; + ngNew?: NgNewResolver, TypeParent, TContext>; - generate?: GenerateResolver, TypeParent, Context>; + generate?: GenerateResolver, TypeParent, TContext>; generateUsingNpm?: GenerateUsingNpmResolver< Maybe, TypeParent, - Context + TContext >; - runNg?: RunNgResolver, TypeParent, Context>; + runNg?: RunNgResolver, TypeParent, TContext>; - runNpm?: RunNpmResolver, TypeParent, Context>; + runNpm?: RunNpmResolver, TypeParent, TContext>; - stopCommand?: StopCommandResolver, TypeParent, Context>; + stopCommand?: StopCommandResolver, TypeParent, TContext>; - removeCommand?: RemoveCommandResolver, TypeParent, Context>; + removeCommand?: RemoveCommandResolver, TypeParent, TContext>; removeAllCommands?: RemoveAllCommandsResolver< Maybe, TypeParent, - Context + TContext >; - restartCommand?: RestartCommandResolver, TypeParent, Context>; + restartCommand?: RestartCommandResolver, TypeParent, TContext>; - openInEditor?: OpenInEditorResolver, TypeParent, Context>; + openInEditor?: OpenInEditorResolver, TypeParent, TContext>; - updateSettings?: UpdateSettingsResolver; + updateSettings?: UpdateSettingsResolver; - saveRecentAction?: SaveRecentActionResolver; + saveRecentAction?: SaveRecentActionResolver; - openInBrowser?: OpenInBrowserResolver, TypeParent, Context>; + openInBrowser?: OpenInBrowserResolver, TypeParent, TContext>; - selectDirectory?: SelectDirectoryResolver, TypeParent, Context>; + selectDirectory?: SelectDirectoryResolver, TypeParent, TContext>; showItemInFolder?: ShowItemInFolderResolver< Maybe, TypeParent, - Context + TContext >; - openDoc?: OpenDocResolver, TypeParent, Context>; + openDoc?: OpenDocResolver, TypeParent, TContext>; } export type NgAddResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface NgAddArgs { path: string; @@ -1512,8 +1515,8 @@ export namespace MutationResolvers { export type NgNewResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface NgNewArgs { path: string; @@ -1527,8 +1530,8 @@ export namespace MutationResolvers { export type GenerateResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface GenerateArgs { path: string; @@ -1540,8 +1543,8 @@ export namespace MutationResolvers { export type GenerateUsingNpmResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface GenerateUsingNpmArgs { path: string; @@ -1555,8 +1558,8 @@ export namespace MutationResolvers { export type RunNgResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface RunNgArgs { path: string; @@ -1566,8 +1569,8 @@ export namespace MutationResolvers { export type RunNpmResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface RunNpmArgs { path: string; @@ -1579,8 +1582,8 @@ export namespace MutationResolvers { export type StopCommandResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface StopCommandArgs { id: string; } @@ -1588,8 +1591,8 @@ export namespace MutationResolvers { export type RemoveCommandResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface RemoveCommandArgs { id: string; } @@ -1597,13 +1600,13 @@ export namespace MutationResolvers { export type RemoveAllCommandsResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type RestartCommandResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface RestartCommandArgs { id: string; } @@ -1611,8 +1614,8 @@ export namespace MutationResolvers { export type OpenInEditorResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface OpenInEditorArgs { editor: string; @@ -1622,8 +1625,8 @@ export namespace MutationResolvers { export type UpdateSettingsResolver< R = any, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface UpdateSettingsArgs { data: string; } @@ -1631,8 +1634,8 @@ export namespace MutationResolvers { export type SaveRecentActionResolver< R = any[], Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface SaveRecentActionArgs { workspacePath: string; @@ -1646,8 +1649,8 @@ export namespace MutationResolvers { export type OpenInBrowserResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface OpenInBrowserArgs { url: string; } @@ -1655,8 +1658,8 @@ export namespace MutationResolvers { export type SelectDirectoryResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface SelectDirectoryArgs { dialogTitle: string; @@ -1668,8 +1671,8 @@ export namespace MutationResolvers { export type ShowItemInFolderResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface ShowItemInFolderArgs { item: string; } @@ -1677,118 +1680,118 @@ export namespace MutationResolvers { export type OpenDocResolver< R = Maybe, Parent = {}, - Context = any - > = Resolver; + TContext = any + > = Resolver; export interface OpenDocArgs { id: string; } } export namespace CommandStartedResolvers { - export interface Resolvers { - id?: IdResolver; + export interface Resolvers { + id?: IdResolver; } - export type IdResolver = Resolver< + export type IdResolver = Resolver< R, Parent, - Context + TContext >; } export namespace StopResultResolvers { - export interface Resolvers { - result?: ResultResolver, TypeParent, Context>; + export interface Resolvers { + result?: ResultResolver, TypeParent, TContext>; } export type ResultResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace RemoveResultResolvers { - export interface Resolvers { - result?: ResultResolver, TypeParent, Context>; + export interface Resolvers { + result?: ResultResolver, TypeParent, TContext>; } export type ResultResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace OpenInEditorResolvers { - export interface Resolvers { - response?: ResponseResolver; + export interface Resolvers { + response?: ResponseResolver; } export type ResponseResolver< R = string, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace OpenInBrowserResultResolvers { - export interface Resolvers { - result?: ResultResolver; + export interface Resolvers { + result?: ResultResolver; } export type ResultResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace SelectDirectoryResultResolvers { - export interface Resolvers { + export interface Resolvers { selectedDirectoryPath?: SelectedDirectoryPathResolver< Maybe, TypeParent, - Context + TContext >; - error?: ErrorResolver, TypeParent, Context>; + error?: ErrorResolver, TypeParent, TContext>; } export type SelectedDirectoryPathResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; export type ErrorResolver< R = Maybe, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace ShowItemInFolderResultResolvers { - export interface Resolvers { - result?: ResultResolver; + export interface Resolvers { + result?: ResultResolver; } export type ResultResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } export namespace OpenDocResultResolvers { - export interface Resolvers { - result?: ResultResolver; + export interface Resolvers { + result?: ResultResolver; } export type ResultResolver< R = boolean, Parent = any, - Context = any - > = Resolver; + TContext = any + > = Resolver; } /** Directs the executor to skip this field or fragment when the `if` argument is true. */ @@ -1824,46 +1827,48 @@ export interface DeprecatedDirectiveArgs { reason?: string; } -export interface IResolvers { - Query?: QueryResolvers.Resolvers; - Settings?: SettingsResolvers.Resolvers; - WorkspaceDefinition?: WorkspaceDefinitionResolvers.Resolvers; +export type IResolvers = { + Query?: QueryResolvers.Resolvers; + Settings?: SettingsResolvers.Resolvers; + WorkspaceDefinition?: WorkspaceDefinitionResolvers.Resolvers; SchematicCollectionForNgNew?: SchematicCollectionForNgNewResolvers.Resolvers< - Context + TContext + >; + Schema?: SchemaResolvers.Resolvers; + Workspace?: WorkspaceResolvers.Resolvers; + Dependencies?: DependenciesResolvers.Resolvers; + Extension?: ExtensionResolvers.Resolvers; + SchematicCollection?: SchematicCollectionResolvers.Resolvers; + Schematic?: SchematicResolvers.Resolvers; + NpmScript?: NpmScriptResolvers.Resolvers; + Project?: ProjectResolvers.Resolvers; + Architect?: ArchitectResolvers.Resolvers; + Options?: OptionsResolvers.Resolvers; + FieldValue?: FieldValueResolvers.Resolvers; + ArchitectConfigurations?: ArchitectConfigurationsResolvers.Resolvers< + TContext >; - Schema?: SchemaResolvers.Resolvers; - Workspace?: WorkspaceResolvers.Resolvers; - Dependencies?: DependenciesResolvers.Resolvers; - Extension?: ExtensionResolvers.Resolvers; - SchematicCollection?: SchematicCollectionResolvers.Resolvers; - Schematic?: SchematicResolvers.Resolvers; - NpmScript?: NpmScriptResolvers.Resolvers; - Project?: ProjectResolvers.Resolvers; - Architect?: ArchitectResolvers.Resolvers; - Options?: OptionsResolvers.Resolvers; - FieldValue?: FieldValueResolvers.Resolvers; - ArchitectConfigurations?: ArchitectConfigurationsResolvers.Resolvers; - RecentAction?: RecentActionResolvers.Resolvers; - Docs?: DocsResolvers.Resolvers; - Doc?: DocResolvers.Resolvers; - CompletionsTypes?: CompletionsTypesResolvers.Resolvers; - CompletionResultType?: CompletionResultTypeResolvers.Resolvers; - EditorSupport?: EditorSupportResolvers.Resolvers; - IsNodeInstalledResult?: IsNodeInstalledResultResolvers.Resolvers; - CommandResponse?: CommandResponseResolvers.Resolvers; - Mutation?: MutationResolvers.Resolvers; - CommandStarted?: CommandStartedResolvers.Resolvers; - StopResult?: StopResultResolvers.Resolvers; - RemoveResult?: RemoveResultResolvers.Resolvers; - OpenInEditor?: OpenInEditorResolvers.Resolvers; - OpenInBrowserResult?: OpenInBrowserResultResolvers.Resolvers; - SelectDirectoryResult?: SelectDirectoryResultResolvers.Resolvers; - ShowItemInFolderResult?: ShowItemInFolderResultResolvers.Resolvers; - OpenDocResult?: OpenDocResultResolvers.Resolvers; -} - -export interface IDirectiveResolvers { + RecentAction?: RecentActionResolvers.Resolvers; + Docs?: DocsResolvers.Resolvers; + Doc?: DocResolvers.Resolvers; + CompletionsTypes?: CompletionsTypesResolvers.Resolvers; + CompletionResultType?: CompletionResultTypeResolvers.Resolvers; + EditorSupport?: EditorSupportResolvers.Resolvers; + IsNodeInstalledResult?: IsNodeInstalledResultResolvers.Resolvers; + CommandResponse?: CommandResponseResolvers.Resolvers; + Mutation?: MutationResolvers.Resolvers; + CommandStarted?: CommandStartedResolvers.Resolvers; + StopResult?: StopResultResolvers.Resolvers; + RemoveResult?: RemoveResultResolvers.Resolvers; + OpenInEditor?: OpenInEditorResolvers.Resolvers; + OpenInBrowserResult?: OpenInBrowserResultResolvers.Resolvers; + SelectDirectoryResult?: SelectDirectoryResultResolvers.Resolvers; + ShowItemInFolderResult?: ShowItemInFolderResultResolvers.Resolvers; + OpenDocResult?: OpenDocResultResolvers.Resolvers; +} & { [typeName: string]: never }; + +export type IDirectiveResolvers = { skip?: SkipDirectiveResolver; include?: IncludeDirectiveResolver; deprecated?: DeprecatedDirectiveResolver; -} +} & { [directiveName: string]: never }; diff --git a/libs/server/src/lib/api/run-command.ts b/libs/server/src/lib/api/run-command.ts index 9c194dd873..77c96a57d5 100644 --- a/libs/server/src/lib/api/run-command.ts +++ b/libs/server/src/lib/api/run-command.ts @@ -11,7 +11,7 @@ export const commands = new Commands(5, 15); export function runCommand( type: string, cwd: string, - displayCommand: string, + programName: string, program: string, cmds: string[], pseudoTerminalFactory: PseudoTerminalFactory, @@ -21,21 +21,22 @@ export function runCommand( const workspace = type === 'new' ? null : readJsonFile('./package.json', cwd).json.name; const id = `${program} ${cmds.join(' ')} ${commandRunIndex++}`; + let command = `${programName} ${cmds.join(' ')}`; const supportsNVM = fileUtils.isWsl() ? fileUtils.wslSupportsNvm() : Boolean(process.env.NVM_DIR); - // We currently don't support the windows implementation of NVM. + // We currently don't suppor the windows implementation of NVM. if (supportsNVM && fileUtils.useNvm()) { - displayCommand = `nvm exec -- ${displayCommand}`; - cmds = ['exec', '--', program, ...cmds]; + command = `nvm exec ${command}`; + cmds = ['exec', program, ...cmds]; program = 'nvm'; } const factory = () => { const commandRunning = pseudoTerminalFactory({ - displayCommand: displayCommand, + displayCommand: command, name: id, program, args: normalizeCommands(cwd, cmds), @@ -57,7 +58,7 @@ export function runCommand( type, id, workspace, - displayCommand, + command, factory, statusCalculator, addToRecent diff --git a/libs/server/src/lib/resolvers/mutation.resolver.ts b/libs/server/src/lib/resolvers/mutation.resolver.ts index 48efa92773..c088285807 100644 --- a/libs/server/src/lib/resolvers/mutation.resolver.ts +++ b/libs/server/src/lib/resolvers/mutation.resolver.ts @@ -31,7 +31,7 @@ export class MutationResolver { return runCommand( 'add', p, - `ng add ${name}`, + 'ng', this.fileUtils.findClosestNg(p), ['add', name, '--no-interactive'], this.pseudoTerminalFactory, @@ -54,7 +54,7 @@ export class MutationResolver { return runCommand( 'new', p, - `new-workspace --collection=${collection} ${newCommand.join(' ')}`, + 'new-workspace', path.join( __dirname, 'assets', @@ -89,7 +89,7 @@ export class MutationResolver { return runCommand( 'generate', p, - `ng generate ${[...genCommand, ...dryRun].join(' ')}`, + 'ng', this.fileUtils.findClosestNg(p), ['generate', ...genCommand, ...dryRun, '--no-interactive'], this.pseudoTerminalFactory, @@ -116,7 +116,7 @@ export class MutationResolver { return runCommand( 'npm', p, - `${npmClient} ${[...genCommand, ...dryRun].join(' ')}`, + npmClient, this.fileUtils.findExecutable(npmClient, p), [...genCommand, ...dryRun, '--no-interactive'], this.pseudoTerminalFactory, @@ -135,9 +135,9 @@ export class MutationResolver { return runCommand( 'ng', p, - `ng ${rc.join(' ')}`, - 'node', - ['--max-old-space-size=4048', this.fileUtils.findClosestNg(p), ...rc], + 'ng', + this.fileUtils.findClosestNg(p), + rc, this.pseudoTerminalFactory, this.fileUtils ); @@ -157,7 +157,7 @@ export class MutationResolver { return runCommand( 'npm', p, - `${npmClient} ${rc.join(' ')}`, + npmClient, this.fileUtils.findExecutable(npmClient, p), rc, this.pseudoTerminalFactory, diff --git a/libs/server/src/lib/utils/stats.ts b/libs/server/src/lib/utils/stats.ts index 49b1f50d6f..e29602b540 100644 --- a/libs/server/src/lib/utils/stats.ts +++ b/libs/server/src/lib/utils/stats.ts @@ -1,12 +1,13 @@ import { readFileSync } from 'fs'; import { join } from 'path'; import { ls } from 'shelljs'; -import * as exploreSourceMap from 'source-map-explorer'; import { gzipSync } from 'zlib'; import { SPECIAL_SOURCE_FILE_MAPPINGS } from './stats.constants'; // @ts-ignore +import * as exploreSourceMap from 'source-map-explorer'; + export interface Module { file: string; size: string;