Skip to content

Commit 5e1d0b0

Browse files
committed
Looks like VS Code tried to be helpful and automatically use my path alias to /src for all files in /src. Unfortunately, this breaks the compiled js because the paths don't get resolved in the js. Working as intended: microsoft/TypeScript#10866
Just going to get rid of that alias entirely - It isn't going to make things easier in the long term like I hoped it would. I originally only intended it to be used in the tests, but if VS code is going to be aggressive about it, then its better to just forgo it entirely.
1 parent 156bb92 commit 5e1d0b0

16 files changed

+30
-36
lines changed

src/coalesce-vue/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
],
5050
"moduleNameMapper": {
5151
"^vue$": "vue/dist/vue.common.js",
52-
"^@/(.*)$": "<rootDir>/src/$1",
5352
"//": "Map the esm version of libs to the non-esm for the tests - jest doesn't do well with es modules & typescript. By some sheer chance of luck, the import statements can be written the same between the es and non-es versions of the files.",
5453
"^date-fns/esm$": "date-fns",
5554
"lodash-es": "lodash"

src/coalesce-vue/src/api-client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ declare module "axios" {
1818
}
1919
}
2020

21-
import { ModelType, ClassType, Method, Service, ApiRoutedType, DataSourceType, Value, ModelValue, CollectionValue, VoidValue } from '@/metadata'
22-
import { Model, convertToModel, mapToDto, mapValueToDto, DataSource, convertValueToModel } from '@/model'
23-
import { OwnProps, Indexable } from '@/util'
21+
import { ModelType, ClassType, Method, Service, ApiRoutedType, DataSourceType, Value, ModelValue, CollectionValue, VoidValue } from './metadata'
22+
import { Model, convertToModel, mapToDto, mapValueToDto, DataSource, convertValueToModel } from './model'
23+
import { OwnProps, Indexable } from './util'
2424

2525
import axios, { AxiosPromise, AxiosResponse, AxiosError, AxiosRequestConfig, Canceler, CancelTokenSource, CancelToken, AxiosInstance, Cancel} from 'axios'
2626
import * as qs from 'qs'

src/coalesce-vue/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
export * from '@/metadata'
4-
export * from '@/model'
5-
export * from '@/api-client'
6-
export * from '@/viewmodel'
3+
export * from './metadata'
4+
export * from './model'
5+
export * from './api-client'
6+
export * from './viewmodel'

src/coalesce-vue/src/model.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Tedious imports for maximum tree shaking
33
import { toDate, isValid, format } from 'date-fns/esm'
44

5-
import { ClassType, Property, PropNames, resolvePropMeta, Value, EnumValue, PrimitiveValue, DateValue, CollectionValue, DataSourceType, ModelValue, ObjectValue } from "@/metadata"
6-
import { Indexable } from '@/util'
5+
import { ClassType, Property, PropNames, resolvePropMeta, Value, EnumValue, PrimitiveValue, DateValue, CollectionValue, DataSourceType, ModelValue, ObjectValue } from "./metadata"
6+
import { Indexable } from './util'
77

