@venizia/ardor 0.4.8-1 → 0.4.8-2
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 +7 -2
- package/dist/index.d.ts +21 -0
- package/dist/index.js +21 -0
- package/dist/presets/app/preset.json +13 -13
- package/dist/presets/lib/preset.json +9 -9
- package/dist/testing.d.ts +3 -2
- package/dist/vite/common/constants.d.ts +6 -0
- package/dist/vite/common/constants.js +6 -0
- package/dist/vite/common/types.d.ts +19 -4
- package/dist/vite/plugin.d.ts +10 -0
- package/dist/vite/plugin.js +10 -0
- package/package.json +17 -17
package/README.md
CHANGED
|
@@ -13,6 +13,8 @@ control comes from `@venizia/ignis-inversion`, and the data layer speaks the que
|
|
|
13
13
|
bun add @venizia/ardor @venizia/ignis-inversion @venizia/ignis-filter @venizia/ignis-kernel @venizia/ignis-helpers reflect-metadata
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
The React-side peers (`react`, `react-dom`, `react-redux`, `@reduxjs/toolkit`, `@tanstack/react-query`, `ra-core`, `ra-i18n-polyglot`, `react-router-dom`) are installed too; the full `bun add` line is in the [setup guide](https://ardor.venizia.ai/guides/get-started/setup).
|
|
17
|
+
|
|
16
18
|
## The `Ardor` namespace
|
|
17
19
|
|
|
18
20
|
`Ardor` gathers every React hook of the react and admin packages under one name: `Ardor.useRepository(...)`, `Ardor.useTranslate()`. It is the same function as the bare `useRepository`, the Rules of Hooks check the call, and a bundler keeps only the hooks you use, so it adds no bytes to an app.
|
|
@@ -20,8 +22,10 @@ bun add @venizia/ardor @venizia/ignis-inversion @venizia/ignis-filter @venizia/i
|
|
|
20
22
|
```tsx
|
|
21
23
|
import { Ardor } from '@venizia/ardor';
|
|
22
24
|
|
|
25
|
+
import { OrdersRepository } from './orders.repository';
|
|
26
|
+
|
|
23
27
|
export const Orders = () => {
|
|
24
|
-
const repository = Ardor.useRepository({
|
|
28
|
+
const repository = Ardor.useRepository({ target: OrdersRepository });
|
|
25
29
|
|
|
26
30
|
return <div>{String(repository)}</div>;
|
|
27
31
|
};
|
|
@@ -108,7 +112,8 @@ export class Application extends BaseArdorApplication {
|
|
|
108
112
|
```
|
|
109
113
|
|
|
110
114
|
The full guide, including the root component and the typed hooks, is in the
|
|
111
|
-
[
|
|
115
|
+
[Quickstart](https://ardor.venizia.ai/guides/get-started/5-minute-quickstart) and the
|
|
116
|
+
[references](https://ardor.venizia.ai/references/hooks).
|
|
112
117
|
|
|
113
118
|
## Migrating from `@minimaltech/ra-core-infra`
|
|
114
119
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every ARDOR hook under one name: `Ardor.useRepository(...)` is the same function as
|
|
3
|
+
* `useRepository`. Call a member by its name; do not index with a computed key (`Ardor[name]`), which
|
|
4
|
+
* keeps every hook in a bundle.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { Ardor, repository } from '@venizia/ardor';
|
|
9
|
+
*
|
|
10
|
+
* @repository()
|
|
11
|
+
* class OrdersRepository {
|
|
12
|
+
* count() { return 3; }
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* export const Orders = () => {
|
|
16
|
+
* const orders = Ardor.useRepository({ target: OrdersRepository });
|
|
17
|
+
* const container = Ardor.useApplicationContainer();
|
|
18
|
+
* return <span>{orders.count()} {container.isBound({ key: 'repositories.OrdersRepository' }) ? 'bound' : 'missing'}</span>;
|
|
19
|
+
* };
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
1
22
|
export * as Ardor from './ardor.js';
|
|
2
23
|
export * from '@venizia/ardor-kernel';
|
|
3
24
|
export * from '@venizia/ardor-react';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
// ARDOR - one entry point over the framework packages.
|
|
2
2
|
// An application imports from `@venizia/ardor`; a consumer that needs only one layer installs that
|
|
3
3
|
// package directly.
|
|
4
|
+
/**
|
|
5
|
+
* Every ARDOR hook under one name: `Ardor.useRepository(...)` is the same function as
|
|
6
|
+
* `useRepository`. Call a member by its name; do not index with a computed key (`Ardor[name]`), which
|
|
7
|
+
* keeps every hook in a bundle.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Ardor, repository } from '@venizia/ardor';
|
|
12
|
+
*
|
|
13
|
+
* @repository()
|
|
14
|
+
* class OrdersRepository {
|
|
15
|
+
* count() { return 3; }
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* export const Orders = () => {
|
|
19
|
+
* const orders = Ardor.useRepository({ target: OrdersRepository });
|
|
20
|
+
* const container = Ardor.useApplicationContainer();
|
|
21
|
+
* return <span>{orders.count()} {container.isBound({ key: 'repositories.OrdersRepository' }) ? 'bound' : 'missing'}</span>;
|
|
22
|
+
* };
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
4
25
|
export * as Ardor from './ardor.js';
|
|
5
26
|
export * from '@venizia/ardor-kernel';
|
|
6
27
|
export * from '@venizia/ardor-react';
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"@reduxjs/toolkit": "^2.13.0",
|
|
15
15
|
"@tanstack/react-query": "^5.104.5",
|
|
16
|
-
"@venizia/ardor": "0.4.8-
|
|
17
|
-
"@venizia/ignis-connectors": "0.4.8-
|
|
18
|
-
"@venizia/ignis-filter": "0.4.7-
|
|
19
|
-
"@venizia/ignis-helpers": "0.4.8-
|
|
20
|
-
"@venizia/ignis-inversion": "0.4.7-
|
|
21
|
-
"@venizia/ignis-kernel": "0.4.8-
|
|
16
|
+
"@venizia/ardor": "0.4.8-2",
|
|
17
|
+
"@venizia/ignis-connectors": "0.4.8-1",
|
|
18
|
+
"@venizia/ignis-filter": "0.4.7-1",
|
|
19
|
+
"@venizia/ignis-helpers": "0.4.8-1",
|
|
20
|
+
"@venizia/ignis-inversion": "0.4.7-1",
|
|
21
|
+
"@venizia/ignis-kernel": "0.4.8-1",
|
|
22
22
|
"class-variance-authority": "^0.7.1",
|
|
23
23
|
"clsx": "^2.1.1",
|
|
24
24
|
"ra-core": "^5.15.5",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@types/bun": "^1.4.3",
|
|
36
36
|
"@types/react": "^19",
|
|
37
37
|
"@types/react-dom": "^19",
|
|
38
|
-
"@venizia/dev-configs": "0.4.8-
|
|
39
|
-
"@venizia/ignis-boot": "0.4.8-
|
|
38
|
+
"@venizia/dev-configs": "0.4.8-1",
|
|
39
|
+
"@venizia/ignis-boot": "0.4.8-1",
|
|
40
40
|
"@vitejs/plugin-react": "^6.1.2",
|
|
41
41
|
"eslint": "^10.13.0",
|
|
42
42
|
"oxlint": "1.89.0",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"peers": {
|
|
49
49
|
"@venizia/dev-configs": "^0.4.0 || ^0.4.8-0",
|
|
50
|
-
"@venizia/ignis-connectors": "^0.4.8-
|
|
51
|
-
"@venizia/ignis-filter": "^0.4.7-
|
|
52
|
-
"@venizia/ignis-helpers": "^0.4.8-
|
|
53
|
-
"@venizia/ignis-inversion": "^0.4.7-
|
|
54
|
-
"@venizia/ignis-kernel": "^0.4.8-
|
|
50
|
+
"@venizia/ignis-connectors": "^0.4.8-1",
|
|
51
|
+
"@venizia/ignis-filter": "^0.4.7-1",
|
|
52
|
+
"@venizia/ignis-helpers": "^0.4.8-1",
|
|
53
|
+
"@venizia/ignis-inversion": "^0.4.7-1",
|
|
54
|
+
"@venizia/ignis-kernel": "^0.4.8-1"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"server:dev": "vite --config .configs/builders/vite.config.mts",
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
"devDependencies": {
|
|
6
6
|
"@types/bun": "^1.4.3",
|
|
7
7
|
"@types/react": "^19",
|
|
8
|
-
"@venizia/ardor": "^0.4.8-
|
|
9
|
-
"@venizia/dev-configs": "0.4.8-
|
|
10
|
-
"@venizia/ignis-boot": "0.4.8-
|
|
11
|
-
"@venizia/ignis-connectors": "0.4.8-
|
|
12
|
-
"@venizia/ignis-filter": "0.4.7-
|
|
13
|
-
"@venizia/ignis-helpers": "0.4.8-
|
|
14
|
-
"@venizia/ignis-inversion": "0.4.7-
|
|
15
|
-
"@venizia/ignis-kernel": "0.4.8-
|
|
8
|
+
"@venizia/ardor": "^0.4.8-2",
|
|
9
|
+
"@venizia/dev-configs": "0.4.8-1",
|
|
10
|
+
"@venizia/ignis-boot": "0.4.8-1",
|
|
11
|
+
"@venizia/ignis-connectors": "0.4.8-1",
|
|
12
|
+
"@venizia/ignis-filter": "0.4.7-1",
|
|
13
|
+
"@venizia/ignis-helpers": "0.4.8-1",
|
|
14
|
+
"@venizia/ignis-inversion": "0.4.7-1",
|
|
15
|
+
"@venizia/ignis-kernel": "0.4.8-1",
|
|
16
16
|
"eslint": "^10.13.0",
|
|
17
17
|
"oxlint": "1.89.0",
|
|
18
18
|
"oxlint-tsgolint": "7.0.2004",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"typescript": "^6.0.3"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@venizia/ardor": "^0.4.8-
|
|
26
|
+
"@venizia/ardor": "^0.4.8-2",
|
|
27
27
|
"react": "^19.3.1",
|
|
28
28
|
"react-dom": "^19.3.1",
|
|
29
29
|
"react-router-dom": "^7.18.4",
|
package/dist/testing.d.ts
CHANGED
|
@@ -16,8 +16,9 @@ export interface IAssertArdorApplicationBootsOptions {
|
|
|
16
16
|
/** The locale whose messages must load. Default: the i18n provider's initial one. */
|
|
17
17
|
locale?: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* An application with no service, repository, datasource, component or configuration and no
|
|
20
|
+
* feature proves nothing (usually the artifact index was empty), so it fails unless this is `true`.
|
|
21
|
+
* @default false
|
|
21
22
|
*/
|
|
22
23
|
allowEmpty?: boolean;
|
|
23
24
|
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/** The build info file's path when `fileName` is not set. */
|
|
1
2
|
export declare const DEFAULT_BUILD_INFO_FILE_NAME = "build-info.json";
|
|
3
|
+
/** The package-name prefix listed under `frameworks` when `frameworkScope` is not set. */
|
|
2
4
|
export declare const DEFAULT_FRAMEWORK_SCOPE = "@venizia/";
|
|
3
5
|
/** What to do when the commit is neither in the pipeline environment nor in git. */
|
|
4
6
|
export declare class UnresolvedPolicies {
|
|
7
|
+
/** The build fails. */
|
|
5
8
|
static readonly ERROR = "error";
|
|
9
|
+
/** The build goes on with the commit recorded as `unspecified`. */
|
|
6
10
|
static readonly UNSPECIFIED = "unspecified";
|
|
11
|
+
/** Every accepted policy value. */
|
|
7
12
|
static readonly SCHEME_SET: Set<string>;
|
|
13
|
+
/** Whether `value` is one of the policies. */
|
|
8
14
|
static isValid(value: string): boolean;
|
|
9
15
|
}
|
|
10
16
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
/** The build info file's path when `fileName` is not set. */
|
|
1
2
|
export const DEFAULT_BUILD_INFO_FILE_NAME = 'build-info.json';
|
|
3
|
+
/** The package-name prefix listed under `frameworks` when `frameworkScope` is not set. */
|
|
2
4
|
export const DEFAULT_FRAMEWORK_SCOPE = '@venizia/';
|
|
3
5
|
/** What to do when the commit is neither in the pipeline environment nor in git. */
|
|
4
6
|
export class UnresolvedPolicies {
|
|
7
|
+
/** The build fails. */
|
|
5
8
|
static { this.ERROR = 'error'; }
|
|
9
|
+
/** The build goes on with the commit recorded as `unspecified`. */
|
|
6
10
|
static { this.UNSPECIFIED = 'unspecified'; }
|
|
11
|
+
/** Every accepted policy value. */
|
|
7
12
|
static { this.SCHEME_SET = new Set([this.ERROR, this.UNSPECIFIED]); }
|
|
13
|
+
/** Whether `value` is one of the policies. */
|
|
8
14
|
static isValid(value) {
|
|
9
15
|
return this.SCHEME_SET.has(value);
|
|
10
16
|
}
|
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
import type { IBuildInfoFile, TConstValue } from '@venizia/ardor-kernel';
|
|
2
2
|
import type { TBuildInfoRecord } from '@venizia/ignis-helpers/core';
|
|
3
3
|
import type { UnresolvedPolicies } from './constants.js';
|
|
4
|
+
/** `'error'` or `'unspecified'`; see `UnresolvedPolicies`. */
|
|
4
5
|
export type TUnresolvedPolicy = TConstValue<typeof UnresolvedPolicies>;
|
|
5
6
|
export interface IBuildInfoFileOptions {
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* The app folder, where its package.json is.
|
|
9
|
+
* @default process.cwd()
|
|
10
|
+
*/
|
|
7
11
|
root?: string;
|
|
8
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* The file's path under the output folder and under the dev server's base.
|
|
14
|
+
* A relative path of letters, digits, `.`, `_` and `-`, with `/` between folders, ending `.json`, and
|
|
15
|
+
* no `..` segment; anything else throws.
|
|
16
|
+
* @default 'build-info.json'
|
|
17
|
+
*/
|
|
9
18
|
fileName?: string;
|
|
10
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Dependencies whose name starts with this are listed under `frameworks`.
|
|
21
|
+
* @default '@venizia/'
|
|
22
|
+
*/
|
|
11
23
|
frameworkScope?: string;
|
|
12
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* What a build does when no commit can be found: `error` or `unspecified`. The dev server always serves what it has and warns.
|
|
26
|
+
* @default UnresolvedPolicies.ERROR
|
|
27
|
+
*/
|
|
13
28
|
onUnresolved?: TUnresolvedPolicy;
|
|
14
29
|
}
|
|
15
30
|
export type TGitReadResult = {
|
package/dist/vite/plugin.d.ts
CHANGED
|
@@ -15,6 +15,16 @@ export declare const createBuildInfoFilePlugin: (opts: {
|
|
|
15
15
|
* Emits `build-info.json` into the build and serves it on the dev server: the commit, the branch and
|
|
16
16
|
* the build time from the pipeline or git, the app's name and version, and the installed versions of
|
|
17
17
|
* the framework packages it depends on. The shape is `IBuildInfoFile` of `@venizia/ardor`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* import { buildInfoFile } from '@venizia/ardor/vite';
|
|
22
|
+
* import { defineConfig } from 'vite';
|
|
23
|
+
*
|
|
24
|
+
* export default defineConfig({
|
|
25
|
+
* plugins: [buildInfoFile({ fileName: 'build-info.json', onUnresolved: 'unspecified' })],
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
18
28
|
*/
|
|
19
29
|
export declare const buildInfoFile: (opts?: IBuildInfoFileOptions) => Plugin;
|
|
20
30
|
export {};
|
package/dist/vite/plugin.js
CHANGED
|
@@ -104,6 +104,16 @@ export const createBuildInfoFilePlugin = (opts) => {
|
|
|
104
104
|
* Emits `build-info.json` into the build and serves it on the dev server: the commit, the branch and
|
|
105
105
|
* the build time from the pipeline or git, the app's name and version, and the installed versions of
|
|
106
106
|
* the framework packages it depends on. The shape is `IBuildInfoFile` of `@venizia/ardor`.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* import { buildInfoFile } from '@venizia/ardor/vite';
|
|
111
|
+
* import { defineConfig } from 'vite';
|
|
112
|
+
*
|
|
113
|
+
* export default defineConfig({
|
|
114
|
+
* plugins: [buildInfoFile({ fileName: 'build-info.json', onUnresolved: 'unspecified' })],
|
|
115
|
+
* });
|
|
116
|
+
* ```
|
|
107
117
|
*/
|
|
108
118
|
export const buildInfoFile = (opts = {}) => createBuildInfoFilePlugin({ options: opts, sources: defaultSources });
|
|
109
119
|
//# sourceMappingURL=plugin.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venizia/ardor",
|
|
3
|
-
"version": "0.4.8-
|
|
3
|
+
"version": "0.4.8-2",
|
|
4
4
|
"description": "ARDOR - frontend application framework for the VENIZIA family. One entry point over ardor-kernel, ardor-react and ardor-admin: IGNIS inversion of control, a REST data layer, auth and i18n providers, and the React bindings for a react-admin application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ardor",
|
|
@@ -79,21 +79,21 @@
|
|
|
79
79
|
"prepublishOnly": "make rebuild"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@venizia/ardor-admin": "0.4.8-
|
|
83
|
-
"@venizia/ardor-kernel": "0.4.8-
|
|
84
|
-
"@venizia/ardor-react": "0.4.8-
|
|
82
|
+
"@venizia/ardor-admin": "0.4.8-2",
|
|
83
|
+
"@venizia/ardor-kernel": "0.4.8-2",
|
|
84
|
+
"@venizia/ardor-react": "0.4.8-2"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@size-limit/preset-small-lib": "^14.2.0",
|
|
88
88
|
"@types/bun": "^1.4.3",
|
|
89
89
|
"@types/node": "^25.0.10",
|
|
90
|
-
"@venizia/dev-configs": "^0.4.8-
|
|
91
|
-
"@venizia/ignis-boot": "^0.4.8-
|
|
92
|
-
"@venizia/ignis-connectors": "^0.4.8-
|
|
93
|
-
"@venizia/ignis-filter": "^0.4.7-
|
|
94
|
-
"@venizia/ignis-helpers": "^0.4.8-
|
|
95
|
-
"@venizia/ignis-inversion": "^0.4.7-
|
|
96
|
-
"@venizia/ignis-kernel": "^0.4.8-
|
|
90
|
+
"@venizia/dev-configs": "^0.4.8-1",
|
|
91
|
+
"@venizia/ignis-boot": "^0.4.8-1",
|
|
92
|
+
"@venizia/ignis-connectors": "^0.4.8-1",
|
|
93
|
+
"@venizia/ignis-filter": "^0.4.7-1",
|
|
94
|
+
"@venizia/ignis-helpers": "^0.4.8-1",
|
|
95
|
+
"@venizia/ignis-inversion": "^0.4.7-1",
|
|
96
|
+
"@venizia/ignis-kernel": "^0.4.8-1",
|
|
97
97
|
"eslint": "^10.13.0",
|
|
98
98
|
"oxlint": "1.89.0",
|
|
99
99
|
"oxlint-tsgolint": "7.0.2004",
|
|
@@ -105,12 +105,12 @@
|
|
|
105
105
|
"peerDependencies": {
|
|
106
106
|
"@reduxjs/toolkit": ">=2.13.0",
|
|
107
107
|
"@tanstack/react-query": ">=5.104.5",
|
|
108
|
-
"@venizia/ignis-boot": "^0.4.8-
|
|
109
|
-
"@venizia/ignis-connectors": "^0.4.8-
|
|
110
|
-
"@venizia/ignis-filter": "^0.4.7-
|
|
111
|
-
"@venizia/ignis-helpers": "^0.4.8-
|
|
112
|
-
"@venizia/ignis-inversion": "^0.4.7-
|
|
113
|
-
"@venizia/ignis-kernel": "^0.4.8-
|
|
108
|
+
"@venizia/ignis-boot": "^0.4.8-1",
|
|
109
|
+
"@venizia/ignis-connectors": "^0.4.8-1",
|
|
110
|
+
"@venizia/ignis-filter": "^0.4.7-1",
|
|
111
|
+
"@venizia/ignis-helpers": "^0.4.8-1",
|
|
112
|
+
"@venizia/ignis-inversion": "^0.4.7-1",
|
|
113
|
+
"@venizia/ignis-kernel": "^0.4.8-1",
|
|
114
114
|
"ra-core": ">=5.15.5",
|
|
115
115
|
"ra-i18n-polyglot": ">=5.15.5",
|
|
116
116
|
"react": ">=19.3.1",
|