Index

src/migrations/2.11.1.ts

addBackbaseBuilderRule
Default value : async (tree: Tree) => { const workspace = await getWorkspace(tree); const apps = getApps(workspace); for (const name of apps) { addBackbaseBuilderToAngularJson(tree, name); } }
addBackbaseBuilderToAngularJson
Default value : (tree: Tree, projectName: string) => { const content = readJsonFile<any>(tree, 'angular.json'); try { content.projects[projectName].architect.build.builder = '@bb-cli/bb-ang:browser'; } catch (_) { throw new SchematicsException(`Could not find build for project ${projectName}`); } tree.overwrite('angular.json', JSON.stringify(content, null, 2)); return tree; }
manualProcess
Default value : ` ## 1. Add the new configuration to the "angular.json" { ... "projects": { "example-app": { ... "architect": { ... "build": { builder: '@bb-cli/bb-ang:browser' ... ... ## 2. Upgrade the "bb-ang" dev dependency Install it as a dev dependency using the following command: npm i --save-dev @bb-cli/bb-ang@3.8.0`

src/migrations/5.3.3.ts

additionalStatement
Default value : ` function resolveContextPath(config) { const context = config.buildWebpack.webpackConfig.context; let urlList = ''; if (Array.isArray(config.buildWebpack.webpackConfig.resolve.roots)) { urlList = config.buildWebpack.webpackConfig.resolve.roots.find(value => value.indexOf(context) !== -1); } return urlList ? urlList : context; }`
manualProcess
Default value : `## This migrates sets only libs/*/public_api.ts to the default scope path. to apply this changes apply the following steps: #### Update project \`karma.conf.js\` to include the following change resolve the project url from \`roots\`, instead of \`context\`: \` + ./karma.conf.js \` `

src/app/index.ts

addNgLocalize
Default value : (schema: NormalizedSchema) => { return chain([addDependency('@angular/localize', projectAngularVersion), addNgLocalizePolyfillToApp]); function addNgLocalizePolyfillToApp(tree: Tree) { const appFolderName = toFileName(schema.name); const polyfillsPath = normalize(`apps/${appFolderName}/src/polyfills.ts`); const polyfills = tree.read(polyfillsPath)?.toString(); if (!polyfills) { return; } tree.overwrite(polyfillsPath, `${polyfills}\nimport '@angular/localize/init';`); } }

src/migrations/4.0.1.ts

addNgLocalize
Type : Rule
Default value : () => { return chain([addDependency('@angular/localize', '^10.0.0'), addPolyfillToApps]); async function addPolyfillToApps(tree: Tree) { const workspace = await getWorkspace(tree); getAppProjects(workspace) .map((project) => project.targets.get('build')?.options?.polyfills) .filter((v): v is string => v !== undefined) .forEach((polyfillsPath) => addPolyfillToApp(tree, polyfillsPath)); } function addPolyfillToApp(tree: Tree, polyfillsPath: string) { const importString = `import '@angular/localize/init';`; const polyfills = tree.read(polyfillsPath)?.toString(); if (!polyfills) { return; } if (polyfills.includes(importString)) { return; } tree.overwrite(polyfillsPath, `${polyfills}\n${importString}`); } }
manualProcess
Default value : ` ## Add \`@angular/localize\` dependency As of Angular 9 there is a new localization package that must be included to support translations. Install the package: ng add @angular/localize ## Initialize \`@angular/localize\` The functionality is initialized by importing it in the \`polyfills.ts\` files: import '@angular/localize/init'; `

src/migrations/2.9.0.ts

