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

29 Коммитов

Автор SHA1 Сообщение Дата
Timothee Guerin 40df1ec9a3
Multipart explicit parts (#3342)
resolve #3046
[Playground](https://cadlplayground.z22.web.core.windows.net/prs/3342/)

Add the following:
- `@multipartBody` decorator
- `File` type
- `HttpPart<Type, Options>` type


Had to do a decent amount of refactoring to be able to reuse the body
parsing, this result in a much cleaner resolution of the body and other
metadata properties across request, response and metadata.

The way it works now is instead of calling `gatherMetadata` that would
just get the properties that are metadata but also ones with `@body` and
`@bodyRoot` we now call a `resolveHtpProperties`, this does the same
resolution in term of filtering properties but it also figure out what
is the kind of property in the concept of http(header, query, body,
etc.) this leaves the error resolution to this function for duplicate
annotations.
What is nice is now we don't need to keep asking oh is this a query or a
header or a body we can just check the kind of `HttpProperty`

also resolve #1311
2024-06-03 22:04:33 +00:00
Timothee Guerin 35f5c90343
Migrate to eslint flat config (#3123)
resolve https://github.com/microsoft/typespec/issues/3121
same change in typespec-azure
https://github.com/Azure/typespec-azure/pull/620

## Single top level config
This makes it a little nicer to run as you know get the absolute path
for errors
No need to have the hacky rushstack dependency to allow using the same
shared config.

## Able to lint the projects that are outside of the pnpm workspace
<img width="1054" alt="image"
src="https://github.com/microsoft/typespec/assets/1031227/f88691d9-1bf2-4140-ba2b-533207b15f9d">


## Eslint 9 -no yet

eslint 9 was just released firday which makes this config the new
default however it does include breaking changes and not all our plugins
have updated
2024-04-08 09:58:19 -07:00
Timothee Guerin a1eb851cc3
Enable spell check for all files and fix (#2881)
fix #2776
2024-02-08 16:54:23 -08:00
Timothee Guerin 842405e8d1
Get rid of rush and move to pnpm (#2775)
Remove the opinionated (wrongly so most of the time) middleman that
brings more config pain than value.

Things to check:
- [x] Parallel build performance vs rush
- [ ] Publishing with submodule
- [x] Changesets
2024-01-24 13:37:34 -08:00
Timothee Guerin 55e232d553
Add a new init template to setup a library (#2766)
Add a new library template with:
- `@alernateName` decorator with some custom diagnostics and tests for
it.
- a linter rule and 2 rulesets(`recommended` and `all`)
2024-01-04 12:22:21 -08:00
Timothee Guerin 9c7bf80187
Migrate test framework to vitest (#2769)
Get rid of mocha and upgrade to vitest which is a more modern
alternative providing, watch, direct typescript compilation out of the
box, expect library and more.

Advantage over mocha:
- Much better cli
  -  watch mode
  - better diff
- Better extension:
  -  tree organization for files too (not everything flattened)
- update in real time the test(no more need to refresh manually to
discover where are the tests)
  - just a little buggy
- Compiles typescript directly
- provides more expectation apis(like jest)

Cons over mocha: 
- Slower(about 2x) but that means we don't need to build the test as
part of build which would speed up that part(not as much as is lost)

Todo: 
- typespec-azure migration
2024-01-02 11:40:29 -08:00
Timothee Guerin b8dc20f989
Playground directly into the website (#2638)
Stop using an iframe and load the latest version(not next)
2023-11-08 14:25:21 -08:00
Timothee Guerin 99d80f82da
Fix playground usage from external package (#2540)
Playground usage was completely broken when used as a package. Local
reference seems to make it work but hwne the package is in node_modules
vite doesn't allow certain things
2023-10-05 12:59:06 -07:00
Timothee Guerin 0c4a80899d
Cleanup vscode settings (#2541)
We didn't have format on save for react files, use that as an oportunity
to cleanup the config a bit
2023-10-04 21:57:56 +00:00
Timothee Guerin f33b0fb140
Fix: regression causing the language server to not be runnable in the browser (#2530)
fix #2529
2023-10-03 10:12:37 -07:00
Mike Harder 42aeb993fd
Upgrade dependency "trim" from 0.0.1 to 0.0.3 (#2474)
- Migrate pnpm config from rush.json to pnpm-config.json
2023-09-22 23:53:51 +00:00
Timothee Guerin 31fd5abf97
Samples as tests (#2215)
fix [#3017](https://github.com/Azure/typespec-azure/issues/3017)

Run the samples as test which allows all of them to run without crashing
on the first one, lets us run it in the test explorer.

This also make the sample regeneration much faster(typespec azure repo):
- Before `~90s`
- Now `~12s`


![image](https://github.com/microsoft/typespec/assets/1031227/a3356a90-7847-43cf-a473-4ecda0c53330)

## New `resolveCompilerOptions` utils
This also include the addition of a new util `resolveCompilerOptions`
that resolve the compiler options programtically in the same way that
the cli would have for a given entrypoint.

I can move this into a dedicated PR if people prefer.

---------

Co-authored-by: Mark Cowlishaw <markcowl@microsoft.com>
2023-08-04 10:19:02 -07:00
Timothee Guerin d355e5c427
Update to support prettier 3.0 (#2157)
fix #2153

This include breaking change if using the typespec formatter
programatically. Some breaking changes to prettier carry over
https://prettier.io/blog/2023/07/05/3.0.0.html
2023-08-03 17:11:54 -07:00
Timothee Guerin 56a30c2387
Metatype accessors for select accessor (#1740) 2023-04-06 21:26:58 +00:00
Timothee Guerin 628a3a9191
Revert: Mocha test explorer parallel (#1801) 2023-04-06 21:11:14 +00:00
Nick Guerrera a9fea12e51
Parallelize test runs in IDE using mocha explorer (#1793) 2023-04-05 14:17:17 -05:00
Allen Zhang 064161d827 1/3 TypeSpec: Find/Replace Content 2023-02-16 13:07:22 -08:00
Timothee Guerin 054cf45a49
Migrate website to use docusaurus (#1266) 2022-11-14 12:44:38 -08:00
Timothee Guerin 4b06c296e2
Add ability to use `workspaceFolder` in Visual studio and VSCode to interpolate settings (#891) 2022-08-19 21:23:23 +00:00
Timothee Guerin b162c3ca5b
Allow loading different install of the same library with the same version (#871) 2022-08-18 13:02:34 -07:00
Timothee Guerin 497c52e76d
Consistent file convention(kebab case and use `.test.ts` suffix for unit tests (#627) 2022-06-14 16:31:17 +00:00
Nick Guerrera 08010590e7
Disable formatOnPaste to work around prettier plugin issue (#617) 2022-06-10 15:18:38 -05:00
Timothee Guerin 5394cacfb2
Provide a better diagnostic when the main file of a library is not found (#550) 2022-05-26 11:24:21 -07:00
Nick Guerrera b1be3793e4
Allow `op` in interfaces (#270) 2022-02-17 20:55:51 +00:00
Nick Guerrera e7d656075b
Small formatting and syntax highlighting improvements (#73)
1. Format *.cadl on save in our repo. This required some extra knobs in
.vscode/settings.json and .prettierrc.json. These are not required when
referencing the prettier plugin via npm, but we need a workaround to consume
the plugin this way from source.

2. Fix a formatter bug with operations that return anonymous models where
the braces around the return model were dropped.

3. Add cadl syntax highlighting to markdown ```cadl blocks
2021-11-22 13:04:36 -06:00
Nick Guerrera 53cbecc69c
Use prettier for markdown too (#72) 2021-11-19 15:52:17 +00:00
Timothee Guerin e3f808b899
VSCode server path use compiler path instead of bin (#43) 2021-11-05 11:10:57 -07:00
Nick Guerrera eb4e11788b
Configure cadl-server path (#39)
Resolve error about conflicting compiler versions in IDE when
working on .cadl files in the core cadl repo.
2021-11-03 18:06:38 +00:00
Nick Guerrera 2c5454dc1a Port build process to new OSS repo 2021-10-19 15:21:39 -05:00