Skip to content

[typespec-vscode] Fix openapi3 preview error when path contain space #7353

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
b0ac596
Merge pull request #1 from microsoft/main
mzhongl524 Nov 22, 2024
3fcbe52
Merge branch 'microsoft:main' into main
mzhongl524 Nov 25, 2024
c109816
Merge branch 'microsoft:main' into main
mzhongl524 Dec 6, 2024
23f0108
Merge branch 'microsoft:main' into main
mzhongl524 Dec 12, 2024
6f04f65
Merge branch 'microsoft:main' into main
mzhongl524 Dec 23, 2024
688ca03
Merge branch 'microsoft:main' into main
mzhongl524 Dec 24, 2024
de3725e
Merge branch 'microsoft:main' into main
mzhongl524 Dec 30, 2024
8130ffb
Merge branch 'microsoft:main' into main
mzhongl524 Jan 3, 2025
beb6433
Merge branch 'microsoft:main' into main
mzhongl524 Jan 15, 2025
8a501f2
Merge branch 'microsoft:main' into main
mzhongl524 Jan 15, 2025
6e1ab2d
Merge branch 'microsoft:main' into main
mzhongl524 Jan 23, 2025
a35052f
Merge branch 'microsoft:main' into main
mzhongl524 Jan 24, 2025
be57c13
Merge branch 'microsoft:main' into main
mzhongl524 Feb 5, 2025
3a9dc7a
Merge branch 'microsoft:main' into main
mzhongl524 Feb 10, 2025
ad7dff7
Merge branch 'microsoft:main' into main
mzhongl524 Feb 10, 2025
f8e8f2f
Merge branch 'microsoft:main' into main
mzhongl524 Feb 12, 2025
7a700c8
Merge branch 'microsoft:main' into main
mzhongl524 Feb 14, 2025
5099583
Merge branch 'microsoft:main' into main
mzhongl524 Feb 18, 2025
a45dbd5
Merge branch 'microsoft:main' into main
mzhongl524 Feb 25, 2025
68cc91d
Merge branch 'microsoft:main' into main
mzhongl524 Feb 25, 2025
48a44ad
Merge branch 'microsoft:main' into main
mzhongl524 Feb 27, 2025
b9283c4
Merge branch 'microsoft:main' into main
mzhongl524 Feb 28, 2025
4286411
Merge branch 'microsoft:main' into main
mzhongl524 Feb 28, 2025
e549035
Merge branch 'microsoft:main' into main
mzhongl524 Mar 5, 2025
9717310
Merge branch 'microsoft:main' into main
mzhongl524 Mar 6, 2025
75260f8
Merge branch 'microsoft:main' into main
mzhongl524 Mar 10, 2025
18b1595
Merge branch 'microsoft:main' into main
mzhongl524 Mar 11, 2025
51078a7
Merge branch 'microsoft:main' into main
mzhongl524 Mar 13, 2025
75ae17a
Merge branch 'microsoft:main' into main
mzhongl524 Mar 17, 2025
da28d95
Merge branch 'microsoft:main' into main
mzhongl524 Mar 18, 2025
4afbb98
Merge branch 'microsoft:main' into main
mzhongl524 Mar 25, 2025
463bdd5
Merge branch 'microsoft:main' into main
mzhongl524 Mar 27, 2025
c105d86
Merge branch 'microsoft:main' into main
mzhongl524 Mar 27, 2025
39dc63e
Merge branch 'microsoft:main' into main
mzhongl524 Mar 31, 2025
ddb0c11
Merge branch 'microsoft:main' into main
mzhongl524 Apr 1, 2025
dccb3dc
Merge branch 'microsoft:main' into main
mzhongl524 Apr 8, 2025
af9903b
Merge branch 'microsoft:main' into main
mzhongl524 Apr 10, 2025
2dddaf5
Merge branch 'microsoft:main' into main
mzhongl524 Apr 15, 2025
857b72b
Merge branch 'microsoft:main' into main
mzhongl524 Apr 16, 2025
41f34d9
Merge branch 'microsoft:main' into main
mzhongl524 Apr 17, 2025
f4dd38f
Merge branch 'microsoft:main' into main
mzhongl524 Apr 18, 2025
4fd48e5
Merge branch 'microsoft:main' into main
mzhongl524 Apr 21, 2025
9870818
Merge branch 'microsoft:main' into main
mzhongl524 Apr 22, 2025
9bf8cdc
Merge branch 'microsoft:main' into main
mzhongl524 Apr 25, 2025
3594679
OpenAPI3 preview reports error when the path contains space
mzhongl524 May 15, 2025
3f1f641
updated
mzhongl524 May 15, 2025
687f0b0
Create fix-openapi3-preview-error-when-path-contain-space-2025-4-15-8…
mzhongl524 May 16, 2025
2ca828b
updated
mzhongl524 May 19, 2025
7fbb45d
updated
mzhongl524 May 20, 2025
af25256
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 20, 2025
abf0824
updated
mzhongl524 May 20, 2025
044680a
updated
mzhongl524 May 20, 2025
fdeae62
updated
mzhongl524 May 21, 2025
9bad89e
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 21, 2025
c131f65
updated
mzhongl524 May 21, 2025
e19cdf2
updated
mzhongl524 May 21, 2025
089ef17
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 21, 2025
88d7533
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 22, 2025
7093ba1
updated
mzhongl524 May 23, 2025
c18ae86
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 23, 2025
4590c92
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 23, 2025
8c8122c
updated
mzhongl524 May 23, 2025
3b4f543
Merge branch 'fix-openapi3-preview-error-when-path-contain-space' of …
mzhongl524 May 23, 2025
d32076d
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 29, 2025
f6e818e
Merge branch 'main' into fix-openapi3-preview-error-when-path-contain…
mzhongl524 May 29, 2025
ca9759e
updated
mzhongl524 May 29, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
changeKind: fix
packages:
- typespec-vscode
---

