Skip to content

Commit 20b89a2

Browse files
Merge branch 'dapr:main' into master
2 parents 0b916e6 + 7300ded commit 20b89a2

File tree

263 files changed

+40938
-12160
lines changed

Some content is hidden

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

263 files changed

+40938
-12160
lines changed

.github/holopin.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
organization: dapr
2+
defaultSticker: clrqfdv4x24910fl5n4iwu5oa
3+
stickers:
4+
-
5+
id: clrqfdv4x24910fl5n4iwu5oa
6+
alias: sdk-badge

.github/scripts/dapr_bot.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const owners = [
2626
"XavierGeerinck",
2727
"amulyavarote",
2828
"shubham1172",
29+
"whitwaldo"
2930
];
3031

3132
/**

.github/workflows/build.yml

Lines changed: 78 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,25 @@ on:
2626
# Manual trigger
2727
workflow_dispatch: {}
2828

29+
env:
30+
NODE_VER: 16.14.0
31+
2932
jobs:
3033
build:
3134
runs-on: ubuntu-latest
32-
environment: production
33-
env:
34-
NODE_VER: 16.14.0
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
node_version: [16.14.0]
3539
steps:
3640
- uses: actions/checkout@v3
3741

38-
# Setup .npmrc file to publish to npm
39-
- name: Configure .npmrc for NPM publish to @dapr
42+
- name: Setup Node ${{ matrix.node_version }}
4043
uses: actions/setup-node@v3
4144
with:
42-
node-version: ${{ env.NODE_VER }}
43-
registry-url: "https://registry.npmjs.org"
45+
node-version: ${{ matrix.node_version }}
4446

45-
- name: Build Package
47+
- name: Build package (install dependencies, lint, prettier, build)
4648
run: npm run build
4749

4850
# @TODO: add a depend on the test-e2e pipeline?
@@ -53,28 +55,85 @@ jobs:
5355
- name: Upload test coverage
5456
uses: codecov/codecov-action@v1
5557

56-
- name: Is Release?
57-
if: startswith(github.ref, 'refs/tags/v')
58-
run: echo "DEPLOY_PACKAGE=true" >> $GITHUB_ENV
58+
publish:
59+
needs: build
60+
if: startswith(github.ref, 'refs/tags/v')
61+
runs-on: ubuntu-latest
62+
environment: production
63+
steps:
64+
- uses: actions/checkout@v3
65+
66+
- name: Setup Node ${{ env.NODE_VER }}
67+
uses: actions/setup-node@v3
68+
with:
69+
node-version: ${{ env.NODE_VER }}
70+
registry-url: "https://registry.npmjs.org"
71+
72+
- name: Install dependencies
73+
run: npm install
74+
75+
- name: Build package
76+
run: npm run build-ci
5977

60-
# note: package.json gets updated here for the new package name
6178
- name: Publish to npm (@dapr/dapr)
62-
if: env.DEPLOY_PACKAGE == 'true'
6379
run: npm publish build/ --access public
6480
env:
6581
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6682

83+
# dapr-client is deprecated, but we still want to publish it for a while.
6784
- name: "[dapr-client] Configure to publish to dapr-client for deprecation notice reasons"
68-
if: env.DEPLOY_PACKAGE == 'true'
69-
run: sed -i s#"@dapr/dapr"#"dapr-client"# package.json
85+
run: |
86+
sed -i s#"@dapr/dapr"#"dapr-client"# package.json
87+
echo "This has been deprecated and will not be updated anymore, please use https://www.npmjs.com/package/@dapr/dapr" > README.md
88+
89+
- name: "[dapr-client] Install dependencies"
90+
run: npm install
7091

7192
- name: "[dapr-client] Build Package"
72-
if: env.DEPLOY_PACKAGE == 'true'
73-
run: npm run build
93+
run: npm run build-ci
7494

75-
# note: package.json gets updated here for the new package name
7695
- name: "[dapr-client] Publish to npm (dapr-client)"
77-
if: env.DEPLOY_PACKAGE == 'true'
96+
run: npm publish build/ --access public
97+
env:
98+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
99+
100+
publish-dev:
101+
needs: build
102+
if: startsWith(github.ref, 'refs/heads/main')
103+
runs-on: ubuntu-latest
104+
environment: development
105+
steps:
106+
- uses: actions/checkout@v3
107+
108+
- name: Setup Node ${{ env.NODE_VER }}
109+
uses: actions/setup-node@v3
110+
with:
111+
node-version: ${{ env.NODE_VER }}
112+
registry-url: "https://registry.npmjs.org"
113+
114+
- name: Configure package name
115+
run: |
116+
sed -i s#"@dapr/dapr"#"@dapr/dapr-dev"# package.json
117+
cat <(echo "WARNING: This is a development version of the SDK. It is not recommended to use this version in production.\n") README.md > README.md.tmp
118+
mv README.md.tmp README.md
119+
120+
- name: Configure version
121+
run: |
122+
# Version should be in the format of <version>-<timestamp>-<commit-hash>
123+
# e.g. 1.0.0-20220101000000-abcdef
124+
VERSION=$(npm version | grep '@dapr/dapr' | awk -F':' '{print $2}' | tr -d "[:space:],'")
125+
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
126+
COMMIT_HASH=$(git rev-parse --short HEAD)
127+
128+
sed -i s#"\"version\": \"$VERSION\""#"\"version\": \"$VERSION-$TIMESTAMP-$COMMIT_HASH\""# package.json
129+
130+
- name: Install dependencies
131+
run: npm install
132+
133+
- name: Build package
134+
run: npm run build-ci
135+
136+
- name: Publish to npm (@dapr/dapr-dev)
78137
run: npm publish build/ --access public
79138
env:
80139
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/dapr-bot-schedule.yml

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

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
test-e2e:
3535
runs-on: ubuntu-latest
3636
env:
37-
GOVER: 1.19
38-
DAPR_CLI_VER: 1.10.0
39-
DAPR_RUNTIME_VER: 1.10.0
37+
GOVER: 1.22
38+
DAPR_CLI_VER: 1.15.0
39+
DAPR_RUNTIME_VER: 1.15.3
4040
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
4141
DAPR_CLI_REF: ""
4242
DAPR_REF: ""

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### vscode ###
2-
.vscode/*
2+
.vscode
33
!.vscode/settings.json
44
!.vscode/tasks.json
55
!.vscode/launch.json
@@ -144,4 +144,13 @@ temp/
144144
build/
145145

146146
# version file is auto-generated
147-
src/version.ts
147+
src/version.ts
148+
149+
# OSX
150+
/.DS_Store
151+
152+
# JetBrains
153+
/.idea
154+
155+
# PNPM
156+
pnpm-lock.yaml

README.md

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,25 @@
1-
<p align="center">
2-
<a href="https://dapr.io">
3-
<img src="https://dapr.io/images/dapr.svg" height="128">
4-
<h1 align="center">Dapr</h1>
5-
</a>
6-
</p>
7-
8-
<p align="center">
9-
<a aria-label="NPM version" href="https://www.npmjs.com/package/@dapr/dapr">
10-
<img alt="" src="https://img.shields.io/npm/v/@dapr/dapr?style=for-the-badge&labelColor=000000">
11-
</a>
12-
<a aria-label="License" href="https://github.com/dapr/js-sdk/blob/main/LICENSE">
13-
<img alt="" src="https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge&labelColor=000000">
14-
</a>
15-
<a aria-label="Join the community on Discord" href="https://discord.com/invite/ptHhX6jc34">
16-
<img alt="" src="https://img.shields.io/badge/Join%20the%20community-blueviolet.svg?style=for-the-badge&logo=Discord&labelColor=000000&logoWidth=20&logoColor=FFFFFF">
17-
</a>
18-
</p>
1+
# Dapr SDK for JavaScript
2+
3+
[![NPM Version](https://img.shields.io/npm/v/%40dapr%2Fdapr?style=flat&logo=npm&label=Latest%20version)](https://www.npmjs.com/package/@dapr/dapr) [![NPM Downloads](https://img.shields.io/npm/dy/%40dapr%2Fdapr?style=flat&logo=npm&label=Downloads)](https://www.npmjs.com/package/@dapr/dapr) [![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/dapr/js-sdk/.github%2Fworkflows%2Fbuild.yml?branch=main&label=Build&logo=github)](https://github.com/dapr/js-sdk/actions/workflows/build.yml) [![codecov](https://codecov.io/gh/dapr/js-sdk/branch/main/graph/badge.svg)](https://codecov.io/gh/dapr/js-sdk) [![GitHub License](https://img.shields.io/github/license/dapr/js-sdk?style=flat&label=License&logo=github)](https://github.com/dapr/js-sdk/blob/main/LICENSE) [![GitHub issue custom search in repo](https://img.shields.io/github/issues-search/dapr/js-sdk?query=type%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22&label=Good%20first%20issues&style=flat&logo=github)](https://github.com/dapr/js-sdk/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) [![Discord](https://img.shields.io/discord/778680217417809931?label=Discord&style=flat&logo=discord)](http://bit.ly/dapr-discord) [![YouTube Channel Views](https://img.shields.io/youtube/channel/views/UCtpSQ9BLB_3EXdWAUQYwnRA?style=flat&label=YouTube%20views&logo=youtube)](https://youtube.com/@daprdev) [![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/daprdev?logo=x&style=flat)](https://twitter.com/daprdev)
194

205
## Getting Started
216

22-
Instantly get started by installing the Dapr JS SDK and reading the [getting started documentation](https://docs.dapr.io/developing-applications/sdks/js) or [follow one of the quickstarts](https://github.com/dapr/quickstarts)
7+
Instantly get started by installing the Dapr JS SDK and reading the [getting started documentation](https://docs.dapr.io/developing-applications/sdks/js/) or [follow one of the quickstarts](https://github.com/dapr/quickstarts)
238

249
```
2510
npm install --save @dapr/dapr
2611
```
2712

28-
> ⚠️ the [`dapr-client`](https://www.npmjs.com/package/dapr-client) package has been deprecated. Please see https://github.com/dapr/js-sdk/issues/259 for more information.
13+
You can also use the development version of the SDK which is built from the `main` branch. Make sure to remove the `@dapr/dapr` package first. This package is not meant for production use, and should only be used for development purposes.
14+
15+
```
16+
npm install --save @dapr/dapr-dev
17+
```
2918

3019
## Documentation
3120

3221
Visit [https://docs.dapr.io/developing-applications/sdks/js/](https://docs.dapr.io/developing-applications/sdks/js/) to view the full documentation.
3322

34-
## Who is using Dapr?
35-
36-
Dapr is used by the world's leading companies.
37-
38-
<div align="center">
39-
<img src="https://dapr.io/images/bosch.png" width="100px">
40-
<img src="https://dapr.io/images/zeiss.png" width="100px">
41-
<img src="https://dapr.io/images/alibaba.png" width="100px">
42-
<img src="https://dapr.io/images/ignition-group.png" width="100px">
43-
<img src="https://dapr.io/images/roadwork.png" width="100px">
44-
<img src="https://dapr.io/images/autonavi.png" width="100px">
45-
<img src="https://dapr.io/images/legentic.png" width="100px">
46-
<img src="https://dapr.io/images/man-group.png" width="100px">
47-
</div>
48-
49-
View the main site [https://dapr.io/](https://dapr.io/) to learn more.
50-
5123
## Community
5224

5325
There are multiple ways to get involved with the SDK community, please see [wiki/Community-engagement](https://github.com/dapr/js-sdk/wiki/Community-engagement) for more information.

daprdocs/content/en/js-sdk-contributing/js-contributing.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,19 +103,23 @@ Try to keep the first commit line short. This is harder to do using this commit
103103
concise and if you need more space, you can use the commit body. Try to make sure that the commit
104104
subject is clear and precise enough that users will know what change by just looking at the changelog.
105105
106+
## Github Dapr Bot Commands
107+
108+
Checkout the [daprbot documentation](https://docs.dapr.io/contributing/daprbot/) for Github commands you can run in this repo for common tasks. For example, you can run the `/assign` (as a comment on an issue) to assign issues to a user or group of users.
109+
106110
## Coding Rules
107111
108112
To ensure consistency throughout the source code, keep these rules in mind as you are working:
109113
110114
- All features or bug fixes **must be tested** by one or more specs (unit-tests).
111115
- All public API methods **must be documented**.
112-
- We follow [ESLint RecommendedRules][https://eslint.org/docs/rules/].
116+
- We follow [ESLint RecommendedRules](https://eslint.org/docs/rules/).
113117
114118
## Examples
115119
116120
The `examples` directory contains code samples for users to run to try out specific functionality of the various JavaScript SDK packages and extensions. When writing new and updated samples keep in mind:
117121
118-
- All examples should be runnable on Windows, Linux, and MacOS. While JavaScript code is consistent among operating systems, any pre/post example commands should provide options through [codetabs]({{< ref "contributing-docs.md#tabbed-content" >}})
122+
- All examples should be runnable on Windows, Linux, and MacOS. While JavaScript code is consistent among operating systems, any pre/post example commands should provide options through [codetabs]({{< ref "contributing-docs.md#tabbed-content" >}}).
119123
- Contain steps to download/install any required pre-requisites. Someone coming in with a fresh OS install should be able to start on the example and complete it without an error. Links to external download pages are fine.
120124
121125
## Docs

daprdocs/content/en/js-sdk-docs/_index.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,26 @@ linkTitle: "JavaScript"
55
weight: 1000
66
description: JavaScript SDK packages for developing Dapr applications
77
no_list: true
8+
cascade:
9+
github_repo: https://github.com/dapr/js-sdk
10+
github_subdir: daprdocs/content/en/js-sdk-docs
11+
path_base_for_github_subdir: content/en/developing-applications/sdks/js/
12+
github_branch: main
813
---
914

1015
A client library for building Dapr apps in JavaScript and TypeScript. This client abstracts the public Dapr APIs like service to service invocation, state management, pub/sub, secrets, and much more, and provides a simple, intuitive API for building applications.
1116

1217
## Installation
1318

14-
To get started with the Javascript SDK, install the Dapr JavaScript SDK package from [NPM](https://www.npmjs.com/package/@dapr/dapr):
19+
To get started with the JavaScript SDK, install the Dapr JavaScript SDK package from [NPM](https://www.npmjs.com/package/@dapr/dapr):
1520

1621
```bash
1722
npm install --save @dapr/dapr
1823
```
1924

20-
> ⚠️ [dapr-client](https://www.npmjs.com/package/dapr-client) is now deprecated. Please see [#259](https://github.com/dapr/js-sdk/issues/259) for more information.
21-
2225
## Structure
2326

24-
The Dapr Javascript SDK contains two major components:
27+
The Dapr JavaScript SDK contains two major components:
2528

2629
- **DaprServer**: to manage all Dapr sidecar to application communication.
2730
- **DaprClient**: to manage all application to Dapr sidecar communication.

0 commit comments

Comments
 (0)