Skip to content

Commit

Permalink
ci: change to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
hallisonbrancalhao committed Apr 25, 2024
1 parent a1423ae commit 2d1c61f
Show file tree
Hide file tree
Showing 8 changed files with 14,512 additions and 21,008 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
pnpm-lock.yaml
53 changes: 31 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
name: CI
name: Publish

on:
push:
branches:
# Change this if your primary branch is not main
- main
pull_request:

# Needed for nx-set-shas when run on the main branch
permissions:
actions: read
contents: read

jobs:
main:
test:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write # needed for provenance data generation
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
- run: npm ci
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
shell: bash

- uses: nrwl/nx-set-shas@v3
# This line is needed for nx affected to work when CI is running on a PR
- run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}
- name: Print Environment Info
run: pnpx nx report
shell: bash

- run: npx nx-cloud record -- nx format:check
- run: npx nx affected -t lint test build e2e-ci
- name: Publish packages
run: |
pnpx nx format:check
pnpx nx run web:build:production
shell: bash
24 changes: 13 additions & 11 deletions apps/web/src/app/app.config.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ const serverConfig: ApplicationConfig = {
providers: [
provideServerRendering(),
{
provide: ROUTES,
multi: true,
useValue: [
{
path: '',
loadComponent: () => import('@nx-cleanarch-spotify/shell').then(m => m.ShellComponent),
loadChildren: () => import('@nx-cleanarch-spotify/shell').then(m => m.shellRoutes)
}
]
}
]
provide: ROUTES,
multi: true,
useValue: [
{
path: '',
loadComponent: () =>
import('@nx-cleanarch-spotify/shell').then((m) => m.ShellComponent),
loadChildren: () =>
import('@nx-cleanarch-spotify/shell').then((m) => m.shellRoutes),
},
],
},
],
};

export const config = mergeApplicationConfig(appConfig, serverConfig);
8 changes: 5 additions & 3 deletions apps/web/src/app/app.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { Route } from '@angular/router';
export const appRoutes: Route[] = [
{
path: '',
loadComponent: () => import('@nx-cleanarch-spotify/shell').then(m => m.ShellComponent),
loadChildren: () => import('@nx-cleanarch-spotify/shell').then(m => m.shellRoutes)
}
loadComponent: () =>
import('@nx-cleanarch-spotify/shell').then((m) => m.ShellComponent),
loadChildren: () =>
import('@nx-cleanarch-spotify/shell').then((m) => m.shellRoutes),
},
];
8 changes: 7 additions & 1 deletion libs/main/feature-shell/src/lib/shell/shell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import { NavbarComponent } from '@nx-cleanarch-spotify/navbar';
@Component({
selector: 'lib-shell',
standalone: true,
imports: [CommonModule, RouterModule, PlayerComponent, ContentComponent, NavbarComponent],
imports: [
CommonModule,
RouterModule,
PlayerComponent,
ContentComponent,
NavbarComponent,
],
templateUrl: './shell.component.html',
styleUrl: './shell.component.scss',
})
Expand Down
5 changes: 3 additions & 2 deletions libs/main/feature-shell/src/lib/shell/shell.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Route } from '@angular/router';
export const shellRoutes: Route[] = [
{
path: '',
loadComponent: () => import('@nx-cleanarch-spotify/home').then(m => m.HomeComponent)
}
loadComponent: () =>
import('@nx-cleanarch-spotify/home').then((m) => m.HomeComponent),
},
];
Loading

0 comments on commit 2d1c61f

Please sign in to comment.