1.115.0 • Published 3 years ago

@legalplace/typeorm-entities v1.115.0

Weekly downloads
379
License
UNLICENSED
Repository
-
Last release
3 years ago

Getting Started


The package works on several projects such as BO-form, user space, API and saas-dashboard.

Clone this project.

Then from the project directory, run:

tsc or yarn build

Release Process


Once your component or feature is tested locally (as explained above), then you are ready to release a new version of the Typeorm-entities package !

After doing git commit locally,to do this, simply run yarn release. This will prepare the Typeorm-entities for publication by automatically bumping the package version, bundling the code and create the release tag.

-Please note: To do the merges request, there is only the master branch, there is no staging branch.

Then run git push --follow-tags origin master or simply git push --follow-tags.

No need to run yarn/npm publish as the CI will publish the new version.

Please note, in order to avoid too many version bumps, you should not release a new version for test purposes unless necessary.

Instead, you should test your components locally by following the steps listed in the "Local Testing" section beforehand.

Folder and file structure

Folders

All elements should go in the src folder and have their own folder containing all of their code.

src
└── MyFirstElement
└── MyNextElement
└── ...
  1. Constants

    To add a new status, go to Constants folder, added the const, then add it to the index.ts file.

  2. Decorator

    To add a new decorator, go to Decorator folder,create a new interface file for example:

    example.decorator.ts,

    then add it to the index.ts file.For Example:

    export { example } from './example.decorator'

  3. Entities

    It contains the entities such as users, orders, modules, etc.

    To add a new entity, go to entities folder,create a new entity file for example:

    example.ts,

    Here is an example of a new entity declaration :

            @Entity("example", { schema: "schema DB" })
            export default abstract class CommonUuidEntity extends BaseEntity {
                // Declaring a primary key with uuid
            @PrimaryGeneratedColumn('uuid')
            id: string
    
            }

    For more details with the use of Typeorm entity annotations

    After the creation of the entity, it must be added to the index.ts file

    For example:

    export { default as Example } from "./example"

  4. Interfaces

    To add a new interface go to interfaces folder, create a new interface file for example:

    example.interface.ts,

    then add it to the index.ts file.For example:

    export { IExample } from './example.interface'

  5. Views

    To add a new view go to views folder, create a new view file.

    Here is an example of a new view declaration :

    @ViewEntity({
    name: "example",
    schema: "example Schema"
    })

    For more details with the use of Typeorm view annotations

    then add it to the index.ts file. For example:

    export { default as Example } from './example'

Files

Each item's folder will contain its main file (index.ts) and item-specific files.

src
└── MyFirstElement
    └── index.ts
    └── Element1.interface.ts
    └── Element2.interface.ts
    └── Element3.interface.ts
└── MyNextElement
    └── index.ts
    └── Entity1.ts
    └── Entity2.ts
    └── Entity3.ts
└── ...

Once your components are ready in the Typeorm-entities, you must check how they behave within the app you intend to use them in and if the data received is correct.

This implies the target app (ex: Bo-form) to be connected to the local version of the Typeorm-entities instead of using the actual package.

As of now, we will be using the yarn link feature to create a symlink between the Typeorm-entities project and the target app project.

This part is slightly tricky and you should the following steps:

  1. From the Typeorm-entities run yarn build
  2. Then run yarn link
  3. From the target app (ex: Bo-form) run yarn link @legalplace/typeorm-entities to replace the package with the symlink to the local Typeorm-entities
  4. All set!
  5. Run yarn build in the Typeorm-entities to see any new changes in the target app.

Once you are done testing your local components:

  1. From the Typeorm-entities, run yarn unlink to remove the symlink to the target app's.
  2. From the target app run yarn unlink @legalplace/typeorm-entities.

In both cases, you may need to run yarn install --force to restore all your packages to normal.

If you run into any issues, delete your node_modules directory, run yarn to reinstall all packges and repeat the process above.

Solved Problems

When you encounter this kind of problem :

You cannot publish over the previously published versions

If you encounter syntax errors you can use the command:

yarn lint --fix

you should do locally: npm version <package_version>

1.115.0

3 years ago

1.114.1

3 years ago

1.114.0

3 years ago

1.113.0

3 years ago

1.112.0

3 years ago

1.111.0

3 years ago

1.111.1

3 years ago

1.110.0

3 years ago

1.109.1

3 years ago

1.109.0

3 years ago

1.108.0

3 years ago

1.107.1

3 years ago

1.107.0

3 years ago

1.106.1

3 years ago

1.105.0

3 years ago

1.106.0

3 years ago

1.104.0

3 years ago

1.103.1

3 years ago

1.103.0

3 years ago

1.102.0

3 years ago

1.101.0

3 years ago

1.101.1

3 years ago

1.100.0

3 years ago

1.99.0

3 years ago

1.98.1

3 years ago

1.98.0