addSharedEnvironmentConfiguration
Default value : (tree: Tree, projectName: string) => { const content = readJsonFile<any>(tree, 'angular.json'); let configurations; try { configurations = content.projects[projectName].architect.build.configurations; } catch (_) { throw new SchematicsException(`Could not find build configurations for project ${projectName}`); } configurations.shared = { fileReplacements: [ { replace: `apps/${projectName}/src/environments/environment.ts`, with: `apps/${projectName}/src/environments/environment.shared.ts`, }, ], }; tree.overwrite('angular.json', JSON.stringify(content, null, 2)); return tree; }
createNewEnvironment
Default value : (tree: Tree, project: workspaces.ProjectDefinition, projectName: string) => { if (!project.sourceRoot) { throw new SchematicsException('Project missing required "sourceRoot" property in angular.json'); } const sharedEnvironmentPath = join(normalize(project.sourceRoot), 'environments', 'environment.shared.ts'); if (tree.exists(sharedEnvironmentPath)) { throw new SchematicsException(`Project already contains ${sharedEnvironmentPath}`); } createSharedEnvironmentFile(tree, sharedEnvironmentPath); addSharedEnvironmentConfiguration(tree, projectName); }
createSharedEnvironmentFile
Default value : (tree: Tree, path: Path): void => { tree.create( path, `import { createMocksInterceptor } from '@backbase/foundation-ang/data-http'; import { Environment } from './type'; export const environment: Environment = { production: false, mockProviders: [createMocksInterceptor()], }; `, ); }
manualProcess
Default value : ` Update each application's "environments/type.ts" file to make the "mockProviders" key optional and add an extra "shared" environment configuration. ## 1. Update the "Environment" type to make "mockProviders" optional (add the "?") export interface Environment { readonly production: boolean; readonly mockProviders?: Array<Provider>; readonly bootstrap?: { readonly pageModel: Item; readonly services: ExternalServices; }; } This will require an update to the apps "AppModule" to handle the case where "mockProviders" is undefined. In the apps "app/app.module.ts" file, add a default value (an empty array) where "mockProviders" is spread into the module providers. @NgModule({ ... providers: [...environment.mockProviders || []], ... }) ## 2. Create a new "shared" environment configuration file ("environments/environment.shared.ts") import { createMocksInterceptor } from '@backbase/foundation-ang/data-http'; import { Environment } from './type'; export const environment: Environment = { production: false, mockProviders: [createMocksInterceptor()], }; Add the new configuration to the "angular.json" { ... "projects": { "example-app": { ... "architect": { ... "build": { ... "configurations": { ... "shared": { "fileReplacements": [ { "replace": "apps/tutorial-app/src/environments/environment.ts", "with": "apps/tutorial-app/src/environments/environment.shared.ts" } ], } } ... ## 3. Upgrade the "bb-ang" dev dependency Install it as a dev dependency using the following command: npm i --save-dev @bb-cli/bb-ang@3.6.0`
provideDefaultMockProviders
Default value : (moduleFile: SourceFile): void => { const decoratorArg = moduleFile.getClassOrThrow('AppModule').getDecoratorOrThrow('NgModule').getArguments()[0]; if (!TypeGuards.isObjectLiteralExpression(decoratorArg)) { throw new SchematicsException('Argument to NgModule Decorator on AppModule expected to be an object literal'); } const providersProperty = decoratorArg.getProperty('providers'); if (!providersProperty || !TypeGuards.isPropertyAssignment(providersProperty)) { return; } const providers = providersProperty.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression); const mockProviders = providers.getFirstDescendant((el) => { if (!TypeGuards.isSpreadElement(el)) { return false; } const spreadVariable = el.getFirstChildByKind(SyntaxKind.PropertyAccessExpression); return !!spreadVariable && spreadVariable.getText() === `environment.mockProviders`; }); if (!mockProviders) { return; } mockProviders.replaceWithText('...environment.mockProviders || []'); }
removeMockProvidersKeyFromProd
Default value : (prodEnvironmentFile: SourceFile): void => { const environmentVariable = prodEnvironmentFile.getVariableDeclarationOrThrow('environment'); const environmentValue = environmentVariable.getInitializerIfKindOrThrow(SyntaxKind.ObjectLiteralExpression); const mockProvidersProperty = environmentValue.getProperty('mockProviders'); if (!mockProvidersProperty || !TypeGuards.isPropertyAssignment(mockProvidersProperty)) { throw new SchematicsException('Could not find expected "mockProviders" key in environment.prod.ts'); } if (mockProvidersProperty.getInitializerIfKindOrThrow(SyntaxKind.ArrayLiteralExpression).getElements().length > 0) { process.stdout.write(` ## Migration Note It is not recommended to use "mockProviders" in a production environment configuration as it may unintentionally cause fake data to appear in a production deployment. The production environment configuration in this project ('environment.prod.ts") includes configuration for "mockProviders". It is recommended that the mock data providers configuration be moved to a more appropriate environment configuration (probably the default development environment or the new "shared" environment). `); return; } const commaToken = mockProvidersProperty.getNextSiblingIfKind(SyntaxKind.CommaToken); prodEnvironmentFile.removeText( mockProvidersProperty.getPos(), commaToken ? commaToken.getEnd() : mockProvidersProperty.getEnd(), ); }
updateEnvironmentInterface
Default value : (typeFile: SourceFile): void => { const environmentInterfaceDeclaration = typeFile.getInterface('Environment'); if (!environmentInterfaceDeclaration) { throw new SchematicsException(`Interface "Environment" is not defined in ${typeFile.getFilePath()}`); } const mockProvidersProperty = environmentInterfaceDeclaration.getProperty('mockProviders'); if (mockProvidersProperty) { mockProvidersProperty.setHasQuestionToken(true); } }
updateEnvironments
Default value : async (tree: Tree) => { const workspace = await getWorkspace(tree); const apps = getApps(workspace); for (const name of apps) { const project = workspace.projects.get(name); if (!project) { continue; } updateEnvironmentTypes(tree, project); createNewEnvironment(tree, project, name); } }
updateEnvironmentTypes
Default value : (tree: Tree, project: workspaces.ProjectDefinition) => { const astProject = new Project({ manipulationSettings: { indentationText: IndentationText.TwoSpaces, quoteKind: QuoteKind.Single, }, useVirtualFileSystem: true, }); if (!project.sourceRoot) { throw new SchematicsException('Project missing required "sourceRoot" property in angular.json'); } const typeFilePath = join(normalize(project.sourceRoot), 'environments', 'type.ts'); const existingTypeTs = tree.read(typeFilePath); if (!existingTypeTs) { throw new SchematicsException(`Project missing expected "type.ts" file at ${typeFilePath}`); } const typeFile = astProject.createSourceFile(typeFilePath, existingTypeTs.toString('utf-8')); updateEnvironmentInterface(typeFile); tree.overwrite(typeFilePath, typeFile.getFullText()); const prodEnvironmentFilePath = join(normalize(project.sourceRoot), 'environments', 'environment.prod.ts'); const existingProdEnvironmentFile = tree.read(prodEnvironmentFilePath); if (!existingProdEnvironmentFile) { throw new SchematicsException(`Project missing expected "environment.prod.ts" file at ${prodEnvironmentFilePath}`); } const prodEnvironmentFile = astProject.createSourceFile( prodEnvironmentFilePath, existingProdEnvironmentFile.toString('utf-8'), ); removeMockProvidersKeyFromProd(prodEnvironmentFile); tree.overwrite(prodEnvironmentFilePath, prodEnvironmentFile.getFullText()); const appModuleFilePath = join(normalize(project.sourceRoot), 'app', 'app.module.ts'); const existingAppModule = tree.read(appModuleFilePath); if (!existingAppModule) { throw new SchematicsException(`Project missing expected "app.module.ts" file at ${appModuleFilePath}`); } const appModuleFile = astProject.createSourceFile(appModuleFilePath, existingAppModule.toString('utf-8')); provideDefaultMockProviders(appModuleFile); tree.overwrite(appModuleFilePath, appModuleFile.getFullText()); }

src/theme/index.ts

addTheme
Default value : (themeRootPath: string, themePackageName: string, themeVersion: string) => { const isThemeV1 = themeVersion && themeVersion !== 'latest' && lt(themeVersion, '2.0.0'); const themeDependencies = [ { name: THEME_NPM_NAME, type: NodeDependencyType.Default, version: themeVersion, }, { name: 'sass', type: NodeDependencyType.Dev, version: '^1.43.2', }, ]; if (isThemeV1) { return addThemeV1(themeRootPath, themePackageName, themeDependencies); } else { return chain([addNodeDependencies(themeDependencies), downloadThemeAndCopyPreset(themePackageName, themeRootPath)]); } }
addThemeV1
Default value : (themeRootPath: string, themePackageName: string, defaultDependencies) => { const themeDependencies = [ ...defaultDependencies, { name: 'material-design-icons-iconfont', version: 'latest', type: NodeDependencyType.Default }, { name: 'bootstrap', version: '~4.3.0', type: NodeDependencyType.Default }, { name: 'fibers', version: 'latest', type: NodeDependencyType.Dev }, ]; return chain([addNodeDependencies(themeDependencies), downloadThemeAndCopyStyles(themePackageName, themeRootPath)]); }
THEME_NPM_NAME
Default value : `@backbase/ui-ang`

src/ui-component/index.ts

addToModule
Default value : (options: any): Rule => { return (host: Tree) => { const modulePath = path.normalize(`${options.path}/${options.lib}.module.ts`); const moduleSource = readFileOrThrow(host, modulePath); const sourceFile = createSourceFile(modulePath, moduleSource, ScriptTarget.Latest, true); const relativeImportPath = `./${dasherize(options.name)}/${dasherize(options.name)}.module`; const itemName = `${classify(options.name)}Module`; insert(host, modulePath, [ insertImport(sourceFile, modulePath, itemName, relativeImportPath), ...addExportToModule(sourceFile, modulePath, itemName), ...addImportToModule(sourceFile, modulePath, itemName), ]); return host; }; }
createExampleJs
Default value : (options: NormalizedOptions): Rule => { return (tree: Tree, context: SchematicContext) => { if (options.path) { const templateSource = apply(url(path.normalize('./files')), [ template({ ...strings, name: options.name, }), move(path.join(options.path, options.name)), ]); const rule = chain([branchAndMerge(chain([mergeWith(templateSource)]))]); return rule(tree, context); } return tree; }; }
normalizeOptions
Default value : async (options: Schema, host: Tree): Promise<NormalizedOptions> => { const workspace = await getWorkspace(host); const libName = options.lib; let projectPath: string; const project = workspace.projects.get(libName); if (project) { if (project.extensions.projectType === 'library' && project.sourceRoot) { projectPath = project.sourceRoot; } else { throw new SchematicsException(`${libName} is not a library.`); } } else { throw new SchematicsException(`Library ${libName} couldn't be found.`); } const normalizedOptions: NormalizedOptions = { name: options.name, lib: options.lib, path: path.normalize(projectPath), }; return normalizedOptions; }

