arena-split-core
v0.0.23-SNAPSHOT
Published
## Typescript application following Domain Driven Design principles
Keywords
Readme
Arena Split Core
Typescript application following Domain Driven Design principles
Development
To start the project you need to have the following tools installed:
- Node.js v20
- NPM v10
- WebStorm or any other IDE that supports Typescript
- Git
Installation of the repository
Clone the repo
git clone [email protected]:carlosupreme/arena-split-core.gitNavigate to the
arena-split-corefoldercd arena-split-coreInmediately after cloning the repository you need to move to the
developbranchgit checkout developAnd create your own branch
git checkout -b my-new-featureInstall the dependencies
npm installRun the tests
npm run testBuild the application to ensure everything is working fine
npm run build
Developing in the Core
Once you have the application running you can start developing in the core. The core is the main application that will be
used by other applications like the api or the web application.
When you are developing in the core application you need to follow these steps
Do Test Driven Development please, write the test first and then write the code to make the test pass
Deployment
Suppose that you made a new feature (with tests).
You can deploy the core application to npm and then other developers that are using the core will have your
changes.
Just run the following commands:
Obviously the tests should be passing before deploying, so ensure that
npm run test If you added new classes or interfaces that should be exported, ensure that the corresponding index.ts file is updated with the new exports
This index files has the following format:
Just the layer application and domain.
Starts with the bounded context name and - and then the layer name (domain or application).
Let's say that you added a new Domain value object called UserName to the friends bounded context, you should update the friends-domain.ts file
// friends-domain.ts before
export * from "./value-objects/Email";
export * from "./value-objects/FullName";// friends-domain.ts after
export * from "./value-objects/Email";
export * from "./value-objects/FullName";
export * from "./value-objects/UserName"; // addedThen run the following command to build the application
npm run buildThe successful output should look like this:
> [email protected] build
> tsup
CLI Building entry: src/index.ts
CLI Using tsconfig: tsconfig.json
CLI tsup v8.1.0
CLI Using tsup config: /home/carlos/programacion/arena-aplit/core/package.json
CLI Target: es2020
CLI Cleaning output folder
CJS Build start
ESM Build start
ESM dist/index.mjs 8.00 KB
ESM dist/index.mjs.map 17.60 KB
ESM ⚡️ Build success in 44ms
CJS dist/index.js 9.77 KB
CJS dist/index.js.map 17.83 KB
CJS ⚡️ Build success in 45ms
DTS Build start
DTS ⚡️ Build success in 1475ms
DTS dist/index.d.ts 5.64 KB
DTS dist/index.d.mts 5.64 KBAfter that, change the package.json version to a new version, following our versioning guide.
package.json before
{
"version": "1.1.0"
}package.json after
{
"version": "1.2.0"
}And then publish it to npm
npm publish --tag latestIf everything goes well commit your branch and push it to the remote repository
git add . && git commit -m 'new feature' && git push origin my-new-featureFinally open a pull request to the develop branch and wait for the approval
