libmodulor 0.7.0 → 0.9.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/CHANGELOG.md +28 -0
- package/README.md +1 -1
- package/dist/esm/apps/Helper/src/lib/project.js +6 -6
- package/dist/esm/convention.d.ts +3 -0
- package/dist/esm/convention.js +3 -0
- package/dist/esm/index.node-express.d.ts +2 -0
- package/dist/esm/index.node-express.js +2 -0
- package/dist/esm/index.node.d.ts +0 -2
- package/dist/esm/index.node.js +0 -2
- package/dist/esm/index.vite.d.ts +1 -1
- package/dist/esm/index.vite.js +1 -1
- package/dist/esm/std/impl/ConsoleLogger.js +2 -1
- package/dist/esm/testing/AppTester.d.ts +4 -1
- package/dist/esm/testing/AppTester.js +25 -12
- package/dist/esm/testing/impl/VitestAppTestSuiteEmitter.js +5 -1
- package/dist/esm/testing/workers/checkers/AppFolderChecker.d.ts +17 -0
- package/dist/esm/testing/workers/checkers/AppFolderChecker.js +51 -0
- package/dist/esm/utils/bundling/vite/StripUCDLifecycleServerPlugin.d.ts +2 -0
- package/dist/esm/utils/bundling/vite/StripUCDLifecycleServerPlugin.js +18 -0
- package/dist/esm/utils/ioc/bindServer.js +1 -1
- package/package.json +32 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v0.9.0 (2025-03-20)
|
|
4
|
+
|
|
5
|
+
**BREAKING**
|
|
6
|
+
|
|
7
|
+
- Move `bindServer` to `libmodulor/node-express`. The following dependencies (`jose`) are now optional. You can remove them if you're using `libmodulor/node` elements in non server targets like `cli`
|
|
8
|
+
- Upgrade to `fast-check` [v4](https://fast-check.dev/docs/migration-guide/from-3.x-to-4.x) : Re-generate your tests with `yarn libmodulor GenerateAppsTests` to get the changes adapted to this version
|
|
9
|
+
|
|
10
|
+
**Misc**
|
|
11
|
+
|
|
12
|
+
- Make `buffer`, `fast-check` and `vitest` deps optional : basic uses of `libmodulor` do not require them (see https://libmodulor.c100k.eu/docs/examples/Basic as an example). You can remove them if you're not using the automated tests
|
|
13
|
+
- Add `ListOrdersUCD` an `CancelOrderUCD` to `examples/supertrader` to showcase data fetching, aggregate building, sensitive use cases, test flows, etc.
|
|
14
|
+
- Remove linter config from examples (linting from repo root folder)
|
|
15
|
+
- Use `debug` instead of `trace` in `ConsoleLogger`
|
|
16
|
+
|
|
17
|
+
## v0.8.0 (2025-03-13)
|
|
18
|
+
|
|
19
|
+
**BREAKING**
|
|
20
|
+
|
|
21
|
+
- Move `NodeExpressServerManager` to a dedicated export (`libmodulor/node` => `libmodulor/node-express`). The following dependencies (`cookie-parser`, `express`, `express-fileupload` and `helmet`) are now optional. You can remove them if you're using `libmodulor/node` elements in non server targets like `cli`
|
|
22
|
+
- Do not enforce `dt` and `policies` folders in app src : place everything that **is not** `*UCD` and `*ServerMain` into `lib` the way you prefer
|
|
23
|
+
- Check app src folder contents : it must contain only the elements allowed by the spec (Re-generate your tests with `yarn libmodulor GenerateAppsTests` to enforce the new rule)
|
|
24
|
+
|
|
25
|
+
**Misc**
|
|
26
|
+
|
|
27
|
+
- Introduce new "Basic" example showing all the primitives in action in one single `.ts` file
|
|
28
|
+
- Move `examples/libmodulor-tuto` to `examples/supertrader`
|
|
29
|
+
- Add `llms.txt` to docs at https://libmodulor.c100k.eu/llms.txt
|
|
30
|
+
|
|
3
31
|
## v0.7.0 (2025-03-07)
|
|
4
32
|
|
|
5
33
|
**Added**
|
package/README.md
CHANGED
|
@@ -42,18 +42,18 @@ export const PACKAGE_JSON = (name) => `{
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@biomejs/biome": "^1.9.4",
|
|
45
|
-
"@types/node": "^22.13.
|
|
46
|
-
"@vitest/coverage-v8": "^3.0.
|
|
45
|
+
"@types/node": "^22.13.10",
|
|
46
|
+
"@vitest/coverage-v8": "^3.0.8",
|
|
47
47
|
"buffer": "^6.0.3",
|
|
48
48
|
"cookie-parser": "^1.4.7",
|
|
49
49
|
"express": "^4.21.2",
|
|
50
50
|
"express-fileupload": "^1.5.1",
|
|
51
|
-
"fast-check": "^
|
|
51
|
+
"fast-check": "^4.0.0",
|
|
52
52
|
"helmet": "^8.0.0",
|
|
53
|
-
"jose": "^6.0.
|
|
53
|
+
"jose": "^6.0.10",
|
|
54
54
|
"typescript": "^5.8.2",
|
|
55
|
-
"vite": "^6.2.
|
|
56
|
-
"vitest": "^3.0.
|
|
55
|
+
"vite": "^6.2.2",
|
|
56
|
+
"vitest": "^3.0.8"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
`;
|
package/dist/esm/convention.d.ts
CHANGED
|
@@ -10,12 +10,15 @@ export declare const APP_I18N_FILE_NAME: string;
|
|
|
10
10
|
export declare const APP_INDEX_NAME: string;
|
|
11
11
|
export declare const APP_INDEX_FILE_NAME: string;
|
|
12
12
|
export declare const APP_INDEX_FILE_NAME_FOR_IMPORT: string;
|
|
13
|
+
export declare const APP_INSTALLER_FILE_NAME: string;
|
|
13
14
|
export declare const APP_MANIFEST_NAME: string;
|
|
14
15
|
export declare const APP_MANIFEST_FILE_EXT: string;
|
|
15
16
|
export declare const APP_MANIFEST_FILE_NAME: string;
|
|
16
17
|
export declare const APP_NAME_PLACEHOLDER: AppName;
|
|
17
18
|
export declare const APP_ROOT_FROM_UCD: string[];
|
|
19
|
+
export declare const APP_SETTINGS_FILE_NAME: string;
|
|
18
20
|
export declare const APP_SRC_DIR_NAME: string;
|
|
21
|
+
export declare const APP_SRC_LIB_DIR_NAME: string;
|
|
19
22
|
export declare const APP_SRC_UCDS_DIR_NAME: string;
|
|
20
23
|
export declare const APP_TEST_DIR_NAME: string;
|
|
21
24
|
export declare const APP_TEST_MAIN_FILE_NAME: string;
|
package/dist/esm/convention.js
CHANGED
|
@@ -14,12 +14,15 @@ export const APP_I18N_FILE_NAME = `${APP_I18N_NAME.toLowerCase()}.ts`;
|
|
|
14
14
|
export const APP_INDEX_NAME = 'index';
|
|
15
15
|
export const APP_INDEX_FILE_NAME = `${APP_INDEX_NAME}.ts`;
|
|
16
16
|
export const APP_INDEX_FILE_NAME_FOR_IMPORT = 'index.js'; // ESM
|
|
17
|
+
export const APP_INSTALLER_FILE_NAME = 'installer.ts';
|
|
17
18
|
export const APP_MANIFEST_NAME = 'Manifest';
|
|
18
19
|
export const APP_MANIFEST_FILE_EXT = '.ts';
|
|
19
20
|
export const APP_MANIFEST_FILE_NAME = `${APP_MANIFEST_NAME.toLowerCase()}${APP_MANIFEST_FILE_EXT}`;
|
|
20
21
|
export const APP_NAME_PLACEHOLDER = 'AppX';
|
|
21
22
|
export const APP_ROOT_FROM_UCD = ['..', '..', '..']; // $root/src/ucds/XyzUCD.ts
|
|
23
|
+
export const APP_SETTINGS_FILE_NAME = 'settings.ts';
|
|
22
24
|
export const APP_SRC_DIR_NAME = SRC_DIR_NAME;
|
|
25
|
+
export const APP_SRC_LIB_DIR_NAME = 'lib';
|
|
23
26
|
export const APP_SRC_UCDS_DIR_NAME = 'ucds';
|
|
24
27
|
export const APP_TEST_DIR_NAME = 'test';
|
|
25
28
|
export const APP_TEST_MAIN_FILE_NAME = 'App.test.ts';
|
package/dist/esm/index.node.d.ts
CHANGED
|
@@ -8,7 +8,5 @@ export { NodeHTTPAPICallExecutorAgentBuilder } from './std/impl/NodeHTTPAPICallE
|
|
|
8
8
|
export { NodePromptManager } from './std/impl/NodePromptManager.js';
|
|
9
9
|
export { NodeSpawnShellCommandExecutor } from './std/impl/NodeSpawnShellCommandExecutor.js';
|
|
10
10
|
export { NodeCoreCLIManager } from './target/node-core-cli/NodeCoreCLIManager.js';
|
|
11
|
-
export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
|
|
12
11
|
export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
|
|
13
12
|
export { bindNodeCore } from './utils/ioc/bindNodeCore.js';
|
|
14
|
-
export { bindServer } from './utils/ioc/bindServer.js';
|
package/dist/esm/index.node.js
CHANGED
|
@@ -8,7 +8,5 @@ export { NodeHTTPAPICallExecutorAgentBuilder } from './std/impl/NodeHTTPAPICallE
|
|
|
8
8
|
export { NodePromptManager } from './std/impl/NodePromptManager.js';
|
|
9
9
|
export { NodeSpawnShellCommandExecutor } from './std/impl/NodeSpawnShellCommandExecutor.js';
|
|
10
10
|
export { NodeCoreCLIManager } from './target/node-core-cli/NodeCoreCLIManager.js';
|
|
11
|
-
export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
|
|
12
11
|
export { bindNodeCLI } from './utils/ioc/bindNodeCLI.js';
|
|
13
12
|
export { bindNodeCore } from './utils/ioc/bindNodeCore.js';
|
|
14
|
-
export { bindServer } from './utils/ioc/bindServer.js';
|
package/dist/esm/index.vite.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { StripUCDLifecycleServerPlugin } from './
|
|
1
|
+
export { StripUCDLifecycleServerPlugin } from './utils/bundling/vite/StripUCDLifecycleServerPlugin.js';
|
package/dist/esm/index.vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { StripUCDLifecycleServerPlugin } from './
|
|
1
|
+
export { StripUCDLifecycleServerPlugin } from './utils/bundling/vite/StripUCDLifecycleServerPlugin.js';
|
|
@@ -56,8 +56,9 @@ let ConsoleLogger = class ConsoleLogger {
|
|
|
56
56
|
if (!this.shouldLog('trace')) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
+
// Using "debug" instead of "trace" because trace expands the stacktrace and pollutes the logs
|
|
59
60
|
// biome-ignore lint/suspicious/noConsole: we want it
|
|
60
|
-
console.
|
|
61
|
+
console.debug(`${this.t()} [trace] ${message}`, ...meta);
|
|
61
62
|
}
|
|
62
63
|
warn(message, ...meta) {
|
|
63
64
|
if (!this.shouldLog('warn')) {
|
|
@@ -12,6 +12,7 @@ import type { AppDocsEmitter } from './workers/AppDocsEmitter.js';
|
|
|
12
12
|
import type { AppTestSuiteTestResult } from './workers/AppTestSuiteEmitter.js';
|
|
13
13
|
import { AppTesterCtxInitializer } from './workers/AppTesterCtxInitializer.js';
|
|
14
14
|
import { UCExecutor, type UCExecutorExecOutput, type Input as UCExecutorInput } from './workers/UCExecutor.js';
|
|
15
|
+
import { AppFolderChecker } from './workers/checkers/AppFolderChecker.js';
|
|
15
16
|
import { AppI18nChecker } from './workers/checkers/AppI18nChecker.js';
|
|
16
17
|
import { AppIndexChecker } from './workers/checkers/AppIndexChecker.js';
|
|
17
18
|
import { AppManifestChecker } from './workers/checkers/AppManifestChecker.js';
|
|
@@ -31,6 +32,7 @@ export interface AppTesterUCTestData<I extends UCInput | undefined = undefined,
|
|
|
31
32
|
}
|
|
32
33
|
export declare class AppTester {
|
|
33
34
|
private appDocsEmitter;
|
|
35
|
+
private appFolderChecker;
|
|
34
36
|
private appI18nChecker;
|
|
35
37
|
private appIndexChecker;
|
|
36
38
|
private appManifestChecker;
|
|
@@ -51,7 +53,8 @@ export declare class AppTester {
|
|
|
51
53
|
private testResults;
|
|
52
54
|
private testSummary;
|
|
53
55
|
private ucDefSourcesCheckerOutput;
|
|
54
|
-
constructor(appDocsEmitter: AppDocsEmitter, appI18nChecker: AppI18nChecker, appIndexChecker: AppIndexChecker, appManifestChecker: AppManifestChecker, appTesterCtxInitializer: AppTesterCtxInitializer, serverManager: ServerManager, simpleHTMLAppTestReportEmitter: SimpleHTMLAppTestReportEmitter, ucBuilder: UCBuilder, ucDefChecker: UCDefChecker, ucDefSourcesChecker: UCDefSourcesChecker, ucExecutor: UCExecutor);
|
|
56
|
+
constructor(appDocsEmitter: AppDocsEmitter, appFolderChecker: AppFolderChecker, appI18nChecker: AppI18nChecker, appIndexChecker: AppIndexChecker, appManifestChecker: AppManifestChecker, appTesterCtxInitializer: AppTesterCtxInitializer, serverManager: ServerManager, simpleHTMLAppTestReportEmitter: SimpleHTMLAppTestReportEmitter, ucBuilder: UCBuilder, ucDefChecker: UCDefChecker, ucDefSourcesChecker: UCDefSourcesChecker, ucExecutor: UCExecutor);
|
|
57
|
+
checkAppFolder(): Promise<void>;
|
|
55
58
|
checkAppI18n(): Promise<void>;
|
|
56
59
|
checkAppIndex(): Promise<void>;
|
|
57
60
|
checkAppManifest(): Promise<void>;
|
|
@@ -23,6 +23,7 @@ import { allWithExamples, defaultUCInputFillers, } from './uc-input.js';
|
|
|
23
23
|
import { awaitForSrcImport } from './utils.js';
|
|
24
24
|
import { AppTesterCtxInitializer } from './workers/AppTesterCtxInitializer.js';
|
|
25
25
|
import { UCExecutor, } from './workers/UCExecutor.js';
|
|
26
|
+
import { AppFolderChecker } from './workers/checkers/AppFolderChecker.js';
|
|
26
27
|
import { AppI18nChecker } from './workers/checkers/AppI18nChecker.js';
|
|
27
28
|
import { AppIndexChecker } from './workers/checkers/AppIndexChecker.js';
|
|
28
29
|
import { AppManifestChecker } from './workers/checkers/AppManifestChecker.js';
|
|
@@ -30,6 +31,7 @@ import { UCDefChecker } from './workers/checkers/UCDefChecker.js';
|
|
|
30
31
|
import { UCDefSourcesChecker, } from './workers/checkers/UCDefSourcesChecker.js';
|
|
31
32
|
let AppTester = class AppTester {
|
|
32
33
|
appDocsEmitter;
|
|
34
|
+
appFolderChecker;
|
|
33
35
|
appI18nChecker;
|
|
34
36
|
appIndexChecker;
|
|
35
37
|
appManifestChecker;
|
|
@@ -51,8 +53,9 @@ let AppTester = class AppTester {
|
|
|
51
53
|
testResults;
|
|
52
54
|
testSummary;
|
|
53
55
|
ucDefSourcesCheckerOutput;
|
|
54
|
-
constructor(appDocsEmitter, appI18nChecker, appIndexChecker, appManifestChecker, appTesterCtxInitializer, serverManager, simpleHTMLAppTestReportEmitter, ucBuilder, ucDefChecker, ucDefSourcesChecker, ucExecutor) {
|
|
56
|
+
constructor(appDocsEmitter, appFolderChecker, appI18nChecker, appIndexChecker, appManifestChecker, appTesterCtxInitializer, serverManager, simpleHTMLAppTestReportEmitter, ucBuilder, ucDefChecker, ucDefSourcesChecker, ucExecutor) {
|
|
55
57
|
this.appDocsEmitter = appDocsEmitter;
|
|
58
|
+
this.appFolderChecker = appFolderChecker;
|
|
56
59
|
this.appI18nChecker = appI18nChecker;
|
|
57
60
|
this.appIndexChecker = appIndexChecker;
|
|
58
61
|
this.appManifestChecker = appManifestChecker;
|
|
@@ -72,6 +75,14 @@ let AppTester = class AppTester {
|
|
|
72
75
|
},
|
|
73
76
|
};
|
|
74
77
|
}
|
|
78
|
+
async checkAppFolder() {
|
|
79
|
+
const { errors } = await this.appFolderChecker.exec({
|
|
80
|
+
appPath: this.ctx.appPath,
|
|
81
|
+
});
|
|
82
|
+
if (errors.length > 0) {
|
|
83
|
+
throw new Error(errors[0]);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
75
86
|
async checkAppI18n() {
|
|
76
87
|
const { errors } = await this.appI18nChecker.exec({
|
|
77
88
|
appManifest: this.ctx.appManifest,
|
|
@@ -337,17 +348,19 @@ let AppTester = class AppTester {
|
|
|
337
348
|
AppTester = __decorate([
|
|
338
349
|
injectable(),
|
|
339
350
|
__param(0, inject('AppDocsEmitter')),
|
|
340
|
-
__param(1, inject(
|
|
341
|
-
__param(2, inject(
|
|
342
|
-
__param(3, inject(
|
|
343
|
-
__param(4, inject(
|
|
344
|
-
__param(5, inject(
|
|
345
|
-
__param(6, inject(
|
|
346
|
-
__param(7, inject(
|
|
347
|
-
__param(8, inject(
|
|
348
|
-
__param(9, inject(
|
|
349
|
-
__param(10, inject(
|
|
350
|
-
|
|
351
|
+
__param(1, inject(AppFolderChecker)),
|
|
352
|
+
__param(2, inject(AppI18nChecker)),
|
|
353
|
+
__param(3, inject(AppIndexChecker)),
|
|
354
|
+
__param(4, inject(AppManifestChecker)),
|
|
355
|
+
__param(5, inject(AppTesterCtxInitializer)),
|
|
356
|
+
__param(6, inject('ServerManager')),
|
|
357
|
+
__param(7, inject(SimpleHTMLAppTestReportEmitter)),
|
|
358
|
+
__param(8, inject(UCBuilder)),
|
|
359
|
+
__param(9, inject(UCDefChecker)),
|
|
360
|
+
__param(10, inject(UCDefSourcesChecker)),
|
|
361
|
+
__param(11, inject(UCExecutor)),
|
|
362
|
+
__metadata("design:paramtypes", [Object, AppFolderChecker,
|
|
363
|
+
AppI18nChecker,
|
|
351
364
|
AppIndexChecker,
|
|
352
365
|
AppManifestChecker,
|
|
353
366
|
AppTesterCtxInitializer, Object, SimpleHTMLAppTestReportEmitter,
|
|
@@ -92,6 +92,10 @@ test('Sources should be valid', async () => {
|
|
|
92
92
|
await runner.checkUCDSources();
|
|
93
93
|
});
|
|
94
94
|
|
|
95
|
+
test('Folder should be valid', async () => {
|
|
96
|
+
await runner.checkAppFolder();
|
|
97
|
+
});
|
|
98
|
+
|
|
95
99
|
test('${APP_MANIFEST_NAME} should be valid', async () => {
|
|
96
100
|
await runner.checkAppManifest();
|
|
97
101
|
});
|
|
@@ -215,7 +219,7 @@ describe.runIf(ucdRefs.length > 0)('Use Cases', () => {
|
|
|
215
219
|
for (const k of Object.keys(inputFields)) {
|
|
216
220
|
inputLike[k] = anything();
|
|
217
221
|
}
|
|
218
|
-
const cmdArbs = record(inputLike, {
|
|
222
|
+
const cmdArbs = record(inputLike, { requiredKeys: [] }).map(
|
|
219
223
|
(r) => new MyCommand(r),
|
|
220
224
|
);
|
|
221
225
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ErrorMessage } from '../../../dt/index.js';
|
|
2
|
+
import type { FSManager, Worker } from '../../../std/index.js';
|
|
3
|
+
import type { AppTesterCtx } from '../../ctx.js';
|
|
4
|
+
interface Input {
|
|
5
|
+
appPath: AppTesterCtx['appPath'];
|
|
6
|
+
}
|
|
7
|
+
interface Output {
|
|
8
|
+
errors: ErrorMessage[];
|
|
9
|
+
}
|
|
10
|
+
export declare class AppFolderChecker implements Worker<Input, Promise<Output>> {
|
|
11
|
+
private fsManager;
|
|
12
|
+
private output;
|
|
13
|
+
constructor(fsManager: FSManager);
|
|
14
|
+
exec({ appPath }: Input): Promise<Output>;
|
|
15
|
+
private makeSureSrcItemsAreAllowed;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { inject, injectable } from 'inversify';
|
|
14
|
+
import { APP_I18N_FILE_NAME, APP_INSTALLER_FILE_NAME, APP_MANIFEST_FILE_NAME, APP_SETTINGS_FILE_NAME, APP_SRC_DIR_NAME, APP_SRC_LIB_DIR_NAME, APP_SRC_UCDS_DIR_NAME, } from '../../../convention.js';
|
|
15
|
+
const ALLOWED_SRC_ITEMS = [
|
|
16
|
+
APP_SRC_LIB_DIR_NAME,
|
|
17
|
+
APP_SRC_UCDS_DIR_NAME,
|
|
18
|
+
APP_I18N_FILE_NAME,
|
|
19
|
+
APP_INSTALLER_FILE_NAME,
|
|
20
|
+
APP_MANIFEST_FILE_NAME,
|
|
21
|
+
APP_SETTINGS_FILE_NAME,
|
|
22
|
+
];
|
|
23
|
+
const ERR_UNALLOWED_SRC_ITEM = (item) => `The app ${APP_SRC_DIR_NAME} folder should contain only the following items : ${ALLOWED_SRC_ITEMS.join(', ')} but found ${item}. Remove it or move it to 'lib'`;
|
|
24
|
+
let AppFolderChecker = class AppFolderChecker {
|
|
25
|
+
fsManager;
|
|
26
|
+
output;
|
|
27
|
+
constructor(fsManager) {
|
|
28
|
+
this.fsManager = fsManager;
|
|
29
|
+
this.output = { errors: [] };
|
|
30
|
+
}
|
|
31
|
+
async exec({ appPath }) {
|
|
32
|
+
const srcPath = this.fsManager.path(appPath, APP_SRC_DIR_NAME);
|
|
33
|
+
const contents = await this.fsManager.ls(srcPath);
|
|
34
|
+
const items = contents.map((i) => i.path);
|
|
35
|
+
this.makeSureSrcItemsAreAllowed(items);
|
|
36
|
+
return this.output;
|
|
37
|
+
}
|
|
38
|
+
makeSureSrcItemsAreAllowed(items) {
|
|
39
|
+
for (const item of items) {
|
|
40
|
+
if (!ALLOWED_SRC_ITEMS.includes(item)) {
|
|
41
|
+
this.output.errors.push(ERR_UNALLOWED_SRC_ITEM(item));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
AppFolderChecker = __decorate([
|
|
47
|
+
injectable(),
|
|
48
|
+
__param(0, inject('FSManager')),
|
|
49
|
+
__metadata("design:paramtypes", [Object])
|
|
50
|
+
], AppFolderChecker);
|
|
51
|
+
export { AppFolderChecker };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UC_DEF_FILE_NAME_SUFFIX } from '../../../convention.js';
|
|
2
|
+
import { stripUCDLifecycleServer } from '../../../uc/index.js';
|
|
3
|
+
export const StripUCDLifecycleServerPlugin = {
|
|
4
|
+
// Why enforce ?
|
|
5
|
+
// Otherwise Rollup parses the file and strips trailing commas.
|
|
6
|
+
// We need them to strip correctly (although the implementation will be made more robust).
|
|
7
|
+
enforce: 'pre',
|
|
8
|
+
name: 'strip-ucd-lifecycle-server',
|
|
9
|
+
transform: (src, id) => {
|
|
10
|
+
if (id.match(new RegExp(`${UC_DEF_FILE_NAME_SUFFIX}$`)) === null) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const code = stripUCDLifecycleServer(src);
|
|
14
|
+
return {
|
|
15
|
+
code,
|
|
16
|
+
};
|
|
17
|
+
},
|
|
18
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { JoseJWTManager } from '../../index.std-jwt-manager-jose.js';
|
|
2
1
|
import { FakeEmailManager } from '../../std/impl/FakeEmailManager.js';
|
|
3
2
|
import { FakeJobManager } from '../../std/impl/FakeJobManager.js';
|
|
3
|
+
import { JoseJWTManager } from '../../std/impl/JoseJWTManager.js';
|
|
4
4
|
export function bindServer(container) {
|
|
5
5
|
// std
|
|
6
6
|
container.bind('EmailManager').to(FakeEmailManager);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libmodulor",
|
|
3
3
|
"description": "An opinionated TypeScript library to create business oriented applications",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"license": "LGPL-3.0",
|
|
6
6
|
"author": "Chafik H'nini <chafik.hnini@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/c100k/libmodulor#readme",
|
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
"./locales/fr": {
|
|
30
30
|
"import": "./dist/esm/i18n/locales/fr.js"
|
|
31
31
|
},
|
|
32
|
+
"./node-express": {
|
|
33
|
+
"import": "./dist/esm/index.node-express.js"
|
|
34
|
+
},
|
|
32
35
|
"./node-mcp": {
|
|
33
36
|
"import": "./dist/esm/index.node-mcp.js"
|
|
34
37
|
},
|
|
@@ -73,27 +76,27 @@
|
|
|
73
76
|
},
|
|
74
77
|
"peerDependencies": {
|
|
75
78
|
"@hono/node-server": "^1.13.8",
|
|
76
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
79
|
+
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
77
80
|
"@stricli/core": "^1.1.1",
|
|
78
81
|
"buffer": "^6.0.3",
|
|
79
82
|
"cookie-parser": "^1.4.7",
|
|
80
83
|
"express": "^4.21.2",
|
|
81
84
|
"express-fileupload": "^1.5.1",
|
|
82
|
-
"fast-check": "^
|
|
85
|
+
"fast-check": "^4.0.0",
|
|
83
86
|
"helmet": "^8.0.0",
|
|
84
|
-
"hono": "^4.7.
|
|
87
|
+
"hono": "^4.7.4",
|
|
85
88
|
"inversify": "^6.2.2",
|
|
86
|
-
"jose": "^6.0.
|
|
89
|
+
"jose": "^6.0.10",
|
|
87
90
|
"knex": "^3.1.0",
|
|
88
|
-
"pg": "^8.
|
|
91
|
+
"pg": "^8.14.0",
|
|
89
92
|
"react": "^19.0.0",
|
|
90
93
|
"react-dom": "^19.0.0",
|
|
91
94
|
"react-native": "^0.78.0",
|
|
92
95
|
"reflect-metadata": "^0.2.2",
|
|
93
96
|
"sqlite3": "^5.1.7",
|
|
94
97
|
"typescript": "^5.8.2",
|
|
95
|
-
"vite": "^6.2.
|
|
96
|
-
"vitest": "^3.0.
|
|
98
|
+
"vite": "^6.2.2",
|
|
99
|
+
"vitest": "^3.0.8"
|
|
97
100
|
},
|
|
98
101
|
"peerDependenciesMeta": {
|
|
99
102
|
"@hono/node-server": {
|
|
@@ -105,6 +108,24 @@
|
|
|
105
108
|
"@stricli/core": {
|
|
106
109
|
"optional": true
|
|
107
110
|
},
|
|
111
|
+
"buffer": {
|
|
112
|
+
"optional": true
|
|
113
|
+
},
|
|
114
|
+
"cookie-parser": {
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
117
|
+
"express": {
|
|
118
|
+
"optional": true
|
|
119
|
+
},
|
|
120
|
+
"express-fileupload": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
123
|
+
"fast-check": {
|
|
124
|
+
"optional": true
|
|
125
|
+
},
|
|
126
|
+
"helmet": {
|
|
127
|
+
"optional": true
|
|
128
|
+
},
|
|
108
129
|
"hono": {
|
|
109
130
|
"optional": true
|
|
110
131
|
},
|
|
@@ -131,6 +152,9 @@
|
|
|
131
152
|
},
|
|
132
153
|
"vite": {
|
|
133
154
|
"optional": true
|
|
155
|
+
},
|
|
156
|
+
"vitest": {
|
|
157
|
+
"optional": true
|
|
134
158
|
}
|
|
135
159
|
},
|
|
136
160
|
"sideEffects": false
|