src/bundle/index.ts

appContainer
Default value : async (tree: Tree, projectName: string): Promise<AppContainer> => { const project = await getAppContainerProjectOrThrow(tree, projectName); return { name: projectName, prefix: project.prefix ?? 'bb', hasIcon: hasIcon(tree, project), modelXml: loadModelXml(tree, project), dependencies: {}, }; }
worker
Default value : (options: Schema): Rule => async (tree: Tree, context: SchematicContext) => { const model: Array<RootContainer> = await getModel(options, tree, context.logger); const appModuleFilePath = await getAppModuleFilePath(tree, options.project); log(`Resolved app module path: ${appModuleFilePath}`); log(`Resolved model: ${JSON.stringify(model)}`); const strategyType = options.strategy || StrategyType.perRoute; log(`Processing model with the following bundling strategy: ${strategyType}`); const strategy = resolveStrategy(strategyType, options); const bundlesConfig = strategy(model); log(`Initial bundle configuration: ${JSON.stringify(bundlesConfig)}`); const moduleDefinitions: ModuleDefinition = moduleDefinitionResolver(appModuleFilePath); const configWithFallbacks = addFallbacks(bundlesConfig, moduleDefinitions); const safeConfig = removeBlacklistedItems(configWithFallbacks); log(`Bundle configuration after clean up: ${JSON.stringify(safeConfig)}`); log('Updating files...'); await writer(safeConfig, moduleDefinitions, options)(tree, context); }

src/bundle/writer.test.ts

appModulePath
Default value : `apps/${appName}/src/app/app.module.ts`
appName
Type : string
Default value : 'my-example-app'
createTree
Default value : (coreImport: BBCoreImport = BBCoreImport.default) => { const angularJsonPath = 'angular.json'; const angularJson = `{ "version": 1, "projects": { "${appName}": { "projectType": "application", "root": "apps/${appName}", "sourceRoot": "apps/${appName}/src", "architect": { "serve": {}, "build": { "configurations": {} } } } }, "defaultProject": "${appName}" }`; const appModule = ` import { NgModule } from '@angular/core'; import { MyExampleModule } from '@my-example/some-package'; import { MyOtherModule } from '@my-example/other-package'; @NgModule({ imports: [ ${coreImport} MyExampleModule, MyOtherModule, ], }) export class AppModule {} `; const tree = new UnitTestTree(Tree.empty()); tree.create(angularJsonPath, angularJson); tree.create(appModulePath, appModule); return tree; }

src/app/index.test.ts

appName
Type : string
Default value : 'web-app'
collectionPath
Type : string
Default value : 'src/collection.json'
componentPath
Default value : `/apps/${appName}/src/app/app.component.ts`
options
Type : Schema
Default value : { name: appName, skipPackageJson: false, }
schematicName
Type : string
Default value : 'app'
templatePath
Default value : `/apps/${appName}/src/app/app.component.html`

src/migrations/2.2.0.ts

bbAng
Type : object
Default value : { name: '@bb-cli/bb-ang', version: '~3.2.0', }
manualProcess
Default value : ` ## Add command to the package scripts In "package.json" file, define a new scripts for api check: { "name": "my-project", "version": "0.0.0", "license": "MIT", "scripts": { "build": "ng build", "e2e": "ng e2e", ... "${newScripts[0].name}": "${newScripts[0].command}", "${newScripts[1].name}": "${newScripts[1].command}" }, ... } ## Make sure the version of @bb-cli/bb-ang is ${bbAng.version} For that install it as a dev dependency using the following command: $ npm i --save-dev @bb-cli/bb-ang@${bbAng.version} `
newScripts
Type : []
Default value : [ { command: 'bb-ang check-api', name: 'api:check', }, { command: 'bb-ang extract-api', name: 'api:extract', }, ]

src/bundle/writer.ts

BBCoreModuleName
Type : string
Default value : 'BackbaseCoreModule'
bundleContent
Default value : (path: string, moduleName: string, imports: Map<string, Set<string>>, ngModules: Set<string>) => { const importStatements = [...imports.entries()] .sort(([a], [b]) => (a < b ? -1 : 1)) .map(([importPath, modules]) => `import { ${[...modules.values()].sort().join(', ')}} from ${importPath};`); return `// ${path} import { NgModule } from '@angular/core'; ${importStatements.join('\n')} @NgModule({ imports: [${[...ngModules].join(', ')}], }) export class ${moduleName} {} `; }
bundleDefinitionExport
Type : string
Default value : 'bundlesDefinition'
configContent
Default value : (bundles: Map<string, { file: string; components: Set<string> }>) => { const definitions = [...bundles.entries()].map( ([bundleModule, { file, components }]) => `{ components: ['${[...components].join(`', '`)}'], loadChildren: () => import('../bundles/${file}').then(m => m.${bundleModule}), },`, ); return `import { LazyConfig } from '@backbase/foundation-ang/core'; export const ${bundleDefinitionExport}: LazyConfig = [ ${definitions.join('\n ')} ]; `; }
createSourceFile
Default value : (filePath: string, sourceFileText: string): SourceFile => new Project({ manipulationSettings: { indentationText: IndentationText.TwoSpaces, quoteKind: QuoteKind.Single, }, useInMemoryFileSystem: true, }).createSourceFile(filePath, sourceFileText)
writer
Type : Writer
Default value : ( bundlesConfig: Array<BundleConfig>, moduleDefinition: ModuleDefinition, options: Partial<{ project: string }> = {}, ): Rule => { let bundleNumber = 1; const generateBundleHash = () => bundleNumber++; return async (tree: Tree): Promise<void> => { const workspace = await getWorkspace(tree); const projectName = options.project || workspace.extensions.defaultProject; if (!projectName) { throw new SchematicsException(`Couldn't find a default project`); } const project = workspace.projects.get(projectName); if (!project?.sourceRoot) { throw new SchematicsException('Project missing required "sourceRoot" property in angular.json'); } const appModuleFilePath = join(normalize(project.sourceRoot), 'app', 'app.module.ts'); const existingAppModule = tree.read(appModuleFilePath); if (!existingAppModule) { throw new SchematicsException(`App module not found at ${appModuleFilePath}`); } const appModuleFile = createSourceFile(appModuleFilePath, existingAppModule.toString('utf-8')); const bundles = new Map<string, { file: string; components: Set<string> }>(); const bundledModules = new Set<string>(); const addToBundle = (module: string, file: string, component: string): void => { const bundle = bundles.get(module) || { file, components: new Set() }; if (bundle.file !== file) { throw new SchematicsException(`Multiple sources of ${module} - ${bundle.file} / ${file}`); } bundle.components.add(component); bundles.set(module, bundle); }; bundlesConfig.forEach((bundleConfig) => { const bundleHash = generateBundleHash(); const bundleFile = `bundle-${bundleHash}`; const bundlePath = join(normalize(<string>project.sourceRoot), 'bundles', `${bundleFile}.ts`); const bundleModuleName = `Bundle${bundleHash}Module`; const ngModules = new Set<string>(); const imports = new Map<string, Set<string>>(); bundleConfig.forEach((classId) => { const module = moduleDefinition.get(classId); if (!module) { throw new SchematicsException(`No module found for component with classId ${classId}`); } ngModules.add(module.ngModule.name); bundledModules.add(module.ngModule.name); const ngModulesFromImport = imports.get(module.importPath) || new Set<string>(); imports.set(module.importPath, ngModulesFromImport.add(module.ngModule.name)); addToBundle(bundleModuleName, bundleFile, classId); }); tree.create(bundlePath, bundleContent(bundlePath, bundleModuleName, imports, ngModules)); }); const bundleDefinitionPath = join(normalize(project.sourceRoot), 'app', 'bundles-definition.ts'); tree.create(bundleDefinitionPath, configContent(bundles)); removeUnusedImports(appModuleFile, bundledModules); appModuleFile.addImportDeclaration({ namedImports: [{ name: 'bundlesDefinition' }], moduleSpecifier: './bundles-definition', }); removeModuleImports(appModuleFile, 'AppModule', bundledModules); updateImportConfig(appModuleFile, 'AppModule', BBCoreModuleName, [ { key: 'lazyModules', value: bundleDefinitionExport, }, ]); tree.overwrite(appModuleFilePath, appModuleFile.getFullText()); }; }

