Add developer toolkit UI component

The commit adds a new a UI component that's enabled in development mode.
This component, initially, provides a button that wen clicked, logs all
the script and category names to the console. It helps revising names
used throughout the application.

By having this component in a conditionally rendered component, it's
excluded from the production builds.
This commit is contained in:
undergroundwires
2023-10-07 15:14:53 +02:00
parent 286295128d
commit 2147eae687
4 changed files with 114 additions and 2 deletions

View File

@@ -7,11 +7,12 @@
<TheCodeButtons class="app__row app__code-buttons" />
<TheFooter />
</div>
<OptionalDevToolkit />
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import { defineAsyncComponent, defineComponent } from 'vue';
import TheHeader from '@/presentation/components/TheHeader.vue';
import TheFooter from '@/presentation/components/TheFooter/TheFooter.vue';
import TheCodeButtons from '@/presentation/components/Code/CodeButtons/TheCodeButtons.vue';
@@ -22,6 +23,10 @@ import { provideDependencies } from '../bootstrapping/DependencyProvider';
const singletonAppContext = await buildContext();
const OptionalDevToolkit = process.env.NODE_ENV !== 'production'
? defineAsyncComponent(() => import('@/presentation/components/DevToolkit/DevToolkit.vue'))
: null;
export default defineComponent({
components: {
TheHeader,
@@ -29,6 +34,7 @@ export default defineComponent({
TheScriptArea,
TheSearchBar,
TheFooter,
OptionalDevToolkit,
},
setup() {
provideDependencies(singletonAppContext); // In Vue 3.0 we can move it to main.ts
@@ -59,5 +65,4 @@ export default defineComponent({
}
}
}
</style>