Skip to content

Commit

Permalink
feat: Publish sdk to GH Actions Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarek-kindred committed Oct 5, 2023
1 parent b4185b0 commit 0ed84cd
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 46 deletions.
2 changes: 1 addition & 1 deletion cohort_banking_replicator_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@talos/cohort_sdk_client": "^0.0.1",
"@kindredgroup/cohort_sdk_client": "^0.0.1",
"pg": "^8.11.3",
"winston": "^3.10.0"
}
Expand Down
63 changes: 32 additions & 31 deletions cohort_sdk_client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cohort_sdk_client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build": "npx tsc -d"
},
"dependencies": {
"@kindredgroup/cohort_sdk_js": "^0.0.1",
"@kindredgroup/cohort_sdk_js": "^0.0.1-b4185b0",
"@types/pg": "^8.10.2",
"ts-node": "^10.9.1",
"winston": "^3.10.0"
Expand Down
2 changes: 1 addition & 1 deletion cohort_sdk_client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
JsOutOfOrderInstallOutcome,
OutOfOrderRequest,
SdkErrorKind,
} from "cohort_sdk_js"
} from "@kindredgroup/cohort_sdk_js"

class TalosSdkError extends Error {
constructor(readonly kind: SdkErrorKind, readonly message: string, options?: ErrorOptions) {
Expand Down
2 changes: 1 addition & 1 deletion cohort_sdk_client/src/initiator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InternalInitiator, JsInitiatorConfig, OutOfOrderRequest, SdkErrorKind } from "cohort_sdk_js"
import { InternalInitiator, JsInitiatorConfig, OutOfOrderRequest, SdkErrorKind } from "@kindredgroup/cohort_sdk_js"
import { isSdkError } from "./internal"
import { TalosSdkError } from "."

Expand Down
2 changes: 1 addition & 1 deletion cohort_sdk_client/src/internal.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SDK_CONTAINER_TYPE } from "cohort_sdk_js"
import { SDK_CONTAINER_TYPE } from "@kindredgroup/cohort_sdk_js"

export const isSdkError = (reason: string): boolean => {
return (reason && reason.indexOf(`"_typ":"${ SDK_CONTAINER_TYPE }"`) > 0 && reason.startsWith("{") && reason.endsWith("}"))
Expand Down
2 changes: 1 addition & 1 deletion cohort_sdk_client/src/replicator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { InternalReplicator, JsKafkaConfig, JsReplicatorConfig, JsStatemapAndSnapshot, SdkErrorKind } from "cohort_sdk_js"
import { InternalReplicator, JsKafkaConfig, JsReplicatorConfig, JsStatemapAndSnapshot, SdkErrorKind } from "@kindredgroup/cohort_sdk_js"
import { isSdkError } from "./internal"
import { TalosSdkError } from "."

Expand Down
13 changes: 4 additions & 9 deletions packages/cohort_sdk_js/scripts/bundle-talos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,19 @@ npm run build
echo "Current content is:"
ls -lah

#echo "Removing node library"
#rm cohort_sdk_js.darwin-x64.node

echo "Current content is:"
ls -lah

echo "D: rm -rf $CURRENT_DIR/$TARGET_DIR/target"
rm -rf $CURRENT_DIR/$TARGET_DIR/target

cd $CURRENT_DIR

echo "Copying index files into module root"
cp \
$TARGET_DIR/packages/cohort_sdk_js/index.js \
$TARGET_DIR/packages/cohort_sdk_js/index.d.ts \
$TARGET_DIR/packages/cohort_sdk_js/index.*s \
$CURRENT_DIR

echo "Moving node library into module root"
mv \
$TARGET_DIR/packages/cohort_sdk_js/cohort_sdk_js.darwin-x64.node \
$TARGET_DIR/packages/cohort_sdk_js/cohort_sdk_js* \
$CURRENT_DIR/

echo "Current content of $CURRENT_DIR is:"
Expand Down

0 comments on commit 0ed84cd

Please sign in to comment.