@aerogel/cli 0.0.0-next.b85327579d32f21c6a9fa21142f0165cdd320d7e → 0.0.0-next.d4e50d20bf4c270c2068f0a4398e9304ee4a062e

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 (67) hide show
  1. package/.prettierignore +1 -0
  2. package/dist/aerogel-cli.cjs.js +1 -1
  3. package/dist/aerogel-cli.cjs.js.map +1 -1
  4. package/dist/aerogel-cli.d.ts +1 -0
  5. package/dist/aerogel-cli.esm.js +1 -1
  6. package/dist/aerogel-cli.esm.js.map +1 -1
  7. package/package.json +10 -4
  8. package/src/cli.ts +22 -2
  9. package/src/commands/Command.ts +11 -6
  10. package/src/commands/create.test.ts +10 -1
  11. package/src/commands/create.ts +10 -7
  12. package/src/commands/generate-component.test.ts +49 -2
  13. package/src/commands/generate-component.ts +51 -18
  14. package/src/commands/generate-model.test.ts +1 -1
  15. package/src/commands/generate-model.ts +9 -10
  16. package/src/commands/generate-overrides.ts +85 -0
  17. package/src/commands/generate-service.ts +8 -9
  18. package/src/commands/info.ts +14 -0
  19. package/src/commands/install.test.ts +26 -3
  20. package/src/commands/install.ts +6 -5
  21. package/src/lib/App.ts +2 -2
  22. package/src/lib/Editor.ts +16 -9
  23. package/src/lib/Shell.mock.ts +1 -1
  24. package/src/lib/Template.ts +5 -1
  25. package/src/lib/utils/app.ts +1 -1
  26. package/src/lib/utils/paths.ts +5 -1
  27. package/src/plugins/Histoire.ts +105 -0
  28. package/src/plugins/Plugin.ts +58 -5
  29. package/src/plugins/Solid.ts +47 -34
  30. package/src/plugins/Soukai.ts +1 -1
  31. package/src/testing/setup.ts +5 -0
  32. package/templates/app/.github/workflows/ci.yml +14 -2
  33. package/templates/app/README.md +3 -0
  34. package/templates/app/cypress/cypress.config.ts +14 -0
  35. package/templates/app/cypress/support/e2e.ts +1 -3
  36. package/templates/app/index.html +3 -2
  37. package/templates/app/package.json +14 -2
  38. package/templates/app/src/App.vue +2 -2
  39. package/templates/app/src/assets/public/robots.txt +2 -0
  40. package/templates/app/src/main.ts +4 -4
  41. package/templates/app/tsconfig.json +1 -0
  42. package/templates/app/vite.config.ts +10 -4
  43. package/templates/component-button/[component.name].vue +42 -0
  44. package/templates/component-button-story/[component.name].story.vue +77 -0
  45. package/templates/component-input/[component.name].vue +16 -0
  46. package/templates/component-input-story/[component.name].story.vue +63 -0
  47. package/templates/histoire/histoire.config.ts +7 -0
  48. package/templates/histoire/patches/histoire+0.17.6.patch +13 -0
  49. package/templates/histoire/src/main.histoire.ts +8 -0
  50. package/templates/overrides/components/index.ts +15 -0
  51. package/templates/overrides/components/overrides/AlertModal.vue +11 -0
  52. package/templates/overrides/components/overrides/ConfirmModal.vue +20 -0
  53. package/templates/overrides/components/overrides/ErrorReportModal.vue +35 -0
  54. package/templates/overrides/components/overrides/LoadingModal.vue +12 -0
  55. package/templates/overrides/components/overrides/ModalWrapper.vue +22 -0
  56. package/templates/overrides/components/overrides/SnackbarNotification.vue +34 -0
  57. package/templates/overrides-story/Overrides.story.vue +86 -0
  58. package/templates/postcss-pseudo-classes/postcss.config.js +15 -0
  59. package/.eslintrc.js +0 -7
  60. package/noeldemartin.config.js +0 -14
  61. package/src/lib/utils/format.test.ts +0 -33
  62. package/src/lib/utils/format.ts +0 -38
  63. package/templates/app/.eslintrc.js +0 -3
  64. package/templates/app/cypress.config.ts +0 -12
  65. package/templates/app/prettier.config.js +0 -5
  66. /package/bin/{ag → gel} +0 -0
  67. /package/templates/app/src/assets/{styles.css → css/styles.css} +0 -0
