Skip to content

Commit

Permalink
revert to default to cjs builds to ensure mocha is happy
Browse files Browse the repository at this point in the history
  • Loading branch information
monken committed Oct 3, 2022
1 parent 08f5ee5 commit 7cd7892
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@
},
"scripts": {
"prepack": "yarn docs && rm -rf dist && yarn build",
"build": "tsc && tsc --module commonjs --outDir dist/cjs",
"build": "tsc && tsc --module esnext --outDir dist/esm",
"docs": "yarn --silent docs:build && yarn --silent docs:merge",
"docs:build": "rm -rf docs README.md && yarn --silent typedoc --hideInPageTOC --excludeNotDocumented --disableSources --theme github-wiki src/index.ts",
"docs:merge": "node --loader=ts-node/esm bin/merge-docs.mts",
"docs:merge": "ts-node bin/merge-docs.ts",
"test": "mocha --bail --watch-files '**/*.ts' --extension ts --timeout 60000 'src/**/*.spec.ts'"
}
}
6 changes: 3 additions & 3 deletions src/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { strict as assert } from 'assert';
import { randomBytes } from 'crypto';
import { createTestTable, docClient } from './testing.js';
import { encodeKey, decodeKey, Paginator, AttributeMap } from './index.js';
import { b64uDecode } from './util.js';
import { createTestTable, docClient } from './testing';
import { encodeKey, decodeKey, Paginator, AttributeMap } from './index';
import { b64uDecode } from './util';

function createKey(pk: string[], sk: string[]): { PK: string, SK: string } {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { QueryCommand, ScanCommand } from '@aws-sdk/lib-dynamodb';
import type { DynamoDBDocumentClient as DynamoDBDocumentClientV3, QueryCommandInput, QueryCommandOutput, ScanCommandInput, ScanCommandOutput } from '@aws-sdk/lib-dynamodb';
import type { NativeAttributeValue } from '@aws-sdk/util-dynamodb';

import { b64uDecode, b64uEncode, uInt16Buffer } from './util.js';
import { b64uDecode, b64uEncode, uInt16Buffer } from './util';

export type AttributeMap = { [key: string]: NativeAttributeValue };

Expand Down
2 changes: 1 addition & 1 deletion src/testing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DynamoDB, CreateTableCommandInput } from '@aws-sdk/client-dynamodb';
import { ServiceException } from '@aws-sdk/smithy-client';
import { randomBytes } from 'crypto';
import { promises as fs } from 'fs';
import { sleep } from './util.js';
import { sleep } from './util';
import { DynamoDBDocument } from '@aws-sdk/lib-dynamodb';

export const ddb = new DynamoDB({});
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
"extends": "@tsconfig/node14/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist/esm",
"outDir": "dist/cjs",
"declaration": true,
"moduleResolution": "node",
"module": "esnext"
},
"include": ["src/index.ts", "src/util.ts"]
}

0 comments on commit 7cd7892

Please sign in to comment.