3 years ago

1.97.0

3 years ago

1.96.0

3 years ago

1.95.3

3 years ago

1.95.2

3 years ago

1.95.1

3 years ago

1.95.0

3 years ago

1.94.0

3 years ago

1.93.3

3 years ago

1.93.2

3 years ago

1.93.1

3 years ago

1.93.0

3 years ago

1.92.0

3 years ago

1.91.1

3 years ago

1.91.0

3 years ago

1.89.1

3 years ago

1.79.0

3 years ago

1.79.1

3 years ago

1.82.0

3 years ago

1.82.1

3 years ago

1.82.2

3 years ago

1.82.3

3 years ago

1.86.0

3 years ago

1.86.1

3 years ago

1.86.2

3 years ago

1.83.0

3 years ago

1.87.0

3 years ago

1.87.1

3 years ago

1.87.2

3 years ago

1.80.0

3 years ago

1.84.0

3 years ago

1.88.0

3 years ago

1.78.1

3 years ago

1.81.0

3 years ago

1.85.0

3 years ago

1.85.1

3 years ago

1.85.2

3 years ago

1.77.1

3 years ago

1.78.0

3 years ago

1.77.0

3 years ago

1.76.0

3 years ago

1.76.1

3 years ago

1.75.0

3 years ago

1.75.1

3 years ago

1.74.4

3 years ago

1.74.1

3 years ago

1.74.2

3 years ago

1.74.3

3 years ago

1.74.0

3 years ago

1.72.0

3 years ago

1.73.0

3 years ago

1.70.0

3 years ago

1.71.0

3 years ago

1.69.0

3 years ago

1.69.1

3 years ago

1.68.1

3 years ago

1.68.0

3 years ago

1.67.0

3 years ago

1.65.1

3 years ago

1.65.2

3 years ago

1.66.0

3 years ago

1.65.0

3 years ago

1.64.0

3 years ago

1.64.1

3 years ago

1.64.2

3 years ago

1.63.4

3 years ago

1.63.5

3 years ago

1.63.2

3 years ago

1.63.3

3 years ago

1.63.0

3 years ago

1.63.1

3 years ago

1.61.0

3 years ago

1.62.0

3 years ago

1.60.0

3 years ago

1.60.2

3 years ago

1.60.1

3 years ago

1.60.4

3 years ago

1.60.3

3 years ago

1.59.1

3 years ago

1.59.0

3 years ago

1.58.1

3 years ago

1.58.0

3 years ago

1.57.2

3 years ago

1.57.1

3 years ago

1.57.0

3 years ago

1.56.7

3 years ago

1.56.6

3 years ago

1.56.5

3 years ago

1.56.4

3 years ago

1.56.3

3 years ago

1.56.2

3 years ago

1.56.1

3 years ago

1.56.0

3 years ago

1.55.1

3 years ago

1.54.2

3 years ago

1.55.0

3 years ago

1.54.1

3 years ago

1.54.0

3 years ago

1.53.0

3 years ago

1.53.1

3 years ago

1.52.1

3 years ago

1.52.0

3 years ago

1.51.0

3 years ago

1.48.0

3 years ago

1.46.2

3 years ago

1.46.1

3 years ago

1.45.1

3 years ago

1.49.0

3 years ago

1.50.0

3 years ago

1.46.0

3 years ago

1.40.3

3 years ago

1.45.0

3 years ago

1.44.2

3 years ago

1.44.1

3 years ago

1.40.2

3 years ago

1.44.0

3 years ago

1.40.1

3 years ago

1.42.0

3 years ago

1.43.0

3 years ago

1.40.0

3 years ago

1.41.0

3 years ago

1.39.0

3 years ago

1.38.0

3 years ago

1.38.1

3 years ago

1.37.0

3 years ago

1.36.0

3 years ago

1.35.0

4 years ago

1.34.0

4 years ago

1.32.0

4 years ago

1.30.1

4 years ago

1.31.0

4 years ago

1.24.0

4 years ago

1.27.0

4 years ago

1.25.2

4 years ago

1.26.0

4 years ago

1.25.1

4 years ago

1.25.0

4 years ago

1.23.0

4 years ago

1.22.4

4 years ago

1.22.0

4 years ago

1.22.3

4 years ago

1.22.1

4 years ago

1.21.0

4 years ago

1.21.1

4 years ago

1.20.0

4 years ago

1.19.1

4 years ago

1.19.0

4 years ago

1.18.1

4 years ago

1.18.0

4 years ago

1.17.0

4 years ago

1.16.0

4 years ago

1.15.0

4 years ago

1.14.5

4 years ago

1.14.4

4 years ago

1.14.2

4 years ago

1.14.1

4 years ago

1.13.4

4 years ago

1.13.3

4 years ago

1.13.2

4 years ago

1.12.1

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.3

4 years ago

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.0.6

4 years ago