@acoustic-content-sdk/schematics-utils v9.0.10076
Home > @acoustic-content-sdk/schematics-utils
schematics-utils package
Helper library to implement schematics.
Classes
| Class | Description |
|---|---|
| InsertChange | Will add text to the source code. |
| NoopChange | An operation that does nothing. |
| RemoveChange | Will remove text from the source code. |
| ReplaceChange | Will replace text from the source code. |
Enumerations
| Enumeration | Description |
|---|---|
| Builders | |
| DEP_TYPE | |
| NodeDependencyType | |
| ProjectType |
Functions
Interfaces
| Interface | Description |
|---|---|
| AppConfig | |
| AppShellBuilderOptions | |
| BrowserBuilderBaseOptions | |
| BrowserBuilderOptions | |
| BuilderTarget | |
| Change | |
| CliConfig | |
| E2EOptions | |
| ExtractI18nOptions | |
| FileReplacements | |
| Host | Copyright Google Inc. All Rights Reserved.Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at https://angular.io/license |
| LibraryBuilderOptions | |
| LintBuilderOptions | |
| Location | |
| ModuleOptions | |
| NodeDependency | |
| ServeBuilderOptions | |
| ServerBuilderOptions | |
| TestBuilderOptions | |
| WorkspaceProject | |
| WorkspaceSchema | |
| WorkspaceTargets | |
| ZipEntry |
Variables
| Variable | Description |
|---|---|
| ajaxRequest | |
| configPath | |
| createXHR | |
| htmlSelectorRe | |
| MODULE_EXT | |
| NOOP_LOGGER | |
| ROUTING_MODULE_EXT | |
| rxDeleteFile | |
| rxReadTextFile | |
| rxReadZip | Export the function to extract a zip file |
| rxTmpFile | |
| rxUnlink | |
| TENANT_BASED_URL_REGEXP | |
| VERSION | Version and build number of the package |
| WCHTOOLS_DEPENDENCIES | |
| writeBufferOnTree | Constructs a WriteTextFile on top of a host |
| writeTextFileOnTree | Constructs a WriteTextFile on top of a host |
Type Aliases
Home > @acoustic-content-sdk/schematics-utils > InsertChange
InsertChange class
Will add text to the source code.
Signature:
export declare class InsertChange implements Change Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(path, pos, toAdd) | Constructs a new instance of the InsertChange class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| description | string | ||
| order | number | ||
| path | string | ||
| pos | number | ||
| toAdd | string |
Methods
| Method | Modifiers | Description |
|---|---|---|
| apply(host) | This method does not insert spaces if there is none in the original string. |
Home > @acoustic-content-sdk/schematics-utils > NoopChange
NoopChange class
An operation that does nothing.
Signature:
export declare class NoopChange implements Change Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| description | string | ||
| order | number | ||
| path | any |
Methods
| Method | Modifiers | Description |
|---|---|---|
| apply() |
Home > @acoustic-content-sdk/schematics-utils > RemoveChange
RemoveChange class
Will remove text from the source code.
Signature:
export declare class RemoveChange implements Change Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(path, pos, toRemove) | Constructs a new instance of the RemoveChange class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| description | string | ||
| order | number | ||
| path | string |
Methods
| Method | Modifiers | Description |
|---|---|---|
| apply(host) |
Home > @acoustic-content-sdk/schematics-utils > ReplaceChange
ReplaceChange class
Will replace text from the source code.
Signature:
export declare class ReplaceChange implements Change Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(path, pos, oldText, newText) | Constructs a new instance of the ReplaceChange class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| description | string | ||
| order | number | ||
| path | string |
Methods
| Method | Modifiers | Description |
|---|---|---|
| apply(host) |
Home > @acoustic-content-sdk/schematics-utils > Builders
Builders enum
Signature:
export declare enum Builders Enumeration Members
| Member | Value | Description |
|---|---|---|
| AppShell | "@angular-devkit/build-angular:app-shell" | |
| Browser | "@angular-devkit/build-angular:browser" | |
| DevServer | "@angular-devkit/build-angular:dev-server" | |
| ExtractI18n | "@angular-devkit/build-angular:extract-i18n" | |
| Karma | "@angular-devkit/build-angular:karma" | |
| NgPackagr | "@angular-devkit/build-ng-packagr:build" | |
| Protractor | "@angular-devkit/build-angular:protractor" | |
| Server | "@angular-devkit/build-angular:server" | |
| TsLint | "@angular-devkit/build-angular:tslint" |
Home > @acoustic-content-sdk/schematics-utils > DEP_TYPE
DEP_TYPE enum
Signature:
export declare enum DEP_TYPE Enumeration Members
| Member | Value | Description |
|---|---|---|
| DEVELOPMENT | 2 | |
| PEER | 0 | |
| RUNTIME | 1 |
Home > @acoustic-content-sdk/schematics-utils > NodeDependencyType
NodeDependencyType enum
Signature:
export declare enum NodeDependencyType Enumeration Members
| Member | Value | Description |
|---|---|---|
| Default | "dependencies" | |
| Dev | "devDependencies" | |
| Optional | "optionalDependencies" | |
| Peer | "peerDependencies" |
Home > @acoustic-content-sdk/schematics-utils > ProjectType
ProjectType enum
Signature:
export declare enum ProjectType Enumeration Members
| Member | Value | Description |
|---|---|---|
| Application | "application" | |
| Library | "library" |
Home > @acoustic-content-sdk/schematics-utils > addBootstrapToModule
addBootstrapToModule() function
Custom function to insert an export into NgModule. It also imports it.
Signature:
export declare function addBootstrapToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addDeclarationToModule
addDeclarationToModule() function
Custom function to insert a declaration (component, pipe, directive) into NgModule declarations. It also imports the component.
Signature:
export declare function addDeclarationToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addEntryComponentToModule
addEntryComponentToModule() function
Warning: This API is now obsolete.
- Since version 9.0.0 with Ivy, entryComponents is no longer necessary.
Custom function to insert an entryComponent into NgModule. It also imports it.
Signature:
export declare function addEntryComponentToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addExportToModule
addExportToModule() function
Custom function to insert an export into NgModule. It also imports it.
Signature:
export declare function addExportToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addImportsToModule
addImportsToModule() function
Changes the identified module by adding a couple of imports
Signature:
export declare function addImportsToModule(aFile: string, aModules: {
[identifier: string]: string;
}, aHost: Tree): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| aFile | string | the filename |
| aModules | { identifier: string: string;} | the modules to be added |
| aHost | Tree | the tree |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > addImportToModule
addImportToModule() function
Custom function to insert an NgModule into NgModule imports. It also imports the module.
Signature:
export declare function addImportToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addPackageJsonDependency
addPackageJsonDependency() function
Signature:
export declare function addPackageJsonDependency(tree: Tree, dependency: NodeDependency): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| tree | Tree | |
| dependency | NodeDependency |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > addProjectToWorkspace
addProjectToWorkspace() function
Signature:
export declare function addProjectToWorkspace<TProjectType extends ProjectType = ProjectType.Application>(workspace: WorkspaceSchema, name: string, project: WorkspaceProject<TProjectType>): Rule;Parameters
| Parameter | Type | Description |
|---|---|---|
| workspace | WorkspaceSchema | |
| name | string | |
| project | WorkspaceProject<TProjectType> |
Returns:
Rule
Home > @acoustic-content-sdk/schematics-utils > addProviderToModule
addProviderToModule() function
Custom function to insert a provider into NgModule. It also imports it.
Signature:
export declare function addProviderToModule(source: SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| modulePath | string | |
| classifiedName | string | |
| importPath | string |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addRouteDeclarationToModule
addRouteDeclarationToModule() function
Adds a new route declaration to a router module (i.e. has a RouterModule declaration)
Signature:
export declare function addRouteDeclarationToModule(source: SourceFile, fileToAdd: string, routeLiteral: string): Change;Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| fileToAdd | string | |
| routeLiteral | string |
Returns:
Change
Home > @acoustic-content-sdk/schematics-utils > addSymbolToNgModuleMetadata
addSymbolToNgModuleMetadata() function
Signature:
export declare function addSymbolToNgModuleMetadata(source: SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[];Parameters
| Parameter | Type | Description |
|---|---|---|
| source | SourceFile | |
| ngModulePath | string | |
| metadataField | string | |
| symbolName | string | |
| importPath | string | null |
Returns:
Change[]
Home > @acoustic-content-sdk/schematics-utils > addToWchToolsDependencies
addToWchToolsDependencies() function
Signature:
export declare function addToWchToolsDependencies(aDeps: string[], aPkg: any): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| aDeps | string[] | |
| aPkg | any |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > assertHasTrailingSlash
assertHasTrailingSlash() function
Signature:
export declare function assertHasTrailingSlash(aValue: any): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > assertIsEmail
assertIsEmail() function
Signature:
export declare function assertIsEmail(aValue: any, aName?: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any | |
| aName | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > assertIsUrl
assertIsUrl() function
Signature:
export declare function assertIsUrl(aValue: any, aName?: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any | |
| aName | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > assertIsValidUserName
assertIsValidUserName() function
Signature:
export declare function assertIsValidUserName(aValue: any, aName?: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any | |
| aName | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > assertNotNull
assertNotNull() function
Signature:
export declare function assertNotNull(aValue: any, aName?: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any | |
| aName | string |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > assertParameter
assertParameter() function
Signature:
export declare function assertParameter(aValue: any, aParameterName: string): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| aValue | any | |
| aParameterName | string |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > buildDefaultPath
buildDefaultPath() function
Build a default project path for generating.
Signature:
export declare function buildDefaultPath(project: WorkspaceProject): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| project | WorkspaceProject | The project to build the path for. |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > buildRelativePath
buildRelativePath() function
Build a relative path from one file path to another file path.
Signature:
export declare function buildRelativePath(from: string, to: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| from | string | |
| to | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > byIdentifier
byIdentifier() function
Signature:
export declare function byIdentifier(aName: string): Predicate<Node>;Parameters
| Parameter | Type | Description |
|---|---|---|
| aName | string |
Returns:
Predicate<Node>
Home > @acoustic-content-sdk/schematics-utils > byName
byName() function
Signature:
export declare function byName(aText: string): Predicate<NamedDeclaration>;Parameters
| Parameter | Type | Description |
|---|---|---|
| aText | string |
Returns:
Predicate<NamedDeclaration>
Home > @acoustic-content-sdk/schematics-utils > byText
byText() function
Signature:
export declare function byText(aText: string): Predicate<Node>;Parameters
| Parameter | Type | Description |
|---|---|---|
| aText | string |
Returns:
Predicate<Node>
Home > @acoustic-content-sdk/schematics-utils > byType
byType() function
Signature:
export declare function byType(aType: SyntaxKind): Predicate<Node>;Parameters
| Parameter | Type | Description |
|---|---|---|
| aType | SyntaxKind |
Returns:
Predicate<Node>
Home > @acoustic-content-sdk/schematics-utils > byTypeAndName
byTypeAndName() function
Signature:
export declare function byTypeAndName(aType: SyntaxKind, aName: string): Predicate<Node>;Parameters
| Parameter | Type | Description |
|---|---|---|
| aType | SyntaxKind | |
| aName | string |
Returns:
Predicate<Node>
Home > @acoustic-content-sdk/schematics-utils > canonicalizeJSON
canonicalizeJSON() function
Signature:
declare function _canonicalize(aData: any): any;Parameters
| Parameter | Type | Description |
|---|---|---|
| aData | any |
Returns:
any
Home > @acoustic-content-sdk/schematics-utils > changeSourceFile
changeSourceFile() function
Signature:
export declare function changeSourceFile(aFile: string, aOp: (aFile: string, aContent: SourceFile) => Change[], aHost: Tree): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| aFile | string | |
| aOp | (aFile: string, aContent: SourceFile) => Change[] | |
| aHost | Tree |
Returns:
void
Home > @acoustic-content-sdk/schematics-utils > copyDir
copyDir() function
Copies from source to target and overrides the target. But does not delete extra files
Signature:
export declare function copyDir(aSrc: string, aDst: string, aHost: Tree, aLogger?: Logger): Tree;Parameters
| Parameter | Type | Description |
|---|---|---|
| aSrc | string | source directory |
| aDst | string | target directory |
| aHost | Tree | tree |
| aLogger | Logger |
Returns:
Tree
the tree
Home > @acoustic-content-sdk/schematics-utils > createLoggerService
createLoggerService() function
Constructs the logger service on top of the context
Signature:
export declare function createLoggerService(context: SchematicContext): LoggerService;Parameters
| Parameter | Type | Description |
|---|---|---|
| context | SchematicContext | context |
Returns:
LoggerService
the logger service
Home > @acoustic-content-sdk/schematics-utils > createTransientTree
createTransientTree() function
Creates a transient copy of a tree
Signature:
export declare function createTransientTree(aRoot: string): Tree;Parameters
| Parameter | Type | Description |
|---|---|---|
| aRoot | string | root folder for the tree |
Returns:
Tree
the tree
Home > @acoustic-content-sdk/schematics-utils > ensureTrailingSlash
ensureTrailingSlash() function
Signature:
declare function _ensureTrailingSlash(aUrl: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| aUrl | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > findBootstrapModuleCall
findBootstrapModuleCall() function
Signature:
export declare function findBootstrapModuleCall(host: Tree, mainPath: string): CallExpression | null;Parameters
| Parameter | Type | Description |
|---|---|---|
| host | Tree | |
| mainPath | string |
Returns:
CallExpression | null
Home > @acoustic-content-sdk/schematics-utils > findBootstrapModulePath
findBootstrapModulePath() function
Signature:
export declare function findBootstrapModulePath(host: Tree, mainPath: string): string;Parameters
| Parameter | Type | Description |
|---|---|---|
| host | Tree | |
| mainPath | string |
Returns:
string
Home > @acoustic-content-sdk/schematics-utils > findDataDir
findDataDir() function
Signature:
export declare function findDataDir(host: Tree, options?: {
data?: string;
}): Path;Parameters
| Parameter | Type | Description |
|---|---|---|
| host | Tree | |
| options | { data?: string;} |
Returns:
Path
Home > @acoustic-content-sdk/schematics-utils > findModule
findModule() function
Function to find the "closest" module to a generated file's path.
Signature:
export declare function findModule(host: Tree, generateDir: string, moduleExt?: string, routingModuleExt?: string): Path;Parameters
| Parameter | Type | Description |
|---|---|---|
| host | Tree | |
| generateDir | string | |
| moduleExt | string | |
| routingModuleExt | string |
Returns:
Path
Home > @acoustic-content-sdk/schematics-utils > findModuleFromOptions
findModuleFromOptions() function
Find the module referred by a set of options passed to the schematics.
Signature:
export declare function findModuleFromOptions(host: Tree, options: ModuleOptions): Path | undefined;Parameters
| Parameter | Type | Description |
|---|---|---|
| host | Tree | |
| options | ModuleOptions |
Returns:
Path | undefined
Home > @acoustic-content-sdk/schematics-utils > findNode
findNode() function
Signature:
export declare function findNode(node: Node, kind: SyntaxKind, text: string): Node | null;Parameters
| Parameter | Type | Description |
|---|---|---|
| node | Node | |
| kind | SyntaxKind | |
| text | string |
Returns:
Node | null
Home > @acoustic-content-sdk/schematics-utils > findNodes
findNodes() function
Find all nodes from the AST in the subtree of node of SyntaxKind kind.
Signature:
export declare function findNodes(node: Node, kind: SyntaxKind, max?: number, recursive?: boolean): Node[];Parameters
| Parameter | Type | Description |
|---|---|---|
| node | Node | |
| kind | SyntaxKind | |
| max | number | The maximum number of items to return. |
| recursive | boolean | Continue looking for nodes of kind recursive until end the last child even when node of kind has been found. |
Returns:
Node[]
all nodes of kind, or [] if none is foun
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago