Skip to content

Commit c933428

Browse files
authored
[JS] chore: dependencies cleanup: typescript, teamsfx, and browserify (#2014)
## Linked issues closes: #1947 closes #1371 #### TLDR: Node 20 is now supported!!! If you're eager for this, you shouldn't need to wait for a release, as the affected packages were our samples. ## Details - Modified package configuration for `typescript` to only allow patch updates. See Change details below for more information. This is (ideally) temporary. - Remove `@microsoft/teamsfx` as a dependency - it turns out this dependency is entirely unused, but due to sub-dependencies was preventing us from being able to support Node >=18. Because of this and `[email protected]` now supporting node 20, teams-ai js package now also runs with node 20 too! - Removed `browserify` - unused dependency - Updated Powered by AI docs to slightly clarify how AI module may use a `planner`. #### Change details [TS made an update](https://devblogs.microsoft.com/typescript/announcing-typescript-5-6) that in 5.6 reveals previously 'hidden' TS errors. `gpt-tokenizer` and `botbuilder` have TS errors that 5.6 catches. I filed bugs for both packages: [[Bug] Cannot upgrade to TS 5.6x due to build errors · Issue #49 · niieani/gpt-tokenizer (github.com)](niieani/gpt-tokenizer#49) [Cannot bump typescript to 5.6 due to botbuilder `INodeBuffer` error · Issue #4746 · microsoft/botbuilder-js (github.com)](microsoft/botbuilder-js#4746) ## Attestation Checklist - [x] My code follows the style guidelines of this project - I have checked for/fixed spelling, linting, and other errors - I have commented my code for clarity - I have made corresponding changes to the documentation (updating the doc strings in the code is sufficient) - My changes generate no new warnings - I have added tests that validates my changes, and provides sufficient test coverage. I have tested with: - Local testing - E2E testing in Teams - New and existing unit tests pass locally with my changes ### Additional information > Feel free to add other relevant information below --------- Co-authored-by: Corina Gum <>
1 parent 923a490 commit c933428

File tree

26 files changed

+1102
-2328
lines changed

26 files changed

+1102
-2328
lines changed

getting-started/CONCEPTS/POWERED-BY-AI.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Feedback loop, when enabled, will add thumbs up and thumbs down buttons to the b
7474
To enable this feature, set the `enable_feedback_loop` property to `true` in the `AIOptions` object when creating the `AI` object.
7575

7676
### JS
77+
7778
```typescript
7879
export const app = new Application<ApplicationTurnState>({
7980
ai: {
@@ -83,6 +84,7 @@ export const app = new Application<ApplicationTurnState>({
8384
```
8485
8586
### C#
87+
8688
```csharp
8789
AIOptions<TurnState> options = new(planner);
8890
options.EnableFeedbackLoop = true; // setting `EnableFeedbackLoop`
@@ -93,10 +95,11 @@ Application<TurnState> app = new ApplicationBuilder<TurnState>()
9395
```
9496
9597
### Python
98+
9699
```python
97100
app = Application[AppTurnState](
98101
ApplicationOptions(
99-
...,
102+
# ...other options e.g. planner
100103
ai=AIOptions(
101104
enable_feedback_loop=True
102105
),
@@ -122,13 +125,15 @@ If the user presses either of the feedback buttons, they will be prompted to pro
122125
Use the `app.feedbackLoop` method to register a feedback loop handler. This method will be called when the user provides feedback on the AI system's response. It is up to the developer to store and process the feedback.
123126
124127
### JS
128+
125129
```typescript
126130
app.feedbackLoop(async (context, state, feedbackLoopData) => {
127131
// custom logic here...
128132
});
129133
```
130134
131135
### C#
136+
132137
```csharp
133138
app.OnFeedbackLoop(async (turnContext, turnState, feedbackLoopData, cancellationToken) =>
134139
{
@@ -137,6 +142,7 @@ app.OnFeedbackLoop(async (turnContext, turnState, feedbackLoopData, cancellation
137142
```
138143
139144
### Python
145+
140146
```python
141147
@app.feedback_loop
142148
async def feedback_loop(
@@ -191,6 +197,7 @@ app.ai.action<PredictedSayCommand>(AI.SayCommandActionName, async (context, stat
191197
```
192198
193199
### C#
200+
194201
```csharp
195202
// AIActions.cs
196203
public class AIActions
@@ -208,6 +215,7 @@ app.AI.ImportActions(new AIActions());
208215
```
209216
210217
### Python
218+
211219
```python
212220
@app.ai.action(ActionTypes.SAY_COMMAND)
213221
async def on_say(

js/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"@typescript-eslint/eslint-plugin": "^6.21.0",
3737
"@typescript-eslint/parser": "^6.21.0",
3838
"applicationinsights": "^2.9.6",
39-
"browserify": "^17.0.0",
4039
"chai": "^4.5.0",
4140
"depcheck": "^1.4.7",
4241
"eslint": "^8.57.0",
@@ -64,7 +63,7 @@
6463
"sponge": "^0.1.0",
6564
"tinyify": "^4.0.0",
6665
"ts-node": "^10.9.2",
67-
"typescript": "^5.5.4",
66+
"typescript": "5.5.4",
6867
"wsrun": "^5.2.4"
6968
}
7069
}

js/packages/teams-ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"rimraf": "5.0.10",
6262
"shx": "^0.3.4",
6363
"ts-mocha": "10.0.0",
64-
"typescript": "^5.5.4"
64+
"typescript": "~5.5.4"
6565
},
6666
"scripts": {
6767
"build": "tsc -b",

js/samples/01.getting-started/a.echoBot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
"prettier": "^3.3.3",
4141
"rimraf": "^5.0.10",
4242
"ts-node": "^10.9.2",
43-
"typescript": "^5.5.4"
43+
"typescript": "~5.5.4"
4444
}
4545
}

js/samples/02.teams-features/a.messageExtensions.searchCommand/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"nodemon": "~3.0.1",
3737
"prettier": "^3.3.3",
3838
"rimraf": "^5.0.10",
39-
"typescript": "^5.5.4",
39+
"typescript": "~5.5.4",
4040
"ts-node": "^10.9.2"
4141
}
4242
}

js/samples/02.teams-features/b.adaptiveCards.typeAheadBot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"prettier": "^3.3.3",
4242
"rimraf": "^5.0.10",
4343
"ts-node": "^10.9.2",
44-
"typescript": "^5.5.4"
44+
"typescript": "~5.5.4"
4545
}
4646
}

js/samples/03.ai-concepts/a.twentyQuestions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
"rimraf": "^5.0.10",
4141
"shx": "^0.3.4",
4242
"ts-node": "^10.9.2",
43-
"typescript": "^5.5.4"
43+
"typescript": "~5.5.4"
4444
}
4545
}

js/samples/03.ai-concepts/b.AI-messageExtensions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"nodemon": "~3.0.1",
3636
"prettier": "^3.3.3",
3737
"rimraf": "^5.0.10",
38-
"typescript": "^5.5.4",
38+
"typescript": "~5.5.4",
3939
"shx": "^0.3.4",
4040
"ts-node": "^10.9.2"
4141
}

js/samples/03.ai-concepts/c.actionMapping-lightBot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
"rimraf": "^5.0.10",
4141
"shx": "^0.3.4",
4242
"ts-node": "^10.9.2",
43-
"typescript": "^5.5.4"
43+
"typescript": "~5.5.4"
4444
}
4545
}

js/samples/03.ai-concepts/d.chainedActions-listBot/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
"rimraf": "^5.0.10",
4242
"shx": "^0.3.4",
4343
"ts-node": "^10.9.2",
44-
"typescript": "^5.5.4"
44+
"typescript": "~5.5.4"
4545
}
4646
}

0 commit comments

Comments
 (0)