Skip to content

Commit

Permalink
Merge pull request #150 from ncats/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
tsheils authored May 23, 2024
2 parents b4560da + 5380dea commit 492968a
Show file tree
Hide file tree
Showing 396 changed files with 23,848 additions and 43,928 deletions.
8 changes: 4 additions & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"root": true,
"ignorePatterns": ["**/*"],
"plugins": ["@nrwl/nx"],
"plugins": ["@nx"],
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"@nx/enforce-module-boundaries": [
"error",
{
"enforceBuildableLibDependency": true,
Expand All @@ -23,12 +23,12 @@
},
{
"files": ["*.ts", "*.tsx"],
"extends": ["plugin:@nrwl/nx/typescript"],
"extends": ["plugin:@nx/typescript"],
"rules": {}
},
{
"files": ["*.js", "*.jsx"],
"extends": ["plugin:@nrwl/nx/javascript"],
"extends": ["plugin:@nx/javascript"],
"rules": {}
},
{
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on:
push:
branches: ['master', 'development']
pull_request:
branches: ['master', 'development']

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm i -g @angular/cli
- run: npm i -g nx
- run: npm i
- run: ng run-many --target=lint
- run: ng run-many --target=test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ yarn-error.log
testem.log
/typings

apps/ramp-client/src/environments/environment*
apps/ramp-client/src/environments/environment.ts

# System Files
.DS_Store
Thumbs.db
Expand All @@ -42,3 +45,5 @@ Thumbs.db
.Rproj.user
RaMP-Client.iml


.nx/cache
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@

/dist
/coverage
/.angular
/.idea
/node_modules
/.nx/cache

.angular
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
dist: jammy
language: node_js
node_js:
- '16'
- 20

addons:
chrome: stable
Expand All @@ -13,5 +14,5 @@ install:
- npm install

script:
- ng lint
- ng run-many --all --target=test -- --no-watch --no-progress --browsers=ChromeHeadlessCI
- ng run-many --all --target=lint
- ng run-many --all --target=test --no-watch --no-progress --browsers=ChromeHeadlessCI
18 changes: 9 additions & 9 deletions apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@ These capabilities include generating applications, libraries, etc as well as th
Below are our core plugins:

- [React](https://reactjs.org)
- `npm install --save-dev @nrwl/react`
- `npm install --save-dev @nx/react`
- Web (no framework frontends)
- `npm install --save-dev @nrwl/web`
- `npm install --save-dev @nx/web`
- [Angular](https://angular.io)
- `npm install --save-dev @nrwl/angular`
- `npm install --save-dev @nx/angular`
- [Nest](https://nestjs.com)
- `npm install --save-dev @nrwl/nest`
- `npm install --save-dev @nx/nest`
- [Express](https://expressjs.com)
- `npm install --save-dev @nrwl/express`
- `npm install --save-dev @nx/express`
- [Node](https://nodejs.org)
- `npm install --save-dev @nrwl/node`
- `npm install --save-dev @nx/node`

There are also many [community plugins](https://nx.dev/community) you could add.

## Generate an application

Run `nx g @nrwl/react:app my-app` to generate an application.
Run `nx g @nx/react:app my-app` to generate an application.

> You can use any of the plugins above to generate applications as well.
When using Nx, you can create multiple applications and libraries in the same workspace.

## Generate a library

Run `nx g @nrwl/react:lib my-lib` to generate a library.
Run `nx g @nx/react:lib my-lib` to generate a library.

> You can also use any of the plugins above to generate libraries as well.
Expand All @@ -51,7 +51,7 @@ Run `nx serve my-app` for a dev server. Navigate to http://localhost:4200/. The

## Code scaffolding

Run `nx g @nrwl/react:component my-component --project=my-app` to generate a new component.
Run `nx g @nx/react:component my-component --project=my-app` to generate a new component.

## Build

Expand Down
8 changes: 2 additions & 6 deletions apps/ramp-client-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"projectType": "application",
"targets": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/ramp-client-e2e/cypress.json",
"devServerTarget": "ramp-client:serve:development",
Expand All @@ -18,11 +18,7 @@
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": ["apps/ramp-client-e2e/**/*.{js,ts}"]
}
"executor": "@nx/eslint:lint"
}
},
"tags": [],
Expand Down
6 changes: 3 additions & 3 deletions apps/ramp-client-e2e/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
},
"include": ["src/**/*.ts", "src/**/*.js"],
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
"strictTemplates": true,
},
}
4 changes: 2 additions & 2 deletions apps/ramp-client/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"files": ["*.ts"],
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand All @@ -29,7 +29,7 @@
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
}
]
Expand Down
3 changes: 1 addition & 2 deletions apps/ramp-client/CLIENT_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ To run the client application locally, please follow these steps:
4. Change directory (`cd`) to the `apps/ramp-client` directory of this repository
5. Type `ng s` or `nx run ramp-client:serve:development` and hit Enter

