Skip to content

Commit b4dfd68

Browse files
authored
refactor: mv durabletask-js into sdk (#738)
* refactor: init refactor moving dt into js sdk Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: updates for build and licences Signed-off-by: Samantha Coyle <sam@diagrid.io> * style: update years on new licences Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: address copilot feedback Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: updates for build to be happy Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: address all of constanins feedback Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: make e2e test build happy Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: address feedback Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix(build): updates for build and e2e tests Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: updates for build Signed-off-by: Samantha Coyle <sam@diagrid.io> * style: add back microsoft license Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: update so dapr license is first Signed-off-by: Samantha Coyle <sam@diagrid.io> * fix: address copilot feedback Signed-off-by: Samantha Coyle <sam@diagrid.io> * style: update comment Signed-off-by: Samantha Coyle <sam@diagrid.io> --------- Signed-off-by: Samantha Coyle <sam@diagrid.io>
1 parent 3f56114 commit b4dfd68

69 files changed

Lines changed: 22539 additions & 14462 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/workflow/authoring/package-lock.json

Lines changed: 0 additions & 487 deletions
This file was deleted.

examples/workflow/management/package-lock.json

Lines changed: 0 additions & 465 deletions
This file was deleted.

jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = {
1616
testEnvironment: "node",
1717
collectCoverage: true,
1818
coverageReporters: ["lcov"],
19+
modulePathIgnorePatterns: ["<rootDir>/build/"],
1920
// Load .github/scripts/*.js files as native CJS — they have no TypeScript syntax.
2021
transformIgnorePatterns: ["/node_modules/", "/.github/"],
2122
};

package-lock.json

Lines changed: 51 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"test:e2e:workflow:internal": "jest test/e2e/workflow --runInBand --detectOpenHandles",
2525
"test:e2e:workflow:durabletask": "./scripts/test-e2e-workflow.sh",
2626
"test:unit": "jest --runInBand --detectOpenHandles",
27-
"test:unit:all": "npm run test:unit:main && npm run test:unit:http && npm run test:unit:grpc && npm run test:unit:common && npm run test:unit:actors && npm run test:unit:logger && npm run test:unit:utils && npm run test:unit:errors && npm run test:unit:scripts",
27+
"test:unit:all": "npm run test:unit:main && npm run test:unit:http && npm run test:unit:grpc && npm run test:unit:common && npm run test:unit:actors && npm run test:unit:logger && npm run test:unit:utils && npm run test:unit:errors && npm run test:unit:scripts && npm run test:unit:workflow",
2828
"test:unit:main": "NODE_ENV=test npm run test:unit 'test/unit/main/.*\\.test\\.ts'",
2929
"test:unit:http": "NODE_ENV=test npm run test:unit 'test/unit/protocols/http/.*\\.test\\.ts'",
3030
"test:unit:grpc": "NODE_ENV=test npm run test:unit 'test/unit/protocols/grpc/.*\\.test\\.ts'",
@@ -34,7 +34,7 @@
3434
"test:unit:utils": "NODE_ENV=test npm run test:unit 'test/unit/utils/.*\\.test\\.ts'",
3535
"test:unit:errors": "NODE_ENV=test npm run test:unit 'test/unit/errors/.*\\.test\\.ts'",
3636
"test:unit:scripts": "NODE_ENV=test npm run test:unit 'test/unit/scripts/.*\\.test\\.ts'",
37-
"test:unit:workflow": "NODE_ENV=test npm run test:unit 'test/unit/workflow/.*\\.test\\.ts'",
37+
"test:unit:workflow": "NODE_ENV=test npm run test:unit 'test/unit/workflow/.*\\.(test|spec)\\.ts'",
3838
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
3939
"prebuild": "./scripts/prebuild.sh",
4040
"build-ci": "npm run prebuild && ./scripts/build.sh",

scripts/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,8 @@ cp README.md build/
4242

4343
# Copy Proto Files
4444
cp -R ./src/proto ./build
45+
46+
# Copy vendored durabletask proto files
47+
mkdir -p ./build/workflow/internal/durabletask/proto
48+
cp -R ./src/workflow/internal/durabletask/proto/*.js ./build/workflow/internal/durabletask/proto/
49+
cp -R ./src/workflow/internal/durabletask/proto/*.d.ts ./build/workflow/internal/durabletask/proto/

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import WorkflowActivityContext from "./workflow/runtime/WorkflowActivityContext"
4545
import WorkflowContext from "./workflow/runtime/WorkflowContext";
4646
import WorkflowRuntime from "./workflow/runtime/WorkflowRuntime";
4747
import { TWorkflow } from "./types/workflow/Workflow.type";
48-
import { Task } from "@dapr/durabletask-js/task/task";
48+
import { Task } from "./workflow/internal/durabletask/task/task";
4949
import { WorkflowFailureDetails } from "./workflow/client/WorkflowFailureDetails";
5050
import { WorkflowState } from "./workflow/client/WorkflowState";
5151
import {

src/types/workflow/Workflow.type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ limitations under the License.
1212
*/
1313

1414
import WorkflowContext from "../../workflow/runtime/WorkflowContext";
15-
import { Task } from "@dapr/durabletask-js/task/task";
15+
import { Task } from "../../workflow/internal/durabletask/task/task";
1616
import { TOutput } from "./InputOutput.type";
1717

1818
/**

src/workflow/client/DaprWorkflowClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
1111
limitations under the License.
1212
*/
1313

14-
import { TaskHubGrpcClient } from "@dapr/durabletask-js";
14+
import { TaskHubGrpcClient } from "../internal/durabletask";
1515
import { WorkflowState } from "./WorkflowState";
1616
import { generateApiTokenClientInterceptors, generateEndpoint, getDaprApiToken } from "../internal/index";
1717
import { TWorkflow } from "../../types/workflow/Workflow.type";
@@ -158,7 +158,7 @@ export default class DaprWorkflowClient {
158158
fetchPayloads,
159159
timeoutInSeconds,
160160
);
161-
if (state != undefined) {
161+
if (state !== undefined) {
162162
return new WorkflowState(state);
163163
}
164164
}

src/workflow/client/WorkflowFailureDetails.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ See the License for the specific language governing permissions and
1111
limitations under the License.
1212
*/
1313

14-
import { FailureDetails } from "@dapr/durabletask-js/task/failure-details";
14+
import { FailureDetails } from "../internal/durabletask/task/failure-details";
1515

1616
/**
1717
* Class that represents the details of a task failure.

0 commit comments

Comments
 (0)