Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate Code from TypeSpec in VSCode #5312

Merged
merged 87 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
ca3249a
emit sdk
chunyu3 Nov 18, 2024
b8468b6
add emitter configuration in extension setting
chunyu3 Nov 20, 2024
f0c4b89
add output dir configuration and options configuration
chunyu3 Nov 22, 2024
4691431
remove unused code
chunyu3 Nov 22, 2024
539bee9
update emitter configuration
chunyu3 Nov 24, 2024
7779481
resolve tsp command
chunyu3 Nov 26, 2024
05bbef7
define promised exec
chunyu3 Nov 26, 2024
41a8796
remove doEmit to emit.ts
chunyu3 Dec 2, 2024
31ee9e2
change to single language generation each run
chunyu3 Dec 3, 2024
6d604d8
select language box
chunyu3 Dec 6, 2024
406e7f9
remove unused code
chunyu3 Dec 6, 2024
a143f0a
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 6, 2024
a93c8b8
add validation of typespec project selection input box
chunyu3 Dec 8, 2024
4ba9a3a
transfer logs from spawn
chunyu3 Dec 8, 2024
ca87267
transport log out when execute command
chunyu3 Dec 9, 2024
a14b47e
validate the typespec project
chunyu3 Dec 9, 2024
5534466
remove executeCommand
chunyu3 Dec 9, 2024
92790d6
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 10, 2024
3a9886c
update pnpm-lock
chunyu3 Dec 10, 2024
7fec5be
add change log
chunyu3 Dec 10, 2024
bddc07b
resolve lint
chunyu3 Dec 10, 2024
8c36463
set package name instead of output dir
chunyu3 Dec 10, 2024
3b820b8
add emit code command
chunyu3 Dec 11, 2024
b3d794b
integrate server code and openapi generation
chunyu3 Dec 12, 2024
c5e28e1
remove unused interface
chunyu3 Dec 12, 2024
8b5ec56
refine the label text
chunyu3 Dec 12, 2024
3c333d9
add icon for start file
chunyu3 Dec 12, 2024
dfcc1fb
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 16, 2024
64af9ad
check dependency and resolve dependency conflict
chunyu3 Dec 17, 2024
416a8ce
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 17, 2024
21536fe
format
chunyu3 Dec 17, 2024
b592c14
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 17, 2024
c883353
remove unused code
chunyu3 Dec 17, 2024
6931980
refine text
chunyu3 Dec 18, 2024
0c8c284
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 18, 2024
86372ee
change the package install options
chunyu3 Dec 18, 2024
b121717
resolve comments
chunyu3 Dec 18, 2024
758ff38
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 18, 2024
7129527
remove options parameter
chunyu3 Dec 18, 2024
e96e073
refine text
chunyu3 Dec 18, 2024
9105874
remove dependency auto-install
chunyu3 Dec 18, 2024
6f49c5f
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 19, 2024
bae77bb
Merge branch 'generateSDK' of https://github.com/chunyu3/typespec int…
chunyu3 Dec 19, 2024
f70e9d0
resolve comments
chunyu3 Dec 19, 2024
e836b52
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 20, 2024
97d57de
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 23, 2024
8dc67ec
resolve comments
chunyu3 Dec 24, 2024
ee763ab
add progress for long running operations
chunyu3 Dec 24, 2024
792ec1c
remove emit to vscode-cmd folder
chunyu3 Dec 24, 2024
95dcef6
Merge branch 'main' into generateSDK
chunyu3 Dec 24, 2024
99c9ad0
refine the logger call
chunyu3 Dec 24, 2024
b2e27ca
submit comment every time
chunyu3 Dec 24, 2024
3b52923
revert try-it comment update
chunyu3 Dec 24, 2024
82b1a42
only pop-up project selection window when there are more than one tsp…
chunyu3 Dec 25, 2024
db5d908
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Dec 26, 2024
77452a0
refine text
chunyu3 Dec 27, 2024
0e2ab0f
support check multiple dependency type
chunyu3 Dec 29, 2024
d353b46
change to use spawnExecutionAndLogToOutput
chunyu3 Dec 29, 2024
0bf3f40
retrive entrypoint file from package.json and parent directory
chunyu3 Dec 29, 2024
9d7c0b1
implement package install or upgrade page
chunyu3 Dec 30, 2024
88eb4a4
log refine
chunyu3 Dec 30, 2024
7cec0fb
disable log pretty
chunyu3 Dec 30, 2024
8af049c
add progress bar for calculating packages to install
chunyu3 Dec 30, 2024
7a96a1c
parse the spawn output and display in correct way
chunyu3 Jan 2, 2025
b0fb151
typo
chunyu3 Jan 2, 2025
d528575
refine te
chunyu3 Jan 2, 2025
ea9c4f1
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 3, 2025
cdbcc8c
add icon for dark themes
chunyu3 Jan 3, 2025
882f14c
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 7, 2025
3973ad3
update the title of page
chunyu3 Jan 7, 2025
ba6b54a
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 8, 2025
e066e81
log nice error message
chunyu3 Jan 8, 2025
303bf9d
remove duplicate error log
chunyu3 Jan 8, 2025
86d7822
Merge branch 'main' into generateSDK
chunyu3 Jan 8, 2025
168d116
add more-detail button in each quick pick item
chunyu3 Jan 8, 2025
128aab5
Merge branch 'generateSDK' of https://github.com/chunyu3/typespec int…
chunyu3 Jan 8, 2025
ab13f86
add button for more-details in install packages pick item
chunyu3 Jan 8, 2025
dd365b4
only add more-details button when it has srcRepo defined
chunyu3 Jan 8, 2025
01c693f
read and update tspconfig.yam
chunyu3 Jan 9, 2025
609928b
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 9, 2025
69fe0bd
add changelog
chunyu3 Jan 9, 2025
9bcc6fc
simplify the config yaml update logic
chunyu3 Jan 9, 2025
067f8e4
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 13, 2025
ae8a70d
update npnm-lock.yaml
chunyu3 Jan 13, 2025
b12637f
show the existing emitters in the tspconfig.yaml
chunyu3 Jan 14, 2025
94dcc8f
remove unused parameter
chunyu3 Jan 14, 2025
bced3ba
Merge branch 'main' of https://github.com/microsoft/typespec into gen…
chunyu3 Jan 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .chronus/changes/generateSDK-2024-11-10-10-45-35.md
allenjzhang marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: feature
packages:
- typespec-vscode
---

