Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

General improvements #388

Merged
merged 14 commits into from
Apr 16, 2023
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ Gopkg.toml
**/e2e/*
**/node_modules/*
**/dist/*
**/test/*
76 changes: 76 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
"parserOptions": {
"project": [
"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": {
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "app",
"style": "kebab-case"
}
],
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "app",
"style": "camelCase"
}
],
"@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",
"max-len": [
"error",
{
"code": 200
}
],
"no-underscore-dangle": "off",
"valid-typeof": "error",
"prefer-arrow/prefer-arrow-functions": "off",
"@typescript-eslint/member-ordering": "off",
"object-shorthand": "off"
}
},
{
"files": [
"*.html"
],
"extends": [
"plugin:@angular-eslint/template/recommended"
],
"rules": {}
}
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ addons:
chrome: stable

before_install:
- nvm install 14.15
- nvm install 14.20

install:
- go get -t ./...
Expand Down
14 changes: 8 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ You must have goimports installed (use `make install-linters`).

## Frontend

The frontend is an Angular application that can be viewed in a web browser. I currently uses Angular 8.
The frontend is an Angular application that can be viewed in a web browser. I currently uses Angular 15.

### Frontend file structure

The frontend code is inside the [src](src) folder and it follows the normal structure of an Angular project.

You can find the components, pipes and services (most of the code) in in the [src/app](src/app) folder. Resource files are in [src/assets](src/assets) and the JS libs/tools that were not included with NPM are in [src/js](src/js).

You can find the code of the e2e tests in the [e2e](e2e) folder. The unit tests are currently not being used.
You can find the code of the e2e tests in the [test](test) folder. The unit tests are currently not being used.

### Integration with the browser's search functionality

Expand Down Expand Up @@ -101,18 +101,20 @@ npm run lint

### e2e Tests

Note: before running the e2e tests you must compile the frontend and run the server. The e2e testing process will use the compiled frontend, so if you forget to run the compilation process your lastest changes will be ignored.

If you are running a Skycoin node normally, you can run the e2e tests with:
If you are running a Skycoin node normally, the server must be run locally with `npm start` and you can run the e2e tests with:

```sh
npm run e2e
```

If you are running a Skycoin node using the test database (`blockchain-180.db`), you can run the e2e tests with:
If you are running a Skycoin node using the test database (`blockchain-180.db`), the server must be running on `http://127.0.0.1:8001` and you can run the e2e tests with:

```sh
npm run e2e-blockchain-180
```

The second method is the one used in Travis.

Note 1: before running the e2e tests with the test database (`blockchain-180.db`), you must compile the frontend and run the server. The e2e testing process will use the compiled frontend, so if you forget to run the compilation process your lastest changes will be ignored.

Note 2: if the e2e tests fail with an error related to the version of Google Chrome and Chromedriver, you must update the version of Chromedriver on [package.json](package.json) to make it coincide with the version of Google Chrome. After that, run `npm install` to update the dependencies and run the tests again.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ When the explorer is being hosted in a server, you only need the URL to access i

For the server to work, you must install Go (Golang) v11.x or newer. You also need a Skycoin node v0.26 or newer (normally the node included with the desktop wallets does not work, as it must be running on the default port: 6420).

For compiling the frontend or starting it in development mode, you need Node.js v11.x or newer and a compatible version of the NPM package manager. If the frontend has already been compiled and will be opened through the included server (via [http://127.0.0.1:8001](http://127.0.0.1:8001)), these requirements are not necessary.
For compiling the frontend or starting it in development mode, you need Node.js v14.20 or newer and a compatible version of the NPM package manager. If the frontend has already been compiled and will be opened through the included server (via [http://127.0.0.1:8001](http://127.0.0.1:8001)), these requirements are not necessary.

### Initial configuration steps

Expand Down
60 changes: 17 additions & 43 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,61 +105,35 @@
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"builder": "@angular-eslint/builder:lint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": []
}
}
}
},
"skycoin-explorer-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": []
}
}
}
},
"skycoin-explorer-e2e-blockchain-180": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor-blockchain-180.conf.js"
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
}
}
}
},
"defaultProject": "skycoin-explorer",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"style": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
},
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
},
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
},
"cli": {
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
}
122 changes: 0 additions & 122 deletions e2e/address-detail/address-detail.e2e-spec.ts

This file was deleted.

Loading