Skip to content

Commit

Permalink
feat: Generate Source Maps (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Feb 19, 2023
1 parent fa53f5c commit 226e9a8
Show file tree
Hide file tree
Showing 84 changed files with 1,020 additions and 185 deletions.
2 changes: 2 additions & 0 deletions fixtures/sample/lib/app.d.ts
@@ -0,0 +1,2 @@
export declare function run(): Promise<void>;
//# sourceMappingURL=app.d.ts.map
1 change: 1 addition & 0 deletions fixtures/sample/lib/app.d.ts.map

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

12 changes: 12 additions & 0 deletions fixtures/sample/lib/app.js

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

1 change: 1 addition & 0 deletions fixtures/sample/lib/app.js.map

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

3 changes: 3 additions & 0 deletions fixtures/sample/lib/database/fetch.d.ts
@@ -0,0 +1,3 @@
import { Entity, GUID } from '../types.js';
export declare function fetchEntity<T extends Entity>(guid: GUID): Promise<T | undefined>;
//# sourceMappingURL=fetch.d.ts.map
1 change: 1 addition & 0 deletions fixtures/sample/lib/database/fetch.d.ts.map

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

5 changes: 5 additions & 0 deletions fixtures/sample/lib/database/fetch.js

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

1 change: 1 addition & 0 deletions fixtures/sample/lib/database/fetch.js.map

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

2 changes: 2 additions & 0 deletions fixtures/sample/lib/database/index.d.ts
@@ -0,0 +1,2 @@
export { fetchEntity } from './fetch.js';
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions fixtures/sample/lib/database/index.d.ts.map

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

2 changes: 2 additions & 0 deletions fixtures/sample/lib/database/index.js

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

1 change: 1 addition & 0 deletions fixtures/sample/lib/database/index.js.map

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

1 change: 1 addition & 0 deletions fixtures/sample/lib/index.d.ts
@@ -1,3 +1,4 @@
export { PrimeNumber, Tuple, GUID, AddressGuid, Address, PhoneNumberGuid, PhoneNumber, PersonGuid, Person, Annotation, } from './types.js';
export { lookUpPerson } from './lookup.js';
export { fetchEntity } from './database/index.js';
//# sourceMappingURL=index.d.ts.map
2 changes: 1 addition & 1 deletion fixtures/sample/lib/index.d.ts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/lib/index.js

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

2 changes: 1 addition & 1 deletion fixtures/sample/lib/index.js.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/lib/lookup.d.ts
@@ -1,3 +1,3 @@
import { Person, PersonGuid } from './types.js';
export declare function lookUpPerson(_guid: PersonGuid): Person | undefined;
export declare function lookUpPerson(_guid: PersonGuid): Promise<Person | undefined>;
//# sourceMappingURL=lookup.d.ts.map
2 changes: 1 addition & 1 deletion fixtures/sample/lib/lookup.d.ts.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/lib/lookup.js

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

2 changes: 1 addition & 1 deletion fixtures/sample/lib/lookup.js.map

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

19 changes: 12 additions & 7 deletions fixtures/sample/lib/types.d.ts
Expand Up @@ -2,10 +2,17 @@ export type PrimeNumber = number;
export type Tuple<T, U> = [T, U];
export type GUID = string;
export type AddressGuid = GUID;
export interface Address {
export interface EntityBase<T extends string> {
guid: GUID;
type: T;
}
export interface Entity {
guid: GUID;
type: string;
}
export interface Address extends EntityBase<'Address'> {
guid: AddressGuid;
name: string;
type: string;
street: string;
city: string;
postalCode: string;
Expand All @@ -15,25 +22,23 @@ export interface Address {
annotations?: Annotation[];
}
export type PhoneNumberGuid = GUID;
export interface PhoneNumber {
export interface PhoneNumber extends EntityBase<'PhoneNumber'> {
guid: PhoneNumberGuid;
name: string;
type: string;
number: string;
annotations?: Annotation[];
}
export type PersonGuid = GUID;
export interface Person {
export interface Person extends EntityBase<'Person'> {
guid: PersonGuid;
name: string;
aliases?: string[];
dob?: string;
addresses?: Address[];
notes?: Annotation[];
}
export interface Annotation {
export interface Annotation extends EntityBase<'Annotation'> {
note: string;
type: string;
madeBy: PersonGuid;
}
//# sourceMappingURL=types.d.ts.map
2 changes: 1 addition & 1 deletion fixtures/sample/lib/types.d.ts.map

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

2 changes: 2 additions & 0 deletions fixtures/sample/out/app.d.mts
@@ -0,0 +1,2 @@
export declare function run(): Promise<void>;
//# sourceMappingURL=app.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/app.d.mts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/app.d.ts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/app.js.map

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

12 changes: 12 additions & 0 deletions fixtures/sample/out/app.mjs
@@ -0,0 +1,12 @@
import chalk from 'chalk';
import { lookUpPerson } from './lookup.mjs';
export async function run() {
const guid = 'GUID';
const person = await lookUpPerson('GUID');
if (!person) {
console.log(chalk.red(`Person ${chalk.yellow(guid)} not found.`));
return;
}
console.log(`Found: ${person.name}`);
}
//# sourceMappingURL=app.mjs.map
1 change: 1 addition & 0 deletions fixtures/sample/out/app.mjs.map

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

3 changes: 3 additions & 0 deletions fixtures/sample/out/database/fetch.d.mts
@@ -0,0 +1,3 @@
import { Entity, GUID } from '../types.mjs';
export declare function fetchEntity<T extends Entity>(guid: GUID): Promise<T | undefined>;
//# sourceMappingURL=fetch.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/database/fetch.d.mts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/database/fetch.d.ts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/database/fetch.js.map

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

5 changes: 5 additions & 0 deletions fixtures/sample/out/database/fetch.mjs
@@ -0,0 +1,5 @@
export async function fetchEntity(guid) {
console.log(`Fetch Entity ${guid}`);
return undefined;
}
//# sourceMappingURL=fetch.mjs.map
1 change: 1 addition & 0 deletions fixtures/sample/out/database/fetch.mjs.map

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

2 changes: 2 additions & 0 deletions fixtures/sample/out/database/index.d.mts
@@ -0,0 +1,2 @@
export { fetchEntity } from './fetch.mjs';
//# sourceMappingURL=index.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/database/index.d.mts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/database/index.d.ts.map

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

1 change: 1 addition & 0 deletions fixtures/sample/out/database/index.js.map

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

2 changes: 2 additions & 0 deletions fixtures/sample/out/database/index.mjs
@@ -0,0 +1,2 @@
export { fetchEntity } from './fetch.mjs';
//# sourceMappingURL=index.mjs.map
1 change: 1 addition & 0 deletions fixtures/sample/out/database/index.mjs.map

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

3 changes: 2 additions & 1 deletion fixtures/sample/out/index.d.mts
@@ -1,3 +1,4 @@
export { PrimeNumber, Tuple, GUID, AddressGuid, Address, PhoneNumberGuid, PhoneNumber, PersonGuid, Person, Annotation, } from './types.mjs';
export { lookUpPerson } from './lookup.mjs';
//# sourceMappingURL=index.d.ts.map
export { fetchEntity } from './database/index.mjs';
//# sourceMappingURL=index.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/index.d.mts.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/out/index.d.ts.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/out/index.js.map

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

3 changes: 2 additions & 1 deletion fixtures/sample/out/index.mjs
@@ -1,2 +1,3 @@
export { lookUpPerson } from './lookup.mjs';
//# sourceMappingURL=index.js.map
export { fetchEntity } from './database/index.mjs';
//# sourceMappingURL=index.mjs.map
1 change: 1 addition & 0 deletions fixtures/sample/out/index.mjs.map

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

4 changes: 2 additions & 2 deletions fixtures/sample/out/lookup.d.mts
@@ -1,3 +1,3 @@
import { Person, PersonGuid } from './types.mjs';
export declare function lookUpPerson(_guid: PersonGuid): Person | undefined;
//# sourceMappingURL=lookup.d.ts.map
export declare function lookUpPerson(_guid: PersonGuid): Promise<Person | undefined>;
//# sourceMappingURL=lookup.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/lookup.d.mts.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/out/lookup.d.ts.map

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

2 changes: 1 addition & 1 deletion fixtures/sample/out/lookup.js.map

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

4 changes: 2 additions & 2 deletions fixtures/sample/out/lookup.mjs
@@ -1,4 +1,4 @@
export function lookUpPerson(_guid) {
export async function lookUpPerson(_guid) {
return undefined;
}
//# sourceMappingURL=lookup.js.map
//# sourceMappingURL=lookup.mjs.map
1 change: 1 addition & 0 deletions fixtures/sample/out/lookup.mjs.map

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

21 changes: 13 additions & 8 deletions fixtures/sample/out/types.d.mts
Expand Up @@ -2,10 +2,17 @@ export type PrimeNumber = number;
export type Tuple<T, U> = [T, U];
export type GUID = string;
export type AddressGuid = GUID;
export interface Address {
export interface EntityBase<T extends string> {
guid: GUID;
type: T;
}
export interface Entity {
guid: GUID;
type: string;
}
export interface Address extends EntityBase<'Address'> {
guid: AddressGuid;
name: string;
type: string;
street: string;
city: string;
postalCode: string;
Expand All @@ -15,25 +22,23 @@ export interface Address {
annotations?: Annotation[];
}
export type PhoneNumberGuid = GUID;
export interface PhoneNumber {
export interface PhoneNumber extends EntityBase<'PhoneNumber'> {
guid: PhoneNumberGuid;
name: string;
type: string;
number: string;
annotations?: Annotation[];
}
export type PersonGuid = GUID;
export interface Person {
export interface Person extends EntityBase<'Person'> {
guid: PersonGuid;
name: string;
aliases?: string[];
dob?: string;
addresses?: Address[];
notes?: Annotation[];
}
export interface Annotation {
export interface Annotation extends EntityBase<'Annotation'> {
note: string;
type: string;
madeBy: PersonGuid;
}
//# sourceMappingURL=types.d.ts.map
//# sourceMappingURL=types.d.mts.map
1 change: 1 addition & 0 deletions fixtures/sample/out/types.d.mts.map

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

0 comments on commit 226e9a8

Please sign in to comment.