From 7e31d09305df058be3e24813bfa4dec2631b0baf Mon Sep 17 00:00:00 2001 From: slikts Date: Mon, 31 Jul 2023 20:30:46 +0300 Subject: [PATCH] build: fix imports --- package.json | 10 ++++++---- src/Node.spec.ts | 2 +- src/Tuple.spec.ts | 2 +- src/Tuple.ts | 2 +- src/deep.spec.ts | 2 +- src/deep.ts | 2 +- src/graph.spec.ts | 4 ++-- src/graph.ts | 2 +- src/memoize.spec.ts | 2 +- src/memoize.ts | 2 +- src/tuplerone.ts | 6 +++--- 11 files changed, 19 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index ba435b48..84de1d1e 100644 --- a/package.json +++ b/package.json @@ -13,14 +13,16 @@ "hashing", "value objects" ], + "type": "module", "exports": { ".": { "types": "./dist/tuplerone.d.ts", - "require": "./dist/tuplerone.js", - "import": "./dist/tuplerone.mjs" - }, - "./package.json": "./package.json" + "import": "./dist/tuplerone.js", + "require": "./dist/tuplerone.cjs" + } }, + "types": "./dist/tuplerone.d.ts", + "main": "./dist/tuplerone.cjs", "files": [ "dist" ], diff --git a/src/Node.spec.ts b/src/Node.spec.ts index 9ef80c09..59147d78 100644 --- a/src/Node.spec.ts +++ b/src/Node.spec.ts @@ -1,4 +1,4 @@ -import { Node } from './Node'; +import { Node } from './Node.ts'; describe('Node', () => { it('constructs', () => { diff --git a/src/Tuple.spec.ts b/src/Tuple.spec.ts index 53ccf9c0..d1d70550 100644 --- a/src/Tuple.spec.ts +++ b/src/Tuple.spec.ts @@ -1,4 +1,4 @@ -import { Tuple } from './Tuple'; +import { Tuple } from './Tuple.ts'; describe(`Tuple`, () => { const a = Object('a'); diff --git a/src/Tuple.ts b/src/Tuple.ts index 3df82ad1..12262ccf 100644 --- a/src/Tuple.ts +++ b/src/Tuple.ts @@ -1,4 +1,4 @@ -import { getNode, registry } from './graph'; +import { getNode, registry } from './graph.ts'; const TupleConstructor = class Tuple extends Array { constructor(values: A) { diff --git a/src/deep.spec.ts b/src/deep.spec.ts index 46e04a7a..3de0ae7d 100644 --- a/src/deep.spec.ts +++ b/src/deep.spec.ts @@ -1,4 +1,4 @@ -import { getDeepSymbol } from './deep'; +import { getDeepSymbol } from './deep.ts'; describe('DeepCompositeSymbol', () => { it('returns symbol', () => { diff --git a/src/deep.ts b/src/deep.ts index 6889f0d9..ff28ad81 100644 --- a/src/deep.ts +++ b/src/deep.ts @@ -1,4 +1,4 @@ -import { getSymbol } from './graph'; +import { getSymbol } from './graph.ts'; export const getDeepSymbol = (target: unknown): symbol => { const result = _get(target); diff --git a/src/graph.spec.ts b/src/graph.spec.ts index 93a287ce..7935975b 100644 --- a/src/graph.spec.ts +++ b/src/graph.spec.ts @@ -1,5 +1,5 @@ -import { getNode, prune, getSymbol, clear } from './graph'; -import { Node } from './Node'; +import { getNode, prune, getSymbol, clear } from './graph.ts'; +import { Node } from './Node.ts'; describe('graph', () => { afterEach(() => { diff --git a/src/graph.ts b/src/graph.ts index f5bcb8bf..11aac03b 100644 --- a/src/graph.ts +++ b/src/graph.ts @@ -1,5 +1,5 @@ // import { Tuple } from './Tuple' -import { Node } from './Node'; +import { Node } from './Node.ts'; const root = new Node(); diff --git a/src/memoize.spec.ts b/src/memoize.spec.ts index 5dca3be8..4290f4e7 100644 --- a/src/memoize.spec.ts +++ b/src/memoize.spec.ts @@ -1,4 +1,4 @@ -import { memoize } from './memoize'; +import { memoize } from './memoize.ts'; describe('memoize()', () => { it('returns a function', () => { diff --git a/src/memoize.ts b/src/memoize.ts index 03f0d478..47cbfe57 100644 --- a/src/memoize.ts +++ b/src/memoize.ts @@ -1,4 +1,4 @@ -import { getNode } from './graph'; +import { getNode } from './graph.ts'; const cache = new WeakMap(); diff --git a/src/tuplerone.ts b/src/tuplerone.ts index b5eb5f52..f78017d9 100644 --- a/src/tuplerone.ts +++ b/src/tuplerone.ts @@ -1,3 +1,3 @@ -export { Tuple, isRef } from './Tuple'; -export { getDeepSymbol } from './deep'; -export { memoize } from './memoize'; +export { Tuple, isRef } from './Tuple.ts'; +export { getDeepSymbol } from './deep.ts'; +export { memoize } from './memoize.ts';