Skip to content

Commit

Permalink
Merge pull request #1094 from basics/feature/fix-auto-import
Browse files Browse the repository at this point in the history
fix(imports): imrpove imports
  • Loading branch information
ThornWalli authored Aug 17, 2024
2 parents c7f37cb + 2d4d589 commit 72a556a
Show file tree
Hide file tree
Showing 52 changed files with 128 additions and 50 deletions.
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@nuxt/module-builder": "0.8.3",
"@nuxt/webpack-builder": "3.12.4",
"@types/node": "20.15.0",
"@types/vue": "^2.0.0",
"commitlint": "19.4.0",
"eslint": "9.9.0",
"eslint-config-prettier": "9.1.0",
Expand Down
1 change: 1 addition & 0 deletions playground/components/InfoLayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import { getStyleDescription } from '#booster/utils/description';
import BoosterLayer from '#booster/components/BoosterLayer';
import BaseButton from '@/components/base/Button';
import { useBoosterFonts, useHead } from '#imports';
const { $getFont } = useBoosterFonts();
Expand Down
1 change: 1 addition & 0 deletions playground/components/PreviewContainer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
</script>

Expand Down
2 changes: 1 addition & 1 deletion playground/components/WeakHardwareOverlay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<script setup>
import BoosterWeakHardwareOverlay from '#booster/components/WeakHardwareOverlay';
import BaseButton from '@/components/base/Button';
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
Expand Down
3 changes: 3 additions & 0 deletions playground/components/base/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import { computed, useAttrs } from 'vue';
const { $getFont } = useBoosterFonts();
defineEmits(['click']);
Expand Down
3 changes: 3 additions & 0 deletions playground/components/base/Headline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import { computed } from 'vue';
const { $getFont } = useBoosterFonts();
const $props = defineProps({
Expand Down
2 changes: 2 additions & 0 deletions playground/components/base/LinkList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
Expand Down
3 changes: 3 additions & 0 deletions playground/components/elements/LoaderTest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
</template>

<script setup>
import { ref, onMounted } from 'vue';
import { useBoosterCritical } from '#imports';
const { isCritical } = useBoosterCritical();
const active = ref(false);
Expand Down
1 change: 1 addition & 0 deletions playground/components/elements/ScrollItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
font: {
Expand Down
2 changes: 2 additions & 0 deletions playground/components/fragments/PageHeaderMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
<script setup>
import Headline from '@/components/base/Headline';
import LinkList from '@/components/base/LinkList';
import { useRoute } from 'vue-router';
import { ref, computed, watch, onMounted } from 'vue';
const props = defineProps({
modelValue: {
Expand Down
1 change: 1 addition & 0 deletions playground/components/modules/ImageText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

<script setup>
import BoosterPicture from '#booster/components/BoosterPicture';
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
Expand Down
2 changes: 2 additions & 0 deletions playground/components/modules/Stage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
import BoosterPicture from '#booster/components/BoosterPicture';
import BoosterImage from '#booster/components/BoosterImage';
import SvgChevronDown from '@/assets/svg/chevron-down.svg';
import { useBoosterFonts } from '#imports';
import { ref, onMounted } from 'vue';
const { $getFont } = useBoosterFonts();
Expand Down
3 changes: 3 additions & 0 deletions playground/components/modules/TextFontA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import { ref, onMounted } from 'vue';
const { $getFont } = useBoosterFonts();
const ready = ref(false);
Expand Down
3 changes: 3 additions & 0 deletions playground/components/modules/TextFontB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import { ref, onMounted } from 'vue';
const { $getFont } = useBoosterFonts();
const ready = ref(false);
defineProps({
Expand Down
1 change: 1 addition & 0 deletions playground/components/modules/VideoVimeo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<script setup>
import BoosterVimeo from '#booster/components/BoosterVimeo';
import WeakHardwareOverlay from '@/components/WeakHardwareOverlay';
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
Expand Down
1 change: 1 addition & 0 deletions playground/components/modules/VideoYoutube.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<script setup>
import BoosterYoutube from '#booster/components/BoosterYoutube';
import WeakHardwareOverlay from '@/components/WeakHardwareOverlay';
import { useBoosterFonts } from '#imports';
const { $getFont } = useBoosterFonts();
defineProps({
Expand Down
3 changes: 2 additions & 1 deletion playground/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

<script setup>
import 'wicg-inert';
import { useBoosterHydrate } from '#imports';
import { useBoosterHydrate, useRoute, useHead } from '#imports';
import { defineAsyncComponent, ref, computed } from 'vue';
const hydrate = useBoosterHydrate();
const InfoLayer = defineAsyncComponent(() => import('@/components/InfoLayer'));
Expand Down
4 changes: 4 additions & 0 deletions playground/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export default defineNuxtConfig(async () => {

ssr: true,

imports: {
autoImport: false
},

runtimeConfig: {
public: {
githubRepoUrl: repository.url.replace(/^git\+(.*)\.git$/, '$1'),
Expand Down
4 changes: 3 additions & 1 deletion playground/pages/tests/booster-layer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
</template>

<script setup>
import BoosterLayer from '#booster/components/BoosterLayer';
import { ref, onMounted } from 'vue';
import { useBoosterHydrate } from '#imports';
import BoosterLayer from '#booster/components/BoosterLayer';
const hydrate = useBoosterHydrate();
const ready = ref(false);
Expand Down
4 changes: 3 additions & 1 deletion playground/pages/tests/iframe/components/Critical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@
</template>

<script setup>
import { ref } from 'vue';
import DefaultIframe from '#booster/components/BoosterIframe';
import PreviewContainer from '@/components/PreviewContainer';
const iframeSrc = 'https://basics.github.io/nuxt-booster/playground/';
const iframeSrc = ref('https://basics.github.io/nuxt-booster/playground/');
</script>
3 changes: 2 additions & 1 deletion playground/pages/tests/iframe/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
</template>

<script setup>
import { ref } from 'vue';
import DefaultIframe from '#booster/components/BoosterIframe';
import PreviewContainer from '@/components/PreviewContainer';
const iframeSrc = 'https://basics.github.io/nuxt-booster/playground/';
const iframeSrc = ref('https://basics.github.io/nuxt-booster/playground/');
</script>
6 changes: 4 additions & 2 deletions playground/pages/tests/image/components/Critical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
</template>

<script setup>
import { ref } from 'vue';
import BoosterImage from '#booster/components/BoosterImage';
import PreviewContainer from '@/components/PreviewContainer';
const image = {
const image = ref({
title: 'Critical - Image',
source: {
format: 'jpg',
Expand All @@ -29,5 +31,5 @@ const image = {
xxl: '100vw'
}
}
};
});
</script>
6 changes: 4 additions & 2 deletions playground/pages/tests/image/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
</template>

<script setup>
import { ref } from 'vue';
import BoosterImage from '#booster/components/BoosterImage';
import PreviewContainer from '@/components/PreviewContainer';
const image = {
const image = ref({
title: 'Lazy - Image',
source: {
src: '/img/lazy.jpg',
Expand All @@ -28,5 +30,5 @@ const image = {
xxl: '100vw'
}
}
};
});
</script>
6 changes: 4 additions & 2 deletions playground/pages/tests/picture/components/Critical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
</template>

<script setup>
import { ref } from 'vue';
import BoosterPicture from '#booster/components/BoosterPicture';
import PreviewContainer from '@/components/PreviewContainer';
const picture = {
const picture = ref({
title: 'Critical',
sources: [
{
Expand All @@ -30,5 +32,5 @@ const picture = {
}
}
]
};
});
</script>
6 changes: 4 additions & 2 deletions playground/pages/tests/picture/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
</template>

<script setup>
import { ref } from 'vue';
import BoosterPicture from '#booster/components/BoosterPicture';
import OrganismPreviewContainer from '@/components/PreviewContainer';
const picture = {
const picture = ref({
title: 'Lazy',
sources: [
{
Expand All @@ -30,5 +32,5 @@ const picture = {
}
}
]
};
});
</script>
3 changes: 3 additions & 0 deletions playground/pages/tests/useBoosterHead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
</template>

<script setup>
import { definePageMeta, useRuntimeConfig } from '#imports';
import { ref } from 'vue';
const {
public: { isTest }
} = useRuntimeConfig();
Expand Down
2 changes: 2 additions & 0 deletions playground/pages/tests/useBoosterHead/empty-1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
</template>

<script setup>
import { ref, onMounted } from 'vue';
const ready = ref(false);
onMounted(() => {
ready.value = true;
Expand Down
2 changes: 2 additions & 0 deletions playground/pages/tests/useBoosterHead/empty-2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
</template>

<script setup>
import { ref, onMounted } from 'vue';
const ready = ref(false);
onMounted(() => {
ready.value = true;
Expand Down
1 change: 1 addition & 0 deletions playground/pages/tests/useBoosterHead/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
</template>

<script setup>
import { ref } from 'vue';
import BaseHeadline from '@/components/base/Headline';
const show = ref(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import PreviewContainer from '@/components/PreviewContainer';
const { $getFont } = useBoosterFonts();
Expand Down
1 change: 1 addition & 0 deletions playground/pages/tests/v-font-media/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import PreviewContainer from '@/components/PreviewContainer';
const { $getFont } = useBoosterFonts();
Expand Down
1 change: 1 addition & 0 deletions playground/pages/tests/v-font/components/Critical.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import PreviewContainer from '@/components/PreviewContainer';
const { $getFont } = useBoosterFonts();
Expand Down
1 change: 1 addition & 0 deletions playground/pages/tests/v-font/components/Lazy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
</template>

<script setup>
import { useBoosterFonts } from '#imports';
import PreviewContainer from '@/components/PreviewContainer';
const { $getFont } = useBoosterFonts();
Expand Down
3 changes: 3 additions & 0 deletions playground/pages/tests/vimeo/components/Default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
</template>

<script setup>
import { computed } from 'vue';
import { useBoosterCritical } from '#imports';
import DefaultVimeo from '#booster/components/BoosterVimeo';
import PreviewContainer from '@/components/PreviewContainer';
Expand Down
2 changes: 2 additions & 0 deletions playground/pages/tests/weak-hardware-overlay/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
</template>

<script setup>
import { ref, onMounted } from 'vue';
import BoosterLayer from '#booster/components/BoosterLayer';
import BoosterWeakHardwareOverlay from '#booster/components/WeakHardwareOverlay';
Expand Down
Loading

0 comments on commit 72a556a

Please sign in to comment.