Skip to content

Commit 591f66a

Browse files
committed
fix: app build returned result
1 parent 3d8b555 commit 591f66a

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

angular/app-types/angular-app-type/angular-app-options.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
BrowserOptions,
55
DevServerOptions
66
} from '@bitdev/angular.dev-services.common';
7+
import { AppDeployContext } from '@teambit/application';
78
import { Bundler } from '@teambit/bundler';
89
import { WebpackConfigTransformer } from '@teambit/webpack';
9-
import { AngularDeployContext } from './deploy-context';
1010

1111
export type AngularAppOptions = {
1212
/**
@@ -37,7 +37,7 @@ export type AngularAppOptions = {
3737
/**
3838
* Deploy function.
3939
*/
40-
deploy?: (context: AngularDeployContext) => Promise<void>;
40+
deploy?: (context: AppDeployContext) => Promise<void>;
4141

4242
/**
4343
* Ranges of ports to use to run the app server.

angular/app-types/angular-app-type/angular-build-result.ts

-9
This file was deleted.

angular/app-types/angular-app-type/angular.application.ts

+15-8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
import { AngularPreview } from '@bitdev/angular.dev-services.preview.preview';
99
import {
1010
AppBuildContext,
11+
AppBuildResult,
1112
AppContext,
1213
Application,
1314
ApplicationInstance,
@@ -28,7 +29,6 @@ import objectHash from 'object-hash';
2829
import { join } from 'path';
2930
import { readConfigFile, sys } from 'typescript';
3031
import { AngularAppOptions } from './angular-app-options';
31-
import { AngularAppBuildResult } from './angular-build-result';
3232
import { buildApplication } from './application.bundler';
3333
import { serveApplication } from './application.dev-server';
3434
import { expandIncludeExclude, JsonObject } from './utils';
@@ -103,7 +103,7 @@ export class AngularApp implements Application {
103103
angularServeOptions,
104104
angularBuildOptions,
105105
ngEnvOptions: this.options.ngEnvOptions,
106-
sourceRoot: this.options.sourceRoot,
106+
sourceRoot: this.options.sourceRoot
107107
});
108108

109109
}
@@ -154,9 +154,9 @@ export class AngularApp implements Application {
154154
// const vite = await loadEsmModule('vite');
155155
// const dotenv = vite.loadEnv(mode, rootDir);
156156
return {
157-
...overrides,
157+
...overrides
158158
// ...dotenv
159-
}
159+
};
160160
}
161161

162162
// TODO: fix return type once bit has a new stable version
@@ -208,7 +208,7 @@ export class AngularApp implements Application {
208208
};
209209
}
210210

211-
async build(context: AppBuildContext): Promise<AngularAppBuildResult> {
211+
async build(context: AppBuildContext): Promise<AppBuildResult> {
212212
const { capsule } = context;
213213
const depsResolver = context.getAspect<DependencyResolverMain>(DependencyResolverAspect.id);
214214
assert(depsResolver, 'Dependency resolver is not defined');
@@ -236,8 +236,8 @@ export class AngularApp implements Application {
236236
tempFolder: tempFolder,
237237
entryServer,
238238
envVars: {
239-
'process.env': envVars
240-
}
239+
'process.env': envVars
240+
}
241241
});
242242
} else {
243243
let bundler: Bundler;
@@ -253,7 +253,14 @@ export class AngularApp implements Application {
253253
await bundler.run();
254254
}
255255
return {
256-
publicDir: outputPath
256+
artifacts: [{
257+
name: this.name,
258+
globPatterns: [outputPath],
259+
}],
260+
metadata: {
261+
publicDir: appOptions.ssr ? join(outputPath, 'browser') : outputPath,
262+
ssrPublicDir: appOptions.ssr ? join(outputPath, 'server') : undefined
263+
}
257264
};
258265
}
259266

angular/app-types/angular-app-type/deploy-context.ts

-4
This file was deleted.

0 commit comments

Comments
 (0)