Skip to content

Commit 90f67f3

Browse files
authored
Merge pull request #6 from Rooster212/fix-exports-for-release
Fix exports in index.ts for packaging, and add a dry-run publish to test
2 parents 95ff802 + b2f06b9 commit 90f67f3

File tree

4 files changed

+20
-31
lines changed

4 files changed

+20
-31
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ jobs:
2121
uses: actions/setup-node@v3
2222
with:
2323
node-version: 16
24-
cache: 'npm'
24+
cache: "npm"
2525
- name: Install dependencies
2626
run: npm ci
2727
- name: Run tests
2828
run: npm run test
29+
- name: Dry run a publish
30+
run: ./publish.sh dry-run

index.ts

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
1-
export { GetOutput, ChangeOutput, DB, Facet } from "./src";
1+
export * from "./src";
22

3-
export {
4-
Processor,
5-
Event,
6-
Initializer,
7-
ProcessResult,
8-
RecordTypeName,
9-
StateUpdater,
10-
StateUpdaterInput,
11-
} from "./src/processor";
3+
export * from "./src/processor";
124

13-
export {
14-
InboundRecord,
15-
OutboundRecord,
16-
StateRecord,
17-
BaseRecord,
18-
EventDB,
19-
isInboundRecord,
20-
isOutboundRecord,
21-
isStateRecord,
22-
newInboundRecord,
23-
newOutboundRecord,
24-
newStateRecord,
25-
} from "./src/db";
5+
export * from "./src/db";
266

27-
export {
28-
OnDynamoDBStreamEvent,
29-
OnDynamoDBStreamEventLogFunc,
30-
createOnDynamoDBStreamHandler,
31-
} from "./stream/onDynamoDBStreamEvent";
7+
export * from "./stream/onDynamoDBStreamEvent";

publish.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,15 @@ cp package-lock.json ./dist
1212
cp LICENSE.txt ./dist
1313
cd ./dist
1414

15-
npm publish
15+
set +v
16+
17+
if [ "$1" = "dry-run" ]; then
18+
echo "================================================="
19+
echo "Dry-run of publish"
20+
echo "================================================="
21+
npm publish --dry-run
22+
echo "================================================="
23+
else
24+
echo "Publishing package"
25+
npm publish
26+
fi

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99
newStateRecord,
1010
newInboundRecord,
1111
newOutboundRecord,
12-
DB,
1312
QueryRecordsResult,
13+
DB,
1414
} from "./db";
1515
import { Processor, Event } from "./processor";
1616

0 commit comments

Comments
 (0)