integrate client SDK generation
7 changes: 7 additions & 0 deletions .chronus/changes/generateSDK-2025-0-10-0-6-24.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: fix
packages:
- "@typespec/internal-build-utils"
---

resolve the program crash when there is no package name in package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,23 @@ async function findThirdPartyPackages() {
const sources = contents.sources;
for (const source of sources) {
const sourcePath = resolve(dirname(map), source);
const packageRoot = await getPackageRoot(sourcePath);
let packageRoot = await getPackageRoot(sourcePath);
if (packageRoot === undefined) {
continue;
}
const pkg = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf-8"));

if (pkg.name === rootName || /microsoft/i.test(JSON.stringify(pkg.author))) {
continue;
}

if (!packages.has(packageRoot)) {
let pkg = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf-8"));

if (!pkg.name) {
packageRoot = await getPackageRoot(packageRoot);
while (!pkg.name && packageRoot) {
pkg = JSON.parse(await readFile(join(packageRoot, "package.json"), "utf-8"));
packageRoot = await getPackageRoot(packageRoot);
}
}
if (!pkg.name || pkg.name === rootName || /microsoft/i.test(JSON.stringify(pkg.author))) {
continue;
}
packages.set(packageRoot, pkg);
}
}
Expand Down
31 changes: 30 additions & 1 deletion packages/typespec-vscode/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ granted herein, whether by implication, estoppel or otherwise.
2. brace-expansion version 2.0.1 (https://github.com/juliangruber/brace-expansion)
3. minimatch version 5.1.6 (https://github.com/isaacs/minimatch)
4. semver version 7.6.3 (https://github.com/npm/node-semver)
5. yaml version 2.5.1 (github:eemeli/yaml)


%% balanced-match NOTICES AND INFORMATION BEGIN HERE
Expand Down Expand Up @@ -111,4 +112,32 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

=====================================================");
END OF semver NOTICES AND INFORMATION
END OF semver NOTICES AND INFORMATION


%% yaml NOTICES AND INFORMATION BEGIN HERE
=====================================================
MIT License

Copyright (c) Microsoft Corporation. All rights reserved.

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

=====================================================");
END OF yaml NOTICES AND INFORMATION
12 changes: 12 additions & 0 deletions packages/typespec-vscode/icons/client.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/typespec-vscode/icons/client.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/typespec-vscode/icons/dotnet.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/typespec-vscode/icons/dotnet.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/typespec-vscode/icons/java.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/typespec-vscode/icons/java.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions packages/typespec-vscode/icons/javascript.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions packages/typespec-vscode/icons/javascript.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/typespec-vscode/icons/openapi.dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions packages/typespec-vscode/icons/openapi.light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading