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

59 split jitar into packages #60

Merged
merged 5 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ After a node starts successfully it will register itself to the gateway with all
Setting up Jitar is easy. It simply needs to be added as a NPM dependency to your application. Node.js version 18.7 or higher are required.

```bash
npm install jitar
npm install jitar-nodejs-server
```

Now you're ready to chop applications! Follow our [Getting started](https://docs.jitar.dev/02_getting_started) guide to create your first application.
Expand Down
4 changes: 2 additions & 2 deletions documentation/02_getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When working with TypeScript version 4.4.2 or higher is required.
Jitar needs to be added as a NPM dependency to your application.

```bash
npm install jitar
npm install jitar-nodejs-server
```

Both JavaScript and TypeScript are supported by default.
Expand Down Expand Up @@ -99,7 +99,7 @@ For bootstrapping Jitar we need to create an application starting point. This is
src/start.ts

```ts
import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion documentation/04_basic_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ Procedures can make use of a broad variety of data types. When sharing data betw

* Primary types (string, number, boolean, null, undefined)
* Collection types (array, set, map)
* Object types (plain objects, class objects)
* Object types (plain objects, class objects, dates)
* [Binary data](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray){:target="_blank"}

Any class object can be transported as long as it can be reconstructed. Private fields are supported, but need access through the constructor or getter / setter. Otherwise, their value will get lost in the transportation process.
Expand Down
4 changes: 2 additions & 2 deletions documentation/05_advanced_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ To bootstrap any Jitar service in Node.js we need to start the server using the
src/server.ts

```ts
import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);

Expand Down Expand Up @@ -190,7 +190,7 @@ When the Jitar server has started using the [startServer](#startserver) hook we
src/start.ts

```ts
import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

import DatabaseHealthCheck from './DatabaseHealthCheck.js';

Expand Down
4 changes: 4 additions & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
cache
node_modules
package-lock.json
2 changes: 1 addition & 1 deletion examples/1-basic/1-hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"start": "node --experimental-network-imports --experimental-fetch dist/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
4 changes: 2 additions & 2 deletions examples/1-basic/1-hello-world/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);
const moduleImporter = async (specifier: string) => import(specifier);

startServer(moduleImporter);
2 changes: 1 addition & 1 deletion examples/1-basic/2-segmentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"node2": "node --experimental-network-imports --experimental-fetch dist/start.js --config=conf/node2.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/2-segmentation/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/3-load-balancing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"node2": "node --experimental-network-imports --experimental-fetch dist/start.js --config=conf/node2.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/3-load-balancing/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/4-access-protection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"start": "node --experimental-network-imports --experimental-fetch dist/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/4-access-protection/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/5-multi-version/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"start": "node --experimental-network-imports --experimental-fetch dist/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/5-multi-version/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/6-data-transportation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"node2": "node --experimental-network-imports --experimental-fetch dist/start.js --config=conf/node2.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/6-data-transportation/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/7-error-handling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"node2": "node --experimental-network-imports --experimental-fetch dist/start.js --config=conf/node2.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/1-basic/7-error-handling/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/1-basic/8-javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"start": "node --experimental-network-imports --experimental-fetch src/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
2 changes: 1 addition & 1 deletion examples/2-advanced/1-start-hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "node --experimental-network-imports --experimental-fetch dist/server.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
},
"devDependencies": {
"cpx2": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/2-advanced/1-start-hooks/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async (specifier: string) => import(specifier);

Expand Down
2 changes: 1 addition & 1 deletion examples/2-advanced/2-run-procedure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"start": "node --experimental-network-imports --experimental-fetch dist/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
},
"devDependencies": {
"cpx2": "^4.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/2-advanced/2-run-procedure/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);
const moduleImporter = async (specifier: string) => import(specifier);

startServer(moduleImporter);
2 changes: 1 addition & 1 deletion examples/2-advanced/3-health-checks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"start": "node --experimental-network-imports --experimental-fetch dist/start.js --config=jitar.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
4 changes: 2 additions & 2 deletions examples/2-advanced/3-health-checks/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

import DatabaseHealthCheck from './DatabaseHealthCheck.js';

const moduleImporter = async(specifier: string) => import(specifier);
const moduleImporter = async (specifier: string) => import(specifier);

// Top level await is not supported in Node.js yet,
// so we use the classic promise syntax for this case.
Expand Down
2 changes: 1 addition & 1 deletion examples/3-apps/1-full-stack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"mongodb": "^4.9.1",
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
},
"devDependencies": {
"@types/react": "^18.0.17",
Expand Down
4 changes: 2 additions & 2 deletions examples/3-apps/1-full-stack/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);
const moduleImporter = async (specifier: string) => import(specifier);

startServer(moduleImporter);
2 changes: 1 addition & 1 deletion examples/3-apps/2-microservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"orders": "node --experimental-network-imports --experimental-fetch dist/start.js --config=./conf/node-orders.json"
},
"dependencies": {
"jitar": "^0.1.2"
"jitar-nodejs-server": "^0.1.0"
}
}
4 changes: 2 additions & 2 deletions examples/3-apps/2-microservices/src/start.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import { startServer } from 'jitar';
import { startServer } from 'jitar-nodejs-server';

const moduleImporter = async(specifier: string) => import(specifier);
const moduleImporter = async (specifier: string) => import(specifier);

startServer(moduleImporter);
7 changes: 0 additions & 7 deletions jitar/src/lib.ts

This file was deleted.

4 changes: 4 additions & 0 deletions packages/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
dist
node_modules
**/*.tgz
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
coverage
src
test
cache
node_modules
.eslintignore
.eslintrc
Expand Down
15 changes: 15 additions & 0 deletions packages/jitar-nodejs-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

# NodeJS server implementation for jitar!

This is the [NodeJS](https://nodejs.org/) server implementation to run [Jitar](https://jitar.dev) applications.

To add the server to your project run:

```bash
npm install jitar-nodejs-server
```

For more information about Jitar:

* [Visit our website](https://jitar.dev)
* [Read the documentation](https://docs.jitar.dev).
File renamed without changes.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 9 additions & 16 deletions jitar/package.json → packages/jitar-nodejs-server/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"name": "jitar",
"version": "0.1.3",
"description": "Distributed runtime for JavaScript and TypeScript to chop monolithic applications into micros.",
"name": "jitar-nodejs-server",
"version": "0.1.0",
"description": "NodeJS server implementation for Jitar.",
"author": "Masking Technology <[email protected]> (https://jitar.dev)",
"license": "MIT",
"type": "module",
"types": "dist/lib.d.ts",
"sideEffects": true,
"exports": {
".": "./dist/lib.js",
"./client.js": "./dist/client.js",
"./server.js": "./dist/server.js",
"./hooks.js": "./dist/hooks.js"
"./server.js": "./dist/server.js"
},
"scripts": {
"test": "jest",
Expand All @@ -32,7 +30,8 @@
"glob-promise": "^5.0.0",
"mime-types": "^2.1.35",
"tslog": "^3.3.3",
"yargs": "^17.6.0"
"yargs": "^17.6.0",
"jitar": "^0.2.0"
},
"devDependencies": {
"@types/express": "^4.17.13",
Expand All @@ -48,7 +47,7 @@
"ts-jest": "^28.0.8"
},
"engines": {
"node": ">=18.7"
"node": ">=18.7"
},
"repository": {
"type": "git",
Expand All @@ -59,13 +58,7 @@
},
"homepage": "https://jitar.dev",
"keywords": [
"distributed",
"runtime",
"javascript",
"typescript",
"microservices",
"monolith",
"full stack",
"web applications"
"jitar",
"nodejs"
]
}
Loading