Skip to content

Commit

Permalink
feat(logger): vatr meta structure
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Feb 28, 2022
1 parent b8b63d9 commit feade73
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions package/logger/src/logger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './meta';
export type LoggerFunction = (message: string, ...restParam: Array<unknown>) => void;
export type LogLevels = 'debug' | 'error' | 'info' | 'log' | 'trace' | 'warn';

Expand Down
19 changes: 19 additions & 0 deletions package/logger/src/meta.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
declare global {
interface Window {
Vatr?: {
registeredList?: Array<{
name: string,
version: string,
}>;
}
}
}

export const vatrRegisteredList = window.Vatr?.registeredList || [];
window.Vatr ??= {};
window.Vatr.registeredList = vatrRegisteredList;

vatrRegisteredList.push({
name: '@vatr/router',
version: '{{VATR_VERSION}}', // TODO: replace with real version at release time.
});

0 comments on commit feade73

Please sign in to comment.