src/widget/index.test.ts

collectionPath
Type : string
Default value : 'src/collection.json'
componentTsPath
Default value : `/libs/${widgetName}/src/${widgetName}.component.ts`
options
Type : Schema
Default value : { name: widgetName, project: projectName, }
projectName
Type : string
Default value : 'test'
schematicName
Type : string
Default value : 'widget'
templatePath
Default value : `/libs/${widgetName}/src/${widgetName}.component.html`
widgetName
Type : string
Default value : 'test-widget'

src/design-system/index.ts

DESIGN_SYSTEM_DEFAULT_RUN_SCRIPT_NAME
Type : string
Default value : 'design-system'
DESIGN_SYSTEM_NPM_PACKAGE_NAME
Type : string
Default value : '@backbase/design-system-ang'
DESIGN_SYSTEM_NPM_VERSION
Type : string
Default value : '^1.0.0'

src/migrations/2.16.1.ts

expectedScripts
Type : []
Default value : [ { command: 'bb-ang build-apps --output-hashing --build-memory=4096 && bb-ang create-provisioning-package', name: 'package:apps', }, { command: undefined, name: 'postpackage:apps', }, ]
manualProcess
Default value : ` 1. Update the "${newScripts[0].name}" script in "package.json" to: { ... scripts: { ... "${newScripts[0].name}": "${newScripts[0].command}" } } 2. Add the "${newScripts[1].name}" script to "package.json": { ... scripts: { ... "${newScripts[1].name}": "${newScripts[1].command}" } }`
newScripts
Type : []
Default value : [ { command: 'bb-ang build-apps --output-hashing --build-memory=4096', name: 'package:apps', }, { command: 'bb-ang create-provisioning-package', name: 'postpackage:apps', }, ]

src/migrations/2.17.2.ts

foundationAng
Type : object
Default value : { name: '@backbase/foundation-ang', version: '^4.34.0', }
manualProcess
Default value : ` ## Upgrade '@backbase/foundation-ang' Make sure the version of ${foundationAng.name} is ${foundationAng.version}: npm install --save ${foundationAng.name}@${foundationAng.version} `

src/migrations/2.5.2.ts

foundationAng
Type : object
Default value : { name: '@backbase/foundation-ang', version: '^4.12.0', }
manualProcess
Default value : ` ## Make sure the version of ${foundationAng.name} is ${foundationAng.version} and version of ${ngBootstrap.name} is ${ngBootstrap.version} For that install it as a dependency using the following command: $ npm i --save ${foundationAng.name}@${foundationAng.version} ${ngBootstrap.name}@${ngBootstrap.version} `
ngBootstrap
Type : object
Default value : { name: '@ng-bootstrap/ng-bootstrap', version: '5.1.1', }

src/migrations/2.7.2.ts

