Skip to content

Commit

Permalink
minor updates on examples
Browse files Browse the repository at this point in the history
Signed-off-by: kaibocai <[email protected]>
  • Loading branch information
kaibocai committed Jan 8, 2024
1 parent 404778a commit d1619a2
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 298 deletions.
8 changes: 4 additions & 4 deletions examples/workflow/authoring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"description": "An example utilizing the Dapr JS-SDK to manage workflow",
"private": "true",
"scripts": {
"build": "rimraf ./dist && tsc",
"build": "npx tsc --outDir ./dist/",
"start:activity-sequence": "npm run build && node dist/activity-sequence.js",
"start:fanout-fanin": "npm run build && node dist/fanout-fanin.js",
"start:human-interaction": "npm run build && node dist/human-interaction.js",
"start:dapr:activity-sequence": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 4001 --components-path ./components npm run start:activity-sequence",
"start:dapr:fanout-fanin": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 4001 --components-path ./components npm run start:fanout-fanin",
"start:dapr:human-interaction": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 4001 --components-path ./components npm run start:human-interaction"
"start:dapr:activity-sequence": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 50001 --components-path ./components npm run start:activity-sequence",
"start:dapr:fanout-fanin": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 50001 --components-path ./components npm run start:fanout-fanin",
"start:dapr:human-interaction": "dapr run --app-id activity-sequence-workflow --app-protocol grpc --dapr-grpc-port 50001 --components-path ./components npm run start:human-interaction"
},
"author": "",
"license": "ISC",
Expand Down
9 changes: 2 additions & 7 deletions examples/workflow/authoring/src/activity-sequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// import { WorkflowClient, WorkflowActivityContext, WorkflowContext, WorkflowRuntime, TWorkflow } from "@dapr/dapr";
import WorkflowClient from "@dapr/dapr/workflow/client/WorkflowClient";
import WorkflowActivityContext from "@dapr/dapr/workflow/runtime/WorkflowActivityContext";
import WorkflowContext from "@dapr/dapr/workflow/runtime/WorkflowContext";
import WorkflowRuntime from "@dapr/dapr/workflow/runtime/WorkflowRuntime";
import { TWorkflow } from "@dapr/dapr/types/workflow/Workflow.type";
import { WorkflowClient, WorkflowActivityContext, WorkflowContext, WorkflowRuntime, TWorkflow } from "@dapr/dapr";

(async () => {
const grpcEndpoint = "localhost:4001";
const grpcEndpoint = "localhost:50001";
const workflowClient = new WorkflowClient(grpcEndpoint);
const workflowRuntime = new WorkflowRuntime(grpcEndpoint);

Expand Down
2 changes: 1 addition & 1 deletion examples/workflow/authoring/src/fanout-fanin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Task, WorkflowClient, WorkflowActivityContext, WorkflowContext, Workflo
// Wrap the entire code in an immediately-invoked async function
(async () => {
// Update the gRPC client and worker to use a local address and port
const grpcServerAddress = "localhost:4001";
const grpcServerAddress = "localhost:50001";
const workflowClient: WorkflowClient = new WorkflowClient(grpcServerAddress);
const workflowRuntime: WorkflowRuntime = new WorkflowRuntime(grpcServerAddress);

Expand Down
2 changes: 1 addition & 1 deletion examples/workflow/authoring/src/human-interaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import * as readlineSync from "readline-sync";
}

// Update the gRPC client and worker to use a local address and port
const grpcServerAddress = "localhost:4001";
const grpcServerAddress = "localhost:50001";
const workflowClient: WorkflowClient = new WorkflowClient(grpcServerAddress);
const workflowRuntime: WorkflowRuntime = new WorkflowRuntime(grpcServerAddress);

Expand Down
2 changes: 1 addition & 1 deletion examples/workflow/authoring/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"target": "ES2020" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */,
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
// "lib": [], /* Specify library files to be included in the compilation. */
// "allowJs": true, /* Allow javascript files to be compiled. */
Expand Down
67 changes: 0 additions & 67 deletions src/workflow/examples/activity-sequence.ts

This file was deleted.

94 changes: 0 additions & 94 deletions src/workflow/examples/fanout-fanin.ts

This file was deleted.

123 changes: 0 additions & 123 deletions src/workflow/examples/human-interaction.ts

This file was deleted.

0 comments on commit d1619a2

Please sign in to comment.