Skip to content

Commit 1456921

Browse files
committed
Fix test and build
1 parent 93c275c commit 1456921

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,10 @@ jobs:
8989
- name: Relocate Artifacts
9090
run: mv firebase-frameworks-${{ github.run_id }} dist
9191
- name: Test
92-
run: npm run test:${{ matrix.framework }}
92+
run: |
93+
npm i -g firebase-tools
94+
npm i --prefix $(npm root -g)/firebase-tools --force --save .
95+
npm run test:${{ matrix.framework }}
9396
env:
9497
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
9598

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,9 @@
3030
"test:e2e": "npm run e2e:config && cd e2e && firebase emulators:exec \"exit 0\"",
3131
"clean:build": "rm -rf dist",
3232
"clean:e2e": "rm -rf e2e",
33-
"clean:dev": "npm uninstall -g firebase-tools && rm -rf firebase-tools",
34-
"test:angular": ". ./tools/dev-tools.sh && npm run e2e:build-angular && npm run test:e2e",
35-
"test:next": ". ./tools/dev-tools.sh && npm run e2e:build-next && npm run test:e2e",
36-
"test:nuxt": ". ./tools/dev-tools.sh && npm run e2e:build-next && npm run test:e2e"
33+
"test:angular": "npm run e2e:build-angular && npm run test:e2e",
34+
"test:next": "npm run e2e:build-next && npm run test:e2e",
35+
"test:nuxt": "npm run e2e:build-next && npm run test:e2e"
3736
},
3837
"exports": {
3938
".": {

src/frameworks/angular/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,26 +44,23 @@ export const build = async (config: DeployConfig | Required<DeployConfig>, getPr
4444
serverTarget = targetFromTargetString(options.serverTarget);
4545
if (prerenderTarget) {
4646
const prerenderOptions = await architectHost.getOptionsForTarget(prerenderTarget);
47-
if (!prerenderOptions) throw 'foo';
48-
if (typeof prerenderOptions.browserTarget !== 'string') throw 'foo';
49-
if (typeof prerenderOptions.serverTarget !== 'string') throw 'foo';
5047
if (browserTarget) {
51-
if (targetStringFromTarget(browserTarget) !== prerenderOptions.browserTarget)
48+
if (targetStringFromTarget(browserTarget) !== prerenderOptions?.browserTarget)
5249
throw 'foo';
5350
} else {
51+
if (typeof prerenderOptions?.browserTarget !== 'string') throw 'foo';
5452
browserTarget = targetFromTargetString(prerenderOptions.browserTarget);
5553
}
56-
if (serverTarget && targetStringFromTarget(serverTarget) !== prerenderOptions.serverTarget)
54+
if (serverTarget && targetStringFromTarget(serverTarget) !== prerenderOptions?.serverTarget)
5755
throw 'foo';
5856
}
5957
} else if (workspaceProject.targets.has('prerender')) {
6058
// TODO test and warn if production doesn't exist, fallback to default
6159
prerenderTarget = { project, target: 'prerender', configuration: 'production' };
6260
const production = await architectHost.getOptionsForTarget(prerenderTarget);
63-
if (!production) throw 'foo';
64-
if (typeof production.browserTarget !== 'string') throw 'foo';
65-
if (typeof production.serverTarget !== 'string') throw 'foo';
61+
if (typeof production?.browserTarget !== 'string') throw 'foo';
6662
browserTarget = targetFromTargetString(production.browserTarget);
63+
if (typeof production?.serverTarget !== 'string') throw 'foo';
6764
serverTarget = targetFromTargetString(production.serverTarget);
6865
} else {
6966
// TODO test and warn if production doesn't exist, fallback to default

tools/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const main = async () => {
4949
const { version } = require('../package.json');
5050
const npmList = JSON.parse(spawnSync('npm', ['list', '--json=true'], { encoding: 'utf8' }).stdout.toString());
5151
const from = ['__FIREBASE_FRAMEWORKS_VERSION__'];
52-
const to = [`file:${process.cwd()}/firebase-frameworks-${version}.tgz`];
52+
const to = [`file:${process.cwd()}`];
5353
for (const [dep, { version }] of Object.entries<Record<string, string>>(npmList.dependencies)) {
5454
from.push(`__${dep.toUpperCase().replace(/[^A-Z]/g, '_')}_VERSION__`);
5555
to.push(`^${version}`);

tools/prepare.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION
1818

1919
npm run build &&
2020
echo "npm --no-git-tag-version --allow-same-version -f version $OVERRIDE_VERSION &&
21-
sed -i \"/const FIREBASE_FRAMEWORKS_VERSION =/c\const FIREBASE_FRAMEWORKS_VERSION = '$OVERRIDE_VERSION'/\" ./dist/index.js &&
21+
sed 's/const FIREBASE_FRAMEWORKS_VERSION =.*/const FIREBASE_FRAMEWORKS_VERSION = \"$OVERRIDE_VERSION\"/' ./dist/index.js &&
2222
npm publish . --tag $NPM_TAG" > ./dist/publish.sh &&
2323
chmod +x ./dist/publish.sh

0 commit comments

Comments
 (0)