isNamedImportDeclaration
Default value : (moduleSpecifier: string, namedImport: string) => (importDeclaration: ImportDeclaration): boolean => importDeclaration.getModuleSpecifier().getLiteralValue() === moduleSpecifier && undefined !== importDeclaration.getNamedImports().find(isNamedImportSpecifier(namedImport))
isNamedImportSpecifier
Default value : (namedImport: string) => (importSpecifier: ImportSpecifier) => importSpecifier.getName() === namedImport
manualProcess
Default value : ` Update import statements in each application's "environments/type.ts" file. ## 1. Update importing of "Item" Change import of "Item" to import { Item } from '@backbase/foundation-ang/core'; ## 2. Update importing of "ExternalServices" Change import of "ExternalServices" to import { ExternalServices } from '@backbase/foundation-ang/start';`
updateNamedImport
Default value : ( typeFile: SourceFile, moduleSpecifier: string, namedImport: string, newModuleSpecifier: string, ): void => { const importStatement = typeFile.getImportDeclaration(isNamedImportDeclaration(moduleSpecifier, namedImport)); if (!importStatement) { return; } if (importStatement.getNamedImports().length > 1) { // If they're importing extra stuff, we don't know where they *should* be imported from. throw new SchematicsException(`Found unexpected imports from ${moduleSpecifier} in type.ts`); } importStatement.setModuleSpecifier(newModuleSpecifier); }
updateTypeImports
Default value : (tree: Tree, project: workspaces.ProjectDefinition) => { const astProject = new Project({ manipulationSettings: { indentationText: IndentationText.TwoSpaces, quoteKind: QuoteKind.Single, }, useVirtualFileSystem: true, }); if (!project.sourceRoot) { throw new SchematicsException('Project missing required "sourceRoot" property in angular.json'); } const typeFilePath = join(normalize(project.sourceRoot), 'environments', 'type.ts'); const existingTypeTs = tree.read(typeFilePath); if (!existingTypeTs) { throw new SchematicsException(`Project missing expected "type.ts" file at ${typeFilePath}`); } const typeFile = astProject.createSourceFile(typeFilePath, existingTypeTs.toString('utf-8')); updateNamedImport(typeFile, '@backbase/core-ang', 'Item', '@backbase/foundation-ang/core'); updateNamedImport(typeFile, '@backbase/web-sdk-api-ang', 'ExternalServices', '@backbase/foundation-ang/start'); tree.overwrite(typeFilePath, typeFile.getFullText()); return; }

src/migrations/2.5.0.ts

libraryRules
Default value : `{ "extends": "../../tslint.json", "rules": { "import-blacklist": [ true, "rxjs/Rx", {"@angular/platform-browser": ["BrowserModule"]}, {"@angular/platform-browser/animations": ["BrowserAnimationsModule"]}, {"@angular/common/http": ["HttpClientModule"]} ] } }`
manualProcess
Default value : ` ## Add tslint file inside each library folder In each library folder add "tslint.json" file next to "public_api.ts" file with the following content: ${libraryRules} `

src/migrations/2.1.0.ts

manualProcess
Default value : ` ## Move Standalone Page Model and External Services to "environment.ts" The page model and external services used for standalone development was previously defined in "apps/*/assets/dev-mock.js". This definition should now be in the "apps/*/environments/environment.ts" file. The page model and external services should be a exported as the "pageModel" and "services" properties (respectively) on the "environment" object. e.g. // apps/my-example-app/environments/environment.ts import { Item } from '@backbase/foundation-ang/core'; import { ExternalServices } from '@backbase/foundation-ang/start'; const services: ExternalServices = {}; const pageModel: Item = { name: 'app-container', properties: {}, children: [], }; export const environment = { production: false, mockProviders: [], bootstrap: { pageModel, services, }, }; ## Move Standalone Bootstrap to "main.ts" To make use of this, the bootstrapping of the application for standalone development has also been moved from "apps/*/assets/dev-mock.js" into the "/apps/*/src/main.ts". // apps/my-example-app/src/main.ts import { environment } from './environments/environment'; // ... const start = registerSingleApp((extraProviders: Array<StaticProvider>) => platformBrowserDynamic(extraProviders).bootstrapModule(AppModule), ); if (environment.bootstrap) { start(environment.bootstrap.services).then(app => { app.bootstrap(environment.bootstrap.pageModel, { parentName: '', index: 0 }); }); } ## Remove redundant "dev-mock.js" Having made these changes, the "apps/*/assets/dev-mock.js" file(s) *should* be redundant. The script tag can be removed from the "apps/*/src/index.html" and the file deleted from the project. `

src/migrations/2.1.1.ts

manualProcess
Default value : ` ## Define an "Environment" type In "apps/*/environments/type.ts" file, define a new type "Environment" that a will be used to add strong typing to the declaration of the environment configuration. // apps/my-example-app/environments/type.ts import { Provider } from '@angular/core'; import { Item } from '@backbase/core-ang'; import { ExternalServices } from '@backbase/web-sdk-api-ang'; export interface Environment { readonly production: boolean; readonly mockProviders: Array<Provider>; readonly bootstrap?: { readonly pageModel: Item, readonly services: ExternalServices, }; } ## Update the environment declarations to conform to the newly defined type To make use of this type, the environment files should be updated to declare the "environment" variable to be of ths new "Environment" type. This should be done for *all* environment files in the Apps (usually "environment.ts" and "environment.prod.ts"). // apps/my-example-app/environments/environment.ts import { Environment } from './type'; // ... export const environment: Environment = // ... ## Update the bootstrap to use the defined type Having made these changes, the bootstrap process in "main.ts" will fail to compile as TypeScript is unable to narrow the type within the closure. We fix this by extracting the type outside of the closure. if (environment.bootstrap) { const { services, pageModel } = environment.bootstrap; start(services).then(app => { app.bootstrap(pageModel, { parentName: '', index: 0 }); }); } `

src/migrations/2.10.2.ts

manualProcess
Default value : ` 1. Change the "update" script in "package.json" Change the update script to: { ... scripts: { ... "update": "ng update @bb-cli/schematics@^2" } } 2. Use exact version of @bb-cli/schematics Remove the semver caret "^" from the @bb-cli/schematics devDependency. After the update it should be: { ... devDependencies: { ... "@bb-cli/schematics": "2.10.2" } }`
schematicsVersion
Type : string
Default value : '2.10.2'

src/migrations/2.12.0.ts

manualProcess
Default value : ` ## Please add "module": "esNext" to the compilerOptions of your apps tsconfig.app.json; So your file should look like this: { "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/app", "types": [], "module": "esNext" }, "include": [ "src/**/*.ts" ], "exclude": [ "src/test.ts", "src/**/*.spec.ts" ] } `
newCompilerOptions
Type : object
Default value : { module: 'esNext' }
tsConfigFileName
Type : string
Default value : 'tsconfig.app.json'

src/migrations/2.16.2.ts

manualProcess
Default value : ` ## Make sure the version of @bb-cli/bb-ang is 3.11.4 For that install it as a dev dependency using the following command: $ npm install --save-dev @bb-cli/bb-ang@3.11.4 ## Ensure \`HttpClientModule\` is included in the app module As the data modules can no longer provide the \`HttpClientModule\` it must be imported by the app module. import { HttpClientModule } from '@angular/common/http'; @NgModule({ imports: [ HttpClientModule, ] }) export class AppModule { }`

src/migrations/2.4.1.ts

manualProcess
Default value : ` ## Please add "module": "es2015" to the compilerOptions of your apps tsconfig.app.json; So your file should look like this: { "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "../../out-tsc/app", "types": [], "module": "es2015" }, "include": [ "src/**/*.ts" ], "exclude": [ "src/test.ts", "src/**/*.spec.ts" ] } `
newCompilerOptions
Type : object
Default value : { module: 'es2015' }
tsConfigFileName
Type : string
Default value : 'tsconfig.app.json'

src/migrations/3.0.0.ts

manualProcess
Default value : ` ## Change the "update" script in "package.json" Change the update script to: { ... scripts: { ... "update": "ng update @bb-cli/schematics@^3 @backbase/foundation-ang@^5" } } ## Install '@backbase/ui-ang' Install ${uiAng.name} version ${uiAng.version} as a dependency using the following command: npm install --save ${uiAng.name}@${uiAng.version} @ng-select/ng-select@^2.19.0 @angular/cdk@8.0.0 bignumber.js@^9.0.0 ## Import directly from '@backbase/ui-ang' All import from the '@backbase/foundation-ang/ui' entry point should be changed to import directly from '@backbase/ui-ang'. For example, an import declaration such as this: import { AccountCardModule } from '@backbase/foundation-ang/ui' should become: import { AccountCardModule } from '@backbase/ui-ang' `
NEW_MODULE
Type : string
Default value : '@backbase/ui-ang'
OLD_MODULE
Type : string
Default value : '@backbase/foundation-ang/ui'
uiAng
Type : object
Default value : { name: '@backbase/ui-ang', version: '4.152.0', }

src/migrations/3.2.1.ts

manualProcess
Default value : ` Fix the dependencies in the project's package: $ npm install --save-exact @ngrx/store@8.1.0 @ngrx/effects@8.1.0 $ npm install --save-dev tslib@^1.9.0 $ npm uninstall @angular-devkit/schematics @schematics/angular tsickle `

src/migrations/4.0.0.ts

manualProcess
Default value : ` ## Ensure dependencies are up to date Update all important dependencies using \`ng update\`. This will allow any these packages to perform any migrations that they deem necessary. ng update @angular/cli@10 @angular/core@10 @bb-cli/bb-ang@4 ## Modify the "update" script in package.json Change the update script from version ^3 to ^4 for @bb-cli/schematics: "scripts": { "update": "ng update @bb-cli/schematics@^4", } ## Make sure the version of @bb-cli/bb-ang is ~4.0.0 $ npm install --save-dev @bb-cli/bb-ang@~4.0.0 ## Remove ngPackage "languageLevel" configuration from all package.json files Previously the supported language level for ngPackager was configured using the "ngPackage.lib" key in the package.json. This information is now part of the Typescript configuration and must be removed from the package.json of any libs in the project. ## Update peer dependency versions in all public libs The peerDependencies of all libs in a project should be aligned with the package versions actually installed in the project. This means that development and tests can be performed against compatible versions of the target dependencies. Any peerDependencies in package.json files inside libs packages should be updated to be compatible with the following versions: @angular/animations: 10.0.0, @angular/common: 10.0.0, @angular/compiler: 10.0.0, @angular/core: 10.0.0, @angular/forms: 10.0.0, @angular/platform-browser: 10.0.0, @angular/platform-browser-dynamic: 10.0.0, @angular/router: 10.0.0, @backbase/foundation-ang: 6.0.0, @ngrx/effects: 10.0.0-beta.0, @ngrx/store: 10.0.0-beta.0, core-js: 2.6.5, rxjs: 6.5.5, zone.js: 0.10.3 Note: This *does not* mean that the version must be locked - the semver range should reflect the most liberal version(s) the library supports. ## Update engines to support newer npm and node "engines": { "node": "^10.13.0 || ^12.16.1", "npm": "^6.11.0" } `
removeNgPackageLanguageLevelConfigFromAllLibs
Type : Rule
Default value : async (tree: Tree) => { const workspace = await getWorkspace(tree); const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { removeNgPackageLanguageLevelConfig(tree, packageJsonPath); } catch (e) { continue; } } return () => tree; function removeNgPackageLanguageLevelConfig(tree: Tree, packageJsonPath: string): void { const packageJson = readJsonFile(tree, packageJsonPath); const newPackageJson = dissocPath(['ngPackage', 'lib', 'languageLevel'], packageJson); tree.overwrite(packageJsonPath, JSON.stringify(newPackageJson, null, 2)); } }
updateEngines
Type : Rule
Default value : chain([ updatePackageJson(assocPath(['engines', 'node'], '^10.13.0 || ^12.16.1')), updatePackageJson(assocPath(['engines', 'npm'], '^6.11.0')), ])
updatePeerDependencyVersionsInAllLibs
Type : Rule
Default value : async (tree: Tree) => { const targetPackageVersions = { '@angular/animations': '10.0.0', '@angular/common': '10.0.0', '@angular/compiler': '10.0.0', '@angular/core': '10.0.0', '@angular/forms': '10.0.0', '@angular/platform-browser': '10.0.0', '@angular/platform-browser-dynamic': '10.0.0', '@angular/router': '10.0.0', '@backbase/foundation-ang': '6.0.0', '@ngrx/effects': '10.0.0-beta.0', '@ngrx/store': '10.0.0-beta.0', 'core-js': '2.6.5', rxjs: '6.5.5', 'zone.js': '0.10.3', }; const workspace = await getWorkspace(tree); const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { updatePeerDependencyVersionsInLib(tree, packageJsonPath, targetPackageVersions); } catch (e) { continue; } } return () => tree; }
updateUpdateScript
Type : Rule
Default value : updateScript('update', (oldScript) => { if (!oldScript) { return 'ng update @bb-cli/schematics@^4'; } return oldScript.replace('@bb-cli/schematics@^3', '@bb-cli/schematics@^4'); })