@@ -1,10 +1,7 @@
1
- import { Node, SyntaxKind } from 'ts-morph';
2
- import type { ArrayLiteralExpression, SourceFile } from 'ts-morph';
3
-
1
+ import File from '@/lib/File';
2
+ import Log from '@/lib/Log';
4
3
  import Plugin from '@/plugins/Plugin';
5
4
  import Shell from '@/lib/Shell';
6
- import Log from '@/lib/Log';
7
- import { findDescendant } from '@/lib/utils/edit';
8
5
  import { isLinkedLocalApp } from '@/lib/utils/app';
9
6
  import { packagePath } from '@/lib/utils/paths';
10
7
  import type { Editor } from '@/lib/Editor';
@@ -16,50 +13,66 @@ export class Solid extends Plugin {
16
13
  }
17
14
 
18
15
  protected async updateFiles(editor: Editor): Promise<void> {
19
- await this.updateTailwindConfig(editor);
16
+ await this.updateTailwindConfig(editor, {
17
+ content: isLinkedLocalApp()
18
+ ? `'${packagePath('plugin-solid')}/dist/**/*.js'`
19
+ : '\'./node_modules/@aerogel/plugin-solid/dist/**/*.js\'',
20
+ });
21
+
22
+ await this.updateNpmScripts(editor);
23
+ await this.updateGitIgnore();
20
24
  await super.updateFiles(editor);
21
25
  }
22
26
 
23
27
  protected async installNpmDependencies(): Promise<void> {
24
- await Shell.run('npm install soukai-solid@next');
28
+ await Shell.run('npm install soukai-solid@next --save-exact');
29
+ await Shell.run('npm install @noeldemartin/solid-utils@next --save-exact');
30
+ await Shell.run('npm install @solid/community-server@7 --save');
25
31
  await super.installNpmDependencies();
26
32
  }
27
33
 
28
- protected async updateTailwindConfig(editor: Editor): Promise<void> {
29
- await Log.animate('Updating tailwind configuration', async () => {
30
- const tailwindConfig = editor.requireSourceFile('tailwind.config.js');
31
- const contentArray = this.getTailwindContentArray(tailwindConfig);
32
- const contentValue = isLinkedLocalApp()
33
- ? `'${packagePath('plugin-solid')}/dist/**/*.js'`
34
- : '\'./node_modules/@aerogel/plugin-solid/dist/**/*.js\'';
34
+ protected async updateNpmScripts(editor: Editor): Promise<void> {
35
+ Log.info('Updating npm scripts...');
35
36
 
36
- if (!contentArray) {
37
- return Log.fail(`
38
- Could not find content array in tailwind config, please add the following manually:
37
+ const packageJson = File.read('package.json');
39
38
 
40
- ${contentValue}
41
- `);
42
- }
39
+ if (!packageJson) {
40
+ return Log.fail('Could not find package.json file');
41
+ }
43
42
 
44
- contentArray.addElement(contentValue);
43
+ File.write(
44
+ 'package.json',
45
+ packageJson
46
+ .replace(
47
+ '"cy:dev": "concurrently --kill-others \\"npm run test:serve-app\\" \\"npm run cy:open\\"",',
48
+ '"cy:dev": "concurrently --kill-others ' +
49
+ '\\"npm run test:serve-app\\" \\"npm run test:serve-pod\\" \\"npm run cy:open\\"",',
50
+ )
51
+ .replace(
52
+ '"cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",',
53
+ '"cy:test": "start-server-and-test ' +
54
+ 'test:serve-app http-get://localhost:5001 test:serve-pod http-get://localhost:3000 cy:run",',
55
+ )
56
+ .replace(
57
+ '"dev": "vite",',
58
+ '"dev": "vite",\n' +
59
+ '"dev:serve-pod": "community-solid-server -c @css:config/file.json -f ./solid-data",',
60
+ )
61
+ .replace(
62
+ '"test:serve-app": "vite --port 5001"',
63
+ '"test:serve-app": "vite --port 5001",\n"test:serve-pod": "community-solid-server -l warn"',
64
+ ),
65
+ );
45
66
 
46
- await editor.save(tailwindConfig);
47
- });
67
+ editor.addModifiedFile('package.json');
48
68
  }
49
69
 
50
- protected getTailwindContentArray(tailwindConfig: SourceFile): ArrayLiteralExpression | null {
51
- const contentAssignment = findDescendant(tailwindConfig, {
52
- guard: Node.isPropertyAssignment,
53
- validate: (propertyAssignment) => propertyAssignment.getName() === 'content',
54
- skip: SyntaxKind.JSDoc,
55
- });
56
- const contentArray = contentAssignment?.getInitializer();
70
+ protected async updateGitIgnore(): Promise<void> {
71
+ Log.info('Updating .gitignore');
57
72
 
58
- if (!Node.isArrayLiteralExpression(contentArray)) {
59
- return null;
60
- }
73
+ const gitignore = File.read('.gitignore') ?? '';
61
74
 
62
- return contentArray;
75
+ File.write('.gitignore', `${gitignore}/solid-data\n`);
63
76
  }
64
77
 
65
78
  }
@@ -8,7 +8,7 @@ export class Soukai extends Plugin {
8
8
  }
9
9
 
10
10
  protected async installNpmDependencies(): Promise<void> {
11
- await Shell.run('npm install soukai@next');
11
+ await Shell.run('npm install soukai@next --save-exact');
12
12
  await super.installNpmDependencies();
13
13
  }
14
14
 
@@ -55,10 +55,15 @@ vi.mock('@/lib/utils/paths', async () => {
55
55
  return basePath(`../${packageName}`);
56
56
  }
57
57
 
58
+ function templatePath(name: string = '') {
59
+ return resolve(__dirname, `../../templates/${name}`);
60
+ }
61
+
58
62
  return {
59
63
  ...original,
60
64
  basePath,
61
65
  packagePath,
66
+ templatePath,
62
67
  };
63
68
  });
