Skip to content

Commit 3f9f0ae

Browse files
authored
Support monorepo builds in Angular adapter (#151)
* add support for nx * check monorepo builder * bump version
1 parent 36759a9 commit 3f9f0ae

File tree

4 files changed

+169
-79
lines changed

4 files changed

+169
-79
lines changed

package-lock.json

Lines changed: 54 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@apphosting/adapter-angular/package.json

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@apphosting/adapter-angular",
3-
"version": "17.2.1",
3+
"version": "17.2.2",
44
"main": "dist/index.js",
55
"description": "Experimental addon to the Firebase CLI to add web framework support",
66
"repository": {
@@ -39,19 +39,24 @@
3939
],
4040
"license": "Apache-2.0",
4141
"dependencies": {
42+
"firebase-functions": "^4.3.1",
4243
"fs-extra": "^11.1.1",
43-
"yaml": "^2.3.4",
44+
"strip-ansi": "^7.1.0",
4445
"tslib": "^2.3.1",
45-
"firebase-functions": "^4.3.1",
46+
"yaml": "^2.3.4",
4647
"zod": "^3.22.4"
4748
},
4849
"peerDependencies": {
4950
"@angular-devkit/architect": "~0.1702.0",
5051
"@angular-devkit/core": "~17.2.0"
5152
},
5253
"peerDependenciesMeta": {
53-
"@angular-devkit/architect": { "optional": true },
54-
"@angular-devkit/core": { "optional": true }
54+
"@angular-devkit/architect": {
55+
"optional": true
56+
},
57+
"@angular-devkit/core": {
58+
"optional": true
59+
}
5560
},
5661
"devDependencies": {
5762
"@angular-devkit/architect": "~0.1702.0",
@@ -60,11 +65,11 @@
6065
"@types/fs-extra": "*",
6166
"@types/mocha": "*",
6267
"@types/tmp": "*",
68+
"mocha": "*",
6369
"semver": "*",
6470
"tmp": "*",
65-
"ts-node": "*",
66-
"mocha": "*",
6771
"ts-mocha": "*",
72+
"ts-node": "*",
6873
"typescript": "*"
6974
}
7075
}
Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
#! /usr/bin/env node
2-
import { checkBuildConditions, build, generateOutputDirectory } from "../utils.js";
2+
import {
3+
build,
4+
generateOutputDirectory,
5+
DEFAULT_COMMAND,
6+
checkStandaloneBuildConditions,
7+
checkMonorepoBuildConditions,
8+
} from "../utils.js";
39

4-
const cwd = process.cwd();
10+
const root = process.cwd();
511

6-
await checkBuildConditions(cwd);
12+
// Determine root of project to build
13+
let projectRoot = root;
14+
if (process.env.MONOREPO_PROJECT && process.env.FIREBASE_APP_DIRECTORY) {
15+
projectRoot = projectRoot.concat("/", process.env.FIREBASE_APP_DIRECTORY);
16+
const builder = process.env.MONOREPO_BUILDER || "";
17+
checkMonorepoBuildConditions(builder);
18+
} else {
19+
await checkStandaloneBuildConditions(projectRoot);
20+
}
721

8-
const outputBundleOptions = await build().catch(() => process.exit(1));
9-
await generateOutputDirectory(cwd, outputBundleOptions);
22+
// Determine which build runner to use
23+
let cmd = DEFAULT_COMMAND;
24+
if (process.env.MONOREPO_COMMAND) {
25+
cmd = process.env.MONOREPO_COMMAND;
26+
}
27+
28+
const outputBundleOptions = await build(projectRoot, cmd);
29+
await generateOutputDirectory(root, outputBundleOptions);

0 commit comments

Comments
 (0)