0.1.0 • Published 2 years ago

tt-core v0.1.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

TT-Core

Workspace for TT-Core library development

Requirements

NPM version 7+

Install

Clone repository and run

npm install

to install workspace.

Integration

If your project already integrated with taxtank-core then skip this step.

Integrate the library to Web/Native app by the following steps: 1) Install NPM-package

npm install taxtank-core

2) Integrate environment into AppModule

@NgModule({
  imports: [
    ...
    TtCoreModule.forRoot(environment)
  ]
})
export class AppModule {}

Development

For local development you need to install taxtank-core as local dependency.

1) Run watcher:

npm run watch

Check if folder dist created and has files: /dist/tt-core/*;

To replace npm package with local repository run the following command:

npm install file:../tt-core/dist/tt-core

../tt-core/dist/tt-core is a relative path from Web/Native repository root to tt-core dist folder. Change it to yours if you cloned tt-core not near Web/Native repos.

Now you got your local tt-core version as Apps dependency. You can start development. To start watcher run the following command:

Now all changes in the library will automatically rebuild your local ./dist/tt-core folder and you will see that changes in your local Web/Native project.

Usage

Just import things you need from the library:

import { AddressService, PropertyCategoryService, PropertyService, User, UserService, UserStatusEnum } from 'taxtank-core';

and use them as usualy.

Deployment

When all changes are done just commit and push them to the repo as usually. After that you have to update npm package by the following steps: 1) Improve NPM-package version: Go to lib directory

cd ./projects/tt-core

Improve package version:

For bugfixing, improvements, small changes, etc.

npm version patch

For new features, refactorings, big changes, etc.

npm version minor

Then go back to the root and build prod configuration:

cd ../..
npm run build

And publish built NPM-package:

cd ./dist/tt-core
npm publish

Finish work

When all changes are saved don't forget to get Web/Native dependency back by the following command:

npm install taxtank-core@latest

Make sure your dependency has the same version as th actual tt-core npm package.

Create new file

When you create new collection, service, enum etc, you must write the path to the file in

projects/tt-core/src/public-api.ts