Skip to content

Commit

Permalink
Looks like VS Code tried to be helpful and automatically use my path …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
ascott18 committed Jul 13, 2018
1 parent 156bb92 commit 5e1d0b0
Show file tree
Hide file tree
Showing 16 changed files with 30 additions and 36 deletions.
1 change: 0 additions & 1 deletion src/coalesce-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
],
"moduleNameMapper": {
"^vue$": "vue/dist/vue.common.js",
"^@/(.*)$": "<rootDir>/src/$1",
"//": "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.",
"^date-fns/esm$": "date-fns",
"lodash-es": "lodash"
Expand Down
6 changes: 3 additions & 3 deletions src/coalesce-vue/src/api-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ declare module "axios" {
}
}

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

import axios, { AxiosPromise, AxiosResponse, AxiosError, AxiosRequestConfig, Canceler, CancelTokenSource, CancelToken, AxiosInstance, Cancel} from 'axios'
import * as qs from 'qs'
Expand Down
8 changes: 4 additions & 4 deletions src/coalesce-vue/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


export * from '@/metadata'
export * from '@/model'
export * from '@/api-client'
export * from '@/viewmodel'
export * from './metadata'
export * from './model'
export * from './api-client'
export * from './viewmodel'
4 changes: 2 additions & 2 deletions src/coalesce-vue/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Tedious imports for maximum tree shaking
import { toDate, isValid, format } from 'date-fns/esm'

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

/**
* Represents a model with metadata information.
Expand Down
8 changes: 4 additions & 4 deletions src/coalesce-vue/src/viewmodel.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

import Vue from 'vue';

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

Expand Down
4 changes: 2 additions & 2 deletions src/coalesce-vue/test/model.display.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as model from "@/model";
import * as model from "../src/model";
import * as $metadata from "./targets.metadata";
import { ObjectValue, Value } from "@/metadata";
import { ObjectValue, Value } from "../src/metadata";
import { shortStringify } from "./test-utils";

const studentProps = $metadata.Student.props;
Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/model.shared.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import * as $metadata from "./targets.metadata";
import { ObjectValue, Value, ModelValue } from "@/metadata";
import { ObjectValue, Value, ModelValue } from "../src/metadata";

const studentProps = $metadata.Student.props;

Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/model.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


import * as model from "@/model";
import * as model from "../src/model";
import * as $metadata from "./targets.metadata";
import { Indexable } from "lib/util";

Expand Down
6 changes: 3 additions & 3 deletions src/coalesce-vue/test/model.toDto.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as model from "@/model";
import * as model from "../src/model";
import * as $metadata from "./targets.metadata";
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "@/metadata";
import { ModelValue, ObjectValue, Value, ObjectType, CollectionValue } from "../src/metadata";
import { shortStringify } from "./test-utils";
import { Indexable } from "@/util";
import { Indexable } from "../src/util";
import { twoWayConversions, studentValue, MappingData } from "./model.shared";

const studentProps = $metadata.Student.props;
Expand Down
6 changes: 3 additions & 3 deletions src/coalesce-vue/test/model.toModel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

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

const studentProps = $metadata.Student.props;
Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/targets.apiclients.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ModelApiClient } from "@/api-client";
import { ModelApiClient } from "../src/api-client";
import * as $models from "./targets.models"
import * as $metadata from "./targets.metadata"

Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/targets.metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectType, BasicCollectionProperty, getEnumMeta, ObjectProperty, ModelType, ModelCollectionNavigationProperty, ClassType } from "@/metadata";
import { ObjectType, BasicCollectionProperty, getEnumMeta, ObjectProperty, ModelType, ModelCollectionNavigationProperty, ClassType } from "../src/metadata";

const metaBase = (name: string = "model") => {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/targets.models.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as metadata from './targets.metadata'
import { Model, DataSource, convertToModel, mapToModel } from '@/model'
import { Model, DataSource, convertToModel, mapToModel } from '../src/model'

export enum Grade {
Freshman = 9,
Expand Down
2 changes: 1 addition & 1 deletion src/coalesce-vue/test/targets.viewmodels.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as metadata from "./targets.metadata"
import * as models from "./targets.models"
import * as apiClients from "./targets.apiclients"
import { ViewModel, ListViewModel, defineProps } from '@/viewmodel'
import { ViewModel, ListViewModel, defineProps } from '../src/viewmodel'

export interface StudentViewModel extends models.Student {}
export class StudentViewModel extends ViewModel<models.Student, apiClients.StudentApiClient> {
Expand Down
4 changes: 2 additions & 2 deletions src/coalesce-vue/test/viewmodel.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@


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

import { StudentViewModel } from './targets.viewmodels';
import { Student } from './targets.models';
Expand Down
7 changes: 1 addition & 6 deletions src/coalesce-vue/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@
"strict": true,
"declaration": true,
"lib": ["es2015", "es2017", "dom"],
"baseUrl": ".",
"paths": {
"@/*": [
"src/*"
]
},
"baseUrl": "."
},

"exclude": [
Expand Down

0 comments on commit 5e1d0b0

Please sign in to comment.