Skip to content
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@node-in-layers/toolkit",
"type": "module",
"version": "1.1.3",
"version": "1.1.4",
"description": "The official toolkit for creating/updating/maintaining Node In Layer based systems.",
"main": "index.js",
"bin": {
Expand Down Expand Up @@ -65,8 +65,8 @@
"typescript": "5.3.3"
},
"dependencies": {
"@node-in-layers/core": "^1.1.2",
"@node-in-layers/db": "^1.0.0",
"@node-in-layers/core": "^1.1.4",
"@node-in-layers/data": "^1.0.3",
"argparse": "^2.0.1",
"chalk": "^4.1.2",
"es-main": "^1.3.0",
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const create = async (options: {
}): Promise<Config> => {
return {
environment: 'prod',
systemName: 'nil-toolkit',
[CoreNamespace.root]: {
apps: [
await import('./templating/index.js'),
Expand Down
7 changes: 3 additions & 4 deletions src/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ const features = {
const templates = generalTemplates.concat(specificTemplates)
logger.info(`Apply templates`)
const data = {
nodeInLayersDbVersion:
await context.services[Namespace.templating].getDependencyVersion(
'@node-in-layers/db'
),
nodeInLayersDbVersion: await context.services[
Namespace.templating
].getDependencyVersion('@node-in-layers/data'),
nodeInLayersCoreVersion: await context.services[
Namespace.templating
].getDependencyVersion('@node-in-layers/core'),
Expand Down
25 changes: 17 additions & 8 deletions src/templating/templates/system/all/bin/shell.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,30 @@ const _systemStartup = async (environment) => {
})
}


const main = async () => {
const args = _parseArguments()
const objects = await _systemStartup(args.environment)
merge(repl.start().context, objects)

console.info(chalk.blue.bold(`Welcome to the shell.`))
console.info(chalk.blue.bold(`--------------------------------`))
const help = (objects) => () => {
console.info(chalk.white.bold(`You have access to the following objects:`))
console.info(
chalk.white.bold(
`[${Object.keys(objects).join(', ')}]`
//`[ services, config, orm, ormQueryBuilder, models, datastoreProvider ]`
)
)
console.info()
console.info(
chalk.white.bold('You can also write "help()" to see this again.')
)
}

const main = async () => {
const args = _parseArguments()
const objects = await _systemStartup(args.environment)
const context = repl.start().context
merge(context, objects)
console.info(chalk.blue.bold(`Welcome to the shell.`))
console.info(chalk.blue.bold(`--------------------------------`))
const helpFunc = help(objects)
helpFunc()
context.help = helpFunc
}

if (esMain(import.meta)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { CoreNamespace } from '@node-in-layers/core/index.js'
import { DataNamespace } from '@node-in-layers/data/index.js'

const core = {
apps: await Promise.all([
import((`@node-in-layers/db/index.js`)),
import((`@node-in-layers/data/index.js`)),
import((`./dist/{{systemName}}/index.js`)),
]),
layerOrder: [
Expand All @@ -13,6 +14,17 @@ const core = {
logFormat: 'json',
}

const data = {
databases: {
default: {
datastoreType: 'memory'
}
}
}

export default () => ({
environment: 'dev',
systemName: '${systemName}',
[CoreNamespace.root]: core,
[DataNamespace.root]: data,
})
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"dependencies": {
"@node-in-layers/core": "{{nodeInLayersCoreVersion}}",
"@node-in-layers/db": "{{nodeInLayersDbVersion}}",
"@node-in-layers/data": "{{nodeInLayersDbVersion}}",
"es-main": "^1.3.0"
}
}
Loading