@universis/common
TypeScript icon, indicating that this package has built-in type declarations

1.6.2 • Public • Published

@universis/common

Universis is a coordinated effort by Greek academic institutions to build a Student Information System as an open source platform. The target is to serve our common needs to support academic and administrative processes.

@universis/common package contains common components and services for building client applications for Universis project.

Usage

npm i @universis/common

Development

Import @universis/common as submodule in any angular cli project by replacing newProjectRoot as already configured in your angular.json

git submodule add https://gitlab.com/universis/common.git <newProjectRoot>/common

e.g.

git submodule add https://gitlab.com/universis/common.git projects/common

Add the following entries to tsconfig.app.json#compilerOptions.paths:

{
    "compilerOptions": {
        "paths": {
            "@universis/common/routing": [
                "<newProjectRoot>/common/routing/src/public_api"
            ],
            "@universis/common/testing": [
                "<newProjectRoot>/common/testing/src/public_api"
            ],
            "@universis/common": [
                "<newProjectRoot>/common/src/public_api"
            ]
            ...
        }
    }
}  

If you want to include @universis/common as an angular cli project, include the following section in angular.json under projects:

"projects": {
  "common": {
    "root": "<newProjectRoot>/common",
    "sourceRoot": "<newProjectRoot>/common/src",
    "projectType": "library",
    "prefix": "lib",
    "architect": {
      "build": {
        "builder": "@angular-devkit/build-ng-packagr:build",
        "options": {
          "tsConfig": "<newProjectRoot>/common/tsconfig.lib.json",
          "project": "<newProjectRoot>/common/ng-package.json"
        }
      },
      "test": {
        "builder": "@angular-devkit/build-angular:karma",
        "options": {
          "main": "<newProjectRoot>/common/src/test.ts",
          "polyfills": "<newProjectRoot>/common/src/polyfills.ts",
          "tsConfig": "<newProjectRoot>/common/tsconfig.spec.json",
          "karmaConfig": "<newProjectRoot>/common/karma.conf.js",
          "watch": false,
          "codeCoverage": true,
          "scripts": []
        }
      },
      "lint": {
        "builder": "@angular-devkit/build-angular:tslint",
        "options": {
          "tsConfig": [
            "<newProjectRoot>/common/tsconfig.lib.json",
            "<newProjectRoot>/common/tsconfig.spec.json"
          ],
          "exclude": [
            "**/node_modules/**"
          ]
        }
      }
    }
  },
  ...
}

Testing

Intro

In order to test @universis/common package, we use Karma as our test-runner and Jasmine as our testing framework. We also use Puppeteer, a high-level API to manipulate the dev-tools of any chromium based browser. You should keep in mind that puppeteer is a peer dependency of the whole project and should be placed in the parent directory of the repository universis.

Example

To run all of our tests simply run

ng test common

This will compile the common package and run our test suite in a ChromeHeadless browser with no sandbox.

Extra

You can also have a visual representation of the tests running by adding

      ChromeNoSandbox: {
        base: 'Chrome',
        flags: [
          '--no-sandbox',
          '--enable-logging=stderr',
          '--disable-web-security',
          '--disable-gpu',
          '--no-proxy-server'
        ]
      },

under the customLaunchers in packages/common/karma.conf.js

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.6.2167latest

Version History

VersionDownloads (Last 7 Days)Published
1.6.2167
15.4.00
15.3.10
15.3.00
15.2.30
15.2.20
1.6.13
15.2.13
15.2.02
1.6.00
15.1.150
1.5.120
15.1.140
15.1.120
1.5.110
15.1.111
15.1.100
15.1.90
1.5.100
1.5.90
15.1.80
15.1.60
15.1.50
15.1.40
15.1.30
15.1.20
1.5.80
1.5.70
1.5.60
1.5.40
1.5.31
1.5.20
1.5.10
1.5.00
1.4.10
1.4.00
1.3.20
1.3.10
1.3.00
1.2.230
1.2.220
1.2.210
1.2.200
1.2.190
1.2.180
1.2.171
1.2.160
1.2.150
1.2.140
1.2.130
1.2.110
1.2.100
1.2.90
1.2.80
1.2.70
1.2.61
1.2.50
1.2.20
1.2.10
1.2.00
1.1.90
1.1.80
1.1.70
1.1.60
1.1.50
1.1.40
1.1.30
1.1.20
1.1.10
1.0.140
1.0.120
1.0.110
1.0.100
1.0.90
1.0.81
1.0.70
1.0.60
1.0.41
1.0.4-dev.40
1.0.4-dev.20
1.0.4-dev.10
1.0.30
1.0.20
1.0.2-dev.10
1.0.10
1.0.1-dev.50
1.0.1-dev.40
1.0.1-dev.30
1.0.1-dev.10

Package Sidebar

Install

npm i @universis/common

Weekly Downloads

182

Version

1.6.2

License

LGPL-3.0-or-later

Unpacked Size

4.44 MB

Total Files

281

Last publish

Collaborators

  • universis