diff --git a/scopes/dev-services/compiler/angular-elements/angular-elements.compiler.ts b/scopes/dev-services/compiler/angular-elements/angular-elements.compiler.ts
index be7b5889..d155da94 100644
--- a/scopes/dev-services/compiler/angular-elements/angular-elements.compiler.ts
+++ b/scopes/dev-services/compiler/angular-elements/angular-elements.compiler.ts
@@ -2,7 +2,6 @@ import type { AngularCompilerOptions } from '@angular/compiler-cli';
import { componentIsApp } from '@teambit/angular-apps';
import type { AngularEnvOptions } from '@teambit/angular-common';
import { getNodeModulesPaths, getWorkspace } from '@teambit/angular-common';
-import { RollupCompiler } from './rollup/rollup.compiler';
import { ApplicationAspect, ApplicationMain } from '@teambit/application';
import {
ArtifactDefinition,
@@ -21,6 +20,7 @@ import { NgccProcessor } from '@teambit/ngcc';
import { Workspace, WorkspaceAspect } from '@teambit/workspace';
import chalk from 'chalk';
import { extname, join } from 'path';
+import { RollupCompiler } from './rollup/rollup.compiler';
interface AngularElementsCompilerOptions {
ngPackagrModulePath?: string;
@@ -109,7 +109,7 @@ Built Angular Compositions
}
// Build compositions
await this.compositionsCompilation(params.component, params.componentDir, params.outputDir, true);
- return;
+
// }
// TODO: implement compilation of components as webcomponents
// throw new Error('not implemented');
diff --git a/scopes/dev-services/compiler/angular-elements/preview/mount.tsx b/scopes/dev-services/compiler/angular-elements/preview/mount.tsx
index 755e6e3d..08634de2 100644
--- a/scopes/dev-services/compiler/angular-elements/preview/mount.tsx
+++ b/scopes/dev-services/compiler/angular-elements/preview/mount.tsx
@@ -11,7 +11,7 @@ const root = document.getElementById('root') as HTMLElement;
* this function can be overridden through ReactAspect.overrideCompositionsMounter() API
* to apply custom logic for component DOM mounting.
*/
-export default async (composition: any/*, previewContext: RenderingContext*/) => {
+export default async (composition: any/* , previewContext: RenderingContext */) => {
ReactDOM.render(
{await ngToReact([composition])}
,
root
diff --git a/scopes/dev-services/compiler/angular-elements/rollup/ngc-plugin/index.ts b/scopes/dev-services/compiler/angular-elements/rollup/ngc-plugin/index.ts
index 4d8bf32b..ff0d4f57 100644
--- a/scopes/dev-services/compiler/angular-elements/rollup/ngc-plugin/index.ts
+++ b/scopes/dev-services/compiler/angular-elements/rollup/ngc-plugin/index.ts
@@ -66,7 +66,7 @@ export async function ngcPlugin(options: Options, logger: Logger): Promise;
@@ -51,14 +51,14 @@ export class RollupCompiler {
}
async bundleFiles(opts: RollupOptions) {
- const cacheDirectory = opts.cacheDirectory;
+ const {cacheDirectory} = opts;
/** File system used by the Angular linker plugin. */
const NodeJSFileSystem = await getNodeJSFileSystem();
const fileSystem = new NodeJSFileSystem();
/** Logger used by the Angular linker plugin. */
- let ConsoleLogger: any, LogLevel: any;
+ let ConsoleLogger: any; let LogLevel: any;
const ngCompilerCliApi = await ngCompilerCli() as any;
if (ngCompilerCliApi.ConsoleLogger && ngCompilerCliApi.LogLevel) {
ConsoleLogger = ngCompilerCliApi.ConsoleLogger;
diff --git a/scopes/dev-services/compiler/angular-elements/rollup/utils/fs.ts b/scopes/dev-services/compiler/angular-elements/rollup/utils/fs.ts
index 270d7420..7b72c0f9 100644
--- a/scopes/dev-services/compiler/angular-elements/rollup/utils/fs.ts
+++ b/scopes/dev-services/compiler/angular-elements/rollup/utils/fs.ts
@@ -2,11 +2,7 @@ import * as fs from 'fs';
import { dirname } from 'path';
import { promisify } from 'util';
-export const readFile = fs.promises.readFile;
-export const writeFile = fs.promises.writeFile;
-export const access = fs.promises.access;
-export const mkdir = fs.promises.mkdir;
-export const stat = fs.promises.stat;
+export const {readFile, writeFile, access, mkdir, stat} = fs.promises;
// @ts-ignore
export const rmdir = fs.promises.rm ?? fs.promises.rmdir;
diff --git a/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.task.ts b/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.task.ts
index d52e999c..9de678de 100644
--- a/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.task.ts
+++ b/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.task.ts
@@ -16,7 +16,7 @@ export const NgMultiCompilerTask = {
const description = options.description || 'compiling components using NgMultiCompiler';
return CompilerTask.from({
- name: name,
+ name,
description,
compiler: options.ngMultiCompiler
});
diff --git a/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.ts b/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.ts
index b4a49ea8..1fe05528 100644
--- a/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.ts
+++ b/scopes/dev-services/compiler/ng-multi-compiler/ng-multi-compiler.ts
@@ -63,6 +63,7 @@ export class NgMultiCompiler implements Compiler {
}
private _babelCompiler!: BabelCompiler;
+
get babelCompiler(): BabelCompiler {
if (!this._babelCompiler) {
this._babelCompiler = this.babelMain.createCompiler({
@@ -95,9 +96,9 @@ export class NgMultiCompiler implements Compiler {
}
if (params.initiator === CompilationInitiator.PreStart || params.initiator === CompilationInitiator.Start) {
return this.mainCompiler.transpileComponent(params);
- } else {
+ }
return this.ngPackagrCompiler.transpileComponent(params);
- }
+
}
transpileFile(fileContent: string, params: TranspileFileParams): TranspileFileOutput {
@@ -122,7 +123,7 @@ export class NgMultiCompiler implements Compiler {
*/
async build(context: BuildContext): Promise {
const componentsResults: ComponentResult[] = [];
- let capsules = context.capsuleNetwork.seedersCapsules;
+ const capsules = context.capsuleNetwork.seedersCapsules;
// compile all app entry files with babel
const appComponentCapsules = capsules.filter(capsule => componentIsApp(capsule.component, this.application));
appComponentCapsules.forEach((capsule: Capsule) => {
@@ -200,12 +201,12 @@ export class NgMultiCompiler implements Compiler {
const application = context.getAspect(ApplicationAspect.id);
const ngPackagrCompiler = NgPackagrCompiler.from({
- artifactName: artifactName,
- distDir: distDir,
- distGlobPatterns: distGlobPatterns,
+ artifactName,
+ distDir,
+ distGlobPatterns,
ngEnvOptions: options.ngEnvOptions,
ngPackagrModulePath,
- shouldCopyNonSupportedFiles: shouldCopyNonSupportedFiles,
+ shouldCopyNonSupportedFiles,
tsCompilerOptions: options.tsCompilerOptions
})(context);
diff --git a/scopes/dev-services/compiler/ng-packagr/ng-packagr.compiler.ts b/scopes/dev-services/compiler/ng-packagr/ng-packagr.compiler.ts
index 6a523174..9f0963aa 100644
--- a/scopes/dev-services/compiler/ng-packagr/ng-packagr.compiler.ts
+++ b/scopes/dev-services/compiler/ng-packagr/ng-packagr.compiler.ts
@@ -99,7 +99,7 @@ export class NgPackagrCompiler implements Compiler {
} else {
// Angular v13+
this.readDefaultTsConfig = async() => {
- const initializeTsConfig = module.initializeTsConfig;
+ const {initializeTsConfig} = module;
const entryPoints: any = [{
data: {
entryPoint: {
@@ -133,7 +133,7 @@ export class NgPackagrCompiler implements Compiler {
updatePackageJson.exports = packageJson.exports;
props.forEach(prop => {
if (packageJson.exports['.'][prop]) {
- updatePackageJson.exports['.'][prop] = './' + posix.join(this.distDir, packageJson.exports['.'][prop]);
+ updatePackageJson.exports['.'][prop] = `./${ posix.join(this.distDir, packageJson.exports['.'][prop])}`;
}
});
}
@@ -151,7 +151,7 @@ export class NgPackagrCompiler implements Compiler {
// check for dependencies other than tslib and move them to peer dependencies
// see https://github.com/ng-packagr/ng-packagr/blob/master/docs/dependencies.md#general-recommendation-use-peerdependencies-whenever-possible
const packageJson = PackageJsonFile.loadFromPathSync(pathToOutputFolder, '');
- const dependencies = packageJson.packageJsonObject.dependencies;
+ const {dependencies} = packageJson.packageJsonObject;
// const peerDependencies = packageJson.packageJsonObject.peerDependencies;
const allowedNonPeerDependencies: string[] = [];
const depKeys = Object.keys(dependencies).filter(dep => dep !== 'tslib'); // only tslib is allowed in dependencies
@@ -228,8 +228,8 @@ export class NgPackagrCompiler implements Compiler {
const dist = join(params.outputDir, this.distDir);
mkdirsSync(dist);
// We do not need to compile using ng-packagr (except for builds) because Angular reads the source files directly
- return;
- /*const isApp = componentIsApp(params.component, this.application);
+
+ /* const isApp = componentIsApp(params.component, this.application);
// No need to compile an app
if (isApp) {
return;
@@ -251,7 +251,7 @@ export class NgPackagrCompiler implements Compiler {
this.logger.off();
// Build component package
await this.ngPackagrCompilation(params.componentDir, params.outputDir, this.tsCompilerOptions, false);
- this.logger.on();*/
+ this.logger.on(); */
}
private getArtifactDefinition(): ArtifactDefinition[] {
@@ -289,7 +289,7 @@ export class NgPackagrCompiler implements Compiler {
const componentsResults: ComponentResult[] = [];
for (const capsule of componentCapsules) {
- const component = capsule.component;
+ const {component} = capsule;
const currentComponentResult: ComponentResult = {
component
};
diff --git a/scopes/dev-services/compiler/ngcc/ngcc-processor.ts b/scopes/dev-services/compiler/ngcc/ngcc-processor.ts
index 05927080..a4b849db 100644
--- a/scopes/dev-services/compiler/ngcc/ngcc-processor.ts
+++ b/scopes/dev-services/compiler/ngcc/ngcc-processor.ts
@@ -59,7 +59,7 @@ export class NgccProcessor {
// The hash is used directly in the file name to mitigate potential read/write race
// conditions as well as to only require a file existence check
- this.runHashFilePath = path.join(tempFolder, runHash + '.lock');
+ this.runHashFilePath = path.join(tempFolder, `${runHash }.lock`);
// If the run hash lock file exists, then ngcc was already run against this project state
if (existsSync(this.runHashFilePath)) {
@@ -101,7 +101,7 @@ export class NgccProcessor {
if (status !== 0) {
const errorMessage = error?.message || '';
- throw new Error(errorMessage + `NGCC failed${errorMessage ? ', see above' : ''}.`);
+ throw new Error(`${errorMessage }NGCC failed${errorMessage ? ', see above' : ''}.`);
}
// ngcc was successful so if a run hash was generated, write it for next time
diff --git a/scopes/dev-services/compiler/webpack/ng-webpack-bundler.ts b/scopes/dev-services/compiler/webpack/ng-webpack-bundler.ts
index 00851d73..433bdf43 100644
--- a/scopes/dev-services/compiler/webpack/ng-webpack-bundler.ts
+++ b/scopes/dev-services/compiler/webpack/ng-webpack-bundler.ts
@@ -74,7 +74,7 @@ export class NgWebpackBundler {
const webpackBuildConfigFactory: WebpackBuildConfigFactory = options.ngEnvOptions.webpackConfigFactory;
const name = options.name || 'ng-webpack-bundler';
const logger = context.createLogger(name);
- const bundlerContext = options.bundlerContext;
+ const {bundlerContext} = options;
const workspace = getWorkspace(context);
const pkg = context.getAspect(PkgAspect.id);
const application = context.getAspect(ApplicationAspect.id);
@@ -90,7 +90,7 @@ export class NgWebpackBundler {
tempFolder = join(CACHE_ROOT, idName);
}
- let appRootPath: string, tsconfigPath: string;
+ let appRootPath: string; let tsconfigPath: string;
let plugins: WebpackPluginInstance[] = [];
if (isAppBuildContext(bundlerContext)) { // When you use `bit run `
appRootPath = bundlerContext.capsule.path;// this.workspace?.componentDir(context.appComponent.id, {ignoreScopeAndVersion: true, ignoreVersion: true}) || '';
diff --git a/scopes/dev-services/compiler/webpack/ng-webpack-dev-server.ts b/scopes/dev-services/compiler/webpack/ng-webpack-dev-server.ts
index 14f566f1..c8c77b64 100644
--- a/scopes/dev-services/compiler/webpack/ng-webpack-dev-server.ts
+++ b/scopes/dev-services/compiler/webpack/ng-webpack-dev-server.ts
@@ -77,7 +77,7 @@ export class NgWebpackDevServer {
const name = options.name || 'ng-webpack-dev-server';
const logger = context.createLogger(name);
- const devServerContext = options.devServerContext;
+ const {devServerContext} = options;
const workspace = getWorkspace(context);
const webpackMain = context.getAspect(WebpackAspect.id);
const pkg = context.getAspect(PkgAspect.id);
@@ -93,7 +93,7 @@ export class NgWebpackDevServer {
tempFolder = join(CACHE_ROOT, idName);
}
- let appRootPath: string, tsconfigPath: string;
+ let appRootPath: string; let tsconfigPath: string;
let isApp = false;
if (isAppContext(devServerContext)) { // When you use `bit run `
appRootPath = workspace?.componentDir(devServerContext.appComponent.id, {
diff --git a/scopes/dev-services/compiler/webpack/webpack-plugins/angular-resolver.ts b/scopes/dev-services/compiler/webpack/webpack-plugins/angular-resolver.ts
index b0710c31..7939c219 100644
--- a/scopes/dev-services/compiler/webpack/webpack-plugins/angular-resolver.ts
+++ b/scopes/dev-services/compiler/webpack/webpack-plugins/angular-resolver.ts
@@ -178,10 +178,10 @@ export class BitDedupeModuleResolvePlugin {
|| V16_ANGULAR_FORMATS.every(f => Object.keys(entryPointPackageJson as JsonObject).includes(f))
) {
return true;
- } else {
- const metadataPath = this.fs.resolve(entryPointPath, typings.replace(/\.d\.ts$/, '') + '.metadata.json');
+ }
+ const metadataPath = this.fs.resolve(entryPointPath, `${typings.replace(/\.d\.ts$/, '') }.metadata.json`);
return this.fs.exists(metadataPath);
- }
+
}
getIssuer(result: any) {
diff --git a/scopes/dev-services/compiler/webpack/webpack-plugins/nodejs-file-system.ts b/scopes/dev-services/compiler/webpack/webpack-plugins/nodejs-file-system.ts
index 5f425470..d3d91c68 100644
--- a/scopes/dev-services/compiler/webpack/webpack-plugins/nodejs-file-system.ts
+++ b/scopes/dev-services/compiler/webpack/webpack-plugins/nodejs-file-system.ts
@@ -104,9 +104,11 @@ export class NodeJSPathManipulation implements PathManipulation {
pwd(): AbsoluteFsPath {
return this.normalize(process.cwd()) as AbsoluteFsPath;
}
+
chdir(dir: AbsoluteFsPath): void {
process.chdir(dir);
}
+
resolve(...paths: string[]): AbsoluteFsPath {
return this.normalize(p.resolve(...paths)) as AbsoluteFsPath;
}
@@ -114,24 +116,31 @@ export class NodeJSPathManipulation implements PathManipulation {
dirname(file: T): T {
return this.normalize(p.dirname(file)) as T;
}
+
join(basePath: T, ...paths: string[]): T {
return this.normalize(p.join(basePath, ...paths)) as T;
}
+
isRoot(path: AbsoluteFsPath): boolean {
return this.dirname(path) === this.normalize(path);
}
+
isRooted(path: string): boolean {
return p.isAbsolute(path);
}
+
relative(from: T, to: T): PathSegment|AbsoluteFsPath {
return this.normalize(p.relative(from, to)) as PathSegment | AbsoluteFsPath;
}
+
basename(filePath: string, extension?: string): PathSegment {
return p.basename(filePath, extension) as PathSegment;
}
+
extname(path: AbsoluteFsPath|PathSegment): string {
return p.extname(path);
}
+
normalize(path: T): T {
// Convert backslashes to forward slashes
return path.replace(/\\/g, '/') as T;
@@ -146,21 +155,27 @@ export class NodeJSReadonlyFileSystem extends NodeJSPathManipulation implements
exists(path: AbsoluteFsPath): boolean {
return fs.existsSync(path);
}
+
readFile(path: AbsoluteFsPath): string {
return fs.readFileSync(path, 'utf8');
}
+
readFileBuffer(path: AbsoluteFsPath): Uint8Array {
return fs.readFileSync(path);
}
+
readdir(path: AbsoluteFsPath): PathSegment[] {
return fs.readdirSync(path) as PathSegment[];
}
+
lstat(path: AbsoluteFsPath): FileStats {
return fs.lstatSync(path);
}
+
stat(path: AbsoluteFsPath): FileStats {
return fs.statSync(path);
}
+
realpath(path: AbsoluteFsPath): AbsoluteFsPath {
return this.resolve(fs.realpathSync(path));
}
@@ -173,18 +188,23 @@ export class NodeJSFileSystem extends NodeJSReadonlyFileSystem implements FileSy
writeFile(path: AbsoluteFsPath, data: string|Uint8Array, exclusive = false): void {
fs.writeFileSync(path, data, exclusive ? {flag: 'wx'} : undefined);
}
+
removeFile(path: AbsoluteFsPath): void {
fs.unlinkSync(path);
}
+
symlink(target: AbsoluteFsPath, path: AbsoluteFsPath): void {
fs.symlinkSync(target, path);
}
+
copyFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void {
fs.copyFileSync(from, to);
}
+
moveFile(from: AbsoluteFsPath, to: AbsoluteFsPath): void {
fs.renameSync(from, to);
}
+
ensureDir(path: AbsoluteFsPath): void {
const parents: AbsoluteFsPath[] = [];
while (!this.isRoot(path) && !this.exists(path)) {
@@ -195,6 +215,7 @@ export class NodeJSFileSystem extends NodeJSReadonlyFileSystem implements FileSy
this.safeMkdir(parents.pop()!);
}
}
+
removeDeep(path: AbsoluteFsPath): void {
fs.rmdirSync(path, {recursive: true});
}
diff --git a/scopes/dev-services/preview/angular-runtime/loader.ts b/scopes/dev-services/preview/angular-runtime/loader.ts
index e85b4c8f..76782d7a 100644
--- a/scopes/dev-services/preview/angular-runtime/loader.ts
+++ b/scopes/dev-services/preview/angular-runtime/loader.ts
@@ -155,9 +155,9 @@ export async function ngToCustomElements(modulesOrComponents: Type[], appli
// elements detached from the DOM when we unmount them. We need to keep the appRef alive to be able to reattach.
appRef = null;
return createCustomElements(componentsToLoad, rootInjector);
- } else {
- throw new Error('Unable to load any composition, the Angular env can only load modules or components');
}
+ throw new Error('Unable to load any composition, the Angular env can only load modules or components');
+
}
export interface NgBootstrapOptions {
@@ -196,7 +196,7 @@ export async function ngBootstrap(modulesOrComponents: Type | Type[
console.warn('wrapperComponentSelector is only used for Angular v13 and below, starting with v14 you need to use a standalone component wrapper with ``');
}
return wrapComponent(options.hostElement, options.wrapper, componentsToLoad, options.appConfig);
- } else {
+ }
const selectors: string[] = [];
componentsToLoad.forEach((component: Type) => {
const selector = getCmpSelector(component);
@@ -214,10 +214,10 @@ export async function ngBootstrap(modulesOrComponents: Type | Type[
}
return bootstrap(parentModule || AppModule, undefined, options.appConfig);
- }
- } else {
- throw new Error('Unable to load any composition, the Angular env can only load modules or components');
+
}
+ throw new Error('Unable to load any composition, the Angular env can only load modules or components');
+
} else { // for v13 and below we need to use angular elements to be able to load standalone components
// if (options.wrapperComponent) {
// throw new Error('WrapperComponent is only supported in Angular v14 and above');
diff --git a/scopes/dev-services/preview/angular-runtime/main.ts b/scopes/dev-services/preview/angular-runtime/main.ts
index dfccb7cb..a57eb826 100644
--- a/scopes/dev-services/preview/angular-runtime/main.ts
+++ b/scopes/dev-services/preview/angular-runtime/main.ts
@@ -8,7 +8,7 @@ class AppComponent {
// @ts-ignore
AppComponent.ɵfac = function AppComponent_Factory(t) { return new (t || AppComponent)(); };
// @ts-ignore
-AppComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AppComponent, selectors: [["app-root"]], decls: 0, vars: 0, template: function AppComponent_Template(rf, ctx) { }, encapsulation: 2 });
+AppComponent.ɵcmp = /* @__PURE__ */ i0.ɵɵdefineComponent({ type: AppComponent, selectors: [["app-root"]], decls: 0, vars: 0, template: function AppComponent_Template(rf, ctx) { }, encapsulation: 2 });
(function () { // @ts-ignore
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppComponent, [{
type: i0.Component,
@@ -24,9 +24,9 @@ class AppModule {
// @ts-ignore
AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); };
// @ts-ignore
-AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule });
+AppModule.ɵmod = /* @__PURE__ */ i0.ɵɵdefineNgModule({ type: AppModule });
// @ts-ignore
-AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [[BrowserModule]] });
+AppModule.ɵinj = /* @__PURE__ */ i0.ɵɵdefineInjector({ imports: [[BrowserModule]] });
(function () { // @ts-ignore
(typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppModule, [{
type: i0.NgModule,
diff --git a/scopes/dev-services/preview/preview/mounter.ts b/scopes/dev-services/preview/preview/mounter.ts
index 0015a47c..a681ee30 100644
--- a/scopes/dev-services/preview/preview/mounter.ts
+++ b/scopes/dev-services/preview/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import { createMounter } from '@teambit/angular-mounter';
export default createMounter();
diff --git a/scopes/forks/angular-env-default/my-angular-env.bit-env.ts b/scopes/forks/angular-env-default/my-angular-env.bit-env.ts
index 136380dc..2853afad 100644
--- a/scopes/forks/angular-env-default/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-default/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularEnv {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-default/preview/mounter.ts b/scopes/forks/angular-env-default/preview/mounter.ts
index 56ca3a8b..7a974b6b 100644
--- a/scopes/forks/angular-env-default/preview/mounter.ts
+++ b/scopes/forks/angular-env-default/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import { createMounter } from '@teambit/angular-mounter';
import { Component, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/forks/angular-env-v12/my-angular-env.bit-env.ts b/scopes/forks/angular-env-v12/my-angular-env.bit-env.ts
index 668656c0..cb1a6656 100644
--- a/scopes/forks/angular-env-v12/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-v12/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularV12Env {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-v12/preview/mounter.ts b/scopes/forks/angular-env-v12/preview/mounter.ts
index d0ea7780..e7f3e6c2 100644
--- a/scopes/forks/angular-env-v12/preview/mounter.ts
+++ b/scopes/forks/angular-env-v12/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable */
import { createMounter } from '@teambit/angular-mounter';
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/forks/angular-env-v13/my-angular-env.bit-env.ts b/scopes/forks/angular-env-v13/my-angular-env.bit-env.ts
index 2704f60f..aafe1333 100644
--- a/scopes/forks/angular-env-v13/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-v13/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularV13Env {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-v13/preview/mounter.ts b/scopes/forks/angular-env-v13/preview/mounter.ts
index d0ea7780..e7f3e6c2 100644
--- a/scopes/forks/angular-env-v13/preview/mounter.ts
+++ b/scopes/forks/angular-env-v13/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable */
import { createMounter } from '@teambit/angular-mounter';
import { Component, NgModule, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/forks/angular-env-v14/my-angular-env.bit-env.ts b/scopes/forks/angular-env-v14/my-angular-env.bit-env.ts
index fcf33f1b..34d3a2a4 100644
--- a/scopes/forks/angular-env-v14/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-v14/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularV14Env {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-v14/preview/mounter.ts b/scopes/forks/angular-env-v14/preview/mounter.ts
index 274c3216..5ec70032 100644
--- a/scopes/forks/angular-env-v14/preview/mounter.ts
+++ b/scopes/forks/angular-env-v14/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import { createMounter } from '@teambit/angular-mounter';
import { Component, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/forks/angular-env-v15/my-angular-env.bit-env.ts b/scopes/forks/angular-env-v15/my-angular-env.bit-env.ts
index 843fd942..8551b15a 100644
--- a/scopes/forks/angular-env-v15/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-v15/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularV15Env {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-v15/preview/mounter.ts b/scopes/forks/angular-env-v15/preview/mounter.ts
index 274c3216..5ec70032 100644
--- a/scopes/forks/angular-env-v15/preview/mounter.ts
+++ b/scopes/forks/angular-env-v15/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import { createMounter } from '@teambit/angular-mounter';
import { Component, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/forks/angular-env-v16/my-angular-env.bit-env.ts b/scopes/forks/angular-env-v16/my-angular-env.bit-env.ts
index b8fb54f9..465e9adf 100644
--- a/scopes/forks/angular-env-v16/my-angular-env.bit-env.ts
+++ b/scopes/forks/angular-env-v16/my-angular-env.bit-env.ts
@@ -110,11 +110,10 @@ export class MyAngularEnv extends AngularV16Env {
*/
override generators(): EnvHandler {
const envName = this.constructor.name;
- const angularVersion = this.angularVersion;
return TemplateList.from([
- NgModuleTemplate.from({envName, angularVersion}),
- NgEnvTemplate.from({envName, angularVersion}),
- NgAppTemplate.from({envName, angularVersion})
+ NgModuleTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgEnvTemplate.from({envName, angularVersion: this.angularVersion}),
+ NgAppTemplate.from({envName, angularVersion: this.angularVersion})
]);
}
diff --git a/scopes/forks/angular-env-v16/preview/mounter.ts b/scopes/forks/angular-env-v16/preview/mounter.ts
index 274c3216..5ec70032 100644
--- a/scopes/forks/angular-env-v16/preview/mounter.ts
+++ b/scopes/forks/angular-env-v16/preview/mounter.ts
@@ -1,3 +1,4 @@
+/* eslint-disable import/no-unresolved */
import { createMounter } from '@teambit/angular-mounter';
import { Component, ViewEncapsulation } from '@angular/core';
diff --git a/scopes/generators/angular-starters/design-system/index.ts b/scopes/generators/angular-starters/design-system/index.ts
index 98966b1c..cc833a81 100644
--- a/scopes/generators/angular-starters/design-system/index.ts
+++ b/scopes/generators/angular-starters/design-system/index.ts
@@ -1,10 +1,10 @@
import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';
import { AngularComponentTemplateOptions } from '@teambit/angular-common';
+import { EnvContext, EnvHandler } from '@teambit/envs';
+import PkgAspect, { PkgMain } from '@teambit/pkg';
import { launchJson } from '../common/launch-json';
import { workspaceConfig } from '../common/workspace-config';
import { gitIgnore } from '../common/git-ignore';
-import { EnvContext, EnvHandler } from '@teambit/envs';
-import PkgAspect, { PkgMain } from '@teambit/pkg';
import { DEFAULT_SCOPE_NAME } from '../constants';
export class DesignSystemStarter implements WorkspaceTemplate {
diff --git a/scopes/generators/angular-starters/index.ts b/scopes/generators/angular-starters/index.ts
index f40d3a62..7ded0330 100644
--- a/scopes/generators/angular-starters/index.ts
+++ b/scopes/generators/angular-starters/index.ts
@@ -1,4 +1,5 @@
import { AngularStarter } from './ng-workspace';
+
export { AngularStarter, /** @deprecated */ AngularStarter as NgWorkspaceTemplate } from './ng-workspace';
export { DesignSystemStarter } from './design-system';
export { MaterialDesignSystemStarter } from './material-design-system';
diff --git a/scopes/generators/angular-starters/material-design-system/index.ts b/scopes/generators/angular-starters/material-design-system/index.ts
index c065a813..688c2305 100644
--- a/scopes/generators/angular-starters/material-design-system/index.ts
+++ b/scopes/generators/angular-starters/material-design-system/index.ts
@@ -1,10 +1,10 @@
import { WorkspaceContext, WorkspaceTemplate } from '@teambit/generator';
import { AngularComponentTemplateOptions } from '@teambit/angular-common';
+import { EnvContext, EnvHandler } from '@teambit/envs';
+import PkgAspect, { PkgMain } from '@teambit/pkg';
import { launchJson } from '../common/launch-json';
import { workspaceConfig } from '../common/workspace-config';
import { gitIgnore } from '../common/git-ignore';
-import { EnvContext, EnvHandler } from '@teambit/envs';
-import PkgAspect, { PkgMain } from '@teambit/pkg';
import { DEFAULT_SCOPE_NAME } from '../constants';
export class MaterialDesignSystemStarter implements WorkspaceTemplate {
diff --git a/scopes/generators/angular-templates/ng-app/template-files/index.ts b/scopes/generators/angular-templates/ng-app/template-files/index.ts
index 1d1c671a..8a7c7567 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/index.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/index.ts
@@ -1,11 +1,11 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const indexFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
+ const { name } = context;
return {
relativePath: `index.ts`,
isMain: true,
content: `export * from './${name}.ng-app';
-`,
+`
};
};
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-html.ts b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-html.ts
index e98384f8..e62ebcdd 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-html.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-html.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const appComponentHtmlFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/app/app.component.html`,
content: `
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-scss.ts b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-scss.ts
index f5743870..cacb35bd 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-scss.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-scss.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const appComponentScssFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/app/app.component.scss`,
content: ``,
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-spec.ts b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-spec.ts
index e3ff014a..b2785ae9 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-spec.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component-spec.ts
@@ -1,7 +1,7 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const appComponentSpecFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
+ const { name } = context;
return {
relativePath: `src/app/app.component.spec.ts`,
content: `import { TestBed } from '@angular/core/testing';
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component.ts b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component.ts
index b1be69eb..2f5b11ad 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.component.ts
@@ -1,7 +1,7 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const appComponentFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
+ const { name } = context;
return {
relativePath: `src/app/app.component.ts`,
content: `import { Component } from '@angular/core';
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.module.ts b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.module.ts
index 85435e6f..855f35a8 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/app/app.module.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/app/app.module.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const appModuleFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/app/app.module.ts`,
content: `import { NgModule } from '@angular/core';
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/assets/gitkeep.ts b/scopes/generators/angular-templates/ng-app/template-files/src/assets/gitkeep.ts
index bbae5f1f..b382fd18 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/assets/gitkeep.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/assets/gitkeep.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const gitKeepFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/assets/.gitkeep`,
content: ``,
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.prod.ts b/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.prod.ts
index 0a08ed0e..4f527630 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.prod.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.prod.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const environmentProdFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/environments/environment.prod.ts`,
content: `export const environment = {
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.ts b/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.ts
index d8dcc190..85084639 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/environments/environment.ts
@@ -1,7 +1,6 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const environmentFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
return {
relativePath: `src/environments/environment.ts`,
content: `// This file can be replaced during build by using the \`fileReplacements\` array.
diff --git a/scopes/generators/angular-templates/ng-app/template-files/src/index-html.ts b/scopes/generators/angular-templates/ng-app/template-files/src/index-html.ts
index 790e57bc..5522d02f 100644
--- a/scopes/generators/angular-templates/ng-app/template-files/src/index-html.ts
+++ b/scopes/generators/angular-templates/ng-app/template-files/src/index-html.ts
@@ -1,7 +1,7 @@
import { ComponentContext, ComponentFile } from '@teambit/generator';
export const indexHtmlFile = (context: ComponentContext): ComponentFile => {
- const { name, namePascalCase: Name } = context;
+ const { namePascalCase: Name } = context;
return {
relativePath: `src/index.html`,
content: `
@@ -17,6 +17,6 @@ export const indexHtmlFile = (context: ComponentContext): ComponentFile => {