To build the application and run it in a container, just build and run the dockerfile in the client directory.

To build the application and run it in a container, just build and run the dockerfile in the client directory.
4 changes: 2 additions & 2 deletions apps/ramp-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.16-alpine3.17 AS build
FROM node:20.11-alpine3.18 AS build

ENV npm_config_unsafe_perm=true

Expand All @@ -20,7 +20,7 @@ RUN npm install -g nx
RUN npm install
RUN nx g @nrwl/workspace:fix-configuration
RUN npm i
RUN NODE_OPTIONS=--max_old_space_size=4096 nx run ramp-client:prerender:production --verbose
RUN NODE_OPTIONS=--max_old_space_size=8192 nx run ramp-client:build:production --verbose

FROM registry.ncats.nih.gov:5000/labshare/docker-base-web

Expand Down
76 changes: 44 additions & 32 deletions apps/ramp-client/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@
"name": "ramp-client",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/ramp-client/src",
"prefix": "ramp-client",
"sourceRoot": "apps/ramp-client/src",
"tags": ["app:ramp-client"],
"targets": {
"build": {
"executor": "@angular-devkit/build-angular:browser",
"executor": "@angular-devkit/build-angular:application",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/ramp-client/browser",
"allowedCommonJsDependencies": [
"swagger-ui"
],
"outputPath": "dist/ramp-client",
"index": "apps/ramp-client/src/index.html",
"main": "apps/ramp-client/src/main.ts",
"browser": "apps/ramp-client/src/main.ts",
"polyfills": ["zone.js"],
"tsConfig": "apps/ramp-client/tsconfig.app.json",
"inlineStyleLanguage": "scss",
Expand All @@ -36,20 +40,28 @@
"node_modules/swagger-ui/dist/swagger-ui.css",
"apps/ramp-client/src/styles.scss"
],
"scripts": []
"scripts": [],
"server": "apps/ramp-client/src/main.server.ts",
"prerender": {
"discoverRoutes": false,
"routesFile": "./apps/ramp-client/routes.txt"
},
"ssr": {
"entry": "apps/ramp-client/server.ts"
}
},
"configurations": {
"production": {
"budgets": [
{
"type": "initial",
"maximumWarning": "500kb",
"maximumError": "1000mb"
"maximumWarning": "5000kb",
"maximumError": "10000mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "2kb",
"maximumError": "500kb"
"maximumWarning": "2000kb",
"maximumError": "5000kb"
}
],
"fileReplacements": [
Expand All @@ -58,15 +70,20 @@
"with": "apps/ramp-client/src/environments/environment.prod.ts"
}
],
"outputHashing": "all"
"outputHashing": "all",
"optimization": {
"scripts": true,
"styles": {
"minify": true,
"inlineCritical": true
},
"fonts": false
}
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
"sourceMap": true
}
},
"defaultConfiguration": "production"
Expand All @@ -75,31 +92,25 @@
"executor": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "ramp-client:build:production"
"buildTarget": "ramp-client:build:production"
},
"development": {
"browserTarget": "ramp-client:build:development"
"buildTarget": "ramp-client:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"executor": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "ramp-client:build"
"buildTarget": "ramp-client:build"
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"options": {
"lintFilePatterns": [
"apps/ramp-client/src/**/*.ts",
"apps/ramp-client/src/**/*.html"
]
}
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nrwl/jest:jest",
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/apps/ramp-client"],
"options": {
"jestConfig": "apps/ramp-client/jest.config.ts",
Expand Down Expand Up @@ -128,9 +139,11 @@
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
"sourceMap": true,
"extractLicenses": false
"extractLicenses": false,
"vendorChunk": true
}
},
"defaultConfiguration": "production",
Expand All @@ -150,7 +163,7 @@
}
},
"serve-ssr": {
"executor": "@nguniversal/builders:ssr-dev-server",
"executor": "@angular-devkit/build-angular:ssr-dev-server",
"configurations": {
"development": {
"browserTarget": "ramp-client:build:development",
Expand All @@ -164,10 +177,10 @@
"defaultConfiguration": "development"
},
"prerender": {
"executor": "@nguniversal/builders:prerender",
"executor": "@angular-devkit/build-angular:prerender",
"options": {
"guessRoutes": false,
"routesFile": "./apps/ramp-client/routes.txt"
"routesFile": "./apps/ramp-client/routes.txt",
"discoverRoutes": false
},
"configurations": {
"production": {
Expand All @@ -181,6 +194,5 @@
},
"defaultConfiguration": "production"
}
},
"tags": ["app:ramp-client"]
}
}
Loading

0 comments on commit 492968a

Please sign in to comment.