Граф коммитов

1580 Коммитов

Автор SHA1 Сообщение Дата
Timothee Guerin d4823c089b
Fix swagger ui build (#3091)
Missed that when doing the PR, the default import tries to load the
`path` library, recommendation is just to import the right bundle
directly.
2024-04-02 09:33:15 -07:00
Timothee Guerin c6506bcdee
Fix: Literal unions with the same variants keep adding duplicate entries (#3090)
fix #3087
2024-04-02 01:21:29 +00:00
Timothee Guerin cda7ccf4d9
Playground: Migrate from swagger-ui-react to swagger-ui-dist (#3089)
swagger-ui-react pull in all the swagger ui dependencies which is a bit
anyoing as they are mostly optional and with pnpm requires you to build
native dependencies.
2024-04-01 17:13:08 -07:00
Timothee Guerin fe67c784a2
Clarify algolia search key is designed to be public (#3085) 2024-04-01 19:14:59 +00:00
Timothee Guerin 5ba95d0371
Allow reload of js files in vitest (#3086)
Setup a workaround for the fact that vitest(vite underneath) doesn't
ever want to reload files in the outDir
https://github.com/vitest-dev/vitest/issues/5429

as the outDir isn't actually used in vitest(as far as I understand) this
is just an ok workaround.
2024-04-01 17:54:38 +00:00
emi0x7d1 fbe9da657e
project-root typo corrected in docs (#3083) 2024-04-01 08:10:37 -07:00
Timothee Guerin 0dea649cd7
Update dependencies to resolve vulnerabilities and license issue (#3081)
- Remove unused rollup-plugin-dts dep that had problematic license
- Update dependencies to fix vulnerabilies
2024-03-29 21:22:06 +00:00
Timothee Guerin a9696087af
Add monarch tokenizer as a dedicated package (#3079)
Package is private for now, this is just a way to maintain the tokenizer
on our side
2024-03-29 10:25:29 -07:00
Timothee Guerin 6d54aeb4aa
Do not crash if hitting a unsupported intrinsic type (#3077)
fix #3073

This still doesn't provide an optimal experience as the error shows up
on the void type instead of where it is referenced but solving that is
that long standing issue about tracing back where an error should be
2024-03-28 20:29:33 +00:00
Timothee Guerin 85fa7aecec
Union template declaration were being finished in projector (#3052)
fix [#2946](https://github.com/microsoft/typespec/issues/2946)

Problem was that in the projector were were calling to this helper to
see if that was a type that we should finish but it was missing the
union case causing union template declaration from being finished in the
projector and then being shown as finished type in the semantic
navigator and crashing openapi3 emitter.
2024-03-28 20:08:30 +00:00
Timothee Guerin e31309e5a7
Fix codefixes docs (#3045) 2024-03-28 19:41:27 +00:00
LadyCailin 4e1d30ddce
Update inconsistent docs (#3072)
`@server` works to provide values for the `servers` object, as is
documented elsewhere in the same files. This PR updates the table to
reflect that. Closes #3071.
2024-03-28 13:50:21 +00:00
Timothee Guerin ce9c567e5b
Improve TM language for enums, unions and escaped identifiers (#3069)
resolves https://github.com/microsoft/typespec/issues/3070
The tm language wasn't correctly defining the syntax for escaped
identifiers

```
`North West`
```


Enums and unions syntax was also not very accurate and didn't tokenize
everything correctly


## Example of issue before


![image](https://github.com/microsoft/typespec/assets/1031227/ee60f4fe-5eef-4f86-baa5-1cc96b665526)

## After

![image](https://github.com/microsoft/typespec/assets/1031227/38405f18-0fa4-44ba-82f6-594bcd4fcebf)
2024-03-27 10:12:29 -07:00
Timothee Guerin 32e45d4da2
Add support for scalar in versioning (#3053)
fix [#3001](https://github.com/microsoft/typespec/issues/3001)
2024-03-26 23:43:37 +00:00
Timothee Guerin 4c34e78747
Fix visibility conflict with base models (#3049)
fix #2922
fix #3048(dup)
2024-03-25 18:56:55 +00:00
Timothee Guerin 095c7dd8d4
OpenAPI3: Fix multipart union part conflict (#3050)
Problem is that was now trying to create a new declaration for a named
union if it was used in multipart and json even though they were the
same
2024-03-25 18:13:26 +00:00
Timothee Guerin 39ee11bc46
Fix: OpenAPI3 not marking part of bytes or something else as `format: binary` (#3013)
fix [#2924](https://github.com/microsoft/typespec/issues/2924)

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2024-03-22 20:45:10 +00:00
Timothee Guerin 72bed4daf8
More reliable codefix application (#3041)
Current approach was getting in all kind of conflict because it was
calling getCodeActions too much and we were clearing the cached id
2024-03-22 17:44:47 +00:00
Timothee Guerin 4e6f137c65
Emit `{nulable: true}` when trying to emit `null` in openapi3 (#2967)
fix #2217

This isn't fully accurate as it is saying in openapi3 that it can be
anything and `null` but this solve a crash, we could consider adding a
warning

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2024-03-22 16:53:54 +00:00
Timothee Guerin e0dfe6f5d0
Grammar: Fix comments in template params not tokenized (#3018)
fix #3017

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2024-03-22 02:53:07 +00:00
Timothee Guerin 06f514dc92
Fix non portable export (#3039)
Not sure why only catching that in the typespec-azure repo build but it
complains that the return type of this function wasn't portable,
Probably good anyway to be more explicit here.
2024-03-22 01:55:12 +00:00
Timothee Guerin 68cd9fe906
Apply same fix to latest docs (#3034) 2024-03-20 15:20:08 +00:00
Timothee Guerin 077db13c8d
Generate TypeScript decorator signatures from `extern dec` (#2122)
Note this is added to `tspd` which is not published yet so this can be
iterated over without any issues.

Adds a decorator signature generator. Generates 2 files:
- `<namespace>.ts` : Contains the decorator signatures that can be
imported and when declaring the decorators functions
- `<namespace>.ts-test.ts`: Contains some test using typescript type
system to make sure the package does reexport the right `$<name>` for
each decorator

---------

Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
2024-03-19 23:08:59 +00:00
Timothee Guerin c9e2f5887f
Fix cookies still saved (#3030) 2024-03-19 19:58:27 +00:00
Timothee Guerin 743c4b0a39
Fix another set of accessibility issues (#3031) 2024-03-19 18:57:02 +00:00
Timothee Guerin d8e4e860e4
Fix cookies (#3029)
Version 4 doesn't seem to be respecting the config, there is also many
different configs which does who knows what...
2024-03-18 20:31:04 +00:00
Timothee Guerin 4199f83575
Upgrade dependencies march 2024 (#3027)
General update of all dependencies, notable
- typescript 5.4
- vitest 1.4
2024-03-18 10:52:06 -07:00
Timothee Guerin 814e518ac9
Accessibility contrast tweaks (#3026)
- Make the light code theme have accessible contrast.
- Docsearch placeholder contrast tweak

Also minor tweak to the prismjs tokenizer to fix optional property
highlighting
2024-03-18 16:23:00 +00:00
Peter Marcu 9e655a95f5
Fixing alt text on website (#3025)
This PR should make sure there is alt text matching the image name on
each of the image elements.
2024-03-18 07:54:57 -07:00
Timothee Guerin 6d42ca6e65
Deprecate projected name (#2910)
fix [#2832](https://github.com/microsoft/typespec/issues/2832)
2024-03-13 12:48:07 -07:00
Timothee Guerin 00996bbe30
Don't prevent going to next stage when a warning is elevated to an error (#2983)
fix #2972
2024-03-12 22:14:42 +00:00
Timothee Guerin 128a508c25
Allow encode on a union (#2992)
fix [#2969](https://github.com/microsoft/typespec/issues/2969)
2024-03-12 14:49:17 -07:00
Timothee Guerin d8576effd5
Website & Docs Cleanup (#3002)
Co-authored-by: Mario Guerra <85648637+mario-guerra@users.noreply.github.com>
Co-authored-by: Libba Lawrence <llawrence@microsoft.com>
Co-authored-by: Allen Zhang <allenzhang@live.com>
Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
2024-03-11 18:56:35 -07:00
Timothee Guerin 57f0d47bef
Integrate 1ds telemetry in website (#2912) 2024-03-08 17:41:55 +00:00
Timothee Guerin 72fb582b3c
Add gif to vscode readme and rerelease (#3003) 2024-03-07 15:46:27 -08:00
Mario Guerra c31aafa07f
grammar fixes (#3000)
First round of website grammar fixes.
2024-03-07 17:25:25 +00:00
Timothee Guerin 7312314bcb
Remove old message burried in changelog (#2989) 2024-03-05 16:05:57 -08:00
Timothee Guerin 9881002f1c
Bump versions for release march 2024 (#2988) 2024-03-05 15:31:47 -08:00
iscai-msft 4cafd969de
Add json schema test library (#2987) 2024-03-05 22:14:58 +00:00
Timothee Guerin 6a9c62ad24
Feature: Code fixes (#2888)
closes #615

## Code fixes added

### Suppress
![Kapture 2024-02-05 at 15 16
22](https://github.com/microsoft/typespec/assets/1031227/644014a3-9352-4bd4-b1b8-0d314c627405)

### `number` -> `float64` typo fix

![Kapture 2024-02-06 at 09 50
28](https://github.com/microsoft/typespec/assets/1031227/65b2e9aa-c510-440f-a1c6-7851611b65a2)

### Enum to extensible enum in typespec-azure

https://github.com/Azure/typespec-azure/pull/258

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2024-03-05 11:51:21 -08:00
Timothee Guerin abba29c173
Validate playground samples and fix docs to deprecated version (#2977)
fix #1560

Json schema emitter also didn't respect the `noEmit` flag
2024-03-04 23:35:17 +00:00
Timothee Guerin de6bd7bc30
Go to import (#2978)
fix #1294
![Kapture 2024-03-01 at 14 41
07](https://github.com/microsoft/typespec/assets/1031227/8be68f83-4eca-421c-b6dd-27bc1eed141f)
2024-03-04 15:15:19 -08:00
Timothee Guerin 82fab0a5e6
Fix: Authentication on containing namespace (#2980)
fix #2979

Authentication wasn't resolving values set on the namespaces.
2024-03-04 10:55:35 -08:00
Timothee Guerin 01ba99b061
Fix dup doc (#2976)
Before
<img width="465" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/b620cac2-b70a-4a99-a784-bf03d55bd28b">

Now
<img width="413" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/d2a0b293-7924-44e7-9e1c-036ff40f1b6d">
2024-03-01 20:50:11 +00:00
Timothee Guerin 8c7c76bf8e
`isErrorModel` check for base models (#2968)
fix #2957
2024-03-01 01:59:52 +00:00
Timothee Guerin fa8b959491
Feature: Spread `Record<T>` (#2920)
fix  #2785
2024-02-29 16:47:23 -08:00
Timothee Guerin 9654dd836b
[OpenAPI3 Emitter] Add option to map `safeint` to `double-int` (#2933)
fix  #2367 
Format was added to the schema registry so we are safe to use that now
https://spec.openapis.org/registry/format/double-int.html

---------

Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
2024-02-29 16:05:41 -08:00
Timothee Guerin 02ed01e79b
Improved ref docs for model (#2951)
fix https://github.com/Azure/typespec-azure-pr/issues/3861
fix #2232
Generate docs for model properties and reference models within the same
package
<img width="1213" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/ae7eccd0-97d8-401e-b07f-3375c7b41446">
2024-02-29 07:21:13 -08:00
Timothee Guerin 717af6421f
Deprecate `@service` version and allow `@OpenAPI.info` to take all properties allowed by openapi (#2902)
fix [#2821](https://github.com/microsoft/typespec/issues/2821)

## Deprecate `@service({version`

Using this property will emit a deprecation warning

## Cover everything with `@OpenAPI.info`

Makes sure all the properties allowed on the `info` object of openapi
specification can also be provided in `@info`. The properties will
either override other ways of specifying those previously or be the only
way.
- `@info({description` would override `@doc` on service namespace
- `@info({summary` would override `@summary` on service namespace
- `@info({title` would override `@service({title}` on service namespace
2024-02-28 22:56:09 +00:00
Timothee Guerin 9d8cfb016e
Fix don't emit shared route error when verb don't match (#2948)
fix [#2925](https://github.com/microsoft/typespec/issues/2925)

Stop emitting the error if there is a shared route and a non shared
route on a different verb.

Also improve the error: 
- change message to be a little more clear
- emit the error on every offending operation not just the first one we
find an duplicate

---------

Co-authored-by: Brian Terlson <brian.terlson@microsoft.com>
2024-02-28 22:17:46 +00:00