Fix openapi3 preview error when path contains space
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@typespec/internal-build-utils"
---

Add lowercase names to the license name
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,16 @@ async function downloadLicenseForKnownPackages(packageName: string): Promise<str
}

async function getLicense(packageName: string, packageRoot: string) {
for (const licenseName of ["LICENSE", "LICENSE.txt", "LICENSE.md", "LICENSE-MIT"]) {
for (const licenseName of [
"license",
"license.txt",
"license.md",
"license-mit",
"LICENSE",
"LICENSE.txt",
"LICENSE.md",
"LICENSE-MIT",
]) {
const licensePath = join(packageRoot, licenseName);
try {
const text = await readFile(licensePath, "utf-8");
Expand Down
144 changes: 135 additions & 9 deletions packages/typespec-vscode/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ granted herein, whether by implication, estoppel or otherwise.
2. balanced-match version 1.0.2 (https://github.com/juliangruber/balanced-match)
3. brace-expansion version 2.0.1 (https://github.com/juliangruber/brace-expansion)
4. change-case version 5.4.4 (https://github.com/blakeembrey/change-case)
5. fast-deep-equal version 3.1.3 (https://github.com/epoberezkin/fast-deep-equal)
6. fast-uri version 3.0.6 (https://github.com/fastify/fast-uri)
7. isexe version 3.1.1 (https://github.com/isaacs/isexe)
8. json-schema-traverse version 1.0.0 (https://github.com/epoberezkin/json-schema-traverse)
9. minimatch version 5.1.6 (https://github.com/isaacs/minimatch)
10. mustache version 4.2.0 (https://github.com/janl/mustache.js)
11. semver version 7.7.2 (https://github.com/npm/node-semver)
12. which version 5.0.0 (https://github.com/npm/node-which)
13. yaml version 2.7.1 (github:eemeli/yaml)
5. cross-spawn version 7.0.6 ([email protected]:moxystudio/node-cross-spawn)
6. fast-deep-equal version 3.1.3 (https://github.com/epoberezkin/fast-deep-equal)
7. fast-uri version 3.0.6 (https://github.com/fastify/fast-uri)
8. isexe version 2.0.0 (https://github.com/isaacs/isexe)
9. isexe version 3.1.1 (https://github.com/isaacs/isexe)
10. json-schema-traverse version 1.0.0 (https://github.com/epoberezkin/json-schema-traverse)
11. minimatch version 5.1.6 (https://github.com/isaacs/minimatch)
12. mustache version 4.2.0 (https://github.com/janl/mustache.js)
13. path-key version 3.1.1 (sindresorhus/path-key)
14. semver version 7.7.2 (https://github.com/npm/node-semver)
15. shebang-command version 2.0.0 (kevva/shebang-command)
16. shebang-regex version 3.0.0 (sindresorhus/shebang-regex)
17. which version 2.0.2 (https://github.com/isaacs/node-which)
18. which version 5.0.0 (https://github.com/npm/node-which)
19. yaml version 2.7.1 (github:eemeli/yaml)


%% ajv NOTICES AND INFORMATION BEGIN HERE
Expand Down Expand Up @@ -136,6 +142,34 @@ THE SOFTWARE.
END OF change-case NOTICES AND INFORMATION


%% cross-spawn NOTICES AND INFORMATION BEGIN HERE
=====================================================
The MIT License (MIT)

Copyright (c) 2018 Made With MOXY Lda <[email protected]>

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 cross-spawn NOTICES AND INFORMATION


%% fast-deep-equal NOTICES AND INFORMATION BEGIN HERE
=====================================================
MIT License
Expand Down Expand Up @@ -200,6 +234,28 @@ The complete list of contributors can be found at:
END OF fast-uri NOTICES AND INFORMATION


%% isexe NOTICES AND INFORMATION BEGIN HERE
=====================================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

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


%% isexe NOTICES AND INFORMATION BEGIN HERE
=====================================================
The ISC License
Expand Down Expand Up @@ -290,6 +346,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
END OF mustache NOTICES AND INFORMATION


%% path-key NOTICES AND INFORMATION BEGIN HERE
=====================================================
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)

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 path-key NOTICES AND INFORMATION


%% semver NOTICES AND INFORMATION BEGIN HERE
=====================================================
The ISC License
Expand All @@ -312,6 +384,60 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
END OF semver NOTICES AND INFORMATION


%% shebang-command NOTICES AND INFORMATION BEGIN HERE
=====================================================
MIT License

Copyright (c) Kevin Mårtensson <[email protected]> (github.com/kevva)

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 shebang-command NOTICES AND INFORMATION


%% shebang-regex NOTICES AND INFORMATION BEGIN HERE
=====================================================
MIT License

Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)

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 shebang-regex NOTICES AND INFORMATION


%% which NOTICES AND INFORMATION BEGIN HERE
=====================================================
The ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

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


%% which NOTICES AND INFORMATION BEGIN HERE
=====================================================
The ISC License
Expand Down
2 changes: 2 additions & 0 deletions packages/typespec-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@
"test:web": "vscode-test-web --quality stable --extensionDevelopmentPath=. --headless --extensionTestsPath=dist/test/web/suite.js ./test/web/data"
},
"devDependencies": {
"@types/cross-spawn": "~6.0.6",
"@types/mocha": "^10.0.9",
"@types/node": "~22.13.11",
"@types/semver": "^7.5.8",
Expand All @@ -270,6 +271,7 @@
"@vscode/test-web": "^0.0.69",
"@vscode/vsce": "~3.3.0",
"ajv": "~8.17.1",
"cross-spawn": "^7.0.6",
"c8": "^10.1.3",
"esbuild": "^0.25.1",
"mocha": "^11.1.0",
Expand Down
8 changes: 3 additions & 5 deletions packages/typespec-vscode/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { ModuleResolutionResult, PackageJson, ResolveModuleHost } from "@typespec/compiler";
import { spawn, SpawnOptions } from "child_process";
import { SpawnOptions } from "child_process";
import { spawn } from "cross-spawn";
import { mkdtemp, readdir, readFile, realpath, stat } from "fs/promises";
import { dirname } from "path";
import vscode, { CancellationToken } from "vscode";
Expand Down Expand Up @@ -230,21 +231,18 @@ export function spawnExecution(
env?: NodeJS.ProcessEnv,
on?: spawnExecutionEvents,
): Promise<ExecOutput> {
const shell = process.platform === "win32";
const cmd = shell && exe.includes(" ") ? `"${exe}"` : exe;
let stdout = "";
let stderr = "";

const options: SpawnOptions = {
shell,
stdio: "pipe",
windowsHide: true,
cwd,
};
if (env) {
options.env = { ...process.env, ...env };
}
const child = spawn(cmd, args, options);
const child = spawn(exe, args, options);

child.stdout!.on("data", (data) => {
stdout += data.toString();
Expand Down
Loading
Loading