@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.
Files changed (62) hide show
  1. package/dist/aerogel-core.cjs.js +1 -1
  2. package/dist/aerogel-core.d.ts +426 -82
  3. package/dist/aerogel-core.esm.js +1 -1
  4. package/package.json +6 -8
  5. package/src/bootstrap/bootstrap.test.ts +0 -56
  6. package/src/bootstrap/index.ts +9 -25
  7. package/src/bootstrap/options.ts +5 -1
  8. package/src/components/basic/AGMarkdown.vue +20 -5
  9. package/src/components/forms/AGButton.vue +26 -3
  10. package/src/components/forms/AGCheckbox.vue +35 -0
  11. package/src/components/forms/AGInput.vue +8 -4
  12. package/src/components/forms/index.ts +2 -1
  13. package/src/components/headless/forms/AGHeadlessButton.vue +3 -4
  14. package/src/components/headless/forms/AGHeadlessInput.ts +2 -2
  15. package/src/components/headless/forms/AGHeadlessInput.vue +5 -5
  16. package/src/components/headless/forms/AGHeadlessInputError.vue +9 -5
  17. package/src/components/headless/forms/AGHeadlessInputInput.vue +20 -4
  18. package/src/components/headless/forms/AGHeadlessInputLabel.vue +16 -0
  19. package/src/components/headless/forms/index.ts +6 -4
  20. package/src/components/headless/modals/AGHeadlessModal.vue +5 -1
  21. package/src/components/headless/modals/AGHeadlessModalPanel.vue +10 -2
  22. package/src/components/index.ts +2 -1
  23. package/src/components/modals/AGAlertModal.vue +13 -2
  24. package/src/components/modals/AGConfirmModal.vue +30 -0
  25. package/src/components/modals/AGLoadingModal.vue +19 -0
  26. package/src/components/modals/AGModal.ts +4 -0
  27. package/src/components/modals/AGModal.vue +20 -2
  28. package/src/components/modals/index.ts +4 -1
  29. package/src/directives/index.ts +5 -3
  30. package/src/errors/Errors.state.ts +31 -0
  31. package/src/errors/Errors.ts +132 -0
  32. package/src/errors/index.ts +21 -0
  33. package/src/forms/Form.test.ts +21 -0
  34. package/src/forms/Form.ts +38 -16
  35. package/src/forms/utils.ts +17 -0
  36. package/src/globals.ts +6 -0
  37. package/src/lang/Lang.ts +47 -8
  38. package/src/lang/index.ts +17 -76
  39. package/src/lang/utils.ts +4 -0
  40. package/src/main.ts +4 -0
  41. package/src/plugins/Plugin.ts +7 -0
  42. package/src/plugins/index.ts +7 -0
  43. package/src/services/App.state.ts +13 -0
  44. package/src/services/App.ts +17 -0
  45. package/src/services/Service.ts +151 -28
  46. package/src/services/index.ts +29 -7
  47. package/src/services/store.ts +27 -0
  48. package/src/types/vite.d.ts +0 -2
  49. package/src/ui/UI.state.ts +3 -6
  50. package/src/ui/UI.ts +35 -2
  51. package/src/ui/index.ts +20 -14
  52. package/src/utils/composition/forms.ts +11 -0
  53. package/src/utils/composition/hooks.ts +9 -0
  54. package/src/utils/index.ts +3 -0
  55. package/tsconfig.json +1 -10
  56. package/vite.config.ts +2 -6
  57. package/src/bootstrap/hooks.ts +0 -19
  58. package/src/lang/helpers.ts +0 -5
  59. package/src/models/index.ts +0 -18
  60. package/src/routing/index.ts +0 -33
  61. package/src/testing/stubs/lang/en.yaml +0 -1
  62. 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 I18n from '@intlify/unplugin-vue-i18n/vite';
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: [Vue(), I18n({ include: resolve(__dirname, './src/testing/stubs/lang/**/*.yaml') })],
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
  });
@@ -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
- }
@@ -1,5 +0,0 @@
1
- import Lang from '@/lang/Lang';
2
-
3
- export function lang(key: string, parameters: Record<string, unknown> = {}): string {
4
- return Lang.translate(key, parameters);
5
- }
@@ -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
- }
@@ -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
@@ -1,3 +0,0 @@
1
- import { Model } from 'soukai';
2
-
3
- export default class User extends Model {}