From 4fe7ffc38659a5a35cb7a0d75386cd8ee70f1b3b Mon Sep 17 00:00:00 2001 From: Olivier Combe Date: Fri, 6 Sep 2024 15:13:24 +0200 Subject: [PATCH] fix preview issues --- .bitmap | 107 +++++++----------- .../app-types/angular-app-type/component.json | 6 +- angular/devkit/common/component.json | 2 +- angular/devkit/common/utils.ts | 67 ++++++++++- .../elements/angular-elements.compiler.ts | 4 +- .../devkit/compiler/elements/component.json | 2 +- .../compiler/multi-compiler/component.json | 2 +- .../devkit/compiler/ng-packagr/component.json | 2 +- .../ng-packagr/ng-packagr.compiler.ts | 10 +- angular/devkit/linter/eslint/component.json | 2 +- angular/devkit/ng-compat/component.json | 2 +- angular/devkit/preview/mounter/component.json | 2 +- angular/devkit/preview/preview/component.json | 2 +- angular/devkit/preview/runtime/component.json | 2 +- angular/devkit/preview/runtime/loader.ts | 1 - angular/devkit/webpack/component.json | 2 +- angular/devkit/webpack/ng-webpack-bundler.ts | 4 +- .../devkit/webpack/ng-webpack-dev-server.ts | 4 +- .../webpack-plugins/angular-resolver.ts | 10 +- angular/envs/angular-env/component.json | 6 +- angular/envs/angular-v13-env/component.json | 6 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/angular-v14-env/component.json | 6 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/angular-v15-env/component.json | 6 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/angular-v16-env/component.json | 6 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/angular-v17-env/component.json | 6 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/angular-v18-env/component.json | 2 +- .../webpack/webpack5.build.config.ts | 6 +- .../webpack/webpack5.serve.config.ts | 8 +- angular/envs/base-env/component.json | 2 +- .../examples/my-angular-env/component.json | 6 +- .../my-angular-v13-env/component.json | 6 +- angular/examples/my-angular-v13-env/env.jsonc | 5 + .../my-angular-v14-env/component.json | 6 +- angular/examples/my-angular-v14-env/env.jsonc | 5 + .../my-angular-v15-env/component.json | 6 +- angular/examples/my-angular-v15-env/env.jsonc | 5 + .../my-angular-v16-env/component.json | 6 +- angular/examples/my-angular-v16-env/env.jsonc | 14 ++- .../my-angular-v17-env/component.json | 6 +- .../my-angular-v18-env/component.json | 6 +- workspace.jsonc | 2 + 51 files changed, 261 insertions(+), 169 deletions(-) diff --git a/.bitmap b/.bitmap index 084bb97..9a7ab6f 100644 --- a/.bitmap +++ b/.bitmap @@ -12,91 +12,91 @@ "angular-env": { "name": "angular-env", "scope": "bitdev.angular", - "version": "b82d566c26cec2544054e84bb883724986691962", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-env" }, "app-types/angular-app-type": { "name": "app-types/angular-app-type", "scope": "bitdev.angular", - "version": "6.0.3", + "version": "6.0.4", "mainFile": "index.ts", "rootDir": "angular/app-types/angular-app-type" }, "dev-services/common": { "name": "dev-services/common", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/common" }, "dev-services/compiler/elements": { "name": "dev-services/compiler/elements", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/compiler/elements" }, "dev-services/compiler/multi-compiler": { "name": "dev-services/compiler/multi-compiler", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/compiler/multi-compiler" }, "dev-services/compiler/ng-packagr": { "name": "dev-services/compiler/ng-packagr", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/compiler/ng-packagr" }, "dev-services/linter/eslint": { "name": "dev-services/linter/eslint", "scope": "bitdev.angular", - "version": "3.0.2", + "version": "3.0.3", "mainFile": "index.js", "rootDir": "angular/devkit/linter/eslint" }, "dev-services/ng-compat": { "name": "dev-services/ng-compat", "scope": "bitdev.angular", - "version": "3.0.1", + "version": "3.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/ng-compat" }, "dev-services/preview/mounter": { "name": "dev-services/preview/mounter", "scope": "bitdev.angular", - "version": "3.0.2", + "version": "3.0.3", "mainFile": "index.ts", "rootDir": "angular/devkit/preview/mounter" }, "dev-services/preview/preview": { "name": "dev-services/preview/preview", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/preview/preview" }, "dev-services/preview/preview-app": { "name": "dev-services/preview/preview-app", "scope": "bitdev.angular", - "version": "1.0.1", + "version": "1.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/preview/preview-app" }, "dev-services/preview/runtime": { "name": "dev-services/preview/runtime", "scope": "bitdev.angular", - "version": "3.0.2", + "version": "3.0.3", "mainFile": "index.ts", "rootDir": "angular/devkit/preview/runtime" }, "dev-services/webpack": { "name": "dev-services/webpack", "scope": "bitdev.angular", - "version": "6.0.1", + "version": "6.0.2", "mainFile": "index.ts", "rootDir": "angular/devkit/webpack" }, @@ -250,166 +250,135 @@ "envs/angular-v13-env": { "name": "envs/angular-v13-env", "scope": "bitdev.angular", - "version": "48cd2655863d31a4664712f252ad1dbae704976e", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v13-env" }, "envs/angular-v14-env": { "name": "envs/angular-v14-env", "scope": "bitdev.angular", - "version": "b7ef8ad1cae4245d069e5763075b013959d65a3b", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v14-env" }, "envs/angular-v15-env": { "name": "envs/angular-v15-env", "scope": "bitdev.angular", - "version": "9eeb2c20c29b6836bf853ee25f98a2c4d913c230", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v15-env" }, "envs/angular-v16-env": { "name": "envs/angular-v16-env", "scope": "bitdev.angular", - "version": "ca6d375d809b84264aa196728716bedce960117f", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v16-env" }, "envs/angular-v17-env": { "name": "envs/angular-v17-env", "scope": "bitdev.angular", - "version": "24bed6ff7072f1bc1378c8d722c45e7738024a18", + "version": "5.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v17-env" }, "envs/angular-v18-env": { "name": "envs/angular-v18-env", "scope": "bitdev.angular", - "version": "a764eff839148d06eb1f2e0037255bca5626783a", + "version": "1.0.5", "mainFile": "index.ts", "rootDir": "angular/envs/angular-v18-env" }, "envs/base-env": { "name": "envs/base-env", "scope": "bitdev.angular", - "version": "1f85bffa7cab3a5db9891da9b315926f90381381", + "version": "6.0.4", "mainFile": "index.ts", "rootDir": "angular/envs/base-env" }, "examples/my-angular-env": { "name": "examples/my-angular-env", "scope": "bitdev.angular", - "version": "859b7a7ef6276d42ac43383608e67eedf937dc64", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-env" }, "examples/my-angular-v13-env": { "name": "examples/my-angular-v13-env", "scope": "bitdev.angular", - "version": "55f0f0e622bffdaf9ab4345c5f68294101a4609b", + "version": "5.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v13-env" }, "examples/my-angular-v14-env": { "name": "examples/my-angular-v14-env", "scope": "bitdev.angular", - "version": "e89f16b83171e24a6a3bc81586cb6b1ef3c92efb", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v14-env" }, "examples/my-angular-v15-env": { "name": "examples/my-angular-v15-env", "scope": "bitdev.angular", - "version": "4433dcf95dc89c223ee37569da04f4aa100c91e3", + "version": "6.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v15-env" }, "examples/my-angular-v16-env": { "name": "examples/my-angular-v16-env", "scope": "bitdev.angular", - "version": "709ece37b4de6da8b8352be45a3fef44ef4de6ad", + "version": "5.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v16-env" }, "examples/my-angular-v17-env": { "name": "examples/my-angular-v17-env", "scope": "bitdev.angular", - "version": "f0c73d62b7e1e92a26216e1d6e045ae9af977efc", + "version": "5.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v17-env" }, "examples/my-angular-v18-env": { "name": "examples/my-angular-v18-env", "scope": "bitdev.angular", - "version": "ba67b840b87042b4fb6c748df9cc7dab1292fa39", + "version": "1.0.5", "mainFile": "index.ts", "rootDir": "angular/examples/my-angular-v18-env" }, "integration/demo-lib": { "name": "integration/demo-lib", "scope": "bitdev.angular", - "version": "56cf7ba13dff1b0be0d4c04e8b995019b82e0ccf", + "version": "0.0.2", "mainFile": "public-api.ts", - "rootDir": "angular/integration/demo-lib", - "onLanesOnly": true, - "isAvailableOnCurrentLane": true + "rootDir": "angular/integration/demo-lib" }, "integration/demo-lib-v15": { "name": "integration/demo-lib-v15", "scope": "bitdev.angular", - "version": "3e44b7e7a187a24708afefeededa7d62ae722d01", + "version": "0.0.2", "mainFile": "public-api.ts", - "rootDir": "angular/integration/demo-lib-v15", - "onLanesOnly": true, - "isAvailableOnCurrentLane": true + "rootDir": "angular/integration/demo-lib-v15" }, "integration/demo-lib-v16": { "name": "integration/demo-lib-v16", "scope": "bitdev.angular", - "version": "220758d582bbbceb2dd8c6a2baa436cee2d93ac2", + "version": "0.0.2", "mainFile": "public-api.ts", - "rootDir": "angular/integration/demo-lib-v16", - "onLanesOnly": true, - "isAvailableOnCurrentLane": true + "rootDir": "angular/integration/demo-lib-v16" }, "integration/demo-lib-v17": { "name": "integration/demo-lib-v17", "scope": "bitdev.angular", - "version": "7da8a7d418f5e34905a462b08bb013016eddd99c", + "version": "0.0.2", "mainFile": "public-api.ts", - "rootDir": "angular/integration/demo-lib-v17", - "onLanesOnly": true, - "isAvailableOnCurrentLane": true + "rootDir": "angular/integration/demo-lib-v17" }, "integration/demo-lib-v18": { "name": "integration/demo-lib-v18", "scope": "bitdev.angular", - "version": "59088ec1991ecbb1f217271ee0855d9b26169860", + "version": "0.0.2", "mainFile": "public-api.ts", - "rootDir": "angular/integration/demo-lib-v18", - "onLanesOnly": true, - "isAvailableOnCurrentLane": true - }, - "templates/generators": { - "name": "templates/generators", - "scope": "bitdev.angular", - "version": "6.0.1", - "mainFile": "index.ts", - "rootDir": "angular/templates/generators" - }, - "templates/starters": { - "name": "templates/starters", - "scope": "bitdev.angular", - "version": "6.0.1", - "mainFile": "index.ts", - "rootDir": "angular/templates/starters" + "rootDir": "angular/integration/demo-lib-v18" }, - "$schema-version": "17.0.0", - "_bit_lane": { - "id": { - "name": "fix-build-ts", - "scope": "bitdev.angular" - }, - "exported": true - } + "$schema-version": "17.0.0" } \ No newline at end of file diff --git a/angular/app-types/angular-app-type/component.json b/angular/app-types/angular-app-type/component.json index de1043e..bf64465 100644 --- a/angular/app-types/angular-app-type/component.json +++ b/angular/app-types/angular-app-type/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "app-types/angular-app-type", - "version": "6.0.3" + "version": "6.0.4" }, "propagate": false, "extensions": { @@ -25,9 +25,7 @@ } }, "bitdev.node/node-env@2.0.2": {}, - "teambit.envs/envs": { - "env": "bitdev.node/node-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/devkit/common/component.json b/angular/devkit/common/component.json index a885d97..8122359 100644 --- a/angular/devkit/common/component.json +++ b/angular/devkit/common/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/common", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/common/utils.ts b/angular/devkit/common/utils.ts index d6ce162..48719dc 100644 --- a/angular/devkit/common/utils.ts +++ b/angular/devkit/common/utils.ts @@ -8,6 +8,8 @@ import { Logger } from '@teambit/logger'; import { PkgMain } from '@teambit/pkg'; import TesterAspect from '@teambit/tester'; import WorkspaceAspect, { Workspace } from '@teambit/workspace'; +import { ScopeMain } from '@teambit/scope'; +import { getRootComponentDir } from '@teambit/workspace.root-components'; import { outputFileSync } from 'fs-extra'; // @ts-ignore import normalize from 'normalize-path'; @@ -51,14 +53,31 @@ export function getWorkspace(context: EnvContext | AppContext): Workspace | unde return undefined; } -export function getNodeModulesPaths(build: boolean, isolator: IsolatorMain, workspace?: Workspace, capsuleOnly = false): string[] { +function getRootComponentDirByRootId(rootComponentsPath: string, rootComponentId: ComponentID, workspace: Workspace): string { + // Root directories for local envs and apps are created without their version number. + // This is done to avoid changes to the lockfile after such components are tagged. + const id = workspace.hasId(rootComponentId) + ? rootComponentId.toStringWithoutVersion() + : rootComponentId.toString(); + return getRootComponentDir(rootComponentsPath, id); +} + +export function getNodeModulesPaths(build: boolean, isolator: IsolatorMain, envId: ComponentID, scope: ScopeMain, workspace?: Workspace, capsuleOnly = false): string[] { const nodeModulesPaths: string[] = []; + const aspectsLoader = scope.getScopeAspectsLoader(); + const aspectsOpts = aspectsLoader.getIsolateOpts(); + if (workspace) { const workspaceDir = workspace.path; - const scopeAspectsRootDir = isolator.getCapsulesRootDir({ baseDir: workspace.scope.getAspectCapsulePath() }); + const scopeAspectsRootDir = isolator.getCapsulesRootDir({ baseDir: scope.getAspectCapsulePath() }); const workspaceCapsulesRootDir = build ? isolator.getCapsulesRootDir({ baseDir: workspace.path }) : undefined; + // Add the root components node modules (.bit_roots/env) + const rootCmpDir = workspace.rootComponentsPath; + const rootCmpEnvDir = getRootComponentDirByRootId(rootCmpDir, envId, workspace); + nodeModulesPaths.push(resolve(rootCmpEnvDir, 'node_modules')); + const workspaceNodeModules = resolve(workspaceDir, 'node_modules'); if (workspaceCapsulesRootDir) { @@ -78,6 +97,14 @@ export function getNodeModulesPaths(build: boolean, isolator: IsolatorMain, work if (!capsuleOnly) { nodeModulesPaths.push(workspaceNodeModules, 'node_modules'); } + } else { // ripple, bit sign, ... + const baseDir = scope.getAspectCapsulePath(); + // check dated-dirs (ripple only) + const capsulesDatedDir = isolator.getCapsulesRootDir({ baseDir, useDatedDirs: true, datedDirId: aspectsOpts.datedDirId }); + nodeModulesPaths.push(resolve(capsulesDatedDir, 'node_modules')); + + const capsulesDefaultDir = isolator.getCapsulesRootDir({ baseDir }); + nodeModulesPaths.push(resolve(capsulesDefaultDir, 'node_modules')); } if (!nodeModulesPaths.includes('node_modules')) { @@ -268,3 +295,39 @@ export function getLoggerApi(logger: Logger) { createChild: () => logger } as any; } + +export function addSafeResolve(path: string): string | undefined { + try { + return require.resolve(path); + } catch(_e) { + return undefined; + } +} + +export function getWebpackAngularAliases() { + const aliases: { [key: string]: string } = {}; + + [ + '@angular/core/primitives/signals', + '@angular/core/primitives/event-dispatch', + '@angular/core', + '@angular/common/http', + '@angular/common', + '@angular/animations/browser', + '@angular/animations', + '@angular/cli', + '@angular/compiler', + '@angular/compiler-cli', + '@angular/platform-browser/animations', + '@angular/platform-browser', + '@angular/platform-browser-dynamic', + '@angular/router' + ].forEach((pkg) => { + const resolved = addSafeResolve(pkg); + if (resolved) { + aliases[pkg] = resolved; + } + }); + + return aliases; +} diff --git a/angular/devkit/compiler/elements/angular-elements.compiler.ts b/angular/devkit/compiler/elements/angular-elements.compiler.ts index 2b75a58..0d956de 100644 --- a/angular/devkit/compiler/elements/angular-elements.compiler.ts +++ b/angular/devkit/compiler/elements/angular-elements.compiler.ts @@ -20,6 +20,7 @@ import { EnvContext, EnvHandler } from '@teambit/envs'; import { IsolatorAspect, IsolatorMain } from '@teambit/isolator'; import { Timer } from '@teambit/legacy/dist/toolbox/timer'; import { Logger } from '@teambit/logger'; +import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { Workspace } from '@teambit/workspace'; import chalk from 'chalk'; import { extname, join } from 'path'; @@ -187,7 +188,8 @@ Built Angular Compositions const compositions = context.getAspect(CompositionsAspect.id); const application = context.getAspect(ApplicationAspect.id); const isolator = context.getAspect(IsolatorAspect.id); - const nodeModulesPaths = getNodeModulesPaths(true, isolator, workspace); + const scope = context.getAspect(ScopeAspect.id); + const nodeModulesPaths = getNodeModulesPaths(true, isolator, context.envId, scope, workspace); return new AngularElementsCompiler( logger, diff --git a/angular/devkit/compiler/elements/component.json b/angular/devkit/compiler/elements/component.json index 0c2a66e..b098b52 100644 --- a/angular/devkit/compiler/elements/component.json +++ b/angular/devkit/compiler/elements/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/compiler/elements", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/compiler/multi-compiler/component.json b/angular/devkit/compiler/multi-compiler/component.json index a2fbcdd..1364781 100644 --- a/angular/devkit/compiler/multi-compiler/component.json +++ b/angular/devkit/compiler/multi-compiler/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/compiler/multi-compiler", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/compiler/ng-packagr/component.json b/angular/devkit/compiler/ng-packagr/component.json index a92ee59..ba0833a 100644 --- a/angular/devkit/compiler/ng-packagr/component.json +++ b/angular/devkit/compiler/ng-packagr/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/compiler/ng-packagr", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/compiler/ng-packagr/ng-packagr.compiler.ts b/angular/devkit/compiler/ng-packagr/ng-packagr.compiler.ts index 2caba9a..1795523 100644 --- a/angular/devkit/compiler/ng-packagr/ng-packagr.compiler.ts +++ b/angular/devkit/compiler/ng-packagr/ng-packagr.compiler.ts @@ -1,5 +1,5 @@ // @ts-ignore -import type { AngularCompilerOptions, CompilerOptions, ParsedConfiguration} from '@angular/compiler-cli'; +import type { AngularCompilerOptions, CompilerOptions, ParsedConfiguration } from '@angular/compiler-cli'; import { AngularEnvOptions, componentIsApp, @@ -13,7 +13,7 @@ import { BuiltTaskResult, ComponentResult } from '@teambit/builder'; -import { CompilationInitiator, Compiler, TranspileComponentParams } from '@teambit/compiler'; +import { Compiler, TranspileComponentParams } from '@teambit/compiler'; import { Component } from '@teambit/component'; import { DependencyResolverAspect, DependencyResolverMain } from '@teambit/dependency-resolver'; import { EnvContext, EnvHandler } from '@teambit/envs'; @@ -22,6 +22,7 @@ import { IsolatorAspect, IsolatorMain } from '@teambit/isolator'; import { PACKAGE_JSON } from '@teambit/legacy/dist/constants.js'; import PackageJsonFile from '@teambit/legacy/dist/consumer/component/package-json-file.js'; import { Logger } from '@teambit/logger'; +import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { Workspace } from '@teambit/workspace'; import chalk from 'chalk'; // @ts-ignore @@ -29,8 +30,8 @@ import { mkdirsSync, outputFileSync, removeSync } from 'fs-extra/esm'; import type { NgPackageConfig } from 'ng-packagr/ng-package.schema.js'; import { createRequire } from 'node:module'; import { join, posix, resolve } from 'node:path'; -import ts from 'typescript'; import type { Diagnostic, DiagnosticWithLocation } from 'typescript'; +import ts from 'typescript'; const ViewEngineTemplateError = `Cannot read property 'type' of null`; const NG_PACKAGE_JSON = 'ng-package.json'; @@ -424,7 +425,8 @@ export class NgPackagrCompiler implements Compiler { const application = context.getAspect(ApplicationAspect.id); const depResolver = context.getAspect(DependencyResolverAspect.id); const isolator = context.getAspect(IsolatorAspect.id); - const nodeModulesPaths = getNodeModulesPaths(true, isolator, workspace, true); + const scope = context.getAspect(ScopeAspect.id); + const nodeModulesPaths = getNodeModulesPaths(true, isolator, context.envId, scope, workspace, true); return new NgPackagrCompiler( ngPackagrModulePath, diff --git a/angular/devkit/linter/eslint/component.json b/angular/devkit/linter/eslint/component.json index f299821..0d744b5 100644 --- a/angular/devkit/linter/eslint/component.json +++ b/angular/devkit/linter/eslint/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/linter/eslint", - "version": "3.0.2" + "version": "3.0.3" }, "propagate": false, "extensions": { diff --git a/angular/devkit/ng-compat/component.json b/angular/devkit/ng-compat/component.json index 784dde3..80d983f 100644 --- a/angular/devkit/ng-compat/component.json +++ b/angular/devkit/ng-compat/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/ng-compat", - "version": "3.0.1" + "version": "3.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/preview/mounter/component.json b/angular/devkit/preview/mounter/component.json index 51b6c22..4a4815e 100644 --- a/angular/devkit/preview/mounter/component.json +++ b/angular/devkit/preview/mounter/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/preview/mounter", - "version": "3.0.2" + "version": "3.0.3" }, "propagate": false, "extensions": { diff --git a/angular/devkit/preview/preview/component.json b/angular/devkit/preview/preview/component.json index a26da3b..8a81ac8 100644 --- a/angular/devkit/preview/preview/component.json +++ b/angular/devkit/preview/preview/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/preview/preview", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/preview/runtime/component.json b/angular/devkit/preview/runtime/component.json index 023f6c2..1156983 100644 --- a/angular/devkit/preview/runtime/component.json +++ b/angular/devkit/preview/runtime/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/preview/runtime", - "version": "3.0.2" + "version": "3.0.3" }, "propagate": false, "extensions": { diff --git a/angular/devkit/preview/runtime/loader.ts b/angular/devkit/preview/runtime/loader.ts index 2f9b94a..a155383 100644 --- a/angular/devkit/preview/runtime/loader.ts +++ b/angular/devkit/preview/runtime/loader.ts @@ -132,7 +132,6 @@ async function getComponentsToLoad(modulesOrComponents: Type[], renderSt console.error(`Unknown type of composition for ${moduleOrComponent.name || moduleOrComponent}, the Angular env can only load modules or components`); } } - return { componentsToLoad, parentModule }; } diff --git a/angular/devkit/webpack/component.json b/angular/devkit/webpack/component.json index 7cdb21c..255d6b9 100644 --- a/angular/devkit/webpack/component.json +++ b/angular/devkit/webpack/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "dev-services/webpack", - "version": "6.0.1" + "version": "6.0.2" }, "propagate": false, "extensions": { diff --git a/angular/devkit/webpack/ng-webpack-bundler.ts b/angular/devkit/webpack/ng-webpack-bundler.ts index b550e2c..1e9a016 100644 --- a/angular/devkit/webpack/ng-webpack-bundler.ts +++ b/angular/devkit/webpack/ng-webpack-bundler.ts @@ -16,6 +16,7 @@ import { AsyncEnvHandler, EnvContext } from '@teambit/envs'; import { IsolatorAspect, IsolatorMain } from '@teambit/isolator'; import { CACHE_ROOT } from '@teambit/legacy/dist/constants'; import { PkgAspect, PkgMain } from '@teambit/pkg'; +import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { GlobalWebpackConfigTransformContext, WebpackAspect, @@ -80,6 +81,7 @@ export class NgWebpackBundler { const pkg = context.getAspect(PkgAspect.id); const application = context.getAspect(ApplicationAspect.id); const isolator = context.getAspect(IsolatorAspect.id); + const scope = context.getAspect(ScopeAspect.id); const webpackMain = context.getAspect(WebpackAspect.id); const devFilesMain = context.getAspect(DevFilesAspect.id); @@ -120,7 +122,7 @@ export class NgWebpackBundler { entryFiles: target.entries as string[], logger, // keep first argument to be false, to avoid issues when building apps - nodeModulesPaths: getNodeModulesPaths(false, isolator, workspace), + nodeModulesPaths: getNodeModulesPaths(false, isolator, context.envId, scope, workspace), plugins, rootPath: options.appRootPath, setup: BundlerSetup.Build, diff --git a/angular/devkit/webpack/ng-webpack-dev-server.ts b/angular/devkit/webpack/ng-webpack-dev-server.ts index 933621f..9cbf326 100644 --- a/angular/devkit/webpack/ng-webpack-dev-server.ts +++ b/angular/devkit/webpack/ng-webpack-dev-server.ts @@ -18,6 +18,7 @@ import { IsolatorAspect, IsolatorMain } from '@teambit/isolator'; import { CACHE_ROOT } from '@teambit/legacy/dist/constants'; import { PkgAspect, PkgMain } from '@teambit/pkg'; import { PubsubMain } from '@teambit/pubsub'; +import { ScopeAspect, ScopeMain } from '@teambit/scope'; import { WebpackAspect, WebpackConfigDevServerTransformContext, @@ -81,6 +82,7 @@ export class NgWebpackDevServer { const pkg = context.getAspect(PkgAspect.id); const application = context.getAspect(ApplicationAspect.id); const isolator = context.getAspect(IsolatorAspect.id); + const scope = context.getAspect(ScopeAspect.id); const devFilesMain = context.getAspect(DevFilesAspect.id); let tempFolder: string; @@ -130,7 +132,7 @@ export class NgWebpackDevServer { entryFiles: devServerContext.entry, isApp, logger, - nodeModulesPaths: getNodeModulesPaths(false, isolator, workspace), + nodeModulesPaths: getNodeModulesPaths(false, isolator, context.envId, scope, workspace), plugins: [], publicPath: devServerContext.publicPath, publicRoot: devServerContext.rootPath, diff --git a/angular/devkit/webpack/webpack-plugins/angular-resolver.ts b/angular/devkit/webpack/webpack-plugins/angular-resolver.ts index 0c2bee8..1060b10 100644 --- a/angular/devkit/webpack/webpack-plugins/angular-resolver.ts +++ b/angular/devkit/webpack/webpack-plugins/angular-resolver.ts @@ -77,6 +77,8 @@ export interface PackageJsonFormatPropertiesMap { esm2020?: string; esm2022?: string; esm5?: string; + esm?: string; + require?: string; main?: string; // UMD module?: string; // if exists then it is actually FESM5 types?: string; // Synonymous to `typings` property - see https://bit.ly/2OgWp2H @@ -94,6 +96,7 @@ export const SUPPORTED_FORMAT_PROPERTIES: EntryPointJsonProperty[] = const OLD_ANGULAR_FORMATS: EntryPointJsonProperty[] = ['fesm2020', 'fesm2015', 'fesm5']; const POST_IVY_ANGULAR_FORMATS: PackageJsonFormatProperties[] = ['types', 'esm2020', 'es2020', 'es2015', 'default']; const V16_ANGULAR_FORMATS: PackageJsonFormatProperties[] = ['types', 'fesm2022', 'es2022', 'default']; +const V17_ANGULAR_FORMATS: PackageJsonFormatProperties[] = ['types', 'esm2022', 'esm', 'default']; export type JsonPrimitive = string|number|boolean|null; export type JsonValue = JsonPrimitive|Array|JsonObject|undefined; @@ -176,9 +179,12 @@ export class BitDedupeModuleResolvePlugin { // * one of the angular formats in package.json // * a `metadata.json` file next to the typings entry-point if(entryPointPackageJson.__processed_by_ivy_ngcc__ !== undefined - || OLD_ANGULAR_FORMATS.some(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) - || POST_IVY_ANGULAR_FORMATS.every(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) + || V17_ANGULAR_FORMATS.every(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) || V16_ANGULAR_FORMATS.every(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) + || POST_IVY_ANGULAR_FORMATS.every(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) + || OLD_ANGULAR_FORMATS.some(f => Object.keys(entryPointPackageJson as JsonObject).includes(f)) + || entryPointPackageJson.schematics !== undefined + || entryPointPackageJson['ng-update'] !== undefined ) { return true; } diff --git a/angular/envs/angular-env/component.json b/angular/envs/angular-env/component.json index d57a6ad..2bdf35f 100644 --- a/angular/envs/angular-env/component.json +++ b/angular/envs/angular-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "angular-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -70,8 +70,6 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - } + "teambit.envs/envs": {} } } diff --git a/angular/envs/angular-v13-env/component.json b/angular/envs/angular-v13-env/component.json index 8cb61d9..e7f542c 100644 --- a/angular/envs/angular-v13-env/component.json +++ b/angular/envs/angular-v13-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v13-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -56,9 +56,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/envs/angular-v13-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v13-env/webpack/webpack5.build.config.ts index e1bc2dd..18391b9 100644 --- a/angular/envs/angular-v13-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v13-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v13-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v13-env/webpack/webpack5.serve.config.ts index c9c0279..12e4686 100644 --- a/angular/envs/angular-v13-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v13-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -124,6 +124,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -163,7 +164,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v14-env/component.json b/angular/envs/angular-v14-env/component.json index a60c59d..02fbf2a 100644 --- a/angular/envs/angular-v14-env/component.json +++ b/angular/envs/angular-v14-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v14-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -64,9 +64,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/envs/angular-v14-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v14-env/webpack/webpack5.build.config.ts index e1bc2dd..18391b9 100644 --- a/angular/envs/angular-v14-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v14-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v14-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v14-env/webpack/webpack5.serve.config.ts index e5daf76..81147b2 100644 --- a/angular/envs/angular-v14-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v14-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -125,6 +125,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -164,7 +165,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v15-env/component.json b/angular/envs/angular-v15-env/component.json index 09bc017..4bfe553 100644 --- a/angular/envs/angular-v15-env/component.json +++ b/angular/envs/angular-v15-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v15-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -64,9 +64,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/envs/angular-v15-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v15-env/webpack/webpack5.build.config.ts index 21cd553..e123e7a 100644 --- a/angular/envs/angular-v15-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v15-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v15-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v15-env/webpack/webpack5.serve.config.ts index 73df6e8..0d9dac3 100644 --- a/angular/envs/angular-v15-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v15-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -125,6 +125,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -163,7 +164,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v16-env/component.json b/angular/envs/angular-v16-env/component.json index 798b7c8..28a2fa2 100644 --- a/angular/envs/angular-v16-env/component.json +++ b/angular/envs/angular-v16-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v16-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -68,9 +68,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/envs/angular-v16-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v16-env/webpack/webpack5.build.config.ts index 21cd553..e123e7a 100644 --- a/angular/envs/angular-v16-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v16-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v16-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v16-env/webpack/webpack5.serve.config.ts index 73df6e8..0d9dac3 100644 --- a/angular/envs/angular-v16-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v16-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -125,6 +125,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -163,7 +164,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v17-env/component.json b/angular/envs/angular-v17-env/component.json index 894320f..831902e 100644 --- a/angular/envs/angular-v17-env/component.json +++ b/angular/envs/angular-v17-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v17-env", - "version": "5.0.3" + "version": "5.0.5" }, "propagate": false, "extensions": { @@ -69,8 +69,6 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - } + "teambit.envs/envs": {} } } diff --git a/angular/envs/angular-v17-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v17-env/webpack/webpack5.build.config.ts index 21cd553..e123e7a 100644 --- a/angular/envs/angular-v17-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v17-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v17-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v17-env/webpack/webpack5.serve.config.ts index 73df6e8..0d9dac3 100644 --- a/angular/envs/angular-v17-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v17-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -125,6 +125,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -163,7 +164,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v18-env/component.json b/angular/envs/angular-v18-env/component.json index 7a874e3..3693e5d 100644 --- a/angular/envs/angular-v18-env/component.json +++ b/angular/envs/angular-v18-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/angular-v18-env", - "version": "1.0.3" + "version": "1.0.5" }, "propagate": false, "extensions": { diff --git a/angular/envs/angular-v18-env/webpack/webpack5.build.config.ts b/angular/envs/angular-v18-env/webpack/webpack5.build.config.ts index 21cd553..e123e7a 100644 --- a/angular/envs/angular-v18-env/webpack/webpack5.build.config.ts +++ b/angular/envs/angular-v18-env/webpack/webpack5.build.config.ts @@ -2,6 +2,7 @@ import { BitDedupeModuleResolvePlugin, WebpackConfig } from '@bitdev/angular.dev import { fallbacks, fallbacksAliases, fallbacksProvidePluginConfig } from '@teambit/webpack'; import { sep } from 'path'; import webpack from 'webpack'; +import { getWebpackAngularAliases } from '@bitdev/angular.dev-services.common'; import { getModuleRulesConfig } from './module-rules.config.js'; export function webpack5BuildConfigFactory( @@ -38,7 +39,10 @@ export function webpack5BuildConfigFactory( }, resolve: { - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: fallbacks, modules: nodeModulesPaths }, diff --git a/angular/envs/angular-v18-env/webpack/webpack5.serve.config.ts b/angular/envs/angular-v18-env/webpack/webpack5.serve.config.ts index 73df6e8..0d9dac3 100644 --- a/angular/envs/angular-v18-env/webpack/webpack5.serve.config.ts +++ b/angular/envs/angular-v18-env/webpack/webpack5.serve.config.ts @@ -1,4 +1,4 @@ -import { normalizePath } from '@bitdev/angular.dev-services.common'; +import { getWebpackAngularAliases, normalizePath } from '@bitdev/angular.dev-services.common'; import { BitDedupeModuleResolvePlugin, StatsLoggerPlugin @@ -125,6 +125,7 @@ export function webpack5ServeConfigFactory( }, client: { + webSocketURL: 'ws://0.0.0.0:0/ws', overlay: false }, @@ -163,7 +164,10 @@ export function webpack5ServeConfigFactory( resolve: { extensions: ['.ts', '.tsx', '.js', '.mdx', '.md'], - alias: fallbacksAliases, + alias: { + ...fallbacksAliases, + ...getWebpackAngularAliases() + }, fallback: { ...fallbacks, events: fileURLToPath(import.meta.resolve('events/')) } as any, modules: nodeModulesPaths }, diff --git a/angular/envs/base-env/component.json b/angular/envs/base-env/component.json index 3e391e6..d7cb3f2 100644 --- a/angular/envs/base-env/component.json +++ b/angular/envs/base-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "envs/base-env", - "version": "6.0.2" + "version": "6.0.4" }, "propagate": false, "extensions": { diff --git a/angular/examples/my-angular-env/component.json b/angular/examples/my-angular-env/component.json index bc1490e..77ce68c 100644 --- a/angular/examples/my-angular-env/component.json +++ b/angular/examples/my-angular-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -19,9 +19,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/examples/my-angular-v13-env/component.json b/angular/examples/my-angular-v13-env/component.json index 5944c07..9659f96 100644 --- a/angular/examples/my-angular-v13-env/component.json +++ b/angular/examples/my-angular-v13-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v13-env", - "version": "5.0.3" + "version": "5.0.5" }, "propagate": false, "extensions": { @@ -17,9 +17,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/examples/my-angular-v13-env/env.jsonc b/angular/examples/my-angular-v13-env/env.jsonc index a0dcc77..ddcba70 100644 --- a/angular/examples/my-angular-v13-env/env.jsonc +++ b/angular/examples/my-angular-v13-env/env.jsonc @@ -70,6 +70,11 @@ "version": "~13.2.0", "supportedRange": "^13.0.0" }, + { + "name": "@angular/router", + "version": "~13.2.0", + "supportedRange": "^13.0.0" + }, { "name": "jest", "version": "^27.4.4", diff --git a/angular/examples/my-angular-v14-env/component.json b/angular/examples/my-angular-v14-env/component.json index 0f51deb..efbffc6 100644 --- a/angular/examples/my-angular-v14-env/component.json +++ b/angular/examples/my-angular-v14-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v14-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -18,9 +18,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/examples/my-angular-v14-env/env.jsonc b/angular/examples/my-angular-v14-env/env.jsonc index b2c9f51..14b2224 100644 --- a/angular/examples/my-angular-v14-env/env.jsonc +++ b/angular/examples/my-angular-v14-env/env.jsonc @@ -70,6 +70,11 @@ "version": "~14.0.2", "supportedRange": "^14.0.0" }, + { + "name": "@angular/router", + "version": "~14.0.2", + "supportedRange": "^14.0.0" + }, { "name": "jest", "version": "^28.0.0", diff --git a/angular/examples/my-angular-v15-env/component.json b/angular/examples/my-angular-v15-env/component.json index 7434e14..b2d4bf9 100644 --- a/angular/examples/my-angular-v15-env/component.json +++ b/angular/examples/my-angular-v15-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v15-env", - "version": "6.0.3" + "version": "6.0.5" }, "propagate": false, "extensions": { @@ -18,9 +18,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/examples/my-angular-v15-env/env.jsonc b/angular/examples/my-angular-v15-env/env.jsonc index 1e117c9..f5e4960 100644 --- a/angular/examples/my-angular-v15-env/env.jsonc +++ b/angular/examples/my-angular-v15-env/env.jsonc @@ -70,6 +70,11 @@ "version": "~15.0.4", "supportedRange": "^15.0.0" }, + { + "name": "@angular/router", + "version": "~15.0.4", + "supportedRange": "^15.0.0" + }, { "name": "jest", "version": "^29.3.1", diff --git a/angular/examples/my-angular-v16-env/component.json b/angular/examples/my-angular-v16-env/component.json index 412bf80..a4b2f77 100644 --- a/angular/examples/my-angular-v16-env/component.json +++ b/angular/examples/my-angular-v16-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v16-env", - "version": "5.0.3" + "version": "5.0.5" }, "propagate": false, "extensions": { @@ -18,9 +18,7 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - }, + "teambit.envs/envs": {}, "teambit.component/renaming": { "renamedFrom": { "scope": "bitdev.angular", diff --git a/angular/examples/my-angular-v16-env/env.jsonc b/angular/examples/my-angular-v16-env/env.jsonc index f14e0db..2d2f5a5 100644 --- a/angular/examples/my-angular-v16-env/env.jsonc +++ b/angular/examples/my-angular-v16-env/env.jsonc @@ -70,6 +70,16 @@ "version": "~16.2.0", "supportedRange": "^16.2.0" }, + { + "name": "@angular/platform-server", + "version": "^16.2.0", + "supportedRange": "^16.2.0" + }, + { + "name": "@angular/router", + "version": "^16.2.0", + "supportedRange": "^16.2.0" + }, { "name": "jest", "version": "^29.5.0", @@ -83,7 +93,7 @@ { "name": "rxjs", "version": "^7.8.1", - "supportedRange": "^6.5.5 || ^7.4.0" + "supportedRange": "^6.5.3 || ^7.4.0" }, { "name": "tslib", @@ -93,7 +103,7 @@ { "name": "typescript", "version": "~5.1.6", - "supportedRange": ">=4.9.3 <5.2" + "supportedRange": ">=4.9.3 <5.2.0" }, { "name": "zone.js", diff --git a/angular/examples/my-angular-v17-env/component.json b/angular/examples/my-angular-v17-env/component.json index a1861a3..93c7b46 100644 --- a/angular/examples/my-angular-v17-env/component.json +++ b/angular/examples/my-angular-v17-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v17-env", - "version": "5.0.3" + "version": "5.0.5" }, "propagate": false, "extensions": { @@ -18,8 +18,6 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - } + "teambit.envs/envs": {} } } diff --git a/angular/examples/my-angular-v18-env/component.json b/angular/examples/my-angular-v18-env/component.json index dc54c7a..38c51e4 100644 --- a/angular/examples/my-angular-v18-env/component.json +++ b/angular/examples/my-angular-v18-env/component.json @@ -2,7 +2,7 @@ "componentId": { "scope": "bitdev.angular", "name": "examples/my-angular-v18-env", - "version": "1.0.3" + "version": "1.0.5" }, "propagate": false, "extensions": { @@ -19,8 +19,6 @@ } }, "bitdev.general/envs/bit-env@1.0.1": {}, - "teambit.envs/envs": { - "env": "bitdev.general/envs/bit-env" - } + "teambit.envs/envs": {} } } diff --git a/workspace.jsonc b/workspace.jsonc index 716a7a6..420da30 100644 --- a/workspace.jsonc +++ b/workspace.jsonc @@ -35,6 +35,7 @@ "packageManager": "teambit.dependencies/pnpm", "policy": { "dependencies": { + "@angular/forms": "^18.2.2", "@bitdev/general.envs.bit-env": "^1.0.2", "@bitdev/node.node-env": "2.0.2", "@clack/prompts": "^0.7.0", @@ -56,6 +57,7 @@ "@teambit/harmony.content.cli-reference": "2.0.285", "@teambit/react.ui.docs-app": "1.0.21", "@teambit/typescript.typescript-compiler": "2.0.30", + "@teambit/workspace.root-components": "^1.0.0", "@types/fs-extra": "~9.0.7", "@types/lodash-es": "^4.17.12", "@types/node": "20.12.7",