@aerogel/cli 0.0.0-next.0be1479064cfd43fb6eafa2552cb7f8775554d93 → 0.0.0-next.2036392036b3c125319b4704b862cbf403480ea2
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/.prettierignore +1 -0
- package/dist/aerogel-cli.cjs.js +1 -1
- package/dist/aerogel-cli.cjs.js.map +1 -1
- package/dist/aerogel-cli.d.ts +2 -2
- package/dist/aerogel-cli.esm.js +1 -1
- package/dist/aerogel-cli.esm.js.map +1 -1
- package/package.json +10 -4
- package/src/cli.ts +23 -3
- package/src/commands/Command.ts +11 -6
- package/src/commands/create.test.ts +10 -1
- package/src/commands/create.ts +10 -7
- package/src/commands/generate-component.test.ts +49 -2
- package/src/commands/generate-component.ts +62 -18
- package/src/commands/generate-model.test.ts +1 -1
- package/src/commands/generate-model.ts +9 -10
- package/src/commands/generate-overrides.ts +85 -0
- package/src/commands/generate-service.test.ts +1 -1
- package/src/commands/generate-service.ts +8 -9
- package/src/commands/info.ts +14 -0
- package/src/commands/install.test.ts +26 -3
- package/src/commands/install.ts +6 -5
- package/src/lib/App.ts +2 -2
- package/src/lib/Editor.ts +16 -9
- package/src/lib/File.mock.ts +1 -5
- package/src/lib/File.ts +1 -1
- package/src/lib/Log.mock.ts +1 -5
- package/src/lib/Log.ts +1 -1
- package/src/lib/Shell.mock.ts +2 -2
- package/src/lib/Shell.ts +1 -1
- package/src/lib/Template.ts +5 -1
- package/src/lib/utils/app.ts +1 -1
- package/src/lib/utils/paths.ts +6 -6
- package/src/plugins/Histoire.ts +113 -0
- package/src/plugins/Plugin.ts +58 -5
- package/src/plugins/Solid.ts +48 -34
- package/src/plugins/Soukai.ts +1 -1
- package/src/testing/setup.ts +8 -11
- package/templates/app/.github/workflows/ci.yml +16 -4
- package/templates/app/README.md +3 -0
- package/templates/app/cypress/cypress.config.ts +14 -0
- package/templates/app/cypress/support/e2e.ts +1 -3
- package/templates/app/cypress/tsconfig.json +3 -1
- package/templates/app/index.html +3 -2
- package/templates/app/package.json +16 -4
- package/templates/app/src/App.vue +2 -2
- package/templates/app/src/assets/public/robots.txt +2 -0
- package/templates/app/src/main.ts +4 -4
- package/templates/app/tsconfig.json +1 -0
- package/templates/app/vite.config.ts +10 -4
- package/templates/component-button/[component.name].vue +42 -0
- package/templates/component-button-story/[component.name].story.vue +77 -0
- package/templates/component-checkbox/[component.name].vue +34 -0
- package/templates/component-checkbox-story/[component.name].story.vue +63 -0
- package/templates/component-input/[component.name].vue +17 -0
- package/templates/component-input-story/[component.name].story.vue +63 -0
- package/templates/histoire/histoire.config.ts +7 -0
- package/templates/histoire/patches/histoire+0.17.6.patch +13 -0
- package/templates/histoire/src/main.histoire.ts +8 -0
- package/templates/overrides/components/index.ts +15 -0
- package/templates/overrides/components/overrides/AlertModal.vue +11 -0
- package/templates/overrides/components/overrides/ConfirmModal.vue +20 -0
- package/templates/overrides/components/overrides/ErrorReportModal.vue +35 -0
- package/templates/overrides/components/overrides/LoadingModal.vue +12 -0
- package/templates/overrides/components/overrides/ModalWrapper.vue +22 -0
- package/templates/overrides/components/overrides/SnackbarNotification.vue +34 -0
- package/templates/overrides-story/Overrides.story.vue +86 -0
- package/templates/postcss-pseudo-classes/postcss.config.js +15 -0
- package/templates/service/[service.name].ts +1 -1
- package/.eslintrc.js +0 -7
- package/noeldemartin.config.js +0 -14
- package/src/lib/utils/format.test.ts +0 -33
- package/src/lib/utils/format.ts +0 -38
- package/templates/app/.eslintrc.js +0 -3
- package/templates/app/cypress.config.ts +0 -12
- package/templates/app/prettier.config.js +0 -5
- /package/bin/{ag → gel} +0 -0
- /package/templates/app/src/assets/{styles.css → css/styles.css} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Story group="base" :layout="{ type: 'grid' }">
|
|
3
|
+
<Variant title="Playground">
|
|
4
|
+
<AGForm :form="form" class="m-1">
|
|
5
|
+
<<% component.name %> name="accept" :form="form">
|
|
6
|
+
{{ label }}
|
|
7
|
+
</<% component.name %>>
|
|
8
|
+
</AGForm>
|
|
9
|
+
|
|
10
|
+
<template #controls>
|
|
11
|
+
<HstText v-model="label" title="Label" />
|
|
12
|
+
</template>
|
|
13
|
+
</Variant>
|
|
14
|
+
|
|
15
|
+
<Variant title="Default">
|
|
16
|
+
<<% component.name %> class="m-1">
|
|
17
|
+
Accept Terms & Conditions
|
|
18
|
+
</<% component.name %>>
|
|
19
|
+
</Variant>
|
|
20
|
+
|
|
21
|
+
<Variant title="Hover">
|
|
22
|
+
<<% component.name %> class="m-1" input-class=":hover">
|
|
23
|
+
Accept Terms & Conditions
|
|
24
|
+
</<% component.name %>>
|
|
25
|
+
</Variant>
|
|
26
|
+
|
|
27
|
+
<Variant title="Focus">
|
|
28
|
+
<<% component.name %> class="m-1" input-class=":focus :focus-visible">
|
|
29
|
+
Accept Terms & Conditions
|
|
30
|
+
</<% component.name %>>
|
|
31
|
+
</Variant>
|
|
32
|
+
|
|
33
|
+
<Variant title="Error">
|
|
34
|
+
<AGForm :form="errorForm" class="m-1">
|
|
35
|
+
<<% component.name %> name="accept">
|
|
36
|
+
Accept Terms & Conditions
|
|
37
|
+
</<% component.name %>>
|
|
38
|
+
</AGForm>
|
|
39
|
+
</Variant>
|
|
40
|
+
</Story>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { requiredBooleanInput, useForm } from '@aerogel/core';
|
|
45
|
+
import { ref } from 'vue';
|
|
46
|
+
|
|
47
|
+
const form = useForm({ accept: requiredBooleanInput(true) });
|
|
48
|
+
const errorForm = useForm({ accept: requiredBooleanInput() });
|
|
49
|
+
const label = ref('Accept Terms & Conditions');
|
|
50
|
+
|
|
51
|
+
form.submit();
|
|
52
|
+
errorForm.submit();
|
|
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,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AGHeadlessInput v-bind="props">
|
|
3
|
+
<AGHeadlessInputLabel />
|
|
4
|
+
<AGHeadlessInputInput v-bind="attrs" />
|
|
5
|
+
<AGHeadlessInputDescription />
|
|
6
|
+
<AGHeadlessInputError />
|
|
7
|
+
</AGHeadlessInput>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script setup lang="ts">
|
|
11
|
+
import { useInputAttrs, useInputProps } from '@aerogel/core';
|
|
12
|
+
|
|
13
|
+
defineOptions({ inheritAttrs: false });
|
|
14
|
+
|
|
15
|
+
const props = defineProps(useInputProps());
|
|
16
|
+
const [attrs] = useInputAttrs();
|
|
17
|
+
</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,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,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,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>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AGHeadlessModal ref="$modal" v-slot="{ close }" v-bind="props">
|
|
3
|
+
<AGHeadlessModalPanel>
|
|
4
|
+
<AGHeadlessModalTitle v-if="title">
|
|
5
|
+
<AGMarkdown :text="title" inline />
|
|
6
|
+
</AGHeadlessModalTitle>
|
|
7
|
+
<slot :close="close" />
|
|
8
|
+
</AGHeadlessModalPanel>
|
|
9
|
+
</AGHeadlessModal>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
import { useModalExpose, useModalProps } from '@aerogel/core';
|
|
15
|
+
import type { IAGHeadlessModal, IAGModal } from '@aerogel/core';
|
|
16
|
+
|
|
17
|
+
const props = defineProps(useModalProps());
|
|
18
|
+
const $modal = ref<IAGHeadlessModal>();
|
|
19
|
+
|
|
20
|
+
defineOptions({ inheritAttrs: false });
|
|
21
|
+
defineExpose<IAGModal>(useModalExpose($modal));
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<AGHeadlessSnackbar :class="colorClasses">
|
|
3
|
+
<AGMarkdown :text="message" inline />
|
|
4
|
+
|
|
5
|
+
<AGButton
|
|
6
|
+
v-for="(action, i) of actions"
|
|
7
|
+
:key="i"
|
|
8
|
+
:color="color"
|
|
9
|
+
@click="activate(action)"
|
|
10
|
+
>
|
|
11
|
+
{{ action.text }}
|
|
12
|
+
</AGButton>
|
|
13
|
+
</AGHeadlessSnackbar>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { computed } from 'vue';
|
|
18
|
+
import { Colors, useSnackbar, useSnackbarProps } from '@aerogel/core';
|
|
19
|
+
|
|
20
|
+
const props = defineProps(useSnackbarProps());
|
|
21
|
+
const { activate } = useSnackbar(props);
|
|
22
|
+
|
|
23
|
+
const colorClasses = computed(() => {
|
|
24
|
+
switch (props.color) {
|
|
25
|
+
case Colors.Danger:
|
|
26
|
+
// Add your custom color classes here.
|
|
27
|
+
return '';
|
|
28
|
+
case Colors.Secondary:
|
|
29
|
+
default:
|
|
30
|
+
// Add your custom color classes here.
|
|
31
|
+
return '';
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
</script>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Story :layout="{ type: 'grid', width: '90%' }">
|
|
3
|
+
<Variant title="Playground">
|
|
4
|
+
<div class="flex space-x-3">
|
|
5
|
+
<AGButton @click="$ui.alert(alertTitle, alertMessage)">
|
|
6
|
+
Alert
|
|
7
|
+
</AGButton>
|
|
8
|
+
<AGButton @click="$ui.confirm(confirmTitle, confirmMessage)">
|
|
9
|
+
Confirm
|
|
10
|
+
</AGButton>
|
|
11
|
+
<AGButton @click="$ui.loading(loadingMessage, after({ seconds: loadingDuration }))">
|
|
12
|
+
Loading
|
|
13
|
+
</AGButton>
|
|
14
|
+
<AGButton @click="$ui.showSnackbar(snackbarMessage, snackbarOptions)">
|
|
15
|
+
Snackbar
|
|
16
|
+
</AGButton>
|
|
17
|
+
<AGButton @click="$errors.inspect(errorReports)">
|
|
18
|
+
Error Report
|
|
19
|
+
</AGButton>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<AGAppOverlays />
|
|
23
|
+
|
|
24
|
+
<template #controls>
|
|
25
|
+
<HstText v-model="alertTitle" title="Alert Title" />
|
|
26
|
+
<HstText v-model="alertMessage" title="Alert Message" />
|
|
27
|
+
<HstText v-model="confirmTitle" title="Confirm Title" />
|
|
28
|
+
<HstText v-model="confirmMessage" title="Confirm Message" />
|
|
29
|
+
<HstText v-model="loadingMessage" title="Loading Message" />
|
|
30
|
+
<HstNumber v-model="loadingDuration" title="Loading Duration" />
|
|
31
|
+
<HstText v-model="snackbarMessage" title="Snackbar Message" />
|
|
32
|
+
<HstSelect v-model="snackbarColor" title="Snackbar Color" :options="snackbarColors" />
|
|
33
|
+
<HstText v-model="snackbarAction" title="Snackbar Action" />
|
|
34
|
+
<HstText v-model="errorReportTitle" title="Error Report Title" />
|
|
35
|
+
<HstText v-model="errorReportDescription" title="Error Report Description" />
|
|
36
|
+
</template>
|
|
37
|
+
</Variant>
|
|
38
|
+
</Story>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script setup lang="ts">
|
|
42
|
+
import { computed, ref } from 'vue';
|
|
43
|
+
import { after, invert } from '@noeldemartin/utils';
|
|
44
|
+
import { Colors, SnackbarColors } from '@aerogel/core';
|
|
45
|
+
import type { ErrorReport, ShowSnackbarOptions } from '@aerogel/core';
|
|
46
|
+
|
|
47
|
+
const alertTitle = ref('Something important happened');
|
|
48
|
+
const alertMessage = ref('And here you can read the details...');
|
|
49
|
+
const confirmTitle = ref('Confirmation');
|
|
50
|
+
const confirmMessage = ref('Are you sure?');
|
|
51
|
+
const loadingMessage = ref('Loading...');
|
|
52
|
+
const loadingDuration = ref(3);
|
|
53
|
+
const snackbarMessage = ref('Something happened');
|
|
54
|
+
const snackbarColor = ref(Colors.Secondary);
|
|
55
|
+
const snackbarColors = invert(SnackbarColors);
|
|
56
|
+
const snackbarAction = ref('Ok');
|
|
57
|
+
const snackbarOptions = computed((): ShowSnackbarOptions => {
|
|
58
|
+
if (!snackbarAction.value) {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return {
|
|
63
|
+
color: snackbarColor.value,
|
|
64
|
+
actions: [
|
|
65
|
+
{
|
|
66
|
+
text: snackbarAction.value,
|
|
67
|
+
dismiss: true,
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const errorReportTitle = ref('Error');
|
|
73
|
+
const errorReportDescription = ref('Something went wrong!');
|
|
74
|
+
const errorReports = computed((): ErrorReport[] => [
|
|
75
|
+
{
|
|
76
|
+
title: errorReportTitle.value,
|
|
77
|
+
description: errorReportDescription.value,
|
|
78
|
+
details: new Error().stack,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: errorReportTitle.value,
|
|
82
|
+
description: errorReportDescription.value,
|
|
83
|
+
details: new Error().stack,
|
|
84
|
+
},
|
|
85
|
+
]);
|
|
86
|
+
</script>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const plugins = {
|
|
2
|
+
tailwindcss: {},
|
|
3
|
+
autoprefixer: {},
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
if (process.env.NODE_ENV === 'development') {
|
|
7
|
+
plugins['postcss-pseudo-classes'] = {
|
|
8
|
+
blacklist: [],
|
|
9
|
+
restrictTo: ['focus', 'focus-visible', 'focus-within', 'hover'],
|
|
10
|
+
allCombinations: true,
|
|
11
|
+
preserveBeforeAfter: false,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
module.exports = { plugins };
|
package/.eslintrc.js
DELETED
package/noeldemartin.config.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest';
|
|
2
|
-
|
|
3
|
-
import { formatCodeBlock } from './format';
|
|
4
|
-
|
|
5
|
-
describe('Format utils', () => {
|
|
6
|
-
|
|
7
|
-
it('Formats code blocks', () => {
|
|
8
|
-
// Arrange
|
|
9
|
-
const raw = `
|
|
10
|
-
|
|
11
|
-
const foo = 'bar';
|
|
12
|
-
|
|
13
|
-
if (foo) {
|
|
14
|
-
doSomething();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
`;
|
|
18
|
-
const formatted = [
|
|
19
|
-
'const foo = \'bar\';', //
|
|
20
|
-
'', //
|
|
21
|
-
'if (foo) {', //
|
|
22
|
-
' doSomething();', //
|
|
23
|
-
'}', //
|
|
24
|
-
].join('\n');
|
|
25
|
-
|
|
26
|
-
// Act
|
|
27
|
-
const actual = formatCodeBlock(raw);
|
|
28
|
-
|
|
29
|
-
// Assert
|
|
30
|
-
expect(actual).toEqual(formatted);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
});
|
package/src/lib/utils/format.ts
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export interface FormatCodeBlockOptions {
|
|
2
|
-
indent?: number;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function formatCodeBlock(code: string, options: FormatCodeBlockOptions = {}): string {
|
|
6
|
-
const lines = code.split('\n');
|
|
7
|
-
const indent = options.indent ?? 0;
|
|
8
|
-
let originalIndent = 0;
|
|
9
|
-
let formatted = '';
|
|
10
|
-
|
|
11
|
-
for (const line of lines) {
|
|
12
|
-
const trimmedLine = line.trim();
|
|
13
|
-
const isEmptyLine = trimmedLine.length === 0;
|
|
14
|
-
|
|
15
|
-
if (formatted.length === 0) {
|
|
16
|
-
if (isEmptyLine) {
|
|
17
|
-
continue;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
originalIndent = line.indexOf(trimmedLine[0] ?? '');
|
|
21
|
-
formatted += `${' '.repeat(indent)}${trimmedLine}\n`;
|
|
22
|
-
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (isEmptyLine) {
|
|
27
|
-
formatted += '\n';
|
|
28
|
-
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const lineIndent = line.indexOf(trimmedLine[0] ?? '');
|
|
33
|
-
|
|
34
|
-
formatted += `${' '.repeat(indent + lineIndent - originalIndent)}${trimmedLine}\n`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return formatted.trimEnd();
|
|
38
|
-
}
|
/package/bin/{ag → gel}
RENAMED
|
File without changes
|
|
File without changes
|