@mono-lit/utility 0.0.3 → 0.0.5

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/README.md CHANGED
@@ -1,157 +1,157 @@
1
- # Mono Utils
2
-
3
- A comprehensive utility library for Vue.js applications built around DevExtreme UI components, providing powerful data management, validation, and export capabilities.
4
-
5
- ## Features
6
-
7
- - 🔧 **OData Integration** - Sophisticated OData client with batch operations, caching, and error handling
8
- - 🎛️ **DevExtreme Helpers** - Utilities for data grids, lookups, and form components
9
- - ✅ **Schema Validation** - Yup-based validation system with nested object support
10
- - 📊 **Excel Export** - Advanced Excel export capabilities with custom formatting and formulas
11
- - 🔔 **Notification System** - Notivue-based notification management
12
- - 🚨 **Error Handling** - Comprehensive HTTP and OData error handling
13
- - 🔄 **Data Manipulation** - Powerful utilities for data transformation and operations
14
-
15
- ## Installation
16
-
17
- **From npmjs (public):**
18
-
19
- ```bash
20
- pnpm add @mono-lit/utility
21
- ```
22
-
23
- **From the Netlify registry:** add this to your project's `.npmrc`, then run the same `pnpm add`:
24
-
25
- ```ini
26
- @mono-lit:registry=https://mono-libs.netlify.app/npm/
27
- //mono-libs.netlify.app/npm/:_authToken=<REGISTRY_DOWNLOAD_TOKEN>
28
- ```
29
-
30
- See the [repository README](https://github.com/mono-lit/core#install-in-your-project) for details.
31
-
32
- ## Dependencies
33
-
34
- ### Core Dependencies
35
-
36
- These are the essential dependencies required for core functionality:
37
-
38
- ```bash
39
- npm install notivue yup exceljs file-saver-es @odata2ts/http-client-fetch json-server change-case chokidar
40
- ```
41
-
42
- **Note:** The additional dependencies (`json-server`, `change-case`, `chokidar`) are recommended for development and should be installed as devDependencies:
43
-
44
- ```bash
45
- npm install --save-dev json-server change-case chokidar
46
- ```
47
-
48
- ### Optional DevExtreme Dependencies
49
-
50
- **For DevExtreme UI Components:**
51
- If you're using DevExtreme components, you'll also need:
52
-
53
- ```bash
54
- npm install devextreme devextreme-vue
55
- ```
56
-
57
- **Note:** The core data fetching, validation, and Excel export utilities work independently of any UI framework. You can use this library with Vue, React, Angular, or vanilla JavaScript.
58
-
59
- ## Quick Start
60
-
61
- ### Basic Setup
62
-
63
- ```vue
64
- <script setup>
65
- import { useUtils } from '@mono-lit/utility/runtime'
66
-
67
- const utils = useUtils()
68
-
69
- // Destructure the utilities you need
70
- const {
71
- notif,
72
- validateAllSchema,
73
- validateSchema,
74
- replacerData,
75
- exportExcel,
76
- useFetchOData,
77
- createFetcher,
78
- advanceExportExcel
79
- } = utils
80
- </script>
81
- ```
82
-
83
- ### Usage Without DevExtreme
84
-
85
- For users working with other UI frameworks (React, Angular, or vanilla JavaScript), you can still use the core data fetching, validation, and export utilities:
86
-
87
- ```javascript
88
- import { useUtils } from '@mono-lit/utility/runtime'
89
-
90
- const { useFetchOData, notif, advanceExportExcel } = useUtils()
91
-
92
- // Fetch data
93
- const { data, error } = await useFetchOData({
94
- url: '/Users',
95
- baseUrl: 'https://your-api.com/odata',
96
- type: 'data'
97
- })
98
-
99
- if (error) {
100
- notif({
101
- message: error.message,
102
- type: 'error'
103
- })
104
- }
105
-
106
- // Export to Excel
107
- await advanceExportExcel({
108
- title: 'User Report',
109
- items: data,
110
- config: {
111
- columns: [
112
- { key: 'Id', title: 'ID', width: 10 },
113
- { key: 'Name', title: 'Name', width: 30 },
114
- { key: 'Email', title: 'Email', width: 40 }
115
- ]
116
- }
117
- })
118
- ```
119
-
120
- ## Documentation
121
-
122
- - **[Data Fetching](./docs/data-fetching.md)** - OData integration, HTTP client, data manipulation
123
- - **[Excel Export](./docs/excel-export.md)** - Advanced Excel export with formatting and formulas
124
- - **[Validation](./docs/validation.md)** - Schema validation with Yup
125
- - **[Notifications](./docs/notifications.md)** - Notivue-based notification system
126
- - **[DevExtreme Integration](./docs/devextreme-integration.md)** - DevExtreme UI helpers and components
127
-
128
- ## API Reference
129
-
130
- ### useUtils Return Object
131
-
132
- The main `useUtils()` function returns an object with the following utilities:
133
-
134
- #### Core Utilities
135
- - `notif` - Notification system
136
- - `validateAllSchema` - Validate entire form with Yup
137
- - `validateSchema` - Validate single field with Yup
138
- - `validateAllSchemaCheck` - Check if any validation errors exist
139
- - `clearSchemaValidation` - Clear all validation errors
140
-
141
- #### Data Utilities
142
- - `replacerData` - Add/update/remove items from arrays or DataSources
143
- - `filterOrIn` - Create OData filter expressions
144
-
145
- #### UI Components
146
- - `exportExcel` - Basic Excel export
147
- - `advanceExportExcel` - Advanced Excel export with formulas
148
-
149
- #### OData & HTTP
150
- - `useFetchOData` - Main OData fetching utility
151
- - `createFetcher` - Create reusable fetchers
152
- - `useNormalFetch` - Simple HTTP fetch utility
153
- - `createUniqueFetcher` - Fetch unique records
154
-
155
- ## License
156
-
1
+ # Mono Utils
2
+
3
+ A comprehensive utility library for Vue.js applications built around DevExtreme UI components, providing powerful data management, validation, and export capabilities.
4
+
5
+ ## Features
6
+
7
+ - 🔧 **OData Integration** - Sophisticated OData client with batch operations, caching, and error handling
8
+ - 🎛️ **DevExtreme Helpers** - Utilities for data grids, lookups, and form components
9
+ - ✅ **Schema Validation** - Yup or Valibot (any Standard Schema) validation with nested object support
10
+ - 📊 **Excel Export** - Advanced Excel export capabilities with custom formatting and formulas
11
+ - 🔔 **Notification System** - Notivue-based notification management
12
+ - 🚨 **Error Handling** - Comprehensive HTTP and OData error handling
13
+ - 🔄 **Data Manipulation** - Powerful utilities for data transformation and operations
14
+
15
+ ## Installation
16
+
17
+ **From npmjs (public):**
18
+
19
+ ```bash
20
+ pnpm add @mono-lit/utility
21
+ ```
22
+
23
+ **From the Netlify registry:** add this to your project's `.npmrc`, then run the same `pnpm add`:
24
+
25
+ ```ini
26
+ @mono-lit:registry=https://mono-libs.netlify.app/npm/
27
+ //mono-libs.netlify.app/npm/:_authToken=<REGISTRY_DOWNLOAD_TOKEN>
28
+ ```
29
+
30
+ See the [repository README](https://github.com/mono-lit/core#install-in-your-project) for details.
31
+
32
+ ## Dependencies
33
+
34
+ ### Core Dependencies
35
+
36
+ These are the essential dependencies required for core functionality:
37
+
38
+ ```bash
39
+ npm install notivue valibot exceljs file-saver-es @odata2ts/http-client-fetch json-server change-case chokidar
40
+ ```
41
+
42
+ **Note:** The additional dependencies (`json-server`, `change-case`, `chokidar`) are recommended for development and should be installed as devDependencies:
43
+
44
+ ```bash
45
+ npm install --save-dev json-server change-case chokidar
46
+ ```
47
+
48
+ ### Optional DevExtreme Dependencies
49
+
50
+ **For DevExtreme UI Components:**
51
+ If you're using DevExtreme components, you'll also need:
52
+
53
+ ```bash
54
+ npm install devextreme devextreme-vue
55
+ ```
56
+
57
+ **Note:** The core data fetching, validation, and Excel export utilities work independently of any UI framework. You can use this library with Vue, React, Angular, or vanilla JavaScript.
58
+
59
+ ## Quick Start
60
+
61
+ ### Basic Setup
62
+
63
+ ```vue
64
+ <script setup>
65
+ import { useUtils } from '@mono-lit/utility/runtime'
66
+
67
+ const utils = useUtils()
68
+
69
+ // Destructure the utilities you need
70
+ const {
71
+ notif,
72
+ validateAllSchema,
73
+ validateSchema,
74
+ replacerData,
75
+ exportExcel,
76
+ useFetchOData,
77
+ createFetcher,
78
+ advanceExportExcel
79
+ } = utils
80
+ </script>
81
+ ```
82
+
83
+ ### Usage Without DevExtreme
84
+
85
+ For users working with other UI frameworks (React, Angular, or vanilla JavaScript), you can still use the core data fetching, validation, and export utilities:
86
+
87
+ ```javascript
88
+ import { useUtils } from '@mono-lit/utility/runtime'
89
+
90
+ const { useFetchOData, notif, advanceExportExcel } = useUtils()
91
+
92
+ // Fetch data
93
+ const { data, error } = await useFetchOData({
94
+ url: '/Users',
95
+ baseUrl: 'https://your-api.com/odata',
96
+ type: 'data'
97
+ })
98
+
99
+ if (error) {
100
+ notif({
101
+ message: error.message,
102
+ type: 'error'
103
+ })
104
+ }
105
+
106
+ // Export to Excel
107
+ await advanceExportExcel({
108
+ title: 'User Report',
109
+ items: data,
110
+ config: {
111
+ columns: [
112
+ { key: 'Id', title: 'ID', width: 10 },
113
+ { key: 'Name', title: 'Name', width: 30 },
114
+ { key: 'Email', title: 'Email', width: 40 }
115
+ ]
116
+ }
117
+ })
118
+ ```
119
+
120
+ ## Documentation
121
+
122
+ - **[Data Fetching](./docs/data-fetching.md)** - OData integration, HTTP client, data manipulation
123
+ - **[Excel Export](./docs/excel-export.md)** - Advanced Excel export with formatting and formulas
124
+ - **[Validation](./docs/validation.md)** - Schema validation with Yup or Valibot
125
+ - **[Notifications](./docs/notifications.md)** - Notivue-based notification system
126
+ - **[DevExtreme Integration](./docs/devextreme-integration.md)** - DevExtreme UI helpers and components
127
+
128
+ ## API Reference
129
+
130
+ ### useUtils Return Object
131
+
132
+ The main `useUtils()` function returns an object with the following utilities:
133
+
134
+ #### Core Utilities
135
+ - `notif` - Notification system
136
+ - `validateAllSchema` - Validate entire form (Yup or Valibot)
137
+ - `validateSchema` - Validate single field (Yup or Valibot)
138
+ - `validateAllSchemaCheck` - Check if any validation errors exist
139
+ - `clearSchemaValidation` - Clear all validation errors
140
+
141
+ #### Data Utilities
142
+ - `replacerData` - Add/update/remove items from arrays or DataSources
143
+ - `filterOrIn` - Create OData filter expressions
144
+
145
+ #### UI Components
146
+ - `exportExcel` - Basic Excel export
147
+ - `advanceExportExcel` - Advanced Excel export with formulas
148
+
149
+ #### OData & HTTP
150
+ - `useFetchOData` - Main OData fetching utility
151
+ - `createFetcher` - Create reusable fetchers
152
+ - `useNormalFetch` - Simple HTTP fetch utility
153
+ - `createUniqueFetcher` - Fetch unique records
154
+
155
+ ## License
156
+
157
157
  This project is licensed under the MIT License.
@@ -78,6 +78,18 @@ declare function appRootDirs(roots: MonoAppRoot[]): string[];
78
78
  declare function pathAppRoots(roots: MonoAppRoot[]): MonoAppRoot[];
79
79
  /** @deprecated renamed {@link pathAppRoots}. */
80
80
  declare const linkedAppRoots: typeof pathAppRoots;
81
+ /**
82
+ * `true` for a HOSTED (mini) app: a source-only root with no `package.json`.
83
+ *
84
+ * A mini remote ships pages/components/composables and its `mono.config.ts`,
85
+ * nothing else — no dependencies, no build config, no env. It cannot install
86
+ * or run by itself; the host that federates it supplies all of that. Derived
87
+ * from the folder rather than declared, so nothing in `apps[]` changes: the
88
+ * same entry (`url` or `path`) serves a full remote and a mini.
89
+ */
90
+ declare function isHostedApp(root: string): boolean;
91
+ /** The hosted (mini) subset of `roots` — see {@link isHostedApp}. */
92
+ declare function hostedAppRoots(roots: MonoAppRoot[]): MonoAppRoot[];
81
93
  /** `true` when an app entry can be synced from GitHub. */
82
94
  declare function hasUrl(app: MonoAppRootInput | undefined): boolean;
83
95
  /** The error every entry point raises for a `path` with no directory and no `url`. */
@@ -87,4 +99,4 @@ declare function isMissingPathError(e: unknown): boolean;
87
99
  /** Test seam: forget which missing paths have been reported. */
88
100
  declare function resetAppPathWarnings(): void;
89
101
  //#endregion
90
- export { ResolveAppRootsOptions as a, isMissingPathError as c, pathAppRoots as d, resetAppPathWarnings as f, MonoMissingPathPolicy as i, linkedAppRoots as l, MonoAppRootInput as n, appRootDirs as o, resolveAppRoots as p, MonoAppRootSource as r, hasUrl as s, MonoAppRoot as t, missingPathMessage as u };
102
+ export { ResolveAppRootsOptions as a, hostedAppRoots as c, linkedAppRoots as d, missingPathMessage as f, resolveAppRoots as h, MonoMissingPathPolicy as i, isHostedApp as l, resetAppPathWarnings as m, MonoAppRootInput as n, appRootDirs as o, pathAppRoots as p, MonoAppRootSource as r, hasUrl as s, MonoAppRoot as t, isMissingPathError as u };
@@ -94,6 +94,22 @@ function pathAppRoots(roots) {
94
94
  }
95
95
  /** @deprecated renamed {@link pathAppRoots}. */
96
96
  const linkedAppRoots = pathAppRoots;
97
+ /**
98
+ * `true` for a HOSTED (mini) app: a source-only root with no `package.json`.
99
+ *
100
+ * A mini remote ships pages/components/composables and its `mono.config.ts`,
101
+ * nothing else — no dependencies, no build config, no env. It cannot install
102
+ * or run by itself; the host that federates it supplies all of that. Derived
103
+ * from the folder rather than declared, so nothing in `apps[]` changes: the
104
+ * same entry (`url` or `path`) serves a full remote and a mini.
105
+ */
106
+ function isHostedApp(root) {
107
+ return isDirectory(root) && !fs.existsSync(path.join(root, "package.json"));
108
+ }
109
+ /** The hosted (mini) subset of `roots` — see {@link isHostedApp}. */
110
+ function hostedAppRoots(roots) {
111
+ return roots.filter((r) => isHostedApp(r.root));
112
+ }
97
113
  /** `true` when an app entry can be synced from GitHub. */
98
114
  function hasUrl(app) {
99
115
  return typeof app?.url === "string" && app.url.trim().length > 0;
@@ -125,4 +141,4 @@ function resetAppPathWarnings() {
125
141
  }
126
142
 
127
143
  //#endregion
128
- export { missingPathMessage as a, resolveAppRoots as c, linkedAppRoots as i, hasUrl as n, pathAppRoots as o, isMissingPathError as r, resetAppPathWarnings as s, appRootDirs as t };
144
+ export { isMissingPathError as a, pathAppRoots as c, isHostedApp as i, resetAppPathWarnings as l, hasUrl as n, linkedAppRoots as o, hostedAppRoots as r, missingPathMessage as s, appRootDirs as t, resolveAppRoots as u };
@@ -1,5 +1,5 @@
1
1
  import { S as MonoSkillConfig, c as MonoConfig, o as MonoAppType, w as MonoTemplate } from "./create-config-B8IhX4ht.js";
2
- import { a as ResolveAppRootsOptions, c as isMissingPathError, d as pathAppRoots, f as resetAppPathWarnings, i as MonoMissingPathPolicy, l as linkedAppRoots, n as MonoAppRootInput, o as appRootDirs, p as resolveAppRoots, r as MonoAppRootSource, s as hasUrl, t as MonoAppRoot, u as missingPathMessage } from "./app-roots-DK41xMWj.js";
2
+ import { a as ResolveAppRootsOptions, c as hostedAppRoots, d as linkedAppRoots, f as missingPathMessage, h as resolveAppRoots, i as MonoMissingPathPolicy, l as isHostedApp, m as resetAppPathWarnings, n as MonoAppRootInput, o as appRootDirs, p as pathAppRoots, r as MonoAppRootSource, s as hasUrl, t as MonoAppRoot, u as isMissingPathError } from "./app-roots-BlcIuAan.js";
3
3
  import { LoadConfigOptions } from "c12";
4
4
  import { TSConfig } from "pkg-types";
5
5
  //#region src/composables/config-node.d.ts
@@ -305,6 +305,11 @@ export interface RunMonoPrepareResult {
305
305
  * does not exist yet — they have not run their own `mono prepare`.
306
306
  */
307
307
  unpreparedApps: string[];
308
+ /**
309
+ * Hosted (mini) `path` apps — no `package.json` — this host prepared on their
310
+ * behalf: `node_modules` linked to the host's, `.mono/tsconfig.json` written.
311
+ */
312
+ hostedApps: HostedAppPrepared[];
308
313
  }
309
314
  /**
310
315
  * Generate `<dirname>/.mono/tsconfig.json` from the mono alias map and wire it
@@ -312,6 +317,38 @@ export interface RunMonoPrepareResult {
312
317
  * inline `@mono-*` paths. Idempotent: safe to run repeatedly.
313
318
  */
314
319
  export declare function runMonoPrepare(opts: RunMonoPrepareOptions): Promise<RunMonoPrepareResult>;
320
+ /** What {@link adoptHostedApps} did for one hosted (mini) `path` app. */
321
+ export interface HostedAppPrepared {
322
+ name: string;
323
+ /** `<mini>/node_modules` -> `<host>/node_modules`: made, already right, or left alone. */
324
+ link: 'created' | 'kept' | 'skipped';
325
+ /** Absolute path of the generated `<mini>/.mono/tsconfig.json`. */
326
+ tsconfig: string;
327
+ }
328
+ /**
329
+ * Prepare every HOSTED (mini) app read in place through `apps[].path`, from the
330
+ * host's side — the mini has no `package.json`, so it can never run a
331
+ * `mono prepare` (or an install) of its own.
332
+ *
333
+ * 1. `<mini>/node_modules` becomes a link (a junction on Windows — no admin
334
+ * rights needed) to the host's `node_modules`. A sibling outside the host
335
+ * has no `node_modules` above it, so every bare import in its files —
336
+ * `vue`, `@mono-lit/utility/*` — fails in Vite AND in jiti (the host's c12
337
+ * loads the mini's `mono.config.ts`). One link fixes Vite, jiti, vue-tsc and
338
+ * the editor together, and because the realpaths ARE the host's, there is
339
+ * still exactly one copy of Vue. A real directory there is never touched.
340
+ * 2. `<mini>/.mono/tsconfig.json` extends the host's config (Nuxt host:
341
+ * `.nuxt/tsconfig.app.json`, Vite host: `tsconfig.json`), and — when the
342
+ * mini has none — `<mini>/tsconfig.json` extends that, so the editor
343
+ * type-checks the mini against the host's aliases and generated
344
+ * auto-import/route types.
345
+ *
346
+ * Unlike `wireClonedApps`' rule for full `path` apps, this DOES write into the
347
+ * sibling — but only files a mini gitignores (`node_modules`, `.mono/`, the
348
+ * generated `tsconfig.json`). Nothing it commits is ever edited. A clone under `.mono/apps` needs none
349
+ * of this: Node already walks up to the host's `node_modules`.
350
+ */
351
+ export declare function adoptHostedApps(dirname: string): HostedAppPrepared[];
315
352
  //#endregion
316
353
  //#region src/skills/config.d.ts
317
354
  /**
@@ -920,4 +957,4 @@ export declare function runSessionShow({ cwd, app, sessionId, remote, run }: {
920
957
  run?: GitRunner;
921
958
  }): SessionShowResult;
922
959
  //#endregion
923
- export { MonoAppRoot, MonoAppRootInput, MonoAppRootSource, MonoMissingPathPolicy, type MonoSkillConfig, ResolveAppRootsOptions, appRootDirs, hasUrl, isMissingPathError, linkedAppRoots, missingPathMessage, pathAppRoots, resetAppPathWarnings, resolveAppRoots };
960
+ export { MonoAppRoot, MonoAppRootInput, MonoAppRootSource, MonoMissingPathPolicy, type MonoSkillConfig, ResolveAppRootsOptions, appRootDirs, hasUrl, hostedAppRoots, isHostedApp, isMissingPathError, linkedAppRoots, missingPathMessage, pathAppRoots, resetAppPathWarnings, resolveAppRoots };
@@ -1,7 +1,7 @@
1
- import { a as missingPathMessage, c as resolveAppRoots, i as linkedAppRoots, n as hasUrl, o as pathAppRoots, r as isMissingPathError, s as resetAppPathWarnings, t as appRootDirs } from "./app-roots-CvJnmXcs.js";
1
+ import { a as isMissingPathError, c as pathAppRoots, i as isHostedApp, l as resetAppPathWarnings, n as hasUrl, o as linkedAppRoots, r as hostedAppRoots, s as missingPathMessage, t as appRootDirs, u as resolveAppRoots } from "./app-roots-LpDrHF_J.js";
2
2
  import { n as loadMonoConfig, t as getMonoConfig } from "./config-node-UzJrXg0Z.js";
3
- import { a as extractTemplate, c as monoConfigFileFor, d as resolveFederatedRoots, f as stripCommentsSafe, i as extractSkill, l as monoMissingApps, n as extractConfig, o as formatMissingApps, r as extractConfigName, s as monoAlias, t as assertAppSources, u as monoStubAliases } from "./mono-alias-DNDm-jB_.js";
4
- import { a as monoTsconfigPaths, i as buildMonoTsconfig, n as MONO_DIR, o as runMonoPrepare, r as MONO_TSCONFIG_REF, t as MONO_APPS_DIR } from "./mono-tsconfig-D2qRL9_R.js";
5
- import { A as BASE_ARGS, B as refPatterns, C as commitAndPush, D as repoDir, E as readRepoFile, F as parseHeadSha, G as SKILLS_DEFAULTS, H as tokenRemote, I as parseLsRemote, J as loadSkillsEnv, K as isGenericAppName, L as parseSymref, M as firstFatal, N as gitEnv, O as resolveRemote, P as isNonFastForward, R as redactUrl, S as SkillsAccessError, T as listRepoFiles, U as ALLOWED_FLAGS, V as runGit, W as GENERIC_APP_NAMES, Y as resolveSkillTarget, _ as stagingRoot, a as applyPlan, b as resolveAppId, c as chunkConversation, d as REQUIRED_FILES, f as cacheDir, g as removeSession, h as moveToFailed, i as runSearch, j as classifyGitFailure, k as skillsRoot, l as redact, m as loadStagedSession, n as runCheck, o as buildSavePlan, p as listSessions, q as loadSkillConfig, r as runRead, s as runSave, t as runSessionShow, u as redactBuffer, v as validateStagedSession, w as ensureRepo, x as detectActor, y as normalizeAppId, z as refDirCandidates } from "./session-Bcig-rPi.js";
3
+ import { a as extractTemplate, c as monoConfigFileFor, d as resolveFederatedRoots, f as stripCommentsSafe, i as extractSkill, l as monoMissingApps, n as extractConfig, o as formatMissingApps, r as extractConfigName, s as monoAlias, t as assertAppSources, u as monoStubAliases } from "./mono-alias-BU2B0tYL.js";
4
+ import { a as buildMonoTsconfig, i as adoptHostedApps, n as MONO_DIR, o as monoTsconfigPaths, r as MONO_TSCONFIG_REF, s as runMonoPrepare, t as MONO_APPS_DIR } from "./mono-tsconfig-4R-pfXV3.js";
5
+ import { A as BASE_ARGS, B as refPatterns, C as commitAndPush, D as repoDir, E as readRepoFile, F as parseHeadSha, G as SKILLS_DEFAULTS, H as tokenRemote, I as parseLsRemote, J as loadSkillsEnv, K as isGenericAppName, L as parseSymref, M as firstFatal, N as gitEnv, O as resolveRemote, P as isNonFastForward, R as redactUrl, S as SkillsAccessError, T as listRepoFiles, U as ALLOWED_FLAGS, V as runGit, W as GENERIC_APP_NAMES, Y as resolveSkillTarget, _ as stagingRoot, a as applyPlan, b as resolveAppId, c as chunkConversation, d as REQUIRED_FILES, f as cacheDir, g as removeSession, h as moveToFailed, i as runSearch, j as classifyGitFailure, k as skillsRoot, l as redact, m as loadStagedSession, n as runCheck, o as buildSavePlan, p as listSessions, q as loadSkillConfig, r as runRead, s as runSave, t as runSessionShow, u as redactBuffer, v as validateStagedSession, w as ensureRepo, x as detectActor, y as normalizeAppId, z as refDirCandidates } from "./session-CbSl2BMJ.js";
6
6
 
7
- export { ALLOWED_FLAGS, BASE_ARGS, GENERIC_APP_NAMES, MONO_APPS_DIR, MONO_DIR, MONO_TSCONFIG_REF, REQUIRED_FILES, SKILLS_DEFAULTS, SkillsAccessError, appRootDirs, applyPlan, assertAppSources, buildMonoTsconfig, buildSavePlan, cacheDir, chunkConversation, classifyGitFailure, commitAndPush, detectActor, ensureRepo, extractConfig, extractConfigName, extractSkill, extractTemplate, firstFatal, formatMissingApps, getMonoConfig, gitEnv, hasUrl, isGenericAppName, isMissingPathError, isNonFastForward, linkedAppRoots, listRepoFiles, listSessions, loadMonoConfig, loadSkillConfig, loadSkillsEnv, loadStagedSession, missingPathMessage, monoAlias, monoConfigFileFor, monoMissingApps, monoStubAliases, monoTsconfigPaths, moveToFailed, normalizeAppId, parseHeadSha, parseLsRemote, parseSymref, pathAppRoots, readRepoFile, redact, redactBuffer, redactUrl, refDirCandidates, refPatterns, removeSession, repoDir, resetAppPathWarnings, resolveAppId, resolveAppRoots, resolveFederatedRoots, resolveRemote, resolveSkillTarget, runCheck, runGit, runMonoPrepare, runRead, runSave, runSearch, runSessionShow, skillsRoot, stagingRoot, stripCommentsSafe, tokenRemote, validateStagedSession };
7
+ export { ALLOWED_FLAGS, BASE_ARGS, GENERIC_APP_NAMES, MONO_APPS_DIR, MONO_DIR, MONO_TSCONFIG_REF, REQUIRED_FILES, SKILLS_DEFAULTS, SkillsAccessError, adoptHostedApps, appRootDirs, applyPlan, assertAppSources, buildMonoTsconfig, buildSavePlan, cacheDir, chunkConversation, classifyGitFailure, commitAndPush, detectActor, ensureRepo, extractConfig, extractConfigName, extractSkill, extractTemplate, firstFatal, formatMissingApps, getMonoConfig, gitEnv, hasUrl, hostedAppRoots, isGenericAppName, isHostedApp, isMissingPathError, isNonFastForward, linkedAppRoots, listRepoFiles, listSessions, loadMonoConfig, loadSkillConfig, loadSkillsEnv, loadStagedSession, missingPathMessage, monoAlias, monoConfigFileFor, monoMissingApps, monoStubAliases, monoTsconfigPaths, moveToFailed, normalizeAppId, parseHeadSha, parseLsRemote, parseSymref, pathAppRoots, readRepoFile, redact, redactBuffer, redactUrl, refDirCandidates, refPatterns, removeSession, repoDir, resetAppPathWarnings, resolveAppId, resolveAppRoots, resolveFederatedRoots, resolveRemote, resolveSkillTarget, runCheck, runGit, runMonoPrepare, runRead, runSave, runSearch, runSessionShow, skillsRoot, stagingRoot, stripCommentsSafe, tokenRemote, validateStagedSession };
@@ -1,5 +1,5 @@
1
1
  import { a as monoMockDb, n as MonoMockRequest, o as resetMonoMockDb, r as MonoMockResponse, t as MonoMockDb } from "./index-BAy6tbOG.js";
2
- import { B as NormalFetchOptions, H as OdataFetchTypes, U as TanstackFetchOptions, Y as UseOdataStaticOpts, _ as getPrefetchBridge, a as TryCatchDatasourceParams, d as promiseWrapper, g as MonoPrefetchRequest, h as MonoPrefetchBridge, i as OdataFetchUniqueTypes, n as FetchOverrides, o as createFetcher, r as LoadChunkStoreArgs } from "./index-DYlzhHq7.js";
2
+ import { G as OdataFetchTypes, K as TanstackFetchOptions, Q as UseOdataStaticOpts, U as NormalFetchOptions, _ as getPrefetchBridge, a as TryCatchDatasourceParams, d as promiseWrapper, g as MonoPrefetchRequest, h as MonoPrefetchBridge, i as OdataFetchUniqueTypes, n as FetchOverrides, o as createFetcher, r as LoadChunkStoreArgs } from "./index-CLXtqgEx.js";
3
3
  import DataSource from "devextreme/data/data_source";
4
4
  import CustomStore from "devextreme/data/custom_store";
5
5
  import ODataStore from "devextreme/data/odata/store";
package/dist/fetching.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as monoState, O as monoStatePatch, T as monoConfig, a as createUniqueFetcher, c as tryCatchDatasource, d as PREFETCH_SUPPORT, f as getPrefetchBridge, h as createStaticDatasource, i as createFetcher, l as useFetchOData, o as loadChuckStore, p as setPrefetchBridge, s as promiseWrapper, u as useNormalFetch } from "./runtime-vs7U9Ed4.js";
1
+ import { D as monoState, O as monoStatePatch, T as monoConfig, a as createUniqueFetcher, c as tryCatchDatasource, d as PREFETCH_SUPPORT, f as getPrefetchBridge, h as createStaticDatasource, i as createFetcher, l as useFetchOData, o as loadChuckStore, p as setPrefetchBridge, s as promiseWrapper, u as useNormalFetch } from "./runtime-TXXmV6Q6.js";
2
2
  import { t as monoCookie, u as decodeJwt } from "./universal-DIVEzCvN.js";
3
3
  import { i as matchMockRoute } from "./generate-CJ7MtcDd.js";
4
4
  import { c as executeQuery, f as parseQuery, l as parseExpand, n as monoMockDb, r as resetMonoMockDb } from "./mock-db-4tTWrF-P.js";
@@ -6,7 +6,7 @@ import CustomStore, { CustomStoreOptions } from "devextreme/data/custom_store";
6
6
  import { FetchRequestConfig } from "@odata2ts/http-client-fetch";
7
7
  import ODataStore, { ODataStoreOptions } from "devextreme/data/odata/store";
8
8
  import { DxColumn, DxDataGrid, DxDataGridTypes } from "devextreme-vue/data-grid";
9
- import { ObjectSchema } from "yup";
9
+ import * as yup from "yup";
10
10
  import { QBooleanPath, QDateTimeOffsetPath, QEntityCollectionPath, QEntityPath, QNumberPath, QStringPath } from "@odata2ts/odata-query-objects";
11
11
  import { LoadOptions } from "devextreme/data";
12
12
  //#region src/core/composables/use-static-datasource.d.ts
@@ -109,11 +109,11 @@ declare const useHelper: () => {
109
109
  };
110
110
  }) => void;
111
111
  filterOrIn: (field: string, values: any[], combine?: boolean) => any;
112
- validateAllSchema: <T extends object = any>({ schema, input, error }: ValidateSchema<T>, callback?: () => void) => Promise<boolean>;
113
- validateSchema: <T = any>({ schema, field, input, error }: ValidateSchema<T>, callback?: Function) => Promise<boolean>;
114
- validateAllSchemaCheck: (error: ValidateError<any>) => boolean;
112
+ validateAllSchema: <T extends object = any>({ schema, input, error }: ValidateSchema<T>, callback?: () => unknown) => Promise<boolean>;
113
+ validateSchema: <T = any>({ schema, field, input, error }: ValidateSchema<T>, callback?: () => unknown) => Promise<boolean>;
114
+ validateAllSchemaCheck: (error: ValidateError<any> | any) => boolean;
115
115
  clearSchemaValidation: ({ error }: {
116
- error: Ref<any>;
116
+ error: any;
117
117
  }) => void;
118
118
  notif: (options: NotifProps) => Promise<import("notivue").NotificationClearMethods | undefined>;
119
119
  dxFilterToString: ({ filter, encode }: {
@@ -321,10 +321,42 @@ interface GroupTemplate {
321
321
  }
322
322
  //#endregion
323
323
  //#region src/core/types/schema.d.ts
324
+ /**
325
+ * Minimal Standard Schema v1 shape (https://standardschema.dev) — what Valibot,
326
+ * Zod, ArkType, … expose as `schema["~standard"]`. Inlined so no schema library
327
+ * is a type dependency.
328
+ */
329
+ interface StandardSchemaV1<Input = unknown, Output = Input> {
330
+ readonly "~standard": {
331
+ readonly version: 1;
332
+ readonly vendor: string;
333
+ readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
334
+ readonly types?: {
335
+ readonly input: Input;
336
+ readonly output: Output;
337
+ } | undefined;
338
+ };
339
+ }
340
+ type StandardSchemaV1Result<Output> = {
341
+ readonly value: Output;
342
+ readonly issues?: undefined;
343
+ } | {
344
+ readonly issues: ReadonlyArray<{
345
+ readonly message: string;
346
+ readonly path?: ReadonlyArray<PropertyKey | {
347
+ readonly key: PropertyKey;
348
+ }> | undefined;
349
+ }>;
350
+ };
351
+ /** A yup schema or any Standard Schema (Valibot, Zod, …). */
352
+ type ValidationSchemaLike = yup.AnySchema | yup.AnyObjectSchema | StandardSchemaV1<any, any>;
324
353
  interface ValidateSchema<T = any> {
325
- schema: any;
326
- field?: keyof T;
354
+ /** yup schema or any Standard Schema (Valibot, Zod, …) */
355
+ schema: ValidationSchemaLike | any;
356
+ /** field to validate; dotted / indexed paths allowed (`"address.city"`, `"items[0].name"`) */
357
+ field?: keyof T | (string & {});
327
358
  input: T;
359
+ /** `{ valid, message }` slots mirroring `input` (object or Ref) */
328
360
  error: any;
329
361
  }
330
362
  type ValidateErrorItem = {
@@ -334,7 +366,7 @@ type ValidateErrorItem = {
334
366
  type ValidateError<T extends string = string> = Record<T, ValidateErrorItem>;
335
367
  type WithUndefined<T> = { [P in keyof T]: T[P] | undefined; };
336
368
  interface SchemaType<T> extends WithUndefined<T> {}
337
- interface Schema<T> extends ObjectSchema<SchemaType<T>> {}
369
+ interface Schema<T> extends yup.ObjectSchema<SchemaType<T>> {}
338
370
  type AnyObject = yup.AnyObject;
339
371
  /** Map a TS type T to the corresponding Yup schema type */
340
372
  type SchemaFor<T> = T extends string ? yup.StringSchema<string> : T extends number ? yup.NumberSchema<number> : T extends boolean ? yup.BooleanSchema<boolean> : T extends Date ? yup.DateSchema<Date> : T extends (infer U)[] ? yup.ArraySchema<SchemaFor<U>, AnyObject, U[]> : T extends Record<string, any> ? yup.ObjectSchema<{ [K in keyof T]-?: SchemaFor<T[K]>; }, AnyObject, T> : yup.Schema<T>;
@@ -511,4 +543,4 @@ type __VLS_Props = {
511
543
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
512
544
  declare const _default: typeof __VLS_export;
513
545
  //#endregion
514
- export { ValidateErrorItem as A, NormalFetchOptions as B, Format as C, SchemaType as D, SchemaObject as E, LoopTemplate as F, NotifProps as G, OdataFetchTypes as H, PathValue as I, MonoNotifButton as J, MonoNotifActionProps as K, FetchLoading as L, ValidateSchema as M, Col as N, ValidateError as O, GroupTemplate as P, FetchOData as R, FilterExpression as S, Schema as T, TanstackFetchOptions as U, NormalFetchResult as V, useHelper as W, createStaticDatasource as X, UseOdataStaticOpts as Y, getPrefetchBridge as _, TryCatchDatasourceParams as a, CustomSummary as b, extractErrorMessage as c, promiseWrapper as d, tryCatchDatasource as f, MonoPrefetchRequest as g, MonoPrefetchBridge as h, OdataFetchUniqueTypes as i, ValidateErrorSingle as j, ValidateErrorComplex as k, loadChuckStore as l, useNormalFetch as m, FetchOverrides as n, createFetcher as o, useFetchOData as p, MonoNotifActionTypes as q, LoadChunkStoreArgs as r, createUniqueFetcher as s, _default as t, parseDxError as u, setPrefetchBridge as v, HeaderFilter as w, DataGrid as x, OdataMapTypes as y, FetchParam as z };
546
+ export { createStaticDatasource as $, ValidateError as A, FetchLoading as B, Format as C, SchemaType as D, SchemaObject as E, ValidationSchemaLike as F, OdataFetchTypes as G, FetchParam as H, Col as I, NotifProps as J, TanstackFetchOptions as K, GroupTemplate as L, ValidateErrorItem as M, ValidateErrorSingle as N, StandardSchemaV1 as O, ValidateSchema as P, UseOdataStaticOpts as Q, LoopTemplate as R, FilterExpression as S, Schema as T, NormalFetchOptions as U, FetchOData as V, NormalFetchResult as W, MonoNotifActionTypes as X, MonoNotifActionProps as Y, MonoNotifButton as Z, getPrefetchBridge as _, TryCatchDatasourceParams as a, CustomSummary as b, extractErrorMessage as c, promiseWrapper as d, tryCatchDatasource as f, MonoPrefetchRequest as g, MonoPrefetchBridge as h, OdataFetchUniqueTypes as i, ValidateErrorComplex as j, StandardSchemaV1Result as k, loadChuckStore as l, useNormalFetch as m, FetchOverrides as n, createFetcher as o, useFetchOData as p, useHelper as q, LoadChunkStoreArgs as r, createUniqueFetcher as s, _default as t, parseDxError as u, setPrefetchBridge as v, HeaderFilter as w, DataGrid as x, OdataMapTypes as y, PathValue as z };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as mergeEcosystem, r as monoEcosystem } from "./merge-file-CtyKTu5L.js";
1
+ import { n as mergeEcosystem, r as monoEcosystem } from "./merge-file-DahuGcvr.js";
2
2
  import fs from "node:fs";
3
3
  import path, { resolve } from "node:path";
4
4
  import fs$1 from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { c as resolveAppRoots } from "./app-roots-CvJnmXcs.js";
1
+ import { u as resolveAppRoots } from "./app-roots-LpDrHF_J.js";
2
2
  import { l as srcDirForType } from "./create-config-DdL3Fh6T.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import { c as resolveAppRoots } from "./app-roots-CvJnmXcs.js";
1
+ import { u as resolveAppRoots } from "./app-roots-LpDrHF_J.js";
2
2
  import { l as srcDirForType } from "./create-config-DdL3Fh6T.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
package/dist/mono-db.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as resolveMonoConfig } from "./create-config-DdL3Fh6T.js";
2
2
  import { t as getMonoConfig } from "./config-node-UzJrXg0Z.js";
3
- import { s as monoAlias } from "./mono-alias-DNDm-jB_.js";
3
+ import { s as monoAlias } from "./mono-alias-BU2B0tYL.js";
4
4
  import { n as generateSeed, s as parseMockSchema } from "./generate-CJ7MtcDd.js";
5
5
  import { writeFileSync } from "node:fs";
6
6
  import path from "node:path";
package/dist/mono-env.mjs CHANGED
@@ -87,8 +87,9 @@ const childEnv = {
87
87
  ...process.env,
88
88
  }
89
89
 
90
- function loadEnvByPath(fullPath, displayPath, label) {
90
+ function loadEnvByPath(fullPath, displayPath, label, quietIfMissing = false) {
91
91
  if (!existsSync(fullPath)) {
92
+ if (quietIfMissing) return
92
93
  console.warn(`[mono-env] Warning: ${label} env file not found: ${displayPath}`)
93
94
  return
94
95
  }
@@ -161,12 +162,16 @@ function loadAppEnv(app) {
161
162
  return
162
163
  }
163
164
 
165
+ // A hosted (mini) app — no package.json — ships no env of its own: the host
166
+ // owns env, so a missing file there is the normal case, not worth a warning.
167
+ const hosted = !existsSync(resolve(app.dir, 'package.json'))
168
+
164
169
  for (const file of envFiles) {
165
170
  const envFileName = basename(file)
166
171
  const appEnvPath = resolve(app.dir, envFileName)
167
172
  const displayPath = `${displayDir(app.dir)}/${envFileName}`
168
173
 
169
- loadEnvByPath(appEnvPath, displayPath, `app:${app.name}`)
174
+ loadEnvByPath(appEnvPath, displayPath, `app:${app.name}`, hosted)
170
175
  }
171
176
  }
172
177