64
69
 
@@ -12,6 +12,18 @@ jobs:
12
12
  node-version-file: '.nvmrc'
13
13
  - run: npm ci
14
14
  - run: npm run lint
15
- - run: npm run test:ci
16
- - run: npm run cy:test
17
15
  - run: npm run build
16
+ - run: npm run test:ci
17
+ - run: npm run cy:test-snapshots:ci
18
+ - name: Upload Cypress screenshots
19
+ uses: actions/upload-artifact@v3
20
+ if: ${{ failure() }}
21
+ with:
22
+ name: cypress_screenshots
23
+ path: cypress/screenshots
24
+ - name: Upload Cypress snapshots
25
+ uses: actions/upload-artifact@v3
26
+ if: ${{ failure() }}
27
+ with:
28
+ name: cypress_snapshots
29
+ path: cypress/snapshots
@@ -0,0 +1,3 @@
1
+ # <% app.name %>
2
+
3
+ App created with [AerogelJS](https://aerogel.js.org)
@@ -0,0 +1,14 @@
1
+ import { setupAerogelNodeEvents } from '@aerogel/cypress/config';
2
+ import { defineConfig } from 'cypress';
3
+
4
+ export default defineConfig({
5
+ e2e: {
6
+ baseUrl: 'http://localhost:5001',
7
+ video: false,
8
+ retries: {
9
+ runMode: 3,
10
+ openMode: 0,
11
+ },
12
+ setupNodeEvents: setupAerogelNodeEvents,
13
+ },
14
+ });
@@ -1,3 +1 @@
1
- import install from '@aerogel/cypress';
2
-
3
- install();
1
+ import '@aerogel/cypress/support';
@@ -3,10 +3,11 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title><% app.name %></title>
6
+ <title>{{ app.name }}</title>
7
+ {{ socialMeta() }}
7
8
  </head>
8
9
  <body class="h-full w-full text-base font-normal leading-tight text-gray-900 antialiased">
9
- <div id="app" class="h-full"></div>
10
+ <div id="app" class="loading h-full"></div>
10
11
  <script type="module" src="./src/main.ts"></script>
11
12
  </body>
12
13
  </html>
@@ -5,8 +5,8 @@
5
5
  "scripts": {
6
6
  "build": "vite build",
7
7
  "cy:dev": "concurrently --kill-others \"npm run test:serve-app\" \"npm run cy:open\"",
8
- "cy:open": "cypress open --e2e --browser chromium",
9
- "cy:run": "cypress run",
8
+ "cy:open": "cypress open --config-file ./cypress/cypress.config.ts --e2e --browser chromium",
9
+ "cy:run": "cypress run --config-file ./cypress/cypress.config.ts",
10
10
  "cy:test": "start-server-and-test test:serve-app http-get://localhost:5001 cy:run",
11
11
  "cy:test-snapshots": "docker run -it -u `id -u ${whoami}` -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
12
12
  "cy:test-snapshots:ci": "docker run -e CYPRESS_SNAPSHOTS=true -v ./:/app -w /app cypress/base:18.16.0 sh -c \"npx cypress install && npm run cy:test\"",
@@ -33,6 +33,7 @@
33
33
  "@aerogel/cli": "<% &dependencies.aerogelCli %>",
34
34
  "@aerogel/cypress": "<% &dependencies.aerogelCypress %>",
35
35
  "@aerogel/vite": "<% &dependencies.aerogelVite %>",
36
+ "@iconify/json": "^2.2.134",
36
37
  "@noeldemartin/eslint-config-vue": "next",
37
38
  "@noeldemartin/scripts": "next",
38
39
  "@total-typescript/ts-reset": "^0.4.2",
@@ -50,5 +51,16 @@
50
51
  "vite": "^4.3.0",
51
52
  "vitest": "^0.33.0",
52
53
  "vue-tsc": "^1.8.15"
54
+ },
55
+ "eslintConfig": {
56
+ "extends": [
57
+ "@noeldemartin/eslint-config-vue"
58
+ ]
59
+ },
60
+ "prettier": {
61
+ "plugins": [
62
+ "prettier-plugin-tailwindcss"
63
+ ],
64
+ "printWidth": 120
53
65
  }
54
66
  }
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <AGAppLayout>
3
- <main class="flex flex-grow flex-col items-center justify-center bg-blue-50">
2
+ <AGAppLayout class="bg-blue-50">
3
+ <main class="flex flex-grow flex-col items-center justify-center">
4
4
  <h1 class="text-4xl font-semibold">
