@antelopejs/dms-frontend 0.1.8 → 0.2.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/README.md +17 -10
- package/dist/commands/build.js +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/index.js +1 -1
- package/dist/layers.js +2 -2
- package/dist/materialize.js +1 -1
- package/dist/verify-source-runner.js +1 -1
- package/package.json +1 -1
- package/templates/vue/vite.config.ts +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,9 @@ Frontend-agnostic loader for AntelopeJS DMS. The backend serves a frontend
|
|
|
10
10
|
manifest and the matching frontend-module archives; the `ajs dms` CLI
|
|
11
11
|
materializes them into a generated workspace for one renderer, builds it, and
|
|
12
12
|
runs its Node frontend server. The `vue` renderer — Vue 3, Vite, Inertia, and
|
|
13
|
-
SSR — is the one shipped today.
|
|
13
|
+
SSR — is the one shipped today. The package itself installs a single executable,
|
|
14
|
+
`ajs-dms`; `ajs dms` is the core CLI delegating to it, and is the name every
|
|
15
|
+
project, script and document uses.
|
|
14
16
|
|
|
15
17
|
## Renderers
|
|
16
18
|
|
|
@@ -42,7 +44,7 @@ making the template root (`src/materialize.ts`) and the manifest query
|
|
|
42
44
|
`--renderer` flag and no renderer registry; the single-renderer assumption is
|
|
43
45
|
deliberate until a second renderer exists. Whatever a renderer names its module
|
|
44
46
|
entry is its own convention: `dms.frontend.ts` and the
|
|
45
|
-
`#dms
|
|
47
|
+
`#dms/frontend-module` alias belong to the Vue renderer, not to the
|
|
46
48
|
loader.
|
|
47
49
|
|
|
48
50
|
## Application ownership
|
|
@@ -55,15 +57,23 @@ not infer application ownership from other framework configuration.
|
|
|
55
57
|
|
|
56
58
|
## Install
|
|
57
59
|
|
|
58
|
-
The loader is an AntelopeJS CLI plugin: install it next to
|
|
59
|
-
and
|
|
60
|
+
The loader is an official AntelopeJS CLI plugin: install it next to
|
|
61
|
+
`@antelopejs/core` and run it as `ajs dms <command>`. That is the only supported
|
|
62
|
+
way to invoke it — in a shell, in a package script, in CI and in a container
|
|
63
|
+
alike.
|
|
60
64
|
|
|
61
65
|
```bash
|
|
66
|
+
# in a project (the usual case: both are already project dependencies)
|
|
67
|
+
pnpm add @antelopejs/core @antelopejs/dms-frontend
|
|
68
|
+
|
|
69
|
+
# or globally
|
|
62
70
|
pnpm add -g @antelopejs/core @antelopejs/dms-frontend
|
|
63
71
|
```
|
|
64
72
|
|
|
65
73
|
`npm install -g` works too; this repository and every generated workspace use
|
|
66
|
-
pnpm.
|
|
74
|
+
pnpm. Inside a package script, `ajs` resolves from `node_modules/.bin`, and the
|
|
75
|
+
`dms` command it delegates to resolves the project-local plugin, so a script
|
|
76
|
+
never depends on a global install.
|
|
67
77
|
|
|
68
78
|
## Commands
|
|
69
79
|
|
|
@@ -76,9 +86,6 @@ ajs dms clean -b https://dms.example.com
|
|
|
76
86
|
ajs dms clean --all
|
|
77
87
|
```
|
|
78
88
|
|
|
79
|
-
`ajs dms <command>` and `ajs-dms <command>` are the same program; the delegation
|
|
80
|
-
only saves you from remembering a second executable name. Package scripts should
|
|
81
|
-
call `ajs-dms` directly so they do not depend on the CLI being installed.
|
|
82
89
|
`--help`, `--version` and `clean` run from any directory. `prepare` also runs
|
|
83
90
|
anywhere: with no backend in reach it warns and exits 0, so a frontend module's
|
|
84
91
|
`postinstall` hook never fails an install, and the generated types are refreshed
|
|
@@ -97,7 +104,7 @@ Manifest negotiation and module materialization are the renderer contract descri
|
|
|
97
104
|
|
|
98
105
|
The generated Vue application uses `@inertiajs/vue3`, `@nuxt/ui/vite` with `{ router: "inertia" }`, and `@nuxt/ui/vue-plugin`. The Node server resolves each Inertia visit through `/dms/page?path=…`, including fresh shared data so account, tenant, and permission changes update navigation state. It proxies backend routes and manages authentication through server-side sessions. `DMS_BOOTSTRAP_SECRET` is used only by the CLI's server-to-server frontend manifest and module archive requests and is never sent by, or exposed to, browser traffic.
|
|
99
106
|
|
|
100
|
-
Vue modules
|
|
107
|
+
Vue modules register through `dms.frontend.ts` and import the SDK from the `#dms/frontend-module` alias, which the loader resolves to the generated `frontend-module.ts`: `defineDmsPlugin`, `useDmsRouter`, the page and session types, and everything else a module needs from the host. Email templates register separately through `dms.email.ts`.
|
|
101
108
|
|
|
102
109
|
An email entry exports `serverEmailTemplates` and may export a plain `appConfig` object, such as shared branding defaults. Email rendering merges these configurations in manifest-priority order and provides them to `useDmsAppConfig` per render. Public runtime options come from the module manifest; `DMS_CLIENT_BASE_URL` overrides `public.dms.clientBaseUrl`. Email entries must not import the browser frontend module.
|
|
103
110
|
|
|
@@ -110,7 +117,7 @@ A materialized module opts into the Vue adapter with a root `dms.frontend.ts`:
|
|
|
110
117
|
```ts
|
|
111
118
|
import MyBlock from "./components/MyBlock.vue";
|
|
112
119
|
import MyPage from "./pages/MyPage.vue";
|
|
113
|
-
import type { DmsFrontendModule } from "
|
|
120
|
+
import type { DmsFrontendModule } from "#dms/frontend-module";
|
|
114
121
|
|
|
115
122
|
const frontendModule: DmsFrontendModule = {
|
|
116
123
|
setup(sdk) {
|
package/dist/commands/build.js
CHANGED
|
@@ -51,7 +51,7 @@ function cmdBuild() {
|
|
|
51
51
|
if (code === 0) {
|
|
52
52
|
console.log("");
|
|
53
53
|
(0, cli_ui_1.success)("Build completed successfully!");
|
|
54
|
-
console.log(chalk_1.default.dim(" Run 'ajs
|
|
54
|
+
console.log(chalk_1.default.dim(" Run 'ajs dms start' to start the production server"));
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
57
|
(0, cli_ui_1.error)("Build failed");
|
package/dist/commands/start.js
CHANGED
|
@@ -26,7 +26,7 @@ function cmdStart() {
|
|
|
26
26
|
if (!(0, node_fs_1.existsSync)(serverPath) || !(0, node_fs_1.existsSync)(clientPath)) {
|
|
27
27
|
console.log("");
|
|
28
28
|
(0, cli_ui_1.error)("Production build not found!");
|
|
29
|
-
console.log(chalk_1.default.dim(" Run 'ajs
|
|
29
|
+
console.log(chalk_1.default.dim(" Run 'ajs dms build -b " +
|
|
30
30
|
options.backendUrl +
|
|
31
31
|
"' first to create a production build"));
|
|
32
32
|
process.exit(1);
|
package/dist/index.js
CHANGED
|
@@ -25,7 +25,7 @@ const runCLI = async () => {
|
|
|
25
25
|
console.log(chalk_1.default.dim(` Frontend Loader for AntelopeJS DMS - v${version}\n`));
|
|
26
26
|
}
|
|
27
27
|
const program = new commander_1.Command()
|
|
28
|
-
.name("ajs
|
|
28
|
+
.name("ajs dms")
|
|
29
29
|
.description(`Antelope DMS - Frontend Loader v${version}\n\n` +
|
|
30
30
|
`Materializes frontend modules from an AntelopeJS backend and starts a Vue or React Vite and Inertia application.`)
|
|
31
31
|
.version(version, "-v, --version", "Display version number")
|
package/dist/layers.js
CHANGED
|
@@ -23,8 +23,8 @@ function assertLayerPathsServed(modules) {
|
|
|
23
23
|
return;
|
|
24
24
|
throw new Error("The backend served a manifest without layer source paths:\n" +
|
|
25
25
|
pathless.map((mod) => ` - ${mod.name}`).join("\n") +
|
|
26
|
-
"\n`ajs
|
|
27
|
-
"`ajs project dev`); use `ajs
|
|
26
|
+
"\n`ajs dms dev` needs a development backend running on this machine (started with " +
|
|
27
|
+
"`ajs project dev`); use `ajs dms build` against a remote or production one.\n" +
|
|
28
28
|
"If the backend is local and in development mode, it did not recognize the bootstrap " +
|
|
29
29
|
"credential — see DMS_BOOTSTRAP_SECRET.");
|
|
30
30
|
}
|
package/dist/materialize.js
CHANGED
|
@@ -140,7 +140,7 @@ function writeFrontendModuleRegistry(workspaceDir, layers) {
|
|
|
140
140
|
}
|
|
141
141
|
function writeFrontendTypePaths(workspaceDir, registry) {
|
|
142
142
|
const paths = {
|
|
143
|
-
"#dms
|
|
143
|
+
"#dms/frontend-module": ["./frontend-module.ts"],
|
|
144
144
|
"@frontend/*": ["./frontend-modules/*"],
|
|
145
145
|
};
|
|
146
146
|
[...registry.modules].reverse().forEach((module) => {
|
|
@@ -53,7 +53,7 @@ function removeDevelopmentDependencies(root) {
|
|
|
53
53
|
if (!process.env.DMS_LAYER_SOURCE)
|
|
54
54
|
throw new Error("DMS_LAYER_SOURCE must identify a frontend package");
|
|
55
55
|
const sourceRoot = (0, node_path_1.resolve)(process.env.DMS_LAYER_SOURCE);
|
|
56
|
-
const workspace = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "dms-
|
|
56
|
+
const workspace = (0, node_fs_1.mkdtempSync)((0, node_path_1.join)((0, node_os_1.tmpdir)(), "dms-frontend-real-source-"));
|
|
57
57
|
const templateRoot = (0, node_path_1.join)((0, common_1.getPackageRoot)(), "templates", "vue");
|
|
58
58
|
const commandEnvironment = { ...process.env };
|
|
59
59
|
const EMAIL_BUILD_SIZE_CEILING_BYTES = 256 * 1024;
|
package/package.json
CHANGED
|
@@ -135,7 +135,7 @@ export default defineConfig({
|
|
|
135
135
|
resolve: {
|
|
136
136
|
dedupe: ["vue", "reka-ui", "@nuxt/ui"],
|
|
137
137
|
alias: {
|
|
138
|
-
"#dms
|
|
138
|
+
"#dms/frontend-module": resolve(__dirname, "frontend-module.ts"),
|
|
139
139
|
"#build/nuxt-icon-client-bundle": "virtual:nuxt-ui-icons",
|
|
140
140
|
"#shortcuts-aggregated": resolve(
|
|
141
141
|
__dirname,
|