Skip to content

Commit

Permalink
fix: app build returned result
Browse files Browse the repository at this point in the history
  • Loading branch information
ocombe committed Feb 5, 2024
1 parent 3d8b555 commit b0a0d44
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
4 changes: 2 additions & 2 deletions angular/app-types/angular-app-type/angular-app-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
BrowserOptions,
DevServerOptions
} from '@bitdev/angular.dev-services.common';
import { AppDeployContext } from '@teambit/application';
import { Bundler } from '@teambit/bundler';
import { WebpackConfigTransformer } from '@teambit/webpack';
import { AngularDeployContext } from './deploy-context';

export type AngularAppOptions = {
/**
Expand Down Expand Up @@ -37,7 +37,7 @@ export type AngularAppOptions = {
/**
* Deploy function.
*/
deploy?: (context: AngularDeployContext) => Promise<void>;
deploy?: (context: AppDeployContext) => Promise<void>;

/**
* Ranges of ports to use to run the app server.
Expand Down
9 changes: 0 additions & 9 deletions angular/app-types/angular-app-type/angular-build-result.ts

This file was deleted.

23 changes: 15 additions & 8 deletions angular/app-types/angular-app-type/angular.application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview';
import {
AppBuildContext,
AppBuildResult,
AppContext,
Application,
ApplicationInstance,
Expand All @@ -28,7 +29,6 @@ import objectHash from 'object-hash';
import { join } from 'path';
import { readConfigFile, sys } from 'typescript';
import { AngularAppOptions } from './angular-app-options';
import { AngularAppBuildResult } from './angular-build-result';
import { buildApplication } from './application.bundler';
import { serveApplication } from './application.dev-server';
import { expandIncludeExclude, JsonObject } from './utils';
Expand Down Expand Up @@ -103,7 +103,7 @@ export class AngularApp implements Application {
angularServeOptions,
angularBuildOptions,
ngEnvOptions: this.options.ngEnvOptions,
sourceRoot: this.options.sourceRoot,
sourceRoot: this.options.sourceRoot
});

}
Expand Down Expand Up @@ -154,9 +154,9 @@ export class AngularApp implements Application {
// const vite = await loadEsmModule('vite');
// const dotenv = vite.loadEnv(mode, rootDir);
return {
...overrides,
...overrides
// ...dotenv
}
};
}

// TODO: fix return type once bit has a new stable version
Expand Down Expand Up @@ -208,7 +208,7 @@ export class AngularApp implements Application {
};
}

async build(context: AppBuildContext): Promise<AngularAppBuildResult> {
async build(context: AppBuildContext): Promise<AppBuildResult> {
const { capsule } = context;
const depsResolver = context.getAspect<DependencyResolverMain>(DependencyResolverAspect.id);
assert(depsResolver, 'Dependency resolver is not defined');
Expand Down Expand Up @@ -236,8 +236,8 @@ export class AngularApp implements Application {
tempFolder: tempFolder,
entryServer,
envVars: {
'process.env': envVars
}
'process.env': envVars
}
});
} else {
let bundler: Bundler;
Expand All @@ -253,7 +253,14 @@ export class AngularApp implements Application {
await bundler.run();
}
return {
publicDir: outputPath
artifacts: [{
name: this.name,
globPatterns: [outputPath],
}],
metadata: {
publicDir: appOptions.ssr ? join(outputPath, 'browser') : outputPath,
ssrPublicDir: appOptions.ssr ? join(outputPath, 'server') : undefined
}
};
}

Expand Down
4 changes: 0 additions & 4 deletions angular/app-types/angular-app-type/deploy-context.ts

This file was deleted.

1 change: 0 additions & 1 deletion angular/app-types/angular-app-type/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export { AngularAppType } from './angular.app-type';
export type { AngularDeployContext } from './deploy-context';
export type { AngularAppOptions } from './angular-app-options';
export { NG_APP_NAME, NG_APP_PATTERN } from '@bitdev/angular.dev-services.common';
export { AngularApp } from './angular.application';

0 comments on commit b0a0d44

Please sign in to comment.