Skip to content

Commit

Permalink
merging with pFDA changes added config option
Browse files Browse the repository at this point in the history
  • Loading branch information
NikoAnderson committed Nov 28, 2023
2 parents d3f5514 + d274012 commit 9357de3
Show file tree
Hide file tree
Showing 961 changed files with 101,792 additions and 31,393 deletions.
51 changes: 51 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"tsconfig.json",
"e2e/tsconfig.json"
],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@typescript-eslint/consistent-type-definitions": "error",
"@typescript-eslint/dot-notation": "off",
"@typescript-eslint/explicit-member-accessibility": [
"off",
{
"accessibility": "explicit"
}
],
"brace-style": [
"error",
"1tbs"
],
"id-blacklist": "off",
"id-match": "off",
"no-underscore-dangle": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/dist
/tmp
/out-tsc
/.angular

# dependencies
/node_modules
Expand All @@ -24,6 +25,11 @@
!.vscode/launch.json
!.vscode/extensions.json

# IDE - VSCode 2019
.vs/*

pre-commit

# misc
/.sass-cache
/connect.lock
Expand All @@ -48,4 +54,4 @@ Thumbs.db

/lib/dojo-custom-jsdraw/**/*

/**/venv
/**/venv
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
dist: trusty

language: node_js
node_js:
- 14.17.0


install:

- cp package.dev.json package.json
- rm -rf node_modules
- rm -rf package-lock.json
- rm -rf package.json
- cp package.dev.json package.json
- npm install
- npm run build-file-select
- npm run build-jsdraw-wrapper
- npm run build-ketcher-wrapper
- cp package.real.json package.json
- npm install --legacy-peer-deps
- npm install webpack
- npm i --save webpack-sources --legacy-peer-deps
- npm install -f @types/[email protected]
- export NODE_OPTIONS="--max-old-space-size=8192"
script:
- npm run build:fda:prod
after_success:
- if [ $TRAVIS_BRANCH = 'development_3.0' ]; then bash travisScript.sh; else echo "Not a branch set to push"; fi
94 changes: 77 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,69 @@ Technology stack
- [Angular CLI](https://github.com/angular/angular-cli)
- [Angular Material](https://material.angular.io/) based on [Google's Material Design methodology](https://material.io/design/)

## Requirements
## Getting Started Overview

The full steps for a complete build are as follows, each will be given in more detail:

1. Step 1 [Required] Obtain the required software dependencies (node, npm, and angular CLI, as mentioned above)
2. Step 2 [Optional] Clear any previous build files, locks, and local dependencies (this step is not typically necessary, but it ensures constency if there were previous local builds)
3. Step 3 [Optional] Prepare dojo dependencies and place in zip file `lib/dojo-custom-jsdraw.zip` (this dojo build is already prepared by default so this step is optional)
4. Step 4 [Required] Prepare fundamental dependencies by doing `npm install` with `package.dev.json` file.
5. Step 5 [Required] Prepare extended one-time build dependencies using specific build commands
6. Step 6 [Required] Build, run or test the codebase as normal

If you are using a bash terminal, steps 2-5 can be accomplished by simply running:
```
bash build.sh
```

## Step 1: Software Requirements

Make sure to have these installed in order to run the application:

- [Node](https://nodejs.org/en/)
- [npm](https://www.npmjs.com/) - usually included in the node installation
- Angular CLI - on any command line run `npm install -g @angular/cli@latest`
- On Windows 7, the angular cli "ng" executable will be located in this folder:
- C:\Users\<USER>\AppData\Roaming\npm\
- Hopefully, you've already added this folder to you windows environment path.
- ... the ng.exe program will be used quite a bit.
* [Node](https://nodejs.org/en/)
* [npm](https://www.npmjs.com/) - usually included in the node installation
* Angular CLI - on any command line run `npm install -g @angular/cli@latest`
* The angular cli "ng" executable will be located in this folder:
* `C:\Users\<USER>\AppData\Roaming\npm\` (Windows 7)
* `~/.npm-global/bin/` (linux)
* Note: For best results, this path should be added to your windows/bash
path as the command will be used a lot.
* The angular CLI tool currently needs to have build-angular version <=0.803.25
* To force this installation after an audit fix run `npm i @angular-devkit/[email protected]`

## Step 2 [Optional]: Clear any Previous Build Files

This step isn't always necessary, but can be useful when attempting to force a de novo build. The following files should be removed from the root directory:

## Install Application Packages
```
package-lock.json
node_modules
package.json
```

After you have cloned the application to your local computer, and prepared the dojo dependencies, open your favorite command line, navigate to the root directory (where the `package.json` file is located),
and copy the `package.dev.json` file to a new file called `package.json`, then run the command:
## Step 3 [Optional]: Prepare Custom Dojo Dependency

This step isn't typically necessary. The purpose of this step is to prepare a slimmed down version of dojo for the jsdraw structure editor component, but the default build already has a form of this prepackaged. To perform a more custom dojo build, read the `lib/README.md` file and follow its instructions.

- `npm install`

## Step 4: Install Fundamental Dependencies

The first time you do this, it will take a while to download all required packages.
This step acquires the "base" dependencies needed to do further builds. The full _real_ `package.json` file would have a cyclic dependency issue if we attempted to install using it directly, so we first build only the bare minimum pieces needed to build the other dependencies. This is accomplished by using a trimmed down version of the package.json file named `package.dev.json`. The following commands will make this happen:

You should repeat this step whenever somebody adds a new package to the application. It's probably not a bad idea to run it whenever you start working on the application
bash:
```
cp package.dev.json package.json
npm install
```

windows CMD:
```
copy package.dev.json package.json
npm install
```

## Perform a One-Time Build of dependencies
## Step 5: Perform a One-Time Build of Dependencies

You'll have to run the following commands the first time you work on the application to make sure a few libraries are built and ready to be used by the application:

Expand All @@ -43,9 +79,27 @@ npm run build-jsdraw-wrapper
npm run build-ketcher-wrapper
```

After this is done, the file `package.real.json` should be copied and replace the `package.json` file.
This MUST be done while the `package.dev.json` file is being used as `package.json`, as in step 4. Once this is done, you then replace the package.json file with package.real.json to complete the preperation. This can be accomplished with the following commands:

bash:
```
cp package.real.json package.json
npm install
```

windows CMD:
```
copy package.real.json package.json
npm install
```

## Run Application for Specific Environment
Doing the install at this time may reveal some elements that suggest an audit fix. While this can be done, newer versions of the angular build tool are not compatible with the current build process, so the specific <=0.803.25 version must be forced. To both do a basic audit fix and force this version, you can run the following commands (either windows CMD or bash):

```
npm audit fix // this step not needed after angular upgrade
```

## Step 6: Run Application for Specific Environment

- Go the the package.json file and look at the scripts property to see what availabe commands exist
- The commands to run during development begin with "start"
Expand All @@ -54,6 +108,10 @@ After this is done, the file `package.real.json` should be copied and replace th
- After a few seconds of compiling the application, you're ready to view your application
- Open your browser and navigate to http://localhost:4200

## Troubleshooting

GSRSFrontend uses node-sass, which has varying compatibilities based on the version of node.js being used. See https://www.npmjs.com/package/node-sass to check which version is compatable with your node version. The value of node-sass being used can be changed in the root 'package.json' file, where the default value is set as `"node-sass": "4.13.1",`

# Development tools


Expand All @@ -69,6 +127,8 @@ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.

Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).



## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
Expand Down
Loading

0 comments on commit 9357de3

Please sign in to comment.