src/migrations/4.10.0.ts

manualProcess
Default value : `## This migrates add the missing changes for angular 10 upgrade. to apply this changes apply the following steps: #### Update project \`tsconfig.json\` to include the following configration inside \`compilerOptions\` add: \` + "forceConsistentCasingInFileNames": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "downlevelIteration": true, \` inside \`angularCompilerOptions\` add: \` + "strictTemplates": true, \` #### update each application update \`tsconfig.app.json\` \`module\` to \`ES2020\` instead of \`esNext\` #### Update each \`protractor.conf.js\` inside e2e applications \` - chromeOptions: { args: [ '--headless', '--disable-gpu', '--window-size=800,600' ] } - jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + jasmine.getEnv().addReporter(new SpecReporter({ + spec: { + displayStacktrace: StacktraceOption.PRETTY + } + })); \` #### Make sure that you are using angular version (10.1.0) for example \` - "@angular/core": "10.2.2", + "@angular/core": "~10.1.0", \` `

src/migrations/4.11.0.ts

manualProcess
Default value : `## This migrates upddates your tslint config with latest best practice. to apply this changes apply the following steps: #### Update project \`tslint.json\` to include the following configration inside \`rules\` remove the following rules: \` - 'use-input-property-decorator' - 'use-output-property-decorator' - 'use-host-property-decorator' - 'use-life-cycle-interface' \` and add the following rules: \` + "component-class-suffix": true, + "contextual-lifecycle": true, + "directive-class-suffix": true, + "no-conflicting-lifecycle": true, + "no-host-metadata-property": true, + "no-input-rename": true, + "no-inputs-metadata-property": true, + "no-output-native": true, + "no-output-on-prefix": true, + "no-output-rename": true, + "no-outputs-metadata-property": true, + "template-banana-in-box": true, + "template-no-negated-async": true, + "use-lifecycle-interface": true, + "use-pipe-transform-interface": true \` `

src/migrations/4.2.1.ts

manualProcess
Default value : ` ## Please update "module" in tsconfig.spec.json to "ES2020" So your file should look like this: { ... "compilerOptions": { ..., "module": "ES2020" }, ... } `
tsConfigFilePath
Type : string
Default value : './tsconfig.spec.json'

src/migrations/4.3.0.ts

manualProcess
Default value : ` ## Ensure dependencies are up to date Update Angular dependencies using \`ng update\`. This will allow these packages to perform any migrations that they deem necessary. ng update @angular/cli@10.1.0 @angular/core@10.1.0 --force Set @angular/localize version to ~10.1.0 and rxjs version to ~6.6.2: ## Update peer dependency versions in all public libs The peerDependencies of all libs in a project should be aligned with the package versions actually installed in the project. This means that development and tests can be performed against compatible versions of the target dependencies. Any peerDependencies in package.json files inside libs packages should be updated to be compatible with the following versions: @angular/animations: 10.1.0, @angular/common: 10.1.0, @angular/compiler: 10.1.0, @angular/core: 10.1.0, @angular/forms: 10.1.0, @angular/platform-browser: 10.1.0, @angular/platform-browser-dynamic: 10.1.0, @angular/router: 10.1.0, @ngrx/effects: 10.0.0, @ngrx/store: 10.0.0, rxjs: 6.6.2 Note: This *does not* mean that the version must be locked - the semver range should reflect the most liberal version(s) the library supports. `
updatePeerDependencyVersionsInAllLibs
Type : Rule
Default value : async (tree: Tree) => { const targetPackageVersions = { '@angular/animations': '10.1.0', '@angular/common': '10.1.0', '@angular/compiler': '10.1.0', '@angular/core': '10.1.0', '@angular/forms': '10.1.0', '@angular/platform-browser': '10.1.0', '@angular/platform-browser-dynamic': '10.1.0', '@angular/router': '10.1.0', '@ngrx/effects': '10.0.0', '@ngrx/store': '10.0.0', rxjs: '6.6.2', }; const workspace = await getWorkspace(tree); return (host: Tree) => { const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { updatePeerDependencyVersionsInLib(host, packageJsonPath, targetPackageVersions); } catch (e) { continue; } } return host; }; }
updateProjectDependencies
Type : Rule
Default value : () => updatePackageJson((packageJson: PackageJson) => ({ ...packageJson, dependencies: { ...packageJson.dependencies, '@angular/localize': '~10.1.0', rxjs: '~6.6.2', }, }))

src/migrations/4.5.0.ts