5
5
  {{ $t('home.title') }}
6
6
  </h1>
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Disallow:
@@ -1,13 +1,13 @@
1
1
  import i18n from '@aerogel/plugin-i18n';
2
2
  import soukai from '@aerogel/plugin-soukai';
3
- import { bootstrapApplication } from '@aerogel/core';
3
+ import { bootstrap } from '@aerogel/core';
4
4
 
5
- import './assets/styles.css';
5
+ import './assets/css/styles.css';
6
6
  import App from './App.vue';
7
7
 
8
- bootstrapApplication(App, {
8
+ bootstrap(App, {
9
9
  plugins: [
10
10
  i18n({ messages: import.meta.glob('@/lang/*.yaml') }),
11
- soukai({ models: import.meta.glob('@/models/*', { eager: true }) }),
11
+ soukai({ models: import.meta.glob(['@/models/*', '!**/*.test.ts'], { eager: true }) }),
12
12
  ],
13
13
  });
@@ -6,6 +6,7 @@
6
6
  "strict": true,
7
7
  "jsx": "preserve",
8
8
  "noUncheckedIndexedAccess": true,
9
+ "skipLibCheck": true,
9
10
  "resolveJsonModule": true,
10
11
  "esModuleInterop": true,
11
12
  "lib": ["esnext", "dom"],
@@ -3,21 +3,27 @@ import Components from 'unplugin-vue-components/vite';
3
3
  import I18n from '@intlify/unplugin-vue-i18n/vite';
4
4
  import Icons from 'unplugin-icons/vite';
5
5
  import IconsResolver from 'unplugin-icons/resolver';
6
+ import { defineConfig } from 'vitest/config';
6
7
  import { resolve } from 'path';
7
8
 
8
- export default {
9
+ export default defineConfig({
10
+ publicDir: resolve(__dirname, './src/assets/public/'),
9
11
  plugins: [
10
- Aerogel(),
12
+ Aerogel({ name: '<% app.name %>' }),
11
13
  Components({
12
14
  dts: false,
13
15
  resolvers: [AerogelResolver(), IconsResolver()],
14
16
  }),
15
17
  I18n({ include: resolve(__dirname, './src/lang/**/*.yaml') }),
16
- Icons(),
18
+ Icons({
19
+ iconCustomizer(_, __, props) {
20
+ props['aria-hidden'] = 'true';
21
+ },
22
+ }),
17
23
  ],
18
24
  resolve: {
19
25
  alias: {
20
26
  '@': resolve(__dirname, './src'),
21
27
  },
22
28
  },
23
- };
29
+ });
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <AGHeadlessButton :class="variantClasses" :disabled="disabled">
3
+ <slot />
4
+ </AGHeadlessButton>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { Colors, booleanProp, enumProp, removeInteractiveClasses } from '@aerogel/core';
9
+ import { computed } from 'vue';
10
+
11
+ const props = defineProps({
12
+ color: enumProp(Colors, Colors.Primary),
13
+ disabled: booleanProp(),
14
+ });
15
+
16
+ const colorClasses = computed(() => {
17
+ switch (props.color) {
18
+ case Colors.Secondary:
19
+ // Add your custom color classes here.
20
+ return '';
21
+ case Colors.Clear:
22
+ // Add your custom color classes here.
23
+ return '';
24
+ case Colors.Danger:
25
+ // Add your custom color classes here.
26
+ return '';
27
+ case Colors.Primary:
28
+ default:
29
+ // Add your custom color classes here.
30
+ return '';
31
+ }
32
+ });
33
+
34
+ const variantClasses = computed(() => {
35
+ if (props.disabled) {
36
+ // Add additional classes for disabled state here.
37
+ return removeInteractiveClasses(colorClasses.value);
38
+ }
39
+
40
+ return colorClasses.value;
41
+ });
42
+ </script>
@@ -0,0 +1,77 @@
1
+ <template>
2
+ <Story :layout="{ type: 'grid' }">
3
+ <Variant title="Playground">
4
+ <<% component.name %> :color="color">
5
+ {{ content }}
6
+ </<% component.name %>>
7
+
8
+ <template #controls>
9
+ <HstText v-model="content" title="Content" />
10
+ <HstSelect v-model="color" title="Color" :options="colorOptions" />
11
+ </template>
12
+ </Variant>
13
+
14
+ <Variant title="Default">
15
+ <<% component.name %>>
16
+ Click me!
17
+ </<% component.name %>>
18
+ </Variant>
19
+
20
+ <Variant title="Hover">
21
+ <<% component.name %> class=":hover">
22
+ Click me!
23
+ </<% component.name %>>
24
+ </Variant>
25
+
26
+ <Variant title="Focus">
27
+ <<% component.name %> class=":focus :focus-visible">
28
+ Click me!
29
+ </<% component.name %>>
30
+ </Variant>
31
+
32
+ <Variant title="Disabled">
33
+ <<% component.name %> disabled>
34
+ You can't click me
35
+ </<% component.name %>>
36
+ </Variant>
37
+
38
+ <Variant title="Colors" :layout="{ width: '300px' }">
39
+ <div class="flex items-center gap-2">
40
+ <<% component.name %> color="primary">
41
+ Primary
42
+ </<% component.name %>>
43
+ <<% component.name %> color="secondary">
44
+ Secondary
45
+ </<% component.name %>>
46
+ <<% component.name %> color="danger">
47
+ Danger
48
+ </<% component.name %>>
49
+ <<% component.name %> color="clear">
50
+ Clear
51
+ </<% component.name %>>
52
+ </div>
53
+ </Variant>
54
+ </Story>
55
+ </template>
56
+
57
+ <script setup lang="ts">
58
+ import { Colors } from '@aerogel/core';
59
+ import { invert } from '@noeldemartin/utils';
60
+ import { ref } from 'vue';
61
+ import type { Color } from '@aerogel/core';
62
+
63
+ const content = ref('Click me!');
64
+ const color = ref<Color>(Colors.Primary);
65
+ const colorOptions = invert(Colors);
66
+ </script>
67
+
68
+ <style>
69
+ .story-<% component.slug %> {
70
+ grid-template-columns: repeat(2, 300px) !important;
71
+ }
72
+
73
+ .story-<% component.slug %> .variant-playground,
74
+ .story-<% component.slug %> .variant-colors{
75
+ grid-column: 1 / -1;
76
+ }
77
+ </style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <AGHeadlessInput v-bind="props">
3
+ <AGHeadlessInputLabel />
4
+ <AGHeadlessInputInput v-bind="attrs" />
5
+ <AGHeadlessInputError />
6
+ </AGHeadlessInput>
7
+ </template>
8
+
9
+ <script setup lang="ts">
10
+ import { useInputAttrs, useInputProps } from '@aerogel/core';
11
+
12
+ defineOptions({ inheritAttrs: false });
13
+
14
+ const props = defineProps(useInputProps());
15
+ const [attrs] = useInputAttrs();
16
+ </script>
@@ -0,0 +1,63 @@
1
+ <template>
2
+ <Story :layout="{ type: 'grid' }">
3
+ <Variant title="Playground">
4
+ <AGForm :form="form">
5
+ <<% component.name %> name="food" :label="label" :placeholder="placeholder" />
6
+ </AGForm>
7
+
8
+ <template #controls>
9
+ <HstText v-model="label" title="Label" />
10
+ <HstText v-model="placeholder" title="Placeholder" />
11
+ <HstCheckbox v-model="hasErrors" title="Errors" />
12
+ </template>
13
+ </Variant>
14
+
15
+ <Variant title="Default">
16
+ <<% component.name %> label="What's the best food?" placeholder="Ramen" />
17
+ </Variant>
18
+
19
+ <Variant title="Hover">
20
+ <<% component.name %> label="What's the best food?" placeholder="Ramen" input-class=":hover" />
21
+ </Variant>
22
+
23
+ <Variant title="Focus">
24
+ <<% component.name %> label="What's the best food?" placeholder="Ramen" input-class=":focus :focus-visible" />
25
+ </Variant>
26
+
27
+ <Variant title="Error">
28
+ <AGForm :form="errorForm">
29
+ <<% component.name %>
30
+ name="food"
31
+ label="What's the best food?"
32
+ placeholder="Ramen"
33
+ class=":focus :focus-visible"
34
+ />
35
+ </AGForm>
36
+ </Variant>
37
+ </Story>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import { requiredStringInput, useForm } from '@aerogel/core';
42
+ import { ref, watchEffect } from 'vue';
43
+
44
+ const form = useForm({ food: requiredStringInput() });
45
+ const errorForm = useForm({ food: requiredStringInput() });
46
+ const label = ref('What\'s the best food?');
47
+ const placeholder = ref('Ramen');
48
+ const hasErrors = ref(false);
49
+
50
+ errorForm.submit();
51
+
52
+ watchEffect(() => (hasErrors.value ? form.submit() : form.reset()));
53
+ </script>
54
+
55
+ <style>
56
+ .story-<% component.slug %> {
57
+ grid-template-columns: repeat(2, 300px) !important;
58
+ }
59
+
60
+ .story-<% component.slug %> .variant-playground {
61
+ grid-column: 1 / -1;
62
+ }
63
+ </style>
@@ -0,0 +1,7 @@
1
+ import HstAerogel from '@aerogel/histoire/dist/plugin';
2
+ import { defineConfig } from 'histoire';
3
+
4
+ export default defineConfig({
5
+ setupFile: '/src/main.histoire.ts',
6
+ plugins: [HstAerogel()],
7
+ });
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/histoire/dist/node/collect/index.js b/node_modules/histoire/dist/node/collect/index.js
2
+ index 8ffd507..37be43e 100644
3
+ --- a/node_modules/histoire/dist/node/collect/index.js
4
+ +++ b/node_modules/histoire/dist/node/collect/index.js
5
+ @@ -22,7 +22,7 @@ export function useCollectStories(options, ctx) {
6
+ /vite\w*\/dist\/client\/(client|env).mjs/,
7
+ ...ctx.config.viteNodeInlineDeps ?? [],
8
+ ],
9
+ - fallbackCJS: true,
10
+ + fallbackCJS: false,
11
+ },
12
+ transformMode: ctx.config.viteNodeTransformMode,
13
+ });
@@ -0,0 +1,8 @@
1
+ import '@aerogel/histoire/dist/styles.css';
2
+ import { defineSetupAerogel } from '@aerogel/histoire';
3
+
4
+ import './assets/css/styles.css';
5
+
6
+ export const setupVue3 = defineSetupAerogel({
7
+ messages: import.meta.glob('@/lang/*.yaml'),
8
+ });
@@ -0,0 +1,15 @@
1
+ import { UIComponents } from '@aerogel/core';
2
+
3
+ import AlertModal from './overrides/AlertModal.vue';
4
+ import ConfirmModal from './overrides/ConfirmModal.vue';
5
+ import ErrorReportModal from './overrides/ErrorReportModal.vue';
6
+ import LoadingModal from './overrides/LoadingModal.vue';
7
+ import SnackbarNotification from './overrides/SnackbarNotification.vue';
8
+
9
+ export const components = {
10
+ [UIComponents.AlertModal]: AlertModal,
11
+ [UIComponents.ConfirmModal]: ConfirmModal,
12
+ [UIComponents.ErrorReportModal]: ErrorReportModal,
13
+ [UIComponents.LoadingModal]: LoadingModal,
14
+ [UIComponents.Snackbar]: SnackbarNotification,
15
+ };
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <ModalWrapper :title="title">
3
+ <AGMarkdown :text="message" />
4
+ </ModalWrapper>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { useAlertModalProps } from '@aerogel/core';
9
+
10
+ defineProps(useAlertModalProps());
11
+ </script>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <ModalWrapper v-slot="{ close }" :title="title" :cancellable="false">
3
+ <AGMarkdown :text="message" />
4
+ <div class="mt-4 flex flex-row-reverse">
5
+ <AGButton @click="close(true)">
6
+ {{ renderedAcceptText }}
7
+ </AGButton>
8
+ <AGButton color="clear" class="mr-2" @click="close(false)">
9
+ {{ renderedCancelText }}
10
+ </AGButton>
11
+ </div>
12
+ </ModalWrapper>
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import { useConfirmModal, useConfirmModalProps } from '@aerogel/core';
17
+
18
+ const props = defineProps(useConfirmModalProps());
19
+ const { renderedAcceptText, renderedCancelText } = useConfirmModal(props);
20
+ </script>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <ModalWrapper>
3
+ <AGErrorReportModalTitle
4
+ :report="report"
5
+ :current-report="activeReportIndex + 1"
6
+ :total-reports="reports.length"
7
+ />
8
+ <AGButton color="clear" :disabled="activeReportIndex === 0" @click="activeReportIndex--">
9
+ {{ previousReportText }}
10
+ </AGButton>
11
+ <AGButton color="clear" :disabled="activeReportIndex === reports.length - 1" @click="activeReportIndex++">
12
+ {{ nextReportText }}
13
+ </AGButton>
14
+ <AGErrorReportModalButtons :report="report">
15
+ <template
16
+ #default="{ url, handler, iconComponent, description }: IAGErrorReportModalButtonsDefaultSlotProps"
17
+ >
18
+ <AGButton :url="url" :aria-label="description" @click="handler">
19
+ <component :is="iconComponent" />
20
+ {{ description }}
21
+ </AGButton>
22
+ </template>
23
+ </AGErrorReportModalButtons>
24
+ <AGMarkdown v-if="report.description" :text="report.description" />
25
+ <pre v-text="details" />
26
+ </ModalWrapper>
27
+ </template>
28
+
29
+ <script setup lang="ts">
30
+ import { useErrorReportModal, useErrorReportModalProps } from '@aerogel/core';
31
+ import type { IAGErrorReportModalButtonsDefaultSlotProps } from '@aerogel/core';
32
+
33
+ const props = defineProps(useErrorReportModalProps());
34
+ const { activeReportIndex, details, nextReportText, previousReportText, report } = useErrorReportModal(props);
35
+ </script>
@@ -0,0 +1,12 @@
1
+ <template>
2
+ <ModalWrapper :cancellable="false">
3
+ <AGMarkdown :text="renderedMessage" />
4
+ </ModalWrapper>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { useLoadingModal, useLoadingModalProps } from '@aerogel/core';
9
+
10
+ const props = defineProps(useLoadingModalProps());
11
+ const { renderedMessage } = useLoadingModal(props);
12
+ </script>