88
/**
99
* Represents a model with metadata information.

src/coalesce-vue/src/viewmodel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

22
import Vue from 'vue';
33

4-
import { ModelType, CollectionProperty, PropertyOrName, resolvePropMeta, PropNames } from '@/metadata';
5-
import { ModelApiClient, ListParameters } from '@/api-client';
6-
import { Model, modelDisplay, propDisplay, mapToDto, convertToModel, updateFromModel } from '@/model';
7-
import { Indexable } from '@/util';
4+
import { ModelType, CollectionProperty, PropertyOrName, resolvePropMeta, PropNames } from './metadata';
5+
import { ModelApiClient, ListParameters } from './api-client';
6+
import { Model, modelDisplay, propDisplay, mapToDto, convertToModel, updateFromModel } from './model';
7+
import { Indexable } from './util';
88
import { debounce } from 'lodash-es'
99
import { Cancelable } from 'lodash'
1010

src/coalesce-vue/test/model.display.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as model from "@/model";
1+
import * as model from "../src/model";
22
import * as $metadata from "./targets.metadata";
3-
import { ObjectValue, Value } from "@/metadata";
3+
import { ObjectValue, Value } from "../src/metadata";
44
import { shortStringify } from "./test-utils";
55

66
const studentProps = $metadata.Student.props;

src/coalesce-vue/test/model.shared.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import * as $metadata from "./targets.metadata";
3-
import { ObjectValue, Value, ModelValue } from "@/metadata";
3+
import { ObjectValue, Value, ModelValue } from "../src/metadata";
44

55
const studentProps = $metadata.Student.props;
66

src/coalesce-vue/test/model.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
import * as model from "@/model";
3+
import * as model from "../src/model";
44
import * as $metadata from "./targets.metadata";
55
import { Indexable } from "lib/util";
66

src/coalesce-vue/test/model.toDto.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as model from "@/model";
1+
import * as model from "../src/model";
22
import * as $metadata from "./targets.metadata";
3-
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "@/metadata";
3+
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "../src/metadata";
44
import { shortStringify } from "./test-utils";
5-
import { Indexable } from "@/util";
5+
import { Indexable } from "../src/util";
66
import { twoWayConversions, studentValue, MappingData } from "./model.shared";
77

88
const studentProps = $metadata.Student.props;

src/coalesce-vue/test/model.toModel.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11

2-
import * as model from "@/model";
2+
import * as model from "../src/model";
33
import * as $metadata from "./targets.metadata";
4-
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "@/metadata";
4+
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "../src/metadata";
55
import { shortStringify } from "./test-utils";
6-
import { Indexable } from "@/util";
6+
import { Indexable } from "../src/util";
77
import { twoWayConversions, studentValue, MappingData, displaysStudentValue } from "./model.shared";
88

99
const studentProps = $metadata.Student.props;

src/coalesce-vue/test/targets.apiclients.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ModelApiClient } from "@/api-client";
1+
import { ModelApiClient } from "../src/api-client";
22
import * as $models from "./targets.models"
33
import * as $metadata from "./targets.metadata"
44

src/coalesce-vue/test/targets.metadata.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ObjectType, BasicCollectionProperty, getEnumMeta, ObjectProperty, ModelType, ModelCollectionNavigationProperty, ClassType } from "@/metadata";
1+
import { ObjectType, BasicCollectionProperty, getEnumMeta, ObjectProperty, ModelType, ModelCollectionNavigationProperty, ClassType } from "../src/metadata";
22

33
const metaBase = (name: string = "model") => {
44
return {

src/coalesce-vue/test/targets.models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as metadata from './targets.metadata'
2-
import { Model, DataSource, convertToModel, mapToModel } from '@/model'
2+
import { Model, DataSource, convertToModel, mapToModel } from '../src/model'
33

44
export enum Grade {
55
Freshman = 9,

src/coalesce-vue/test/targets.viewmodels.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as metadata from "./targets.metadata"
22
import * as models from "./targets.models"
33
import * as apiClients from "./targets.apiclients"
4-
import { ViewModel, ListViewModel, defineProps } from '@/viewmodel'
4+
import { ViewModel, ListViewModel, defineProps } from '../src/viewmodel'
55

66
export interface StudentViewModel extends models.Student {}
77
export class StudentViewModel extends ViewModel<models.Student, apiClients.StudentApiClient> {

src/coalesce-vue/test/viewmodel.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22

33
import Vue from 'vue';
4-
import { AxiosClient, AxiosItemResult } from '@/api-client'
5-
import { mapToDto, mapToModel } from '@/model';
4+
import { AxiosClient, AxiosItemResult } from '../src/api-client'
5+
import { mapToDto, mapToModel } from '../src/model';
66

77
import { StudentViewModel } from './targets.viewmodels';
88
import { Student } from './targets.models';

src/coalesce-vue/tsconfig.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,7 @@
1010
"strict": true,
1111
"declaration": true,
1212
"lib": ["es2015", "es2017", "dom"],
13-
"baseUrl": ".",
14-
"paths": {
15-
"@/*": [
16-
"src/*"
17-
]
18-
},
13+
"baseUrl": "."
1914
},
2015

2116
"exclude": [

0 commit comments

Comments
 (0)