manualProcess
Default value : ` ## Please update libs tslint.json files to include no-implicit-dependencies rule So your file should look like this: { ... "rules": { ..., "no-implicit-dependencies": { "severity": "warning", "options": true } ... }, ... "linterOptions": {"exclude": ["test.ts"]} } `

src/migrations/4.6.0.ts

manualProcess
Default value : ` ## Please update libs and widgets package.json files to include tslib version ^2.0.0 as dependancy So your file should look like this: { ... "dependencies": { ... "tslib": "^2.0.0" } ... } `

src/migrations/4.8.0.ts

manualProcess
Default value : ` ## This migrates from the bb-ang extract-api and bb-ang check-api wrappers to using the api-extractor tool directly. to apply this changes apply the following steps: #### update each public library package.json to include the following scripts \` ... "scripts": { "api:check": "../../node_modules/.bin/api-extractor run -c ./api-extractor.json", "api:extract": "npm run api:check -- --local" }, ... \` #### Add api-extractor.json config file to each lib Add an \`api-extractor.json\` file under each library folder. The content of the file should look like this. Replace LIBRARY_NAME with the correct path name for the library. \` { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "extends": "../../api-extractor.json", "mainEntryPointFilePath": "../../dist/libs/LIBRARY_NAME/public_api.d.ts", "projectFolder": "." } \` #### Update project package.json to include check and extract scripts for each lib \` { ... "scripts": { "api:check": "npm run api:check:example-widget && npm run api:check:example-data-http", "api:check:example-data-http": "cd libs/example-data-http && npm run api:check", "api:check:example-widget": "cd libs/example-widget && npm run api:check", "api:extract": "npm run api:extract:example-widget && npm run api:extract:example-data-http", "api:extract:example-data-http": "cd libs/example-data-http && npm run api:extract", "api:extract:example-widget": "cd libs/example-widget && npm run api:extract", ... } ... } \` #### Add an \`api-extractor.json\` to the project root \` { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "bundledPackages": [], "compiler": { "overrideTsconfig": { "extends": "../../tsconfig.json", "compilerOptions": { "typeRoots": [ "./node_modules/@types" ] } } }, "apiReport": { "enabled": true, "reportFolder": "<projectFolder>", "reportTempFolder": "dist" }, "docModel": { "enabled": false }, "dtsRollup": { "enabled": false }, "tsdocMetadata": { "enabled": false }, "messages": { "compilerMessageReporting": { "default": { "logLevel": "warning" } }, "extractorMessageReporting": { "default": { "logLevel": "warning", "addToApiReportFile": true }, "ae-missing-release-tag": { "logLevel": "none", "addToApiReportFile": false }, "ae-forgotten-export": { "logLevel": "warning", "addToApiReportFile": true }, "ae-incompatible-release-tags": { "logLevel": "none", "addToApiReportFile": false }, "ae-internal-missing-underscore": { "logLevel": "none", "addToApiReportFile": false }, "ae-unresolved-inheritdoc-reference": { "logLevel": "none", "addToApiReportFile": false }, "ae-unresolved-inheritdoc-base": { "logLevel": "none", "addToApiReportFile": false }, "ae-missing-getter": { "logLevel": "warning", "addToApiReportFile": true }, "ae-setter-with-docs": { "logLevel": "none", "addToApiReportFile": false } }, "tsdocMessageReporting": { "default": { "logLevel": "none" } } } } \` `

src/migrations/5.0.0.ts

manualProcess
Default value : ` ## Ensure dependencies are up to date Update all important dependencies using \`ng update\`. This will allow any these packages to perform any migrations that they deem necessary. ng update @angular/cli@11 @angular/core@11 @bb-cli/bb-ang@5 ## Modify the "update" script in package.json Change the update script from version ^4 to ^5 for @bb-cli/schematics: "scripts": { "update": "ng update @bb-cli/schematics@^5", } ## Make sure the version of @bb-cli/bb-ang is ~5.0.0 $ npm install --save-dev @bb-cli/bb-ang@~5.0.0 ## Update peer dependency versions in all public libs The peerDependencies of all libs in a project should be aligned with the package versions actually installed in the project. This means that development and tests can be performed against compatible versions of the target dependencies. Any peerDependencies in package.json files inside libs packages should be updated to be compatible with the following versions: @angular/animations: 11.1.0, @angular/common: 11.1.0, @angular/compiler: 11.1.0, @angular/core: 11.1.0, @angular/forms: 11.1.0, @angular/platform-browser: 11.1.0, @angular/platform-browser-dynamic: 11.1.0, @angular/router: 11.1.0, @backbase/foundation-ang: 6.0.0, rxjs: 6.6.2, Note: This *does not* mean that the version must be locked - the semver range should reflect the most liberal version(s) the library supports. ## Add support for native async/await to protractor config To allow async/await in e2e tests the protractor promise manager needs to be disabled by adding SELENIUM_PROMISE_MANAGER: false to the 'protractor.conf.js' for each 'e2e' project. `
updatePeerDependencyVersionsInAllLibs
Type : Rule
Default value : async (tree: Tree) => { const targetPackageVersions = { '@angular/animations': '11.1.0', '@angular/common': '11.1.0', '@angular/compiler': '11.1.0', '@angular/core': '11.1.0', '@angular/forms': '11.1.0', '@angular/platform-browser': '11.1.0', '@angular/platform-browser-dynamic': '11.1.0', '@angular/router': '11.1.0', '@backbase/foundation-ang': '6.0.0', rxjs: '6.6.2', }; const workspace = await getWorkspace(tree); const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { updatePeerDependencyVersionsInLib(tree, packageJsonPath, targetPackageVersions); } catch (e) { continue; } } return () => tree; }
updateProtractorConfig
Default value : async (tree: Tree) => { const workspace = await getWorkspace(tree); getAppProjects(workspace, appType.e2eApps).forEach((project) => { const protractorConfig = project.targets.get('e2e')?.options?.protractorConfig; if (!protractorConfig || typeof protractorConfig !== 'string') return; const content = tree.read(protractorConfig); if (!content) return; const sourceFile = ts.createSourceFile( 'protractor-config.js', content.toString('utf-8'), ts.ScriptTarget.ES2020, true, ); const changes: Change[] = []; const visitor = (node: ts.Node) => { changes.push(...disableSeleniumPromiseManager(node, protractorConfig)); ts.forEachChild(node, visitor); }; ts.forEachChild(sourceFile, visitor); insert(tree, protractorConfig, changes); }); }
updateUpdateScript
Type : Rule
Default value : updateScript('update', (oldScript) => { if (!oldScript) { return 'ng update @bb-cli/schematics@^5'; } return oldScript.replace('@bb-cli/schematics@^4', '@bb-cli/schematics@^5'); })

src/migrations/5.3.1.ts

manualProcess
Default value : `## This migrates sets only libs/*/public_api.ts to the default scope path. to apply this changes apply the following steps: #### Update project \`tsconfig.json\` to include the following configration inside \`compilerOptions\`, \`path\` set public_api libs: \` + libs/*/public_api.ts \` `

src/migrations/5.4.0.ts

