Skip to content

Commit

Permalink
add Nx cloud, run lint and formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
santoshyadavdev committed Jul 10, 2023
1 parent 00714c8 commit 0b35a75
Show file tree
Hide file tree
Showing 10 changed files with 605 additions and 210 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI
on:
push:
branches:
- main
pull_request:

env:
NX_CLOUD_DISTRIBUTED_EXECUTION: 'true'

jobs:
main:
name: Nx Cloud - Main Job
uses: nrwl/ci/.github/workflows/nx-cloud-main.yml@v0.13.0
with:
number-of-agents: 3
parallel-commands: |
npx nx-cloud record -- npx nx format:check
parallel-commands-on-agents: |
npx nx affected -t lint --parallel=3 --configuration=ci & npx nx affected -t build --parallel=3
agents:
name: Nx Cloud - Agents
uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.0
with:
number-of-agents: 3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**This workspace has been generated by [Nx, a Smart, fast and extensible build system.](https://nx.dev)**

## Start the app
## Start the app

To start the development server run `nx serve santoshWorkspace`. Open your browser and navigate to http://localhost:4200/. Happy coding!

Expand Down
18 changes: 5 additions & 13 deletions apps/santosh-workspace/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"outputs": [
"{options.outputPath}"
],
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/santosh-workspace",
"index": "apps/santosh-workspace/src/index.html",
"main": "apps/santosh-workspace/src/main.ts",
"polyfills": [
"zone.js"
],
"polyfills": ["zone.js"],
"tsConfig": "apps/santosh-workspace/tsconfig.app.json",
"assets": [
"apps/santosh-workspace/src/favicon.ico",
Expand Down Expand Up @@ -76,9 +72,7 @@
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": [
"{options.outputFile}"
],
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"apps/santosh-workspace/**/*.ts",
Expand All @@ -88,9 +82,7 @@
},
"test": {
"executor": "@nx/jest:jest",
"outputs": [
"{workspaceRoot}/coverage/{projectRoot}"
],
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/santosh-workspace/jest.config.ts",
"passWithNoTests": true
Expand All @@ -109,4 +101,4 @@
}
}
}
}
}
5 changes: 4 additions & 1 deletion apps/santosh-workspace/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ import { appRoutes } from './app.routes';
import { provideAnimations } from '@angular/platform-browser/animations';

export const appConfig: ApplicationConfig = {
providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation()), provideAnimations()],
providers: [
provideRouter(appRoutes, withEnabledBlockingInitialNavigation()),
provideAnimations(),
],
};
14 changes: 10 additions & 4 deletions apps/santosh-workspace/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
<base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
/>
</head>
<body class="mat-typography">
<org-root></org-root>
</body>
Expand Down
10 changes: 8 additions & 2 deletions apps/santosh-workspace/src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/* You can add global styles to this file, and also import other style files */

html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }
html,
body {
height: 100%;
}
body {
margin: 0;
font-family: Roboto, 'Helvetica Neue', sans-serif;
}
2 changes: 1 addition & 1 deletion libs/home/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const total = 10;
export const total = 10;
5 changes: 3 additions & 2 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"$schema": "./node_modules/nx/schemas/nx-schema.json",
"tasksRunnerOptions": {
"default": {
"runner": "nx/tasks-runners/default",
"runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "test", "e2e"]
"cacheableOperations": ["build", "lint", "test", "e2e"],
"accessToken": "YjgyNjI0M2YtNDhjOC00YjU1LWI1N2YtOGY0ODU0MzUzOThifHJlYWQtd3JpdGU="
}
}
},
Expand Down
Loading

0 comments on commit 0b35a75

Please sign in to comment.