@tactical-ddd/nx 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/generators/shared-kernel/schema.d.js +6 -0
- package/generators/shared-kernel/schema.d.js.map +1 -0
- package/generators/shared-kernel/schema.d.ts +3 -0
- package/generators/shared-kernel/schema.json +15 -0
- package/generators/shared-kernel/shared-kernel.d.ts +5 -0
- package/generators/shared-kernel/shared-kernel.d.ts.map +1 -0
- package/generators/shared-kernel/shared-kernel.js +65 -0
- package/generators/shared-kernel/shared-kernel.js.map +1 -0
- package/generators.json +9 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -0
- package/index.js +8 -0
- package/index.js.map +1 -0
- package/package.json +33 -0
- package/types.d.ts +13 -0
- package/types.d.ts.map +1 -0
- package/types.js +34 -0
- package/types.js.map +1 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Artyom Kayun
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx/src/generators/shared-kernel/schema.d.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "SharedKernelGenerator",
|
|
4
|
+
"title": "Tactical DDD: Shared Kernel Generator",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"directory": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Root folder for the shared kernel (it is recommended to keep libs/shared)",
|
|
10
|
+
"default": "libs/shared",
|
|
11
|
+
"x-prompt": "Which directory should the Shared Kernel be generated into?"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"required": ["directory"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
import type { SharedKernelGeneratorSchema } from './schema';
|
|
3
|
+
export declare function sharedKernelGenerator(tree: Tree, options: SharedKernelGeneratorSchema): Promise<void>;
|
|
4
|
+
export default sharedKernelGenerator;
|
|
5
|
+
//# sourceMappingURL=shared-kernel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-kernel.d.ts","sourceRoot":"","sources":["../../../../../packages/nx/src/generators/shared-kernel/shared-kernel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AAG5D,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,2BAA2B,iBAkDrC;AAED,eAAe,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get default () {
|
|
13
|
+
return _default;
|
|
14
|
+
},
|
|
15
|
+
get sharedKernelGenerator () {
|
|
16
|
+
return sharedKernelGenerator;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _devkit = require("@nx/devkit");
|
|
20
|
+
const _js = require("@nx/js");
|
|
21
|
+
const _types = require("../../types");
|
|
22
|
+
async function sharedKernelGenerator(tree, options) {
|
|
23
|
+
const sharedDirectory = options.directory;
|
|
24
|
+
const contractsRoot = `${sharedDirectory}/contracts`;
|
|
25
|
+
const utilsRoot = `${sharedDirectory}/utils`;
|
|
26
|
+
const infrastructureRoot = `${sharedDirectory}/infrastructure`;
|
|
27
|
+
if (!tree.exists(contractsRoot)) {
|
|
28
|
+
console.log(`Creating contracts library at ${contractsRoot}...`);
|
|
29
|
+
await (0, _js.libraryGenerator)(tree, {
|
|
30
|
+
name: 'contracts',
|
|
31
|
+
directory: contractsRoot,
|
|
32
|
+
useProjectJson: false,
|
|
33
|
+
unitTestRunner: 'none',
|
|
34
|
+
tags: `${_types.LibraryScope.Shared},${_types.LibraryType.Contracts}`
|
|
35
|
+
});
|
|
36
|
+
} else {
|
|
37
|
+
console.log(`Contracts library already exists at ${contractsRoot}`);
|
|
38
|
+
}
|
|
39
|
+
if (!tree.exists(utilsRoot)) {
|
|
40
|
+
console.log(`Creating utils library at ${utilsRoot}...`);
|
|
41
|
+
await (0, _js.libraryGenerator)(tree, {
|
|
42
|
+
name: 'utils',
|
|
43
|
+
directory: utilsRoot,
|
|
44
|
+
useProjectJson: false,
|
|
45
|
+
tags: `${_types.LibraryScope.Shared},${_types.LibraryType.Utils}`
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
console.log(`Utils library already exists at ${utilsRoot}`);
|
|
49
|
+
}
|
|
50
|
+
if (!tree.exists(infrastructureRoot)) {
|
|
51
|
+
console.log(`Creating infrastructure library at ${infrastructureRoot}...`);
|
|
52
|
+
await (0, _js.libraryGenerator)(tree, {
|
|
53
|
+
name: 'infrastructure',
|
|
54
|
+
directory: infrastructureRoot,
|
|
55
|
+
useProjectJson: false,
|
|
56
|
+
tags: `${_types.LibraryScope.Shared},${_types.LibraryType.Infrastructure}`
|
|
57
|
+
});
|
|
58
|
+
} else {
|
|
59
|
+
console.log(`Infrastructure library already exists at ${infrastructureRoot}`);
|
|
60
|
+
}
|
|
61
|
+
await (0, _devkit.formatFiles)(tree);
|
|
62
|
+
}
|
|
63
|
+
const _default = sharedKernelGenerator;
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=shared-kernel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../packages/nx/src/generators/shared-kernel/shared-kernel.ts"],"sourcesContent":["import { formatFiles, type Tree } from '@nx/devkit';\nimport { libraryGenerator } from '@nx/js';\n\nimport type { SharedKernelGeneratorSchema } from './schema';\nimport { LibraryScope, LibraryType } from '../../types';\n\nexport async function sharedKernelGenerator(\n tree: Tree,\n options: SharedKernelGeneratorSchema,\n) {\n const sharedDirectory = options.directory;\n const contractsRoot = `${sharedDirectory}/contracts`;\n const utilsRoot = `${sharedDirectory}/utils`;\n const infrastructureRoot = `${sharedDirectory}/infrastructure`;\n\n if (!tree.exists(contractsRoot)) {\n console.log(`Creating contracts library at ${contractsRoot}...`);\n\n await libraryGenerator(tree, {\n name: 'contracts',\n directory: contractsRoot,\n useProjectJson: false,\n unitTestRunner: 'none',\n tags: `${LibraryScope.Shared},${LibraryType.Contracts}`,\n });\n } else {\n console.log(`Contracts library already exists at ${contractsRoot}`);\n }\n\n if (!tree.exists(utilsRoot)) {\n console.log(`Creating utils library at ${utilsRoot}...`);\n\n await libraryGenerator(tree, {\n name: 'utils',\n directory: utilsRoot,\n useProjectJson: false,\n tags: `${LibraryScope.Shared},${LibraryType.Utils}`,\n });\n } else {\n console.log(`Utils library already exists at ${utilsRoot}`);\n }\n\n if (!tree.exists(infrastructureRoot)) {\n console.log(`Creating infrastructure library at ${infrastructureRoot}...`);\n\n await libraryGenerator(tree, {\n name: 'infrastructure',\n directory: infrastructureRoot,\n useProjectJson: false,\n tags: `${LibraryScope.Shared},${LibraryType.Infrastructure}`,\n });\n } else {\n console.log(\n `Infrastructure library already exists at ${infrastructureRoot}`,\n );\n }\n\n await formatFiles(tree);\n}\n\nexport default sharedKernelGenerator;\n"],"names":["sharedKernelGenerator","tree","options","sharedDirectory","directory","contractsRoot","utilsRoot","infrastructureRoot","exists","console","log","libraryGenerator","name","useProjectJson","unitTestRunner","tags","LibraryScope","Shared","LibraryType","Contracts","Utils","Infrastructure","formatFiles"],"mappings":";;;;;;;;;;;QA4DA;eAAA;;QAtDsBA;eAAAA;;;wBANiB;oBACN;uBAGS;AAEnC,eAAeA,sBACpBC,IAAU,EACVC,OAAoC;IAEpC,MAAMC,kBAAkBD,QAAQE,SAAS;IACzC,MAAMC,gBAAgB,GAAGF,gBAAgB,UAAU,CAAC;IACpD,MAAMG,YAAY,GAAGH,gBAAgB,MAAM,CAAC;IAC5C,MAAMI,qBAAqB,GAAGJ,gBAAgB,eAAe,CAAC;IAE9D,IAAI,CAACF,KAAKO,MAAM,CAACH,gBAAgB;QAC/BI,QAAQC,GAAG,CAAC,CAAC,8BAA8B,EAAEL,cAAc,GAAG,CAAC;QAE/D,MAAMM,IAAAA,oBAAgB,EAACV,MAAM;YAC3BW,MAAM;YACNR,WAAWC;YACXQ,gBAAgB;YAChBC,gBAAgB;YAChBC,MAAM,GAAGC,mBAAY,CAACC,MAAM,CAAC,CAAC,EAAEC,kBAAW,CAACC,SAAS,EAAE;QACzD;IACF,OAAO;QACLV,QAAQC,GAAG,CAAC,CAAC,oCAAoC,EAAEL,eAAe;IACpE;IAEA,IAAI,CAACJ,KAAKO,MAAM,CAACF,YAAY;QAC3BG,QAAQC,GAAG,CAAC,CAAC,0BAA0B,EAAEJ,UAAU,GAAG,CAAC;QAEvD,MAAMK,IAAAA,oBAAgB,EAACV,MAAM;YAC3BW,MAAM;YACNR,WAAWE;YACXO,gBAAgB;YAChBE,MAAM,GAAGC,mBAAY,CAACC,MAAM,CAAC,CAAC,EAAEC,kBAAW,CAACE,KAAK,EAAE;QACrD;IACF,OAAO;QACLX,QAAQC,GAAG,CAAC,CAAC,gCAAgC,EAAEJ,WAAW;IAC5D;IAEA,IAAI,CAACL,KAAKO,MAAM,CAACD,qBAAqB;QACpCE,QAAQC,GAAG,CAAC,CAAC,mCAAmC,EAAEH,mBAAmB,GAAG,CAAC;QAEzE,MAAMI,IAAAA,oBAAgB,EAACV,MAAM;YAC3BW,MAAM;YACNR,WAAWG;YACXM,gBAAgB;YAChBE,MAAM,GAAGC,mBAAY,CAACC,MAAM,CAAC,CAAC,EAAEC,kBAAW,CAACG,cAAc,EAAE;QAC9D;IACF,OAAO;QACLZ,QAAQC,GAAG,CACT,CAAC,yCAAyC,EAAEH,oBAAoB;IAEpE;IAEA,MAAMe,IAAAA,mBAAW,EAACrB;AACpB;MAEA,WAAeD"}
|
package/generators.json
ADDED
package/index.d.ts
ADDED
package/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/nx/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC"}
|
package/index.js
ADDED
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/nx/src/index.ts"],"sourcesContent":["export * from './types';\n"],"names":[],"mappings":";;;;;uBAAc"}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tactical-ddd/nx",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Artyom Kayun",
|
|
7
|
+
"email": "kayun.artem@gmail.com",
|
|
8
|
+
"url": "https://github.com/kayun"
|
|
9
|
+
},
|
|
10
|
+
"type": "commonjs",
|
|
11
|
+
"main": "./index.js",
|
|
12
|
+
"module": "./index.js",
|
|
13
|
+
"types": "./index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./index.d.ts",
|
|
18
|
+
"import": "./index.js",
|
|
19
|
+
"default": "./index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"**/*",
|
|
24
|
+
"!**/*.tsbuildinfo",
|
|
25
|
+
"generators.json"
|
|
26
|
+
],
|
|
27
|
+
"generators": "./generators.json",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nx/devkit": "^22.0.0 || ^23.0.0",
|
|
30
|
+
"@nx/js": "^22.0.0 || ^23.0.0",
|
|
31
|
+
"@swc/helpers": "~0.5.18"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum LibraryScope {
|
|
2
|
+
Shared = "scope:shared",
|
|
3
|
+
Domain = "scope:domain"
|
|
4
|
+
}
|
|
5
|
+
export declare enum LibraryType {
|
|
6
|
+
Contracts = "type:contracts",
|
|
7
|
+
Core = "type:core",
|
|
8
|
+
Features = "type:features",
|
|
9
|
+
Utils = "type:utils",
|
|
10
|
+
Testing = "type:testing",
|
|
11
|
+
Infrastructure = "type:infrastructure"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
package/types.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../packages/nx/src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACtB,MAAM,iBAAiB;IACvB,MAAM,iBAAiB;CACxB;AAED,oBAAY,WAAW;IACrB,SAAS,mBAAmB;IAC5B,IAAI,cAAc;IAClB,QAAQ,kBAAkB;IAC1B,KAAK,eAAe;IACpB,OAAO,iBAAiB;IACxB,cAAc,wBAAwB;CACvC"}
|
package/types.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
get LibraryScope () {
|
|
13
|
+
return LibraryScope;
|
|
14
|
+
},
|
|
15
|
+
get LibraryType () {
|
|
16
|
+
return LibraryType;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
var LibraryScope = /*#__PURE__*/ function(LibraryScope) {
|
|
20
|
+
LibraryScope["Shared"] = "scope:shared";
|
|
21
|
+
LibraryScope["Domain"] = "scope:domain";
|
|
22
|
+
return LibraryScope;
|
|
23
|
+
}({});
|
|
24
|
+
var LibraryType = /*#__PURE__*/ function(LibraryType) {
|
|
25
|
+
LibraryType["Contracts"] = "type:contracts";
|
|
26
|
+
LibraryType["Core"] = "type:core";
|
|
27
|
+
LibraryType["Features"] = "type:features";
|
|
28
|
+
LibraryType["Utils"] = "type:utils";
|
|
29
|
+
LibraryType["Testing"] = "type:testing";
|
|
30
|
+
LibraryType["Infrastructure"] = "type:infrastructure";
|
|
31
|
+
return LibraryType;
|
|
32
|
+
}({});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=types.js.map
|
package/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../packages/nx/src/types.ts"],"sourcesContent":["export enum LibraryScope {\n Shared = 'scope:shared',\n Domain = 'scope:domain',\n}\n\nexport enum LibraryType {\n Contracts = 'type:contracts',\n Core = 'type:core',\n Features = 'type:features',\n Utils = 'type:utils',\n Testing = 'type:testing',\n Infrastructure = 'type:infrastructure',\n}\n"],"names":["LibraryScope","LibraryType"],"mappings":";;;;;;;;;;;QAAYA;eAAAA;;QAKAC;eAAAA;;;AALL,IAAA,AAAKD,sCAAAA;;;WAAAA;;AAKL,IAAA,AAAKC,qCAAAA;;;;;;;WAAAA"}
|