manualProcess
Default value : ` ## Ensure dependencies are up to date Update Angular dependencies using \`ng update\`. This will allow these packages to perform any migrations that they deem necessary. ng update @angular/cli@11.2.0 @angular/core@11.2.0 --force Set @ngrx/store and @ngrx/effects version to ~11.0.0: ## Update peer dependency versions in all public libs The peerDependencies of all libs in a project should be aligned with the package versions actually installed in the project. This means that development and tests can be performed against compatible versions of the target dependencies. Any peerDependencies in package.json files inside libs packages should be updated to be compatible with the following versions: @angular/animations: 11.2.0, @angular/common: 11.2.0, @angular/compiler: 11.2.0, @angular/core: 11.2.0, @angular/forms: 11.2.0, @angular/platform-browser: 11.2.0, @angular/platform-browser-dynamic: 11.2.0, @angular/router: 11.2.0, @angular/localize: 11.2.0, @ngrx/effects: 11.0.0, @ngrx/store: 11.0.0, Note: This *does not* mean that the version must be locked - the semver range should reflect the most liberal version(s) the library supports. `
updatePeerDependencyVersionsInAllLibs
Type : Rule
Default value : async (tree: Tree) => { const targetPackageVersions = { '@angular/animations': '11.2.0', '@angular/common': '11.2.0', '@angular/compiler': '11.2.0', '@angular/core': '11.2.0', '@angular/forms': '11.2.0', '@angular/platform-browser': '11.2.0', '@angular/platform-browser-dynamic': '11.2.0', '@angular/router': '11.2.0', '@angular/localize': '11.2.0', '@ngrx/effects': '11.0.0', '@ngrx/store': '11.0.0', }; const workspace = await getWorkspace(tree); return (host: Tree) => { const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { updatePeerDependencyVersionsInLib(host, packageJsonPath, targetPackageVersions); } catch (e) { continue; } } return host; }; }
updateProjectDependencies
Type : Rule
Default value : () => updatePackageJson((packageJson: PackageJson) => ({ ...packageJson, dependencies: { ...packageJson.dependencies, '@angular/animations': '~11.2.0', '@angular/common': '~11.2.0', '@angular/compiler': '~11.2.0', '@angular/core': '~11.2.0', '@angular/forms': '~11.2.0', '@angular/platform-browser': '~11.2.0', '@angular/platform-browser-dynamic': '~11.2.0', '@angular/router': '~11.2.0', '@angular/localize': '~11.2.0', '@ngrx/effects': '~11.0.0', '@ngrx/store': '~11.0.0', }, devDependencies: { ...packageJson.devDependencies, '@angular-devkit/architect': '~0.1102.0', '@angular-devkit/build-angular': '~0.1102.0', '@angular/cli': '~11.2.0', '@angular/compiler-cli': '~11.2.0', '@angular/language-service': '~11.2.0', }, }))

src/migrations/6.0.0.ts

manualProcess
Default value : ` ## Ensure dependencies are up to date Update all important dependencies using \`ng update\`. This will allow any these packages to perform any migrations that they deem necessary. ng update @angular/cli@12 @angular/core@12 @bb-cli/bb-ang@6 ## Modify the "update" script in package.json Change the update script from version ^5 to ^6 for @bb-cli/schematics: "scripts": { "update": "ng update @bb-cli/schematics@^6", } ## Make sure the version of @bb-cli/bb-ang is ~6.0.0 $ npm install --save-dev @bb-cli/bb-ang@~6.0.0 ## Update peer dependency versions in all public libs The peerDependencies of all libs in a project should be aligned with the package versions actually installed in the project. This means that development and tests can be performed against compatible versions of the target dependencies. Any peerDependencies in package.json files inside libs packages should be updated to be compatible with the following versions: @angular/animations: 12.2.10, @angular/common: 12.2.10, @angular/compiler: 12.2.10, @angular/core: 12.2.10, @angular/forms: 12.2.10, @angular/platform-browser: 12.2.10, @angular/platform-browser-dynamic: 12.2.10, @angular/router: 12.2.10, @backbase/foundation-ang: 6.15.1 Note: This *does not* mean that the version must be locked - the semver range should reflect the most liberal version(s) the library supports. `
updatePeerDependencyVersionsInAllLibs
Type : Rule
Default value : async (tree: Tree) => { const targetPackageVersions = { '@angular/animations': '12.2.10', '@angular/common': '12.2.10', '@angular/compiler': '12.2.10', '@angular/core': '12.2.10', '@angular/forms': '12.2.10', '@angular/platform-browser': '12.2.10', '@angular/platform-browser-dynamic': '12.2.10', '@angular/router': '12.2.10', '@backbase/foundation-ang': '6.15.1', }; const workspace = await getWorkspace(tree); const packageJsonPaths = getLibProjects(workspace).map((project) => path.join(project.root, 'package.json')); for (const packageJsonPath of packageJsonPaths) { try { updatePeerDependencyVersionsInLib(tree, packageJsonPath, targetPackageVersions); } catch (e) { continue; } } return () => tree; }
updateUpdateScript
Type : Rule
Default value : updateScript('update', (oldScript) => { if (!oldScript) { return 'ng update @bb-cli/schematics@^6'; } return oldScript.replace('@bb-cli/schematics@^5', '@bb-cli/schematics@^6'); })

src/migrations/6.0.5.ts

manualProcess
Default value : ` ## Import directly from '@backbase/universal-ang' to be restricted from eslint All the imports from @backbase/universal-ang will throw an error. As the eslint rule is added in .eslintrc.json: overrides object should become: { overrides: { rules: { ..., "no-restricted-imports": [ "error", { "patterns": [{ "group": ["@backbase/universal-ang"], "message": "Please import the module directly, @backbase/universal-ang/foo --> @backbase/foo-ang" }] } ] } } }`
updateRulesWithUniversalRestriction
Type : Rule
Default value : async (tree: Tree) => { const tslint = getEsLint(tree); const preExistingRestrictedImports = tslint?.overrides?.[0]?.rules?.['no-restricted-imports']?.[1] || []; const newRule = { 'no-restricted-imports': [ 'error', { ...preExistingRestrictedImports, patterns: [ ...(preExistingRestrictedImports?.patterns || []), { group: ['@backbase/universal-ang'], message: 'Please import the module directly, @backbase/universal-ang/foo --> @backbase/foo-ang', }, ], }, ], }; updateEslintOverridesRules(tree, '*.ts', newRule); }

src/migrations/6.0.6.ts

manualProcess
Default value : ` ## Install '@backbase/ui-ang' Install ${uiAng.name} version ${uiAng.version} as a dependency using the following command: npm install --save ${uiAng.name}@${uiAng.version} ## Uninstall '@backbase/backbase-theme' Uninstall '@backbase/backbase-theme' as a dependency using the following command: npm uninstall @backbase/backbase-theme ## Update theme imports from '@backbase/backbase-theme' to '@backbase/ui-ang' All import from the '@backbase/theme' entry point should be changed to import from '@backbase/ui-ang'. For example, an import declaration such as this: @import '~@backbase/backbase-theme/scss/main'; should become: @import '~@backbase/ui-ang/scss/main'; ## If one is using backbase-theme-retail-preset or backbase-theme-wealth-preset or backbase-theme-business-preset, please update to its latest version. `
uiAng
Type : object
Default value : { name: '@backbase/ui-ang', version: '^7.5.0', }

results matching ""

    No results matching ""