Skip to content

Commit

Permalink
Update the e2e with the latest tsp in JS (#57)
Browse files Browse the repository at this point in the history
* Update the e2e with the latest tsp

* add todo test case

* update

* Update todoApp/clients/javascript/test/todoItemsClientTest.spec.ts

* update

* update emmiter version

* add sample

* remove test

* update devDependencies package

---------

Co-authored-by: Jiao Di (MSFT) <80496810+v-jiaodi@users.noreply.github.com>
  • Loading branch information
MaryGao and v-jiaodi authored Dec 31, 2024
1 parent 3d505b9 commit f7e6206
Show file tree
Hide file tree
Showing 39 changed files with 2,796 additions and 12 deletions.
2 changes: 1 addition & 1 deletion 1.0-E2E-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ Legend:
| | Python | Yuchao | :green_circle: | 12/31 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/tree/main/petstore/clients/python) | |
| ToDo App | | | | | | |
| | C# | Dapeng | :running_man: | 1/15 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/tree/main/todoApp/clients/dotnet) | |
| | JS | Qiaoqiao | :running_man: | 1/15 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/pull/31/files) | |
| | JS | Qiaoqiao | :running_man: | 1/15 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/tree/main/todoApp/clients/javascript) | |
| | Java | Weidong | :green_circle: | 1/15 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/tree/main/todoApp/clients/java) | |
| | Python | Yuchao | :running_man: | 1/15 | [Code](https://github.com/allenjzhang/typespec-e2e-demo/tree/main/todoApp/clients/python) | |
| Chat | | | | | | |
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"@typespec/http-server-csharp": "https://artprodcus3.artifacts.visualstudio.com/A0fb41ef4-5012-48a9-bf39-4ee3de03ee35/29ec6040-b234-4e31-b139-33dc4287b756/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL2F6dXJlLXNkay9wcm9qZWN0SWQvMjllYzYwNDAtYjIzNC00ZTMxLWIxMzktMzNkYzQyODdiNzU2L2J1aWxkSWQvNDQyNzY3NC9hcnRpZmFjdE5hbWUvcGFja2FnZXM1/content?format=file&subPath=%2Ftypespec-http-server-csharp-0.58.0-alpha.7-pr-5417.20241220.7.tgz",
"@typespec/http-server-javascript": "^0.58.0-alpha.6",
"@typespec/http-client-java": "^0.1.5",
"@azure-tools/typespec-ts": "^0.36.0",
"@azure-tools/typespec-ts": "^0.37.0",
"@typespec/http-client-python": "^0.4.4",
"@typespec/json-schema": "^0.63.0",
"@typespec/openapi": "^0.63.0",
Expand Down
2 changes: 1 addition & 1 deletion petstore/clients/javascript/samples/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To run the samples using the grenerated code:
```bash
npm install && npm run build
```
2. Install the dependencies using `npm` in folder `samples/javascript`:
2. Install the dependencies using `npm` in folder `samples/typescript`:

```bash
npm install
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"dotenv": "latest"
},
"devDependencies": {
"@types/node": "^18.0.0",
"typescript": "~5.6.2",
"rimraf": "5.0.5"

Expand Down
7 changes: 7 additions & 0 deletions todoApp/clients/javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.tshy-build
.tshy
dist
package-lock.json
temp
types
test-results.browser.xml
21 changes: 21 additions & 0 deletions todoApp/clients/javascript/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2024 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions todoApp/clients/javascript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Todo client library for JavaScript



Key links:

- [Package (NPM)](https://www.npmjs.com/package/@notabrand/todo-non-branded)

## Getting started

### Currently supported environments

- LTS versions of Node.js

### Install the `@notabrand/todo-non-branded` package

Install the Todo client library for JavaScript with `npm`:

```bash
npm install @notabrand/todo-non-branded
```
18 changes: 18 additions & 0 deletions todoApp/clients/javascript/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"mainEntryPointFilePath": "./dist/esm/index.d.ts",
"docModel": { "enabled": true },
"apiReport": { "enabled": true, "reportFolder": "./review" },
"dtsRollup": {
"enabled": true,
"untrimmedFilePath": "",
"publicTrimmedFilePath": "./types/todo-non-branded.d.ts"
},
"messages": {
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
"extractorMessageReporting": {
"ae-missing-release-tag": { "logLevel": "none" },
"ae-unresolved-link": { "logLevel": "none" }
}
}
}
166 changes: 166 additions & 0 deletions todoApp/clients/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
{
"name": "@notabrand/todo-non-branded",
"version": "1.0.0-beta.1",
"description": "A generated SDK for TodoClient.",
"engines": {
"node": ">=18.0.0"
},
"sideEffects": false,
"autoPublish": false,
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts",
"./models": "./src/models/index.ts",
"./api": "./src/api/index.ts",
"./api/todoItems/attachments": "./src/api/todoItems/attachments/index.ts",
"./api/todoItems": "./src/api/todoItems/index.ts",
"./api/users": "./src/api/users/index.ts"
},
"dialects": [
"esm",
"commonjs"
],
"esmDialects": [
"browser",
"react-native"
],
"selfLink": false
},
"type": "module",
"scripts": {
"clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
"pack": "npm pack 2>&1",
"lint": "eslint package.json api-extractor.json src",
"lint:fix": "eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]",
"build": "npm run clean && tshy && npm run extract-api"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.40.3",
"@types/node": "^18.0.0",
"eslint": "^9.9.0",
"typescript": "~5.6.2",
"tshy": "^2.0.0",
"rimraf": "^5.0.5",
"mkdirp": "^3.0.1"
},
"dependencies": {
"tslib": "^2.6.2",
"@typespec/ts-http-runtime": "0.1.0"
},
"exports": {
"./package.json": "./package.json",
".": {
"browser": {
"types": "./dist/browser/index.d.ts",
"default": "./dist/browser/index.js"
},
"react-native": {
"types": "./dist/react-native/index.d.ts",
"default": "./dist/react-native/index.js"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./models": {
"browser": {
"types": "./dist/browser/models/index.d.ts",
"default": "./dist/browser/models/index.js"
},
"react-native": {
"types": "./dist/react-native/models/index.d.ts",
"default": "./dist/react-native/models/index.js"
},
"import": {
"types": "./dist/esm/models/index.d.ts",
"default": "./dist/esm/models/index.js"
},
"require": {
"types": "./dist/commonjs/models/index.d.ts",
"default": "./dist/commonjs/models/index.js"
}
},
"./api": {
"browser": {
"types": "./dist/browser/api/index.d.ts",
"default": "./dist/browser/api/index.js"
},
"react-native": {
"types": "./dist/react-native/api/index.d.ts",
"default": "./dist/react-native/api/index.js"
},
"import": {
"types": "./dist/esm/api/index.d.ts",
"default": "./dist/esm/api/index.js"
},
"require": {
"types": "./dist/commonjs/api/index.d.ts",
"default": "./dist/commonjs/api/index.js"
}
},
"./api/todoItems/attachments": {
"browser": {
"types": "./dist/browser/api/todoItems/attachments/index.d.ts",
"default": "./dist/browser/api/todoItems/attachments/index.js"
},
"react-native": {
"types": "./dist/react-native/api/todoItems/attachments/index.d.ts",
"default": "./dist/react-native/api/todoItems/attachments/index.js"
},
"import": {
"types": "./dist/esm/api/todoItems/attachments/index.d.ts",
"default": "./dist/esm/api/todoItems/attachments/index.js"
},
"require": {
"types": "./dist/commonjs/api/todoItems/attachments/index.d.ts",
"default": "./dist/commonjs/api/todoItems/attachments/index.js"
}
},
"./api/todoItems": {
"browser": {
"types": "./dist/browser/api/todoItems/index.d.ts",
"default": "./dist/browser/api/todoItems/index.js"
},
"react-native": {
"types": "./dist/react-native/api/todoItems/index.d.ts",
"default": "./dist/react-native/api/todoItems/index.js"
},
"import": {
"types": "./dist/esm/api/todoItems/index.d.ts",
"default": "./dist/esm/api/todoItems/index.js"
},
"require": {
"types": "./dist/commonjs/api/todoItems/index.d.ts",
"default": "./dist/commonjs/api/todoItems/index.js"
}
},
"./api/users": {
"browser": {
"types": "./dist/browser/api/users/index.d.ts",
"default": "./dist/browser/api/users/index.js"
},
"react-native": {
"types": "./dist/react-native/api/users/index.d.ts",
"default": "./dist/react-native/api/users/index.js"
},
"import": {
"types": "./dist/esm/api/users/index.d.ts",
"default": "./dist/esm/api/users/index.js"
},
"require": {
"types": "./dist/commonjs/api/users/index.d.ts",
"default": "./dist/commonjs/api/users/index.js"
}
}
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"module": "./dist/esm/index.js"
}
Loading

0 comments on commit f7e6206

Please sign in to comment.