Skip to content

Commit b5fbb87

Browse files
authored
Merge pull request #3 from cskiwi/fix/enabling-fetch
fix: enable fetch
2 parents 16ad4d5 + beee59b commit b5fbb87

21 files changed

+62
-58
lines changed

.changeset/fast-taxis-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fake-scope/fake-pkg": patch
3+
---
4+
5+
fix: enable fetch

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ jobs:
2222
with:
2323
bun-version: latest
2424

25-
# Connect your workspace on nx.app and uncomment this to enable task distribution.
26-
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
27-
# - run: bunx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
28-
2925
- run: bun install --no-cache
3026
- uses: nrwl/nx-set-shas@v4
3127

32-
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
33-
# - run: bun nx-cloud record -- echo Hello World
28+
- name: Install Playwright Browsers
29+
run: npx playwright install --with-deps
30+
3431
- run: bun nx affected -t lint test build
3532
- run: bun nx affected --parallel 1 -t e2e-ci
33+
- uses: actions/upload-artifact@v4
34+
if: ${{ !cancelled() }}
35+
with:
36+
name: playwright-report
37+
path: playwright-report/
38+
retention-days: 30

apps/app-e2e/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default defineConfig({
2525
},
2626
/* Run your local dev server before starting the tests */
2727
webServer: {
28-
command: 'bun nx serve app',
28+
command: 'bun start',
2929
url: 'http://localhost:4200',
3030
reuseExistingServer: !process.env['CI'],
3131
cwd: workspaceRoot,

apps/app/src/main.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { AppComponent, config } from '@app/frontend-root';
2+
import { RootComponent, config } from '@app/frontend-root';
33

4-
const bootstrap = () => bootstrapApplication(AppComponent, config);
4+
const bootstrap = () => bootstrapApplication(RootComponent, config);
55

66
export default bootstrap;

apps/app/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { bootstrapApplication } from '@angular/platform-browser';
2-
import { AppComponent, appConfig } from '@app/frontend-root';
2+
import { RootComponent, appConfig } from '@app/frontend-root';
33

4-
bootstrapApplication(AppComponent, appConfig).catch((err) =>
4+
bootstrapApplication(RootComponent, appConfig).catch((err) =>
55
console.error(err)
66
);

bun.lockb

2.79 KB
Binary file not shown.

libs/backend/test/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"name": "@backend/test",
33
"version": "0.0.1",
44
"dependencies": {
5-
"tslib": "^2.3.0"
5+
"tslib": "^2.3.0",
6+
"@nestjs/common": "^10.3.8",
7+
"express": "~4.19.2"
68
},
79
"type": "commonjs",
810
"main": "./src/index.js",

libs/frontend/root/src/app.component.html

Lines changed: 0 additions & 5 deletions
This file was deleted.

libs/frontend/root/src/app.component.spec.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

libs/frontend/root/src/app.config.ts renamed to libs/frontend/root/src/config/app.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { provideRouter } from '@angular/router';
33
import { appRoutes } from './app.routes';
44
import { provideClientHydration } from '@angular/platform-browser';
55
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
6-
import { provideHttpClient } from '@angular/common/http';
6+
import { provideHttpClient, withFetch } from '@angular/common/http';
77

88
export const appConfig: ApplicationConfig = {
99
providers: [
1010
provideClientHydration(),
1111
provideZoneChangeDetection({ eventCoalescing: true }),
1212
provideRouter(appRoutes),
1313
provideAnimationsAsync(),
14-
provideHttpClient(),
14+
provideHttpClient(withFetch()),
1515
],
1616
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './app.routes';
2+
export * from './app.config';
3+
export * from './app.config.server';

libs/frontend/root/src/index.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
export * from './app.component';
2-
export * from './app.routes';
3-
export * from './app.config';
4-
export * from './app.config.server';
1+
export * from './root';
2+
export * from './config';

libs/frontend/root/src/root/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './root.component';
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<h1>Welcome app</h1>
2+
3+
<pre>{{ movie() | json }}</pre>
4+
5+
<router-outlet></router-outlet>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { provideHttpClient } from '@angular/common/http';
2+
import { TestBed } from '@angular/core/testing';
3+
import { RootComponent } from './root.component';
4+
5+
describe('RootComponent', () => {
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
8+
providers: [provideHttpClient()],
9+
imports: [RootComponent],
10+
}).compileComponents();
11+
});
12+
13+
it('should render title', () => {
14+
const fixture = TestBed.createComponent(RootComponent);
15+
fixture.detectChanges();
16+
const compiled = fixture.nativeElement as HTMLElement;
17+
expect(compiled.querySelector('h1')?.textContent).toContain('Welcome app');
18+
});
19+
});
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { JsonPipe } from '@angular/common';
2-
import { HttpClient, provideHttpClient } from '@angular/common/http';
2+
import { HttpClient } from '@angular/common/http';
33
import { Component, inject } from '@angular/core';
44
import { RouterModule } from '@angular/router';
55
import { derivedAsync } from 'ngxtension/derived-async';
@@ -8,10 +8,10 @@ import { derivedAsync } from 'ngxtension/derived-async';
88
standalone: true,
99
imports: [RouterModule, JsonPipe],
1010
selector: 'app-root',
11-
templateUrl: './app.component.html',
12-
styleUrl: './app.component.scss',
11+
templateUrl: './root.component.html',
12+
styleUrl: './root.component.scss',
1313
})
14-
export class AppComponent {
14+
export class RootComponent {
1515
private readonly httpClient = inject(HttpClient);
1616
movie = derivedAsync(() => this.httpClient.get(`/api/backend-test`));
1717
}

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "./node_modules/nx/schemas/nx-schema.json",
3-
"defaultBase": "master",
3+
"defaultBase": "main",
44
"defaultProject": "app",
55
"namedInputs": {
66
"default": ["{projectRoot}/**/*", "sharedGlobals"],

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"@angular-devkit/build-angular": "~18.0.1",
3838
"@angular-devkit/core": "~18.0.1",
3939
"@angular-devkit/schematics": "~18.0.1",
40-
"@angular-eslint/eslint-plugin": "~17.5.1",
41-
"@angular-eslint/eslint-plugin-template": "~17.5.1",
42-
"@angular-eslint/template-parser": "~17.5.1",
40+
"@angular-eslint/eslint-plugin": "rc-v18",
41+
"@angular-eslint/eslint-plugin-template": "rc-v18",
42+
"@angular-eslint/template-parser": "rc-v18",
4343
"@angular/cli": "~18.0.1",
4444
"@angular/compiler-cli": "~18.0.0",
4545
"@angular/language-service": "~18.0.0",

0 commit comments

Comments
 (0)