Skip to content

Commit

Permalink
🚧 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maraisr committed Sep 6, 2024
1 parent 59a33f7 commit ed6f470
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"./utils": "./lib/utils.ts"
},
"imports": {
"diary": "./lib/mod.ts",
"diary/utils": "./lib/utils.ts",

"@std/assert": "jsr:@std/assert@^1",
"@std/async": "jsr:@std/async@^1",
"@std/testing": "jsr:@std/testing@^1",
Expand Down
4 changes: 2 additions & 2 deletions lib/mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { assertInstanceOf } from '@std/assert';
import { assertSpyCall, spy } from '@std/testing/mock';

import type { Level } from '../lib/mod.ts';
import * as lib from '../lib/mod.ts';
import type { Level } from 'diary';
import * as lib from 'diary';

Deno.test('api', () => {
assertInstanceOf(lib.diary, Function);
Expand Down
2 changes: 1 addition & 1 deletion lib/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Dict, Pretty, Props } from './utils.ts';
import type { Dict, Pretty, Props } from 'diary/utils';

/**
* TODO
Expand Down
4 changes: 2 additions & 2 deletions lib/output.console.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Level } from './mod.ts';
import { interpolate } from './utils.ts';
import type { Level } from 'diary';
import { interpolate } from 'diary/utils';

import { blue, bold, gray, magenta, red, yellow } from 'kleur/colors';

Expand Down
3 changes: 2 additions & 1 deletion lib/stream.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { assertEquals, assertInstanceOf } from '@std/assert';
import { delay } from '@std/async';

import * as stream from './stream.ts';
import * as lib from './mod.ts';
import * as lib from 'diary';

Deno.test('api', () => {
assertInstanceOf(lib.diary, Function);
Expand Down
2 changes: 1 addition & 1 deletion lib/stream.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as lib from './mod.ts';
import * as lib from "diary";

export function diary(
cb: (r: ReadableStream<lib.LogEvent>) => any,
Expand Down
3 changes: 2 additions & 1 deletion lib/using.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { assertInstanceOf } from '@std/assert';
import * as lib from './using.ts';
import { assertSpyCall, spy } from '@std/testing/mock';
import { delay } from '@std/async';

import * as lib from './using.ts';

Deno.test('api', () => {
assertInstanceOf(lib.diary, Function);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/using.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as lib from './mod.ts';
import * as lib from 'diary';

export interface Diary extends lib.Diary {
[Symbol.dispose](): void;
Expand Down
3 changes: 2 additions & 1 deletion lib/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assertEquals } from '@std/assert';
import * as lib from './utils.ts';

import * as lib from 'diary/utils';

Deno.test('api', () => {
assertEquals(lib.interpolate('hello {name}', { name: 'world' }), 'hello world');
Expand Down
6 changes: 2 additions & 4 deletions scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ async function transform(name: string, filename: string) {

let outfile = `${outdir}/${name}.d.ts`;
console.log('> writing "%s" file', outfile);
let outsource = xform.declaration!.replaceAll(/\.ts/g, '.js');
await Deno.writeTextFile(outfile, outsource);
await Deno.writeTextFile(outfile, xform.declaration!);

outfile = `${outdir}/${name}.js`;
console.log('> writing "%s" file', outfile);
outsource = xform.sourceText.replaceAll(/\.ts/g, '.js');
await Deno.writeTextFile(outfile, outsource);
await Deno.writeTextFile(outfile, xform.sourceText);
}

if (exists(outdir)) {
Expand Down

0 comments on commit ed6f470

Please sign in to comment.