@aerogel/core 0.0.0-next.7f6ed5a1f91688a86bf5ede2adc465e4fd6cfdea → 0.0.0-next.b85327579d32f21c6a9fa21142f0165cdd320d7e
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/dist/aerogel-core.cjs.js +1 -1
- package/dist/aerogel-core.d.ts +426 -82
- package/dist/aerogel-core.esm.js +1 -1
- package/package.json +6 -8
- package/src/bootstrap/bootstrap.test.ts +0 -56
- package/src/bootstrap/index.ts +9 -25
- package/src/bootstrap/options.ts +5 -1
- package/src/components/basic/AGMarkdown.vue +20 -5
- package/src/components/forms/AGButton.vue +26 -3
- package/src/components/forms/AGCheckbox.vue +35 -0
- package/src/components/forms/AGInput.vue +8 -4
- package/src/components/forms/index.ts +2 -1
- package/src/components/headless/forms/AGHeadlessButton.vue +3 -4
- package/src/components/headless/forms/AGHeadlessInput.ts +2 -2
- package/src/components/headless/forms/AGHeadlessInput.vue +5 -5
- package/src/components/headless/forms/AGHeadlessInputError.vue +9 -5
- package/src/components/headless/forms/AGHeadlessInputInput.vue +20 -4
- package/src/components/headless/forms/AGHeadlessInputLabel.vue +16 -0
- package/src/components/headless/forms/index.ts +6 -4
- package/src/components/headless/modals/AGHeadlessModal.vue +5 -1
- package/src/components/headless/modals/AGHeadlessModalPanel.vue +10 -2
- package/src/components/index.ts +2 -1
- package/src/components/modals/AGAlertModal.vue +13 -2
- package/src/components/modals/AGConfirmModal.vue +30 -0
- package/src/components/modals/AGLoadingModal.vue +19 -0
- package/src/components/modals/AGModal.ts +4 -0
- package/src/components/modals/AGModal.vue +20 -2
- package/src/components/modals/index.ts +4 -1
- package/src/directives/index.ts +5 -3
- package/src/errors/Errors.state.ts +31 -0
- package/src/errors/Errors.ts +132 -0
- package/src/errors/index.ts +21 -0
- package/src/forms/Form.test.ts +21 -0
- package/src/forms/Form.ts +38 -16
- package/src/forms/utils.ts +17 -0
- package/src/globals.ts +6 -0
- package/src/lang/Lang.ts +47 -8
- package/src/lang/index.ts +17 -76
- package/src/lang/utils.ts +4 -0
- package/src/main.ts +4 -0
- package/src/plugins/Plugin.ts +7 -0
- package/src/plugins/index.ts +7 -0
- package/src/services/App.state.ts +13 -0
- package/src/services/App.ts +17 -0
- package/src/services/Service.ts +151 -28
- package/src/services/index.ts +29 -7
- package/src/services/store.ts +27 -0
- package/src/types/vite.d.ts +0 -2
- package/src/ui/UI.state.ts +3 -6
- package/src/ui/UI.ts +35 -2
- package/src/ui/index.ts +20 -14
- package/src/utils/composition/forms.ts +11 -0
- package/src/utils/composition/hooks.ts +9 -0
- package/src/utils/index.ts +3 -0
- package/tsconfig.json +1 -10
- package/vite.config.ts +2 -6
- package/src/bootstrap/hooks.ts +0 -19
- package/src/lang/helpers.ts +0 -5
- package/src/models/index.ts +0 -18
- package/src/routing/index.ts +0 -33
- package/src/testing/stubs/lang/en.yaml +0 -1
- package/src/testing/stubs/models/User.ts +0 -3
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
2
3
|
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"types": [],
|
|
8
|
-
"jsx": "preserve",
|
|
9
|
-
"noUncheckedIndexedAccess": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"lib": ["esnext", "dom"],
|
|
13
4
|
"baseUrl": ".",
|
|
14
5
|
"paths": {
|
|
15
6
|
"@/*": ["./src/*"]
|
package/vite.config.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Vue from '@vitejs/plugin-vue';
|
|
1
|
+
import Aerogel from '@aerogel/vite';
|
|
3
2
|
import { defineConfig } from 'vitest/config';
|
|
4
3
|
import { resolve } from 'path';
|
|
5
4
|
|
|
6
|
-
const isTesting = process.env.NODE_ENV === 'test';
|
|
7
|
-
|
|
8
5
|
export default defineConfig({
|
|
9
6
|
test: { clearMocks: true },
|
|
10
|
-
plugins: [
|
|
7
|
+
plugins: [Aerogel()],
|
|
11
8
|
resolve: {
|
|
12
9
|
alias: {
|
|
13
10
|
'@': resolve(__dirname, './src'),
|
|
14
11
|
},
|
|
15
12
|
},
|
|
16
|
-
define: isTesting ? { __AG_BASE_PATH: 'undefined' } : undefined,
|
|
17
13
|
});
|
package/src/bootstrap/hooks.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { App } from 'vue';
|
|
2
|
-
|
|
3
|
-
import type { BootstrapOptions } from '@/bootstrap/options';
|
|
4
|
-
|
|
5
|
-
const mountedHooks: Function[] = [];
|
|
6
|
-
|
|
7
|
-
export type BootstrapHook = (app: App, options: BootstrapOptions) => Promise<void>;
|
|
8
|
-
|
|
9
|
-
export function onAppMounted(hook: Function): void {
|
|
10
|
-
mountedHooks.push(hook);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function runAppMountedHooks(): void {
|
|
14
|
-
mountedHooks.forEach((hook) => hook());
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function defineBootstrapHook<T extends BootstrapHook>(hook: T): T {
|
|
18
|
-
return hook;
|
|
19
|
-
}
|
package/src/lang/helpers.ts
DELETED
package/src/models/index.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { IndexedDBEngine, bootModelsFromViteGlob, setEngine } from 'soukai';
|
|
2
|
-
|
|
3
|
-
import { defineBootstrapHook } from '@/bootstrap/hooks';
|
|
4
|
-
|
|
5
|
-
export default defineBootstrapHook(async (_, options) => {
|
|
6
|
-
if (!options.models) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
setEngine(new IndexedDBEngine());
|
|
11
|
-
bootModelsFromViteGlob(options.models);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
declare module '@/bootstrap/options' {
|
|
15
|
-
interface BootstrapOptions {
|
|
16
|
-
models?: Record<string, Record<string, unknown>>;
|
|
17
|
-
}
|
|
18
|
-
}
|
package/src/routing/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from 'vue-router';
|
|
2
|
-
import type { Plugin } from 'vue';
|
|
3
|
-
|
|
4
|
-
import { defineBootstrapHook } from '@/bootstrap/hooks';
|
|
5
|
-
|
|
6
|
-
function createAppRouter(options: { routes: RouteRecordRaw[]; basePath?: string }): Plugin {
|
|
7
|
-
return createRouter({
|
|
8
|
-
history: createWebHistory(options.basePath),
|
|
9
|
-
routes: options.routes,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default defineBootstrapHook(async (app, options) => {
|
|
14
|
-
if (!options.routes) {
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const plugin = createAppRouter({
|
|
19
|
-
routes: options.routes,
|
|
20
|
-
basePath: options.basePath ?? __AG_BASE_PATH,
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
app.use(plugin);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
declare module '@/bootstrap/options' {
|
|
27
|
-
interface BootstrapOptions {
|
|
28
|
-
routes?: RouteRecordRaw[];
|
|
29
|
-
basePath?: string;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
import type { RouteRecordRaw } from 'vue-router';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
foo: Bar
|