Skip to content

Commit

Permalink
VBLOCKS-1301 Add esm output. (#182)
Browse files Browse the repository at this point in the history
* VBLOCKS-1301 Add esm output.
* VBLOCKS-1301 Adding es6 module check and updating .release.json and config.yml.
  • Loading branch information
manjeshbhargav authored Jul 24, 2023
1 parent 10dda21 commit 2f52f2a
Show file tree
Hide file tree
Showing 11 changed files with 469 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ commands:
- build
- run:
name: Running build checks
command: npm run test:es5 && npm run test:typecheck && npm run lint && npm run test:unit
command: npm run test:es5 && npm run test:esm && npm run test:typecheck && npm run lint && npm run test:unit
- store_artifacts:
path: coverage
destination: coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config.yaml
coverage
dist
es5
esm
extension/token.js
node_modules
docs
Expand Down
6 changes: 3 additions & 3 deletions .release.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"node ./node_modules/.bin/release --bump ${CURRENT_VERSION} ${RELEASE_VERSION}",
"git config user.name \"${GIT_USER_NAME}\"",
"git config user.email \"${GIT_USER_EMAIL}\"",
"git rm -rf --ignore-unmatch dist es5 docs lib/twilio/constants.ts",
"git rm -rf --ignore-unmatch dist es5 esm docs lib/twilio/constants.ts",
"npm run build:release",
"git add package.json",
"git add -f dist es5 docs lib/twilio/constants.ts",
"git add -f dist es5 esm docs lib/twilio/constants.ts",
"git commit -nm \"${RELEASE_VERSION}\"",
"git tag ${RELEASE_VERSION}",
"git remote set-url origin \"https://${GH_TOKEN}@${GH_REF}\"",
Expand All @@ -40,7 +40,7 @@
"development": {
"commands": [
"node ./node_modules/.bin/release --bump ${RELEASE_VERSION} ${DEVELOPMENT_VERSION}",
"git rm -rf dist es5 docs lib/twilio/constants.ts",
"git rm -rf dist es5 esm docs lib/twilio/constants.ts",
"npm run clean",
"npm run docs:clean",
"git add package.json",
Expand Down
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
2.6.1 (July 7, 2023)
2.7.0 (In Progress)
===================

ECMAScript Module Support
-------------------------

Currently, the SDK is imported as a [CommonJS Module (CJS)](https://nodejs.org/api/modules.html) using the root path `@twilio/voice-sdk`. With this release, the SDK contains an experimental feature that allows it to be imported as an [ECMAScript Module (ESM)](https://nodejs.org/api/esm.html) using the `@twilio/voice-sdk/esm` path. As this is an experimental feature, certain frameworks may not work such as [svelte](https://kit.svelte.dev/docs/introduction). ESM full support will be available in a future release and will become the default import behavior of the SDK.

Example:

```ts
import { Device } from '@twilio/voice-sdk/esm';
```

2.6.1 (July 7, 2023)
====================

Changes
-------

Expand Down
Loading

0 comments on commit 2f52f2a

Please sign in to comment.