Skip to content

Commit

Permalink
adjusts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 12, 2023
1 parent 5af02c2 commit ab80997
Show file tree
Hide file tree
Showing 54 changed files with 1,198 additions and 224 deletions.
1,279 changes: 1,126 additions & 153 deletions generators/vue/__snapshots__/generator.spec.mts.snap

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions generators/vue/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ export default class VueGenerator extends BaseApplicationGenerator {
application.applicationRootRelativeToClientTestDir = `${relative(application.clientSpecDir, '.')}/`;
application.clientSrcDirRelativeToClientTestDir = `${relative(application.clientSpecDir, application.clientWebappDir)}/`;

source.addViteConfig = args => {
const viteConfigPath = 'vite.config.ts';
const ignoreNonExisting = this.sharedData.getControl().ignoreNeedlesError && 'Vite configuration file not found';
source.addWebpackConfig = args => {
const webpackPath = 'webpack/webpack.common.js';
const ignoreNonExisting = this.sharedData.getControl().ignoreNeedlesError && 'Webpack configuration file not found';
this.editFile(
viteConfigPath,
webpackPath,
{ ignoreNonExisting },
createNeedleCallback({
needle: 'jhipster-needle-add-vite-config',
needle: 'jhipster-needle-add-webpack-config',
contentToAdd: `,${args.config}`,
}),
);
Expand Down
1 change: 1 addition & 0 deletions generators/vue/templates/.eslintrc.cjs.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/consistent-type-imports': 'error',
},
ignorePatterns: ['<%= temporaryDir %>'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sinon from 'sinon';

import { createTestingPinia } from '@pinia/testing';
import AccountService from './account.service';
import { AccountStore, useStore } from '@/store';
import { type AccountStore, useStore } from '@/store';

const resetStore = (store: AccountStore) => {
store.$reset();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';

import { AccountStore } from '@/store';
import { type AccountStore } from '@/store';

export default class AccountService {
constructor(private store: AccountStore) {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { vitest } from 'vitest';
import { shallowMount, ComponentMountingOptions } from '@vue/test-utils';
import { shallowMount, type ComponentMountingOptions } from '@vue/test-utils';
import axios from 'axios';
import sinon from 'sinon';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineComponent, inject, onMounted, ref, Ref } from 'vue';
import { defineComponent, inject, onMounted, ref, type Ref } from 'vue';
import { useI18n } from 'vue-i18n';
import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';
import ActivateService from './activate.service';
import { useRoute } from 'vue-router';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosInstance } from 'axios';
import axios, { type AxiosInstance } from 'axios';

export default class ActivateService {
private axios: AxiosInstance;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComputedRef, defineComponent, inject, ref, Ref } from 'vue';
import { type ComputedRef, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { vitest } from 'vitest';
import { shallowMount, MountingOptions } from '@vue/test-utils';
import { shallowMount, type MountingOptions } from '@vue/test-utils';
import axios from 'axios';
import sinon from 'sinon';
import { RouteLocation } from 'vue-router';
import { type RouteLocation } from 'vue-router';
import { PiniaVuePlugin } from 'pinia';
import { createTestingPinia } from '@pinia/testing';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import axios from 'axios';
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
import { useRoute, useRouter } from 'vue-router';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import AccountService from '../account.service';
import LoginService from '@/account/login.service';
import type AccountService from '../account.service';
import type LoginService from '@/account/login.service';

export default defineComponent({
compatConfig: { MODE: 3 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Vue from 'vue';
<%_ } _%>
<%_ if (!authenticationTypeJwt) { _%>
import axios, { AxiosPromise } from 'axios';
import axios, { type AxiosPromise } from 'axios';
<%_ } _%>

export default class LoginService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { computed, defineComponent, inject, ref, Ref } from 'vue';
import { computed, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import { useVuelidate } from '@vuelidate/core'
import { email, helpers, maxLength, minLength, required, sameAs } from '@vuelidate/validators';
import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';
import RegisterService from '@/account/register/register.service';
import { EMAIL_ALREADY_USED_TYPE, LOGIN_ALREADY_USED_TYPE } from '@/constants';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import axios from 'axios';
import { useVuelidate } from '@vuelidate/core'
import { maxLength, minLength, required, sameAs } from '@vuelidate/validators';
import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';

export default defineComponent({
compatConfig: { MODE: 3 },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, Ref } from 'vue';
import { defineComponent, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, Ref, computed } from 'vue';
import { defineComponent, ref, type Ref, computed } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, ComputedRef, defineComponent, inject, ref, Ref } from 'vue';
import { computed, type ComputedRef, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
import languages from '@/shared/config/languages';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, defineComponent, inject, ref, Ref } from 'vue';
import { computed, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref, onMounted } from 'vue';
import { defineComponent, inject, ref, type Ref, onMounted } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosPromise } from 'axios';
import axios, { type AxiosPromise } from 'axios';

export default class HealthService {
public separator: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, defineComponent, inject, ref, Ref } from 'vue';
import { computed, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosPromise } from 'axios';
import axios, { type AxiosPromise } from 'axios';

export default class LogsService {
public changeLevel(name: string, configuredLevel: string): AxiosPromise<any> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, Ref, computed, PropType } from 'vue';
import { defineComponent, ref, type Ref, computed, type PropType } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosPromise } from 'axios';
import axios, { type AxiosPromise } from 'axios';

export default class MetricsService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { shallowMount } from '@vue/test-utils';
import axios from 'axios';
import * as sinon from 'sinon';
import { Subject, Subscription } from 'rxjs';
import { createMemoryHistory, createRouter, Router } from 'vue-router';
import { createMemoryHistory, createRouter, type Router } from 'vue-router';

import <%=jhiPrefixCapitalized%>Tracker from './tracker.vue';
import TrackerService from './tracker.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref, onMounted, onUnmounted } from 'vue';
import { defineComponent, inject, ref, type Ref, onMounted, onUnmounted } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { vitest } from 'vitest';
import { ref, Ref } from 'vue';
import { ref, type Ref } from 'vue';
import { shallowMount } from '@vue/test-utils';
import { createMemoryHistory, createRouter, Router } from 'vue-router';
import { createMemoryHistory, createRouter, type Router } from 'vue-router';
import { Subject } from 'rxjs';

import TrackerService, { useTrackerService } from './tracker.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComputedRef, inject, ref, watch } from 'vue';
import { type ComputedRef, inject, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import * as SockJS from 'sockjs-client';
import { map } from 'rxjs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
const tsKeyId = this.generateTestEntityId(user.primaryKey.type);
_%>
import { vitest } from 'vitest';
import { shallowMount, MountingOptions } from '@vue/test-utils';
import { shallowMount, type MountingOptions } from '@vue/test-utils';
import axios from 'axios';
import sinon from 'sinon';
import { RouteLocation } from 'vue-router';
import { type RouteLocation } from 'vue-router';

import AlertService from '@/shared/alert/alert.service';
import UserManagementEdit from './user-management-edit.vue';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import { useVuelidate } from '@vuelidate/core'
import { email, maxLength, minLength, required } from '@vuelidate/validators';
import UserManagementService from './user-management.service';
import { IUser, User } from '@/shared/model/user.model';
import { type IUser, User } from '@/shared/model/user.model';
import { useAlertService } from '@/shared/alert/alert.service';
import { useRoute, useRouter } from 'vue-router';
<%_ if (enableTranslation) { _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { vitest } from 'vitest';
import { shallowMount } from '@vue/test-utils';
import axios from 'axios';
import sinon from 'sinon';
import { RouteLocation, Router } from 'vue-router';
import { type RouteLocation, type Router } from 'vue-router';

import AlertService from '@/shared/alert/alert.service';
import UserManagementView from './user-management-view.vue';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ComputedRef, defineComponent, inject, Ref, ref } from 'vue';
import { type ComputedRef, defineComponent, inject, type Ref, ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import buildPaginationQueryOpts from '@/shared/sort/sorts';
<%_ if (databaseTypeCassandra) { _%>
import {Authority} from '@/shared/security/authority'
<%_ } _%>
import { IUser } from '@/shared/model/user.model';
import { type IUser } from '@/shared/model/user.model';

export default class UserManagementService {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { vitest } from 'vitest';
import { Ref, ref } from 'vue';
import { type Ref, ref } from 'vue';
import { shallowMount } from '@vue/test-utils';
import { RouteLocation } from 'vue-router';
import { type RouteLocation } from 'vue-router';

import Error from './error.vue';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ComputedRef, defineComponent, inject, Ref, ref } from 'vue';
import { type ComputedRef, defineComponent, inject, type Ref, ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';
import { useRoute } from 'vue-router';

export default defineComponent({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ComputedRef, defineComponent, inject } from 'vue';
import { type ComputedRef, defineComponent, inject } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>

import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';

export default defineComponent({
compatConfig: { MODE: 3 },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { vitest } from 'vitest';
import { computed } from 'vue';
import { shallowMount } from '@vue/test-utils';
import JhiNavbar from './jhi-navbar.vue';
import { Router } from 'vue-router';
import { type Router } from 'vue-router';
import { createTestingPinia } from '@pinia/testing';

import { useStore } from '@/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { computed, <% if (applicationTypeGateway && microfrontend) { %>defineAsyncComponent, <% } %>defineComponent, inject, ref, Ref } from 'vue';
import { computed, <% if (applicationTypeGateway && microfrontend) { %>defineAsyncComponent, <% } %>defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
import LoginService from '@/account/login.service';
import type LoginService from '@/account/login.service';
import type AccountService from '@/account/account.service';
<%_ if (enableTranslation) { _%>
import languages from '@/shared/config/languages';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { shallowMount } from "@vue/test-utils";
import Ribbon from './ribbon.vue';

import { createTestingPinia } from '@pinia/testing';
import { AccountStore, useStore } from '@/store';
import { type AccountStore, useStore } from '@/store';

type RibbonComponentType = InstanceType<typeof Ribbon>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const tsKeyId = this.generateTestEntityId(primaryKey.type);
_%>
/* tslint:disable max-line-length */
import { vitest } from 'vitest';
import { shallowMount, MountingOptions } from '@vue/test-utils';
import { shallowMount, type MountingOptions } from '@vue/test-utils';
import sinon, { SinonStubbedInstance } from 'sinon';
import { RouteLocation } from 'vue-router';
import { type RouteLocation } from 'vue-router';

import <%= entityAngularName %>Details from './<%= entityFileName %>-details.vue';
import <%= entityAngularName %>Service from './<%= entityFileName %>.service';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, inject, ref, Ref } from 'vue';
import { defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<%_ const tsKeyId = this.generateTestEntityId(primaryKey.type); _%>
/* tslint:disable max-line-length */
import { vitest } from 'vitest';
import { shallowMount, MountingOptions } from '@vue/test-utils';
import { shallowMount, type MountingOptions } from '@vue/test-utils';
import sinon, { SinonStubbedInstance } from 'sinon';
import { RouteLocation } from 'vue-router';
import { type RouteLocation } from 'vue-router';

<%_ if (anyFieldIsTimeDerived) { _%>
import dayjs from 'dayjs';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { computed, defineComponent, inject, ref, Ref } from 'vue';
import { computed, defineComponent, inject, ref, type Ref } from 'vue';
<%_ if (enableTranslation) { _%>
import { useI18n } from 'vue-i18n';
<%_ } _%>
Expand Down
Loading

0 comments on commit ab